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