xref: /trunk/main/svx/source/sdr/contact/viewcontactofsdrpage.cxx (revision 16bba488c3d48e207291611c0a87d272868594f2)
1f6e50924SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3f6e50924SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f6e50924SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f6e50924SAndrew Rist  * distributed with this work for additional information
6f6e50924SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f6e50924SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f6e50924SAndrew Rist  * "License"); you may not use this file except in compliance
9f6e50924SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11f6e50924SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13f6e50924SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f6e50924SAndrew Rist  * software distributed under the License is distributed on an
15f6e50924SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f6e50924SAndrew Rist  * KIND, either express or implied.  See the License for the
17f6e50924SAndrew Rist  * specific language governing permissions and limitations
18f6e50924SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20f6e50924SAndrew Rist  *************************************************************/
21f6e50924SAndrew Rist 
22f6e50924SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svx.hxx"
26cdf0e10cSrcweir #include <svx/sdr/contact/viewcontactofsdrpage.hxx>
27cdf0e10cSrcweir #include <svx/sdr/contact/viewobjectcontact.hxx>
28cdf0e10cSrcweir #include <svx/svdpage.hxx>
29cdf0e10cSrcweir #include <svx/sdr/contact/displayinfo.hxx>
30cdf0e10cSrcweir #include <svx/sdr/contact/viewobjectcontactofsdrpage.hxx>
31cdf0e10cSrcweir #include <basegfx/polygon/b2dpolygontools.hxx>
32cdf0e10cSrcweir #include <basegfx/matrix/b2dhommatrix.hxx>
33cdf0e10cSrcweir #include <svx/svdpagv.hxx>
34cdf0e10cSrcweir #include <svx/svdview.hxx>
35cdf0e10cSrcweir #include <vcl/svapp.hxx>
36cdf0e10cSrcweir #include <svx/sdr/contact/objectcontact.hxx>
37cdf0e10cSrcweir #include <drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx>
38cdf0e10cSrcweir #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
39cdf0e10cSrcweir #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
40cdf0e10cSrcweir #include <basegfx/polygon/b2dpolygon.hxx>
41cdf0e10cSrcweir #include <svx/sdr/primitive2d/sdrattributecreator.hxx>
42cdf0e10cSrcweir #include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
43cdf0e10cSrcweir #include <vcl/lazydelete.hxx>
44cdf0e10cSrcweir #include <svx/svdstr.hrc>
45cdf0e10cSrcweir #include <svx/svdglob.hxx>
46cdf0e10cSrcweir #include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx>
47cdf0e10cSrcweir #include <drawinglayer/attribute/sdrfillattribute.hxx>
48cdf0e10cSrcweir 
49cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
50cdf0e10cSrcweir 
51cdf0e10cSrcweir #define PAPER_SHADOW(SIZE) (SIZE >> 8)
52cdf0e10cSrcweir 
53cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
54cdf0e10cSrcweir 
55cdf0e10cSrcweir namespace sdr
56cdf0e10cSrcweir {
57cdf0e10cSrcweir     namespace contact
58cdf0e10cSrcweir     {
59cdf0e10cSrcweir         ViewContactOfPageSubObject::ViewContactOfPageSubObject(ViewContactOfSdrPage& rParentViewContactOfSdrPage)
60cdf0e10cSrcweir         :   mrParentViewContactOfSdrPage(rParentViewContactOfSdrPage)
61cdf0e10cSrcweir         {
62cdf0e10cSrcweir         }
63cdf0e10cSrcweir 
64cdf0e10cSrcweir         ViewContactOfPageSubObject::~ViewContactOfPageSubObject()
65cdf0e10cSrcweir         {
66cdf0e10cSrcweir         }
67cdf0e10cSrcweir 
68cdf0e10cSrcweir         ViewContact* ViewContactOfPageSubObject::GetParentContact() const
69cdf0e10cSrcweir         {
70cdf0e10cSrcweir             return &mrParentViewContactOfSdrPage;
71cdf0e10cSrcweir         }
72cdf0e10cSrcweir 
73cdf0e10cSrcweir         const SdrPage& ViewContactOfPageSubObject::getPage() const
74cdf0e10cSrcweir         {
75cdf0e10cSrcweir             return mrParentViewContactOfSdrPage.GetSdrPage();
76cdf0e10cSrcweir         }
77cdf0e10cSrcweir     } // end of namespace contact
78cdf0e10cSrcweir } // end of namespace sdr
79cdf0e10cSrcweir 
80cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
81cdf0e10cSrcweir 
82cdf0e10cSrcweir namespace sdr
83cdf0e10cSrcweir {
84cdf0e10cSrcweir     namespace contact
85cdf0e10cSrcweir     {
86cdf0e10cSrcweir         ViewObjectContact& ViewContactOfPageBackground::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
87cdf0e10cSrcweir         {
88cdf0e10cSrcweir             ViewObjectContact* pRetval = new ViewObjectContactOfPageBackground(rObjectContact, *this);
89cdf0e10cSrcweir             DBG_ASSERT(pRetval, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
90cdf0e10cSrcweir 
91cdf0e10cSrcweir             return *pRetval;
92cdf0e10cSrcweir         }
93cdf0e10cSrcweir 
94cdf0e10cSrcweir         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageBackground::createViewIndependentPrimitive2DSequence() const
95cdf0e10cSrcweir         {
96cdf0e10cSrcweir             // We have only the page information, not the view information. Use the
97*16bba488Smseidel             // svtools::DOCCOLOR color for initialization
98cdf0e10cSrcweir             const svtools::ColorConfig aColorConfig;
99cdf0e10cSrcweir             const Color aInitColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
100cdf0e10cSrcweir             const basegfx::BColor aRGBColor(aInitColor.getBColor());
101cdf0e10cSrcweir             const drawinglayer::primitive2d::Primitive2DReference xReference(
102cdf0e10cSrcweir                 new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor));
103cdf0e10cSrcweir 
104cdf0e10cSrcweir             return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
105cdf0e10cSrcweir         }
106cdf0e10cSrcweir 
107cdf0e10cSrcweir         ViewContactOfPageBackground::ViewContactOfPageBackground(ViewContactOfSdrPage& rParentViewContactOfSdrPage)
108cdf0e10cSrcweir         :   ViewContactOfPageSubObject(rParentViewContactOfSdrPage)
109cdf0e10cSrcweir         {
110cdf0e10cSrcweir         }
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         ViewContactOfPageBackground::~ViewContactOfPageBackground()
113cdf0e10cSrcweir         {
114cdf0e10cSrcweir         }
115cdf0e10cSrcweir     } // end of namespace contact
116cdf0e10cSrcweir } // end of namespace sdr
117cdf0e10cSrcweir 
118cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
119cdf0e10cSrcweir 
120cdf0e10cSrcweir namespace sdr
121cdf0e10cSrcweir {
122cdf0e10cSrcweir     namespace contact
123cdf0e10cSrcweir     {
124cdf0e10cSrcweir         ViewObjectContact& ViewContactOfPageShadow::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
125cdf0e10cSrcweir         {
126cdf0e10cSrcweir             ViewObjectContact* pRetval = new ViewObjectContactOfPageShadow(rObjectContact, *this);
127cdf0e10cSrcweir             DBG_ASSERT(pRetval, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
128cdf0e10cSrcweir 
129cdf0e10cSrcweir             return *pRetval;
130cdf0e10cSrcweir         }
131cdf0e10cSrcweir 
132cdf0e10cSrcweir         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageShadow::createViewIndependentPrimitive2DSequence() const
133cdf0e10cSrcweir         {
134cdf0e10cSrcweir             static bool bUseOldPageShadow(false);
135cdf0e10cSrcweir             const SdrPage& rPage = getPage();
136cdf0e10cSrcweir             basegfx::B2DHomMatrix aPageMatrix;
137cdf0e10cSrcweir             aPageMatrix.set(0, 0, (double)rPage.GetWdt());
138cdf0e10cSrcweir             aPageMatrix.set(1, 1, (double)rPage.GetHgt());
139cdf0e10cSrcweir 
140cdf0e10cSrcweir             if(bUseOldPageShadow)
141cdf0e10cSrcweir             {
142cdf0e10cSrcweir                 // create page shadow polygon
143cdf0e10cSrcweir                 const double fPageBorderFactor(1.0 / 256.0);
144cdf0e10cSrcweir                 basegfx::B2DPolygon aPageShadowPolygon;
145cdf0e10cSrcweir                 aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor));
146cdf0e10cSrcweir                 aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor));
147cdf0e10cSrcweir                 aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor));
148cdf0e10cSrcweir                 aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor));
149cdf0e10cSrcweir                 aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0));
150cdf0e10cSrcweir                 aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0));
151cdf0e10cSrcweir                 aPageShadowPolygon.setClosed(true);
152cdf0e10cSrcweir                 aPageShadowPolygon.transform(aPageMatrix);
153cdf0e10cSrcweir 
154cdf0e10cSrcweir                 // We have only the page information, not the view information. Use the
155c22beca6Smseidel                 // svtools::FONTCOLOR color for initialization
156cdf0e10cSrcweir                 const svtools::ColorConfig aColorConfig;
157cdf0e10cSrcweir                 const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
158cdf0e10cSrcweir                 const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor());
159cdf0e10cSrcweir                 const drawinglayer::primitive2d::Primitive2DReference xReference(
160cdf0e10cSrcweir                     new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
161cdf0e10cSrcweir                         basegfx::B2DPolyPolygon(aPageShadowPolygon),
162cdf0e10cSrcweir                         aRGBShadowColor));
163cdf0e10cSrcweir 
164cdf0e10cSrcweir                 return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
165cdf0e10cSrcweir             }
166cdf0e10cSrcweir             else
167cdf0e10cSrcweir             {
1686de8cae6SArmin Le Grand                 static vcl::DeleteOnDeinit< drawinglayer::primitive2d::DiscreteShadow > aDiscreteShadow(
1696de8cae6SArmin Le Grand                     new drawinglayer::primitive2d::DiscreteShadow(
1706de8cae6SArmin Le Grand                         BitmapEx(
1716de8cae6SArmin Le Grand                             ResId(
1726de8cae6SArmin Le Grand                                 SIP_SA_PAGESHADOW35X35,
1736de8cae6SArmin Le Grand                                 *ImpGetResMgr()))));
1746de8cae6SArmin Le Grand 
1756de8cae6SArmin Le Grand                 if(aDiscreteShadow.get())
176cdf0e10cSrcweir                 {
177cdf0e10cSrcweir                     const drawinglayer::primitive2d::Primitive2DReference xReference(
178cdf0e10cSrcweir                         new drawinglayer::primitive2d::DiscreteShadowPrimitive2D(
179cdf0e10cSrcweir                             aPageMatrix,
180cdf0e10cSrcweir                             *aDiscreteShadow.get()));
181cdf0e10cSrcweir 
182cdf0e10cSrcweir                     return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
183cdf0e10cSrcweir                 }
1846de8cae6SArmin Le Grand 
185cdf0e10cSrcweir                 return drawinglayer::primitive2d::Primitive2DSequence();
186cdf0e10cSrcweir             }
187cdf0e10cSrcweir         }
188cdf0e10cSrcweir 
189cdf0e10cSrcweir         ViewContactOfPageShadow::ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage)
190cdf0e10cSrcweir         :   ViewContactOfPageSubObject(rParentViewContactOfSdrPage)
191cdf0e10cSrcweir         {
192cdf0e10cSrcweir         }
193cdf0e10cSrcweir 
194cdf0e10cSrcweir         ViewContactOfPageShadow::~ViewContactOfPageShadow()
195cdf0e10cSrcweir         {
196cdf0e10cSrcweir         }
197cdf0e10cSrcweir     } // end of namespace contact
198cdf0e10cSrcweir } // end of namespace sdr
199cdf0e10cSrcweir 
200cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
201cdf0e10cSrcweir 
202cdf0e10cSrcweir namespace sdr
203cdf0e10cSrcweir {
204cdf0e10cSrcweir     namespace contact
205cdf0e10cSrcweir     {
206cdf0e10cSrcweir         ViewObjectContact& ViewContactOfMasterPage::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
207cdf0e10cSrcweir         {
208cdf0e10cSrcweir             ViewObjectContact* pRetval = new ViewObjectContactOfMasterPage(rObjectContact, *this);
209cdf0e10cSrcweir             DBG_ASSERT(pRetval, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
210cdf0e10cSrcweir 
211cdf0e10cSrcweir             return *pRetval;
212cdf0e10cSrcweir         }
213cdf0e10cSrcweir 
214cdf0e10cSrcweir         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfMasterPage::createViewIndependentPrimitive2DSequence() const
215cdf0e10cSrcweir         {
216cdf0e10cSrcweir             drawinglayer::primitive2d::Primitive2DSequence xRetval;
217cdf0e10cSrcweir 
218cdf0e10cSrcweir             // this class is used when the page is a MasterPage and is responsible to
219c22beca6Smseidel             // create a visualization for the MPBGO, if exists. This needs to be suppressed
220c22beca6Smseidel             // when a SdrPage which uses a MasterPage creates its output. Suppression
221cdf0e10cSrcweir             // is done in the corresponding VOC since DisplayInfo data is needed
222cdf0e10cSrcweir             const SdrPage& rPage = getPage();
223cdf0e10cSrcweir 
224cdf0e10cSrcweir             if(rPage.IsMasterPage())
225cdf0e10cSrcweir             {
226cdf0e10cSrcweir                 if(0 == rPage.GetPageNum())
227cdf0e10cSrcweir                 {
228cdf0e10cSrcweir                     // #i98063#
229cdf0e10cSrcweir                     // filter MasterPage 0 since it's the HandoutPage. Thus, it's a
230cdf0e10cSrcweir                     // MasterPage, but has no MPBGO, so there is nothing to do here.
231cdf0e10cSrcweir                 }
232cdf0e10cSrcweir                 else
233cdf0e10cSrcweir                 {
234cdf0e10cSrcweir                     drawinglayer::attribute::SdrFillAttribute aFill;
235cdf0e10cSrcweir 
236cdf0e10cSrcweir                     // #i110846# Suppress SdrPage FillStyle for MasterPages without StyleSheets,
237cdf0e10cSrcweir                     // else the PoolDefault (XFILL_COLOR and Blue8) will be used. Normally, all
238cdf0e10cSrcweir                     // MasterPages should have a StyleSheet excactly for this reason, but historically
239cdf0e10cSrcweir                     // e.g. the Notes MasterPage has no StyleSheet set (and there maybe others).
240cdf0e10cSrcweir                     if(rPage.getSdrPageProperties().GetStyleSheet())
241cdf0e10cSrcweir                     {
242cdf0e10cSrcweir                         // create page fill attributes with correct properties
243cdf0e10cSrcweir                         aFill = drawinglayer::primitive2d::createNewSdrFillAttribute(
244cdf0e10cSrcweir                             rPage.getSdrPageProperties().GetItemSet());
245cdf0e10cSrcweir                     }
246cdf0e10cSrcweir 
247cdf0e10cSrcweir                     if(!aFill.isDefault())
248cdf0e10cSrcweir                     {
249cdf0e10cSrcweir                         // direct model data is the page size, get and use it
250cdf0e10cSrcweir                         const basegfx::B2DRange aInnerRange(
251cdf0e10cSrcweir                             rPage.GetLftBorder(), rPage.GetUppBorder(),
252cdf0e10cSrcweir                             rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder());
253cdf0e10cSrcweir                         const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
254cdf0e10cSrcweir                         const drawinglayer::primitive2d::Primitive2DReference xReference(
255cdf0e10cSrcweir                             drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
256cdf0e10cSrcweir                                 basegfx::B2DPolyPolygon(aInnerPolgon),
257cdf0e10cSrcweir                                 aFill,
258cdf0e10cSrcweir                                 drawinglayer::attribute::FillGradientAttribute()));
259cdf0e10cSrcweir 
260cdf0e10cSrcweir                         xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
261cdf0e10cSrcweir                     }
262cdf0e10cSrcweir                 }
263cdf0e10cSrcweir             }
264cdf0e10cSrcweir 
265cdf0e10cSrcweir             return xRetval;
266cdf0e10cSrcweir         }
267cdf0e10cSrcweir 
268cdf0e10cSrcweir         ViewContactOfMasterPage::ViewContactOfMasterPage(ViewContactOfSdrPage& rParentViewContactOfSdrPage)
269cdf0e10cSrcweir         :   ViewContactOfPageSubObject(rParentViewContactOfSdrPage)
270cdf0e10cSrcweir         {
271cdf0e10cSrcweir         }
272cdf0e10cSrcweir 
273cdf0e10cSrcweir         ViewContactOfMasterPage::~ViewContactOfMasterPage()
274cdf0e10cSrcweir         {
275cdf0e10cSrcweir         }
276cdf0e10cSrcweir     } // end of namespace contact
277cdf0e10cSrcweir } // end of namespace sdr
278cdf0e10cSrcweir 
279cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
280cdf0e10cSrcweir 
281cdf0e10cSrcweir namespace sdr
282cdf0e10cSrcweir {
283cdf0e10cSrcweir     namespace contact
284cdf0e10cSrcweir     {
285cdf0e10cSrcweir         ViewObjectContact& ViewContactOfPageFill::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
286cdf0e10cSrcweir         {
287cdf0e10cSrcweir             ViewObjectContact* pRetval = new ViewObjectContactOfPageFill(rObjectContact, *this);
288cdf0e10cSrcweir             DBG_ASSERT(pRetval, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
289cdf0e10cSrcweir 
290cdf0e10cSrcweir             return *pRetval;
291cdf0e10cSrcweir         }
292cdf0e10cSrcweir 
293cdf0e10cSrcweir         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageFill::createViewIndependentPrimitive2DSequence() const
294cdf0e10cSrcweir         {
295cdf0e10cSrcweir             const SdrPage& rPage = getPage();
296cdf0e10cSrcweir             const basegfx::B2DRange aPageFillRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt());
297cdf0e10cSrcweir             const basegfx::B2DPolygon aPageFillPolygon(basegfx::tools::createPolygonFromRect(aPageFillRange));
298cdf0e10cSrcweir 
299cdf0e10cSrcweir             // We have only the page information, not the view information. Use the
300c22beca6Smseidel             // svtools::DOCCOLOR color for initialization
301cdf0e10cSrcweir             const svtools::ColorConfig aColorConfig;
302cdf0e10cSrcweir             const Color aPageFillColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
303cdf0e10cSrcweir 
304cdf0e10cSrcweir             // create and add primitive
305cdf0e10cSrcweir             const basegfx::BColor aRGBColor(aPageFillColor.getBColor());
306cdf0e10cSrcweir             const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPageFillPolygon), aRGBColor));
307cdf0e10cSrcweir 
308cdf0e10cSrcweir             return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
309cdf0e10cSrcweir         }
310cdf0e10cSrcweir 
311cdf0e10cSrcweir         ViewContactOfPageFill::ViewContactOfPageFill(ViewContactOfSdrPage& rParentViewContactOfSdrPage)
312cdf0e10cSrcweir         :   ViewContactOfPageSubObject(rParentViewContactOfSdrPage)
313cdf0e10cSrcweir         {
314cdf0e10cSrcweir         }
315cdf0e10cSrcweir 
316cdf0e10cSrcweir         ViewContactOfPageFill::~ViewContactOfPageFill()
317cdf0e10cSrcweir         {
318cdf0e10cSrcweir         }
319cdf0e10cSrcweir     } // end of namespace contact
320cdf0e10cSrcweir } // end of namespace sdr
321cdf0e10cSrcweir 
322cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
323cdf0e10cSrcweir 
324cdf0e10cSrcweir namespace sdr
325cdf0e10cSrcweir {
326cdf0e10cSrcweir     namespace contact
327cdf0e10cSrcweir     {
328cdf0e10cSrcweir         ViewObjectContact& ViewContactOfOuterPageBorder::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
329cdf0e10cSrcweir         {
330cdf0e10cSrcweir             ViewObjectContact* pRetval = new ViewObjectContactOfOuterPageBorder(rObjectContact, *this);
331cdf0e10cSrcweir             DBG_ASSERT(pRetval, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
332cdf0e10cSrcweir 
333cdf0e10cSrcweir             return *pRetval;
334cdf0e10cSrcweir         }
335cdf0e10cSrcweir 
336cdf0e10cSrcweir         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfOuterPageBorder::createViewIndependentPrimitive2DSequence() const
337cdf0e10cSrcweir         {
338cdf0e10cSrcweir             drawinglayer::primitive2d::Primitive2DSequence xRetval;
339cdf0e10cSrcweir             const SdrPage& rPage = getPage();
340cdf0e10cSrcweir             const basegfx::B2DRange aPageBorderRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt());
341cdf0e10cSrcweir 
342*16bba488Smseidel             // Changed to 0x000000 as in Writer, before svtools::FONTCOLOR was used.
343cdf0e10cSrcweir             // Added old case as fallback for HighContrast.
344*16bba488Smseidel             basegfx::BColor aRGBBorderColor(0x00 / (double)0xff, 0x00 / (double)0xff, 0x00 / (double)0xff);
345cdf0e10cSrcweir 
346cdf0e10cSrcweir             if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
347cdf0e10cSrcweir             {
348cdf0e10cSrcweir                 const svtools::ColorConfig aColorConfig;
349cdf0e10cSrcweir                 const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
350cdf0e10cSrcweir 
351cdf0e10cSrcweir                 aRGBBorderColor = aBorderColor.getBColor();
352cdf0e10cSrcweir             }
353cdf0e10cSrcweir 
354cdf0e10cSrcweir             if(rPage.getPageBorderOnlyLeftRight())
355cdf0e10cSrcweir             {
356cdf0e10cSrcweir                 // #i93597# for Report Designer, the page border shall be only displayed right and left,
357cdf0e10cSrcweir                 // but not top and bottom. Create simplified geometry.
358cdf0e10cSrcweir                 basegfx::B2DPolygon aLeft, aRight;
359cdf0e10cSrcweir 
360cdf0e10cSrcweir                 aLeft.append(basegfx::B2DPoint(aPageBorderRange.getMinX(), aPageBorderRange.getMinY()));
361cdf0e10cSrcweir                 aLeft.append(basegfx::B2DPoint(aPageBorderRange.getMinX(), aPageBorderRange.getMaxY()));
362cdf0e10cSrcweir 
363cdf0e10cSrcweir                 aRight.append(basegfx::B2DPoint(aPageBorderRange.getMaxX(), aPageBorderRange.getMinY()));
364cdf0e10cSrcweir                 aRight.append(basegfx::B2DPoint(aPageBorderRange.getMaxX(), aPageBorderRange.getMaxY()));
365cdf0e10cSrcweir 
366cdf0e10cSrcweir                 xRetval.realloc(2);
367cdf0e10cSrcweir                 xRetval[0] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aLeft, aRGBBorderColor));
368cdf0e10cSrcweir                 xRetval[1] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aRight, aRGBBorderColor));
369cdf0e10cSrcweir             }
370cdf0e10cSrcweir             else
371cdf0e10cSrcweir             {
372cdf0e10cSrcweir                 xRetval.realloc(1);
373cdf0e10cSrcweir                 const basegfx::B2DPolygon aPageBorderPolygon(basegfx::tools::createPolygonFromRect(aPageBorderRange));
374cdf0e10cSrcweir                 xRetval[0] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aPageBorderPolygon, aRGBBorderColor));
375cdf0e10cSrcweir             }
376cdf0e10cSrcweir 
377cdf0e10cSrcweir             return xRetval;
378cdf0e10cSrcweir         }
379cdf0e10cSrcweir 
380cdf0e10cSrcweir         ViewContactOfOuterPageBorder::ViewContactOfOuterPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage)
381cdf0e10cSrcweir         :   ViewContactOfPageSubObject(rParentViewContactOfSdrPage)
382cdf0e10cSrcweir         {
383cdf0e10cSrcweir         }
384cdf0e10cSrcweir 
385cdf0e10cSrcweir         ViewContactOfOuterPageBorder::~ViewContactOfOuterPageBorder()
386cdf0e10cSrcweir         {
387cdf0e10cSrcweir         }
388cdf0e10cSrcweir     } // end of namespace contact
389cdf0e10cSrcweir } // end of namespace sdr
390cdf0e10cSrcweir 
391cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
392cdf0e10cSrcweir 
393cdf0e10cSrcweir namespace sdr
394cdf0e10cSrcweir {
395cdf0e10cSrcweir     namespace contact
396cdf0e10cSrcweir     {
397cdf0e10cSrcweir         ViewObjectContact& ViewContactOfInnerPageBorder::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
398cdf0e10cSrcweir         {
399cdf0e10cSrcweir             ViewObjectContact* pRetval = new ViewObjectContactOfInnerPageBorder(rObjectContact, *this);
400cdf0e10cSrcweir             DBG_ASSERT(pRetval, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
401cdf0e10cSrcweir 
402cdf0e10cSrcweir             return *pRetval;
403cdf0e10cSrcweir         }
404cdf0e10cSrcweir 
405cdf0e10cSrcweir         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfInnerPageBorder::createViewIndependentPrimitive2DSequence() const
406cdf0e10cSrcweir         {
407cdf0e10cSrcweir             const SdrPage& rPage = getPage();
408cdf0e10cSrcweir             const basegfx::B2DRange aPageBorderRange(
409cdf0e10cSrcweir                 (double)rPage.GetLftBorder(), (double)rPage.GetUppBorder(),
410cdf0e10cSrcweir                 (double)(rPage.GetWdt() - rPage.GetRgtBorder()), (double)(rPage.GetHgt() - rPage.GetLwrBorder()));
411cdf0e10cSrcweir             const basegfx::B2DPolygon aPageBorderPolygon(basegfx::tools::createPolygonFromRect(aPageBorderRange));
412cdf0e10cSrcweir 
413cdf0e10cSrcweir             // We have only the page information, not the view information. Use the
414*16bba488Smseidel             // svtools::FONTCOLOR or svtools::DOCBOUNDARIES color for initialization
415cdf0e10cSrcweir             const svtools::ColorConfig aColorConfig;
416cdf0e10cSrcweir             Color aBorderColor;
417cdf0e10cSrcweir 
418cdf0e10cSrcweir             if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
419cdf0e10cSrcweir             {
420cdf0e10cSrcweir                 aBorderColor = aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor;
421cdf0e10cSrcweir             }
422cdf0e10cSrcweir             else
423cdf0e10cSrcweir             {
424cdf0e10cSrcweir                 aBorderColor = aColorConfig.GetColorValue(svtools::DOCBOUNDARIES).nColor;
425cdf0e10cSrcweir             }
426cdf0e10cSrcweir 
427cdf0e10cSrcweir             // create page outer border primitive
428cdf0e10cSrcweir             const basegfx::BColor aRGBBorderColor(aBorderColor.getBColor());
429cdf0e10cSrcweir             const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aPageBorderPolygon, aRGBBorderColor));
430cdf0e10cSrcweir 
431cdf0e10cSrcweir             return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
432cdf0e10cSrcweir         }
433cdf0e10cSrcweir 
434cdf0e10cSrcweir         ViewContactOfInnerPageBorder::ViewContactOfInnerPageBorder(ViewContactOfSdrPage& rParentViewContactOfSdrPage)
435cdf0e10cSrcweir         :   ViewContactOfPageSubObject(rParentViewContactOfSdrPage)
436cdf0e10cSrcweir         {
437cdf0e10cSrcweir         }
438cdf0e10cSrcweir 
439cdf0e10cSrcweir         ViewContactOfInnerPageBorder::~ViewContactOfInnerPageBorder()
440cdf0e10cSrcweir         {
441cdf0e10cSrcweir         }
442cdf0e10cSrcweir     } // end of namespace contact
443cdf0e10cSrcweir } // end of namespace sdr
444cdf0e10cSrcweir 
445cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
446cdf0e10cSrcweir 
447cdf0e10cSrcweir namespace sdr
448cdf0e10cSrcweir {
449cdf0e10cSrcweir     namespace contact
450cdf0e10cSrcweir     {
451cdf0e10cSrcweir         ViewObjectContact& ViewContactOfPageHierarchy::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
452cdf0e10cSrcweir         {
453cdf0e10cSrcweir             ViewObjectContact* pRetval = new ViewObjectContactOfPageHierarchy(rObjectContact, *this);
454cdf0e10cSrcweir             DBG_ASSERT(pRetval, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
455cdf0e10cSrcweir 
456cdf0e10cSrcweir             return *pRetval;
457cdf0e10cSrcweir         }
458cdf0e10cSrcweir 
459cdf0e10cSrcweir         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageHierarchy::createViewIndependentPrimitive2DSequence() const
460cdf0e10cSrcweir         {
461cdf0e10cSrcweir             // collect sub-hierarchy
462cdf0e10cSrcweir             drawinglayer::primitive2d::Primitive2DSequence xRetval;
463cdf0e10cSrcweir             const sal_uInt32 nObjectCount(GetObjectCount());
464cdf0e10cSrcweir 
465cdf0e10cSrcweir             // collect all sub-primitives
466cdf0e10cSrcweir             for(sal_uInt32 a(0); a < nObjectCount; a++)
467cdf0e10cSrcweir             {
468cdf0e10cSrcweir                 const ViewContact& rCandidate(GetViewContact(a));
469cdf0e10cSrcweir                 const drawinglayer::primitive2d::Primitive2DSequence aCandSeq(rCandidate.getViewIndependentPrimitive2DSequence());
470cdf0e10cSrcweir 
471cdf0e10cSrcweir                 drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, aCandSeq);
472cdf0e10cSrcweir             }
473cdf0e10cSrcweir 
474cdf0e10cSrcweir             return xRetval;
475cdf0e10cSrcweir         }
476cdf0e10cSrcweir 
477cdf0e10cSrcweir         ViewContactOfPageHierarchy::ViewContactOfPageHierarchy(ViewContactOfSdrPage& rParentViewContactOfSdrPage)
478cdf0e10cSrcweir         :   ViewContactOfPageSubObject(rParentViewContactOfSdrPage)
479cdf0e10cSrcweir         {
480cdf0e10cSrcweir         }
481cdf0e10cSrcweir 
482cdf0e10cSrcweir         ViewContactOfPageHierarchy::~ViewContactOfPageHierarchy()
483cdf0e10cSrcweir         {
484cdf0e10cSrcweir         }
485cdf0e10cSrcweir 
486cdf0e10cSrcweir         sal_uInt32 ViewContactOfPageHierarchy::GetObjectCount() const
487cdf0e10cSrcweir         {
488cdf0e10cSrcweir             return getPage().GetObjCount();
489cdf0e10cSrcweir         }
490cdf0e10cSrcweir 
491cdf0e10cSrcweir         ViewContact& ViewContactOfPageHierarchy::GetViewContact(sal_uInt32 nIndex) const
492cdf0e10cSrcweir         {
493cdf0e10cSrcweir             SdrObject* pObj = getPage().GetObj(nIndex);
494cdf0e10cSrcweir             DBG_ASSERT(pObj, "ViewContactOfPageHierarchy::GetViewContact: Corrupt SdrObjList (!)");
495cdf0e10cSrcweir             return pObj->GetViewContact();
496cdf0e10cSrcweir         }
497cdf0e10cSrcweir     } // end of namespace contact
498cdf0e10cSrcweir } // end of namespace sdr
499cdf0e10cSrcweir 
500cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
501cdf0e10cSrcweir 
502cdf0e10cSrcweir namespace sdr
503cdf0e10cSrcweir {
504cdf0e10cSrcweir     namespace contact
505cdf0e10cSrcweir     {
506cdf0e10cSrcweir         ViewObjectContact& ViewContactOfGrid::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
507cdf0e10cSrcweir         {
508cdf0e10cSrcweir             ViewObjectContact* pRetval = new ViewObjectContactOfPageGrid(rObjectContact, *this);
509cdf0e10cSrcweir             DBG_ASSERT(pRetval, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
510cdf0e10cSrcweir 
511cdf0e10cSrcweir             return *pRetval;
512cdf0e10cSrcweir         }
513cdf0e10cSrcweir 
514cdf0e10cSrcweir         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGrid::createViewIndependentPrimitive2DSequence() const
515cdf0e10cSrcweir         {
516cdf0e10cSrcweir             // We have only the page information, not the view information and thus no grid settings. Create empty
517cdf0e10cSrcweir             // default. For the view-dependent implementation, see ViewObjectContactOfPageGrid::createPrimitive2DSequence
518cdf0e10cSrcweir             return drawinglayer::primitive2d::Primitive2DSequence();
519cdf0e10cSrcweir         }
520cdf0e10cSrcweir 
521cdf0e10cSrcweir         ViewContactOfGrid::ViewContactOfGrid(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront)
522cdf0e10cSrcweir         :   ViewContactOfPageSubObject(rParentViewContactOfSdrPage),
523cdf0e10cSrcweir             mbFront(bFront)
524cdf0e10cSrcweir         {
525cdf0e10cSrcweir         }
526cdf0e10cSrcweir 
527cdf0e10cSrcweir         ViewContactOfGrid::~ViewContactOfGrid()
528cdf0e10cSrcweir         {
529cdf0e10cSrcweir         }
530cdf0e10cSrcweir     } // end of namespace contact
531cdf0e10cSrcweir } // end of namespace sdr
532cdf0e10cSrcweir 
533cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
534cdf0e10cSrcweir 
535cdf0e10cSrcweir namespace sdr
536cdf0e10cSrcweir {
537cdf0e10cSrcweir     namespace contact
538cdf0e10cSrcweir     {
539cdf0e10cSrcweir         ViewObjectContact& ViewContactOfHelplines::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
540cdf0e10cSrcweir         {
541cdf0e10cSrcweir             ViewObjectContact* pRetval = new ViewObjectContactOfPageHelplines(rObjectContact, *this);
542cdf0e10cSrcweir             DBG_ASSERT(pRetval, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
543cdf0e10cSrcweir 
544cdf0e10cSrcweir             return *pRetval;
545cdf0e10cSrcweir         }
546cdf0e10cSrcweir 
547cdf0e10cSrcweir         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfHelplines::createViewIndependentPrimitive2DSequence() const
548cdf0e10cSrcweir         {
549cdf0e10cSrcweir             // We have only the page information, not the view information and thus no helplines. Create empty
550cdf0e10cSrcweir             // default. For the view-dependent implementation, see ViewObjectContactOfPageHelplines::createPrimitive2DSequence
551cdf0e10cSrcweir             return drawinglayer::primitive2d::Primitive2DSequence();
552cdf0e10cSrcweir         }
553cdf0e10cSrcweir 
554cdf0e10cSrcweir         ViewContactOfHelplines::ViewContactOfHelplines(ViewContactOfSdrPage& rParentViewContactOfSdrPage, bool bFront)
555cdf0e10cSrcweir         :   ViewContactOfPageSubObject(rParentViewContactOfSdrPage),
556cdf0e10cSrcweir             mbFront(bFront)
557cdf0e10cSrcweir         {
558cdf0e10cSrcweir         }
559cdf0e10cSrcweir 
560cdf0e10cSrcweir         ViewContactOfHelplines::~ViewContactOfHelplines()
561cdf0e10cSrcweir         {
562cdf0e10cSrcweir         }
563cdf0e10cSrcweir     } // end of namespace contact
564cdf0e10cSrcweir } // end of namespace sdr
565cdf0e10cSrcweir 
566cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
567cdf0e10cSrcweir 
568cdf0e10cSrcweir namespace sdr
569cdf0e10cSrcweir {
570cdf0e10cSrcweir     namespace contact
571cdf0e10cSrcweir     {
572cdf0e10cSrcweir         // Create a Object-Specific ViewObjectContact, set ViewContact and
573cdf0e10cSrcweir         // ObjectContact. Always needs to return something.
574cdf0e10cSrcweir         ViewObjectContact& ViewContactOfSdrPage::CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact)
575cdf0e10cSrcweir         {
576cdf0e10cSrcweir             ViewObjectContact* pRetval = new ViewObjectContactOfSdrPage(rObjectContact, *this);
577cdf0e10cSrcweir             DBG_ASSERT(pRetval, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
578cdf0e10cSrcweir 
579cdf0e10cSrcweir             return *pRetval;
580cdf0e10cSrcweir         }
581cdf0e10cSrcweir 
582cdf0e10cSrcweir         ViewContactOfSdrPage::ViewContactOfSdrPage(SdrPage& rPage)
583cdf0e10cSrcweir         :   ViewContact(),
584cdf0e10cSrcweir             mrPage(rPage),
585cdf0e10cSrcweir             maViewContactOfPageBackground(*this),
586cdf0e10cSrcweir             maViewContactOfPageShadow(*this),
587cdf0e10cSrcweir             maViewContactOfPageFill(*this),
588cdf0e10cSrcweir             maViewContactOfMasterPage(*this),
589cdf0e10cSrcweir             maViewContactOfOuterPageBorder(*this),
590cdf0e10cSrcweir             maViewContactOfInnerPageBorder(*this),
591cdf0e10cSrcweir             maViewContactOfGridBack(*this, false),
592cdf0e10cSrcweir             maViewContactOfHelplinesBack(*this, false),
593cdf0e10cSrcweir             maViewContactOfPageHierarchy(*this),
594cdf0e10cSrcweir             maViewContactOfGridFront(*this, true),
595cdf0e10cSrcweir             maViewContactOfHelplinesFront(*this, true)
596cdf0e10cSrcweir         {
597cdf0e10cSrcweir         }
598cdf0e10cSrcweir 
599cdf0e10cSrcweir         ViewContactOfSdrPage::~ViewContactOfSdrPage()
600cdf0e10cSrcweir         {
601cdf0e10cSrcweir         }
602cdf0e10cSrcweir 
603cdf0e10cSrcweir         // Access to possible sub-hierarchy
604cdf0e10cSrcweir         sal_uInt32 ViewContactOfSdrPage::GetObjectCount() const
605cdf0e10cSrcweir         {
606cdf0e10cSrcweir             // Fixed count of content. It contains PageBackground (Wiese), PageShadow, PageFill,
607cdf0e10cSrcweir             // then - depending on if the page has a MasterPage - either MasterPage Hierarchy
608cdf0e10cSrcweir             // or MPBGO. Also OuterPageBorder, InnerPageBorder and two pairs of Grid and Helplines
609cdf0e10cSrcweir             // (for front and back) which internally are visible or not depending on the current
610cdf0e10cSrcweir             // front/back setting for those.
611cdf0e10cSrcweir             return 11;
612cdf0e10cSrcweir         }
613cdf0e10cSrcweir 
614cdf0e10cSrcweir         ViewContact& ViewContactOfSdrPage::GetViewContact(sal_uInt32 nIndex) const
615cdf0e10cSrcweir         {
616cdf0e10cSrcweir             switch(nIndex)
617cdf0e10cSrcweir             {
618cdf0e10cSrcweir                 case 0: return (ViewContact&)maViewContactOfPageBackground;
619cdf0e10cSrcweir                 case 1: return (ViewContact&)maViewContactOfPageShadow;
620cdf0e10cSrcweir                 case 2: return (ViewContact&)maViewContactOfPageFill;
621cdf0e10cSrcweir                 case 3:
622cdf0e10cSrcweir                 {
623cdf0e10cSrcweir                     const SdrPage& rPage = GetSdrPage();
624cdf0e10cSrcweir 
625cdf0e10cSrcweir                     if(rPage.TRG_HasMasterPage())
626cdf0e10cSrcweir                     {
627cdf0e10cSrcweir                         return rPage.TRG_GetMasterPageDescriptorViewContact();
628cdf0e10cSrcweir                     }
629cdf0e10cSrcweir                     else
630cdf0e10cSrcweir                     {
631cdf0e10cSrcweir                         return (ViewContact&)maViewContactOfMasterPage;
632cdf0e10cSrcweir                     }
633cdf0e10cSrcweir                 }
634cdf0e10cSrcweir                 case 4: return (ViewContact&)maViewContactOfOuterPageBorder;
635cdf0e10cSrcweir                 case 5: return (ViewContact&)maViewContactOfInnerPageBorder;
636cdf0e10cSrcweir                 case 6: return (ViewContact&)maViewContactOfGridBack;
637cdf0e10cSrcweir                 case 7: return (ViewContact&)maViewContactOfHelplinesBack;
638cdf0e10cSrcweir                 case 8: return (ViewContact&)maViewContactOfPageHierarchy;
639cdf0e10cSrcweir                 case 9: return (ViewContact&)maViewContactOfGridFront;
640cdf0e10cSrcweir                 default: return (ViewContact&)maViewContactOfHelplinesFront;
641cdf0e10cSrcweir             }
642cdf0e10cSrcweir         }
643cdf0e10cSrcweir 
644cdf0e10cSrcweir         // React on changes of the object of this ViewContact
645cdf0e10cSrcweir         void ViewContactOfSdrPage::ActionChanged()
646cdf0e10cSrcweir         {
647cdf0e10cSrcweir             // call parent
648cdf0e10cSrcweir             ViewContact::ActionChanged();
649cdf0e10cSrcweir 
650cdf0e10cSrcweir             // apply to local viewContacts, they all rely on page information. Exception
651cdf0e10cSrcweir             // is the sub hierarchy; this will not be influenced by the change
652cdf0e10cSrcweir             maViewContactOfPageBackground.ActionChanged();
653cdf0e10cSrcweir             maViewContactOfPageShadow.ActionChanged();
654cdf0e10cSrcweir             maViewContactOfPageFill.ActionChanged();
655cdf0e10cSrcweir 
656cdf0e10cSrcweir             const SdrPage& rPage = GetSdrPage();
657cdf0e10cSrcweir 
658cdf0e10cSrcweir             if(rPage.TRG_HasMasterPage())
659cdf0e10cSrcweir             {
660cdf0e10cSrcweir                 rPage.TRG_GetMasterPageDescriptorViewContact().ActionChanged();
661cdf0e10cSrcweir             }
662cdf0e10cSrcweir             else if(rPage.IsMasterPage())
663cdf0e10cSrcweir             {
664cdf0e10cSrcweir                 maViewContactOfMasterPage.ActionChanged();
665cdf0e10cSrcweir             }
666cdf0e10cSrcweir 
667cdf0e10cSrcweir             maViewContactOfOuterPageBorder.ActionChanged();
668cdf0e10cSrcweir             maViewContactOfInnerPageBorder.ActionChanged();
669cdf0e10cSrcweir             maViewContactOfGridBack.ActionChanged();
670cdf0e10cSrcweir             maViewContactOfHelplinesBack.ActionChanged();
671cdf0e10cSrcweir             maViewContactOfGridFront.ActionChanged();
672cdf0e10cSrcweir             maViewContactOfHelplinesFront.ActionChanged();
673cdf0e10cSrcweir         }
674cdf0e10cSrcweir 
675c22beca6Smseidel         // overload for accessing the SdrPage
676cdf0e10cSrcweir         SdrPage* ViewContactOfSdrPage::TryToGetSdrPage() const
677cdf0e10cSrcweir         {
678cdf0e10cSrcweir             return &GetSdrPage();
679cdf0e10cSrcweir         }
680cdf0e10cSrcweir 
681cdf0e10cSrcweir         drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrPage::createViewIndependentPrimitive2DSequence() const
682cdf0e10cSrcweir         {
683cdf0e10cSrcweir             drawinglayer::primitive2d::Primitive2DSequence xRetval;
684cdf0e10cSrcweir 
685cdf0e10cSrcweir             // collect all sub-sequences including sub hierarchy.
686cdf0e10cSrcweir             drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, maViewContactOfPageBackground.getViewIndependentPrimitive2DSequence());
687cdf0e10cSrcweir             drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, maViewContactOfPageShadow.getViewIndependentPrimitive2DSequence());
688cdf0e10cSrcweir             drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, maViewContactOfPageFill.getViewIndependentPrimitive2DSequence());
689cdf0e10cSrcweir 
690cdf0e10cSrcweir             const SdrPage& rPage = GetSdrPage();
691cdf0e10cSrcweir 
692cdf0e10cSrcweir             if(rPage.TRG_HasMasterPage())
693cdf0e10cSrcweir             {
694cdf0e10cSrcweir                 drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval,
695cdf0e10cSrcweir                     rPage.TRG_GetMasterPageDescriptorViewContact().getViewIndependentPrimitive2DSequence());
696cdf0e10cSrcweir             }
697cdf0e10cSrcweir             else if(rPage.IsMasterPage())
698cdf0e10cSrcweir             {
699cdf0e10cSrcweir                 drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval,
700cdf0e10cSrcweir                     maViewContactOfMasterPage.getViewIndependentPrimitive2DSequence());
701cdf0e10cSrcweir             }
702cdf0e10cSrcweir 
703cdf0e10cSrcweir             drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, maViewContactOfOuterPageBorder.getViewIndependentPrimitive2DSequence());
704cdf0e10cSrcweir             drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, maViewContactOfInnerPageBorder.getViewIndependentPrimitive2DSequence());
705cdf0e10cSrcweir             drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, maViewContactOfPageHierarchy.getViewIndependentPrimitive2DSequence());
706cdf0e10cSrcweir 
707cdf0e10cSrcweir             // Only add front versions of grid and helplines since no visibility test is done,
708cdf0e10cSrcweir             // so adding the back incarnations is not necessary. This makes the Front
709c22beca6Smseidel             // visualization the default when no visibility tests are done.
710cdf0e10cSrcweir             //
711cdf0e10cSrcweir             // Since we have no view here, no grid and helpline definitions are available currently. The used
712cdf0e10cSrcweir             // methods at ViewContactOfHelplines and ViewContactOfGrid return only empty sequences and
713cdf0e10cSrcweir             // do not need to be called ATM. This may change later if grid or helpline info gets
714cdf0e10cSrcweir             // model data (it should not). Keeping the lines commented to hold this hint.
715cdf0e10cSrcweir             //
716cdf0e10cSrcweir             // drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, maViewContactOfGridFront.getViewIndependentPrimitive2DSequence());
717cdf0e10cSrcweir             // drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, maViewContactOfHelplinesFront.getViewIndependentPrimitive2DSequence());
718cdf0e10cSrcweir 
719cdf0e10cSrcweir             return xRetval;
720cdf0e10cSrcweir         }
721cdf0e10cSrcweir     } // end of namespace contact
722cdf0e10cSrcweir } // end of namespace sdr
723cdf0e10cSrcweir 
724cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
725cdf0e10cSrcweir // eof
726