LibreOffice Module svx (master)  1
viewcontactofpageobj.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
21 #include <svx/svdopage.hxx>
22 #include <vcl/canvastools.hxx>
27 
28 namespace sdr::contact
29 {
30 ViewObjectContact&
32 {
33  ViewObjectContact* pRetval = new ViewObjectContactOfPageObj(rObjectContact, *this);
34  return *pRetval;
35 }
36 
38  : ViewContactOfSdrObj(rPageObj)
39 {
40 }
41 
43 
44 // #i35972# React on changes of the object of this ViewContact
46 {
47  static bool bIsInActionChange(false);
48 
49  if (!bIsInActionChange)
50  {
51  // set recursion flag, see description in *.hxx
52  bIsInActionChange = true;
53 
54  // call parent
56 
57  // reset recursion flag, see description in *.hxx
58  bIsInActionChange = false;
59  }
60 }
61 
64 {
65  // create graphical visualisation data. Since this is the view-independent version which should not be used,
66  // create a replacement graphic visualisation here. Use GetLastBoundRect to access the model data directly
67  // which is aOutRect for SdrPageObj.
68  const tools::Rectangle aModelRectangle(GetPageObj().GetLastBoundRect());
69  const basegfx::B2DRange aModelRange = vcl::unotools::b2DRectangleFromRectangle(aModelRectangle);
71  const basegfx::BColor aYellow(1.0, 1.0, 0.0);
74 
75  rVisitor.visit(xReference);
76 }
77 }
78 
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor &rVisitor) const override
virtual ViewObjectContact & CreateObjectSpecificViewObjectContact(ObjectContact &rObjectContact) override
virtual void visit(const Primitive2DReference &)=0
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
const SdrPageObj & GetPageObj() const