1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <sdr/contact/viewcontactofsdrpage.hxx>
21 #include <svx/sdr/contact/viewobjectcontact.hxx>
22 #include <svx/svdpage.hxx>
23 #include <sdr/contact/viewobjectcontactofsdrpage.hxx>
24 #include <basegfx/polygon/b2dpolygontools.hxx>
25 #include <basegfx/matrix/b2dhommatrix.hxx>
26 #include <svtools/colorcfg.hxx>
27 #include <tools/debug.hxx>
28 #include <vcl/svapp.hxx>
29 #include <svx/sdr/contact/objectcontact.hxx>
30 #include <drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx>
31 #include <drawinglayer/primitive2d/PolygonHairlinePrimitive2D.hxx>
32 #include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
33 #include <drawinglayer/attribute/fillgradientattribute.hxx>
34 #include <basegfx/polygon/b2dpolygon.hxx>
35 #include <sdr/primitive2d/sdrattributecreator.hxx>
36 #include <sdr/primitive2d/sdrdecompositiontools.hxx>
37 #include <tools/lazydelete.hxx>
38 #include <vcl/settings.hxx>
39 #include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx>
40 #include <drawinglayer/attribute/sdrfillattribute.hxx>
41 #include <bitmaps.hlst>
43 namespace sdr::contact
{
45 ViewContactOfPageSubObject::ViewContactOfPageSubObject(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
)
46 : mrParentViewContactOfSdrPage(rParentViewContactOfSdrPage
)
50 ViewContactOfPageSubObject::~ViewContactOfPageSubObject()
54 ViewContact
* ViewContactOfPageSubObject::GetParentContact() const
56 return &mrParentViewContactOfSdrPage
;
59 const SdrPage
& ViewContactOfPageSubObject::getPage() const
61 return mrParentViewContactOfSdrPage
.GetSdrPage();
64 ViewObjectContact
& ViewContactOfPageBackground::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
66 ViewObjectContact
* pRetval
= new ViewObjectContactOfPageBackground(rObjectContact
, *this);
67 DBG_ASSERT(pRetval
, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
72 void ViewContactOfPageBackground::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
& rVisitor
) const
74 // We have only the page information, not the view information. Use the
75 // svtools::DOCCOLOR color for initialisation
76 const svtools::ColorConfig aColorConfig
;
77 const Color
aInitColor(aColorConfig
.GetColorValue(svtools::DOCCOLOR
).nColor
);
78 const basegfx::BColor
aRGBColor(aInitColor
.getBColor());
79 const drawinglayer::primitive2d::Primitive2DReference
xReference(
80 new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor
));
82 rVisitor
.visit(xReference
);
85 ViewContactOfPageBackground::ViewContactOfPageBackground(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
)
86 : ViewContactOfPageSubObject(rParentViewContactOfSdrPage
)
90 ViewContactOfPageBackground::~ViewContactOfPageBackground()
94 ViewObjectContact
& ViewContactOfPageShadow::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
96 ViewObjectContact
* pRetval
= new ViewObjectContactOfPageShadow(rObjectContact
, *this);
97 DBG_ASSERT(pRetval
, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
102 void ViewContactOfPageShadow::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
& rVisitor
) const
104 static bool bUseOldPageShadow(false); // loplugin:constvars:ignore
105 const SdrPage
& rPage
= getPage();
106 basegfx::B2DHomMatrix aPageMatrix
;
107 aPageMatrix
.set(0, 0, static_cast<double>(rPage
.GetWidth()));
108 aPageMatrix
.set(1, 1, static_cast<double>(rPage
.GetHeight()));
110 if(bUseOldPageShadow
)
112 // create page shadow polygon
113 const double fPageBorderFactor(1.0 / 256.0);
114 basegfx::B2DPolygon aPageShadowPolygon
;
115 aPageShadowPolygon
.append(basegfx::B2DPoint(1.0, fPageBorderFactor
));
116 aPageShadowPolygon
.append(basegfx::B2DPoint(1.0 + fPageBorderFactor
, fPageBorderFactor
));
117 aPageShadowPolygon
.append(basegfx::B2DPoint(1.0 + fPageBorderFactor
, 1.0 + fPageBorderFactor
));
118 aPageShadowPolygon
.append(basegfx::B2DPoint(fPageBorderFactor
, 1.0 + fPageBorderFactor
));
119 aPageShadowPolygon
.append(basegfx::B2DPoint(fPageBorderFactor
, 1.0));
120 aPageShadowPolygon
.append(basegfx::B2DPoint(1.0, 1.0));
121 aPageShadowPolygon
.setClosed(true);
122 aPageShadowPolygon
.transform(aPageMatrix
);
124 // We have only the page information, not the view information. Use the
125 // svtools::FONTCOLOR color for initialisation
126 const svtools::ColorConfig aColorConfig
;
127 const Color
aShadowColor(aColorConfig
.GetColorValue(svtools::FONTCOLOR
).nColor
);
128 const basegfx::BColor
aRGBShadowColor(aShadowColor
.getBColor());
129 const drawinglayer::primitive2d::Primitive2DReference
xReference(
130 new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
131 basegfx::B2DPolyPolygon(aPageShadowPolygon
),
134 rVisitor
.visit(xReference
);
138 static tools::DeleteOnDeinit
< drawinglayer::primitive2d::DiscreteShadow
> aDiscreteShadow((
139 BitmapEx(SIP_SA_PAGESHADOW35X35
)));
141 if(aDiscreteShadow
.get())
143 const drawinglayer::primitive2d::Primitive2DReference
xReference(
144 new drawinglayer::primitive2d::DiscreteShadowPrimitive2D(
146 *aDiscreteShadow
.get()));
148 rVisitor
.visit(xReference
);
153 ViewContactOfPageShadow::ViewContactOfPageShadow(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
)
154 : ViewContactOfPageSubObject(rParentViewContactOfSdrPage
)
158 ViewContactOfPageShadow::~ViewContactOfPageShadow()
162 ViewObjectContact
& ViewContactOfMasterPage::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
164 ViewObjectContact
* pRetval
= new ViewObjectContactOfMasterPage(rObjectContact
, *this);
165 DBG_ASSERT(pRetval
, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
170 void ViewContactOfMasterPage::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
& rVisitor
) const
172 // this class is used when the page is a MasterPage and is responsible to
173 // create a visualisation for the MPBGO, if exists. This needs to be suppressed
174 // when a SdrPage which uses a MasterPage creates it's output. Suppression
175 // is done in the corresponding VOC since DisplayInfo data is needed
176 const SdrPage
& rPage
= getPage();
178 if(rPage
.IsMasterPage())
180 if(0 == rPage
.GetPageNum())
183 // filter MasterPage 0 since it's the HandoutPage. Thus, it's a
184 // MasterPage, but has no MPBGO, so there is nothing to do here.
188 drawinglayer::attribute::SdrFillAttribute aFill
;
190 // #i110846# Suppress SdrPage FillStyle for MasterPages without StyleSheets,
191 // else the PoolDefault (XFILL_COLOR and Blue8) will be used. Normally, all
192 // MasterPages should have a StyleSheet exactly for this reason, but historically
193 // e.g. the Notes MasterPage has no StyleSheet set (and there maybe others).
194 if(rPage
.getSdrPageProperties().GetStyleSheet())
196 // create page fill attributes with correct properties
197 aFill
= drawinglayer::primitive2d::createNewSdrFillAttribute(
198 rPage
.getSdrPageProperties().GetItemSet());
201 if(!aFill
.isDefault())
203 // direct model data is the page size, get and use it
204 const basegfx::B2DRange
aOuterRange(
205 0, 0, rPage
.GetWidth(), rPage
.GetHeight());
206 const basegfx::B2DRange
aInnerRange(
207 rPage
.GetLeftBorder(), rPage
.GetUpperBorder(),
208 rPage
.GetWidth() - rPage
.GetRightBorder(), rPage
.GetHeight() - rPage
.GetLowerBorder());
209 bool const isFullSize(rPage
.IsBackgroundFullSize());
210 const basegfx::B2DPolygon
aFillPolygon(
211 basegfx::utils::createPolygonFromRect(isFullSize
? aOuterRange
: aInnerRange
));
212 const drawinglayer::primitive2d::Primitive2DReference
xReference(
213 drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
214 basegfx::B2DPolyPolygon(aFillPolygon
),
216 drawinglayer::attribute::FillGradientAttribute()));
218 rVisitor
.visit(xReference
);
224 ViewContactOfMasterPage::ViewContactOfMasterPage(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
)
225 : ViewContactOfPageSubObject(rParentViewContactOfSdrPage
)
229 ViewContactOfMasterPage::~ViewContactOfMasterPage()
233 ViewObjectContact
& ViewContactOfPageFill::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
235 ViewObjectContact
* pRetval
= new ViewObjectContactOfPageFill(rObjectContact
, *this);
236 DBG_ASSERT(pRetval
, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
241 void ViewContactOfPageFill::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
& rVisitor
) const
243 const SdrPage
& rPage
= getPage();
244 const basegfx::B2DRange
aPageFillRange(0.0, 0.0, static_cast<double>(rPage
.GetWidth()), static_cast<double>(rPage
.GetHeight()));
245 const basegfx::B2DPolygon
aPageFillPolygon(basegfx::utils::createPolygonFromRect(aPageFillRange
));
247 // We have only the page information, not the view information. Use the
248 // svtools::DOCCOLOR color for initialisation
249 const svtools::ColorConfig aColorConfig
;
250 const Color
aPageFillColor(aColorConfig
.GetColorValue(svtools::DOCCOLOR
).nColor
);
252 // create and add primitive
253 const basegfx::BColor
aRGBColor(aPageFillColor
.getBColor());
254 rVisitor
.visit(new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPageFillPolygon
), aRGBColor
));
257 ViewContactOfPageFill::ViewContactOfPageFill(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
)
258 : ViewContactOfPageSubObject(rParentViewContactOfSdrPage
)
262 ViewContactOfPageFill::~ViewContactOfPageFill()
266 ViewObjectContact
& ViewContactOfOuterPageBorder::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
268 ViewObjectContact
* pRetval
= new ViewObjectContactOfOuterPageBorder(rObjectContact
, *this);
269 DBG_ASSERT(pRetval
, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
274 void ViewContactOfOuterPageBorder::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
& rVisitor
) const
276 const SdrPage
& rPage
= getPage();
277 const basegfx::B2DRange
aPageBorderRange(0.0, 0.0, static_cast<double>(rPage
.GetWidth()), static_cast<double>(rPage
.GetHeight()));
279 // Changed to 0x949599 for renaissance, before svtools::FONTCOLOR was used.
280 // Added old case as fallback for HighContrast.
281 basegfx::BColor
aRGBBorderColor(0x94 / double(0xff), 0x95 / double(0xff), 0x99 / double(0xff));
283 if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
285 const svtools::ColorConfig aColorConfig
;
286 const Color
aBorderColor(aColorConfig
.GetColorValue(svtools::FONTCOLOR
).nColor
);
288 aRGBBorderColor
= aBorderColor
.getBColor();
291 if(rPage
.getPageBorderOnlyLeftRight())
293 // #i93597# for Report Designer, the page border shall be only displayed right and left,
294 // but not top and bottom. Create simplified geometry.
295 basegfx::B2DPolygon aLeft
, aRight
;
297 aLeft
.append(basegfx::B2DPoint(aPageBorderRange
.getMinX(), aPageBorderRange
.getMinY()));
298 aLeft
.append(basegfx::B2DPoint(aPageBorderRange
.getMinX(), aPageBorderRange
.getMaxY()));
300 aRight
.append(basegfx::B2DPoint(aPageBorderRange
.getMaxX(), aPageBorderRange
.getMinY()));
301 aRight
.append(basegfx::B2DPoint(aPageBorderRange
.getMaxX(), aPageBorderRange
.getMaxY()));
303 rVisitor
.visit(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(std::move(aLeft
), aRGBBorderColor
));
304 rVisitor
.visit(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(std::move(aRight
), aRGBBorderColor
));
308 basegfx::B2DPolygon
aPageBorderPolygon(basegfx::utils::createPolygonFromRect(aPageBorderRange
));
309 rVisitor
.visit(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(std::move(aPageBorderPolygon
), aRGBBorderColor
));
313 ViewContactOfOuterPageBorder::ViewContactOfOuterPageBorder(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
)
314 : ViewContactOfPageSubObject(rParentViewContactOfSdrPage
)
318 ViewContactOfOuterPageBorder::~ViewContactOfOuterPageBorder()
322 ViewObjectContact
& ViewContactOfInnerPageBorder::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
324 ViewObjectContact
* pRetval
= new ViewObjectContactOfInnerPageBorder(rObjectContact
, *this);
325 DBG_ASSERT(pRetval
, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
330 void ViewContactOfInnerPageBorder::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
& rVisitor
) const
332 const SdrPage
& rPage
= getPage();
333 const basegfx::B2DRange
aPageBorderRange(
334 static_cast<double>(rPage
.GetLeftBorder()), static_cast<double>(rPage
.GetUpperBorder()),
335 static_cast<double>(rPage
.GetWidth() - rPage
.GetRightBorder()), static_cast<double>(rPage
.GetHeight() - rPage
.GetLowerBorder()));
336 basegfx::B2DPolygon
aPageBorderPolygon(basegfx::utils::createPolygonFromRect(aPageBorderRange
));
338 // We have only the page information, not the view information. Use the
339 // svtools::FONTCOLOR or svtools::DOCBOUNDARIES color for initialisation
340 const svtools::ColorConfig aColorConfig
;
343 if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
345 aBorderColor
= aColorConfig
.GetColorValue(svtools::FONTCOLOR
).nColor
;
349 svtools::ColorConfigValue aBorderConfig
= aColorConfig
.GetColorValue(svtools::DOCBOUNDARIES
);
350 aBorderColor
= aBorderConfig
.bIsVisible
? aBorderConfig
.nColor
:
351 aColorConfig
.GetColorValue(svtools::DOCCOLOR
).nColor
;
354 // create page outer border primitive
355 const basegfx::BColor
aRGBBorderColor(aBorderColor
.getBColor());
356 rVisitor
.visit(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(std::move(aPageBorderPolygon
), aRGBBorderColor
));
359 ViewContactOfInnerPageBorder::ViewContactOfInnerPageBorder(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
)
360 : ViewContactOfPageSubObject(rParentViewContactOfSdrPage
)
364 ViewContactOfInnerPageBorder::~ViewContactOfInnerPageBorder()
368 ViewObjectContact
& ViewContactOfPageHierarchy::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
370 ViewObjectContact
* pRetval
= new ViewObjectContactOfPageHierarchy(rObjectContact
, *this);
371 DBG_ASSERT(pRetval
, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
376 void ViewContactOfPageHierarchy::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
& rVisitor
) const
378 // collect sub-hierarchy
379 const sal_uInt32
nObjectCount(GetObjectCount());
381 // collect all sub-primitives
382 for(sal_uInt32
a(0); a
< nObjectCount
; a
++)
384 const ViewContact
& rCandidate(GetViewContact(a
));
385 rCandidate
.getViewIndependentPrimitive2DContainer(rVisitor
);
389 ViewContactOfPageHierarchy::ViewContactOfPageHierarchy(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
)
390 : ViewContactOfPageSubObject(rParentViewContactOfSdrPage
)
394 ViewContactOfPageHierarchy::~ViewContactOfPageHierarchy()
398 sal_uInt32
ViewContactOfPageHierarchy::GetObjectCount() const
400 return getPage().GetObjCount();
403 ViewContact
& ViewContactOfPageHierarchy::GetViewContact(sal_uInt32 nIndex
) const
405 SdrObject
* pObj
= getPage().GetObj(nIndex
);
406 assert(pObj
&& "ViewContactOfPageHierarchy::GetViewContact: Corrupt SdrObjList (!)");
407 return pObj
->GetViewContact();
410 ViewObjectContact
& ViewContactOfGrid::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
412 ViewObjectContact
* pRetval
= new ViewObjectContactOfPageGrid(rObjectContact
, *this);
413 DBG_ASSERT(pRetval
, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
418 void ViewContactOfGrid::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
&) const
420 // We have only the page information, not the view information and thus no grid settings. Create empty
421 // default. For the view-dependent implementation, see ViewObjectContactOfPageGrid::createPrimitive2DSequence
424 ViewContactOfGrid::ViewContactOfGrid(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
, bool bFront
)
425 : ViewContactOfPageSubObject(rParentViewContactOfSdrPage
),
430 ViewContactOfGrid::~ViewContactOfGrid()
434 ViewObjectContact
& ViewContactOfHelplines::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
436 ViewObjectContact
* pRetval
= new ViewObjectContactOfPageHelplines(rObjectContact
, *this);
437 DBG_ASSERT(pRetval
, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
442 void ViewContactOfHelplines::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
&) const
444 // We have only the page information, not the view information and thus no helplines. Create empty
445 // default. For the view-dependent implementation, see ViewObjectContactOfPageHelplines::createPrimitive2DSequence
448 ViewContactOfHelplines::ViewContactOfHelplines(ViewContactOfSdrPage
& rParentViewContactOfSdrPage
, bool bFront
)
449 : ViewContactOfPageSubObject(rParentViewContactOfSdrPage
),
454 ViewContactOfHelplines::~ViewContactOfHelplines()
458 // Create an Object-Specific ViewObjectContact, set ViewContact and
459 // ObjectContact. Always needs to return something.
460 ViewObjectContact
& ViewContactOfSdrPage::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
462 ViewObjectContact
* pRetval
= new ViewObjectContactOfSdrPage(rObjectContact
, *this);
463 DBG_ASSERT(pRetval
, "ViewContact::CreateObjectSpecificViewObjectContact() failed (!)");
468 ViewContactOfSdrPage::ViewContactOfSdrPage(SdrPage
& rPage
)
470 maViewContactOfPageBackground(*this),
471 maViewContactOfPageShadow(*this),
472 maViewContactOfPageFill(*this),
473 maViewContactOfMasterPage(*this),
474 maViewContactOfOuterPageBorder(*this),
475 maViewContactOfInnerPageBorder(*this),
476 maViewContactOfGridBack(*this, false),
477 maViewContactOfHelplinesBack(*this, false),
478 maViewContactOfPageHierarchy(*this),
479 maViewContactOfGridFront(*this, true),
480 maViewContactOfHelplinesFront(*this, true)
484 ViewContactOfSdrPage::~ViewContactOfSdrPage()
488 // Access to possible sub-hierarchy
489 sal_uInt32
ViewContactOfSdrPage::GetObjectCount() const
491 // Fixed count of content. It contains PageBackground (Wiese), PageShadow, PageFill,
492 // then - depending on if the page has a MasterPage - either MasterPage Hierarchy
493 // or MPBGO. Also OuterPageBorder, InnerPageBorder, PageHierarchy and two pairs of Grid and
494 // Helplines (for front and back) which internally are visible or not depending on the current
495 // front/back setting for those.
499 ViewContact
& ViewContactOfSdrPage::GetViewContact(sal_uInt32 nIndex
) const
503 case 0: return const_cast<ViewContactOfPageBackground
&>(maViewContactOfPageBackground
);
504 case 1: return const_cast<ViewContactOfPageShadow
&>(maViewContactOfPageShadow
);
505 case 2: return const_cast<ViewContactOfPageFill
&>(maViewContactOfPageFill
);
508 const SdrPage
& rPage
= GetSdrPage();
510 if(rPage
.TRG_HasMasterPage())
512 return rPage
.TRG_GetMasterPageDescriptorViewContact();
516 return const_cast<ViewContactOfMasterPage
&>(maViewContactOfMasterPage
);
519 case 4: return const_cast<ViewContactOfOuterPageBorder
&>(maViewContactOfOuterPageBorder
);
520 case 5: return const_cast<ViewContactOfInnerPageBorder
&>(maViewContactOfInnerPageBorder
);
521 case 6: return const_cast<ViewContactOfGrid
&>(maViewContactOfGridBack
);
522 case 7: return const_cast<ViewContactOfHelplines
&>(maViewContactOfHelplinesBack
);
523 case 8: return const_cast<ViewContactOfPageHierarchy
&>(maViewContactOfPageHierarchy
);
524 case 9: return const_cast<ViewContactOfGrid
&>(maViewContactOfGridFront
);
525 case 10: return const_cast<ViewContactOfHelplines
&>(maViewContactOfHelplinesFront
);
526 default: assert(false);return const_cast<ViewContactOfHelplines
&>(maViewContactOfHelplinesFront
);
530 // React on changes of the object of this ViewContact
531 void ViewContactOfSdrPage::ActionChanged()
534 ViewContact::ActionChanged();
536 // apply to local viewContacts, they all rely on page information. Exception
537 // is the sub hierarchy; this will not be influenced by the change
538 maViewContactOfPageBackground
.ActionChanged();
539 maViewContactOfPageShadow
.ActionChanged();
540 maViewContactOfPageFill
.ActionChanged();
542 const SdrPage
& rPage
= GetSdrPage();
544 if(rPage
.TRG_HasMasterPage())
546 rPage
.TRG_GetMasterPageDescriptorViewContact().ActionChanged();
548 else if(rPage
.IsMasterPage())
550 maViewContactOfMasterPage
.ActionChanged();
553 maViewContactOfOuterPageBorder
.ActionChanged();
554 maViewContactOfInnerPageBorder
.ActionChanged();
555 maViewContactOfGridBack
.ActionChanged();
556 maViewContactOfHelplinesBack
.ActionChanged();
557 maViewContactOfGridFront
.ActionChanged();
558 maViewContactOfHelplinesFront
.ActionChanged();
561 void ViewContactOfSdrPage::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
& rVisitor
) const
563 // collect all sub-sequences including sub hierarchy.
564 maViewContactOfPageBackground
.getViewIndependentPrimitive2DContainer(rVisitor
);
565 maViewContactOfPageShadow
.getViewIndependentPrimitive2DContainer(rVisitor
);
566 maViewContactOfPageFill
.getViewIndependentPrimitive2DContainer(rVisitor
);
568 const SdrPage
& rPage
= GetSdrPage();
570 if(rPage
.TRG_HasMasterPage())
572 rPage
.TRG_GetMasterPageDescriptorViewContact().getViewIndependentPrimitive2DContainer(rVisitor
);
574 else if(rPage
.IsMasterPage())
576 maViewContactOfMasterPage
.getViewIndependentPrimitive2DContainer(rVisitor
);
579 maViewContactOfOuterPageBorder
.getViewIndependentPrimitive2DContainer(rVisitor
);
580 maViewContactOfInnerPageBorder
.getViewIndependentPrimitive2DContainer(rVisitor
);
581 maViewContactOfPageHierarchy
.getViewIndependentPrimitive2DContainer(rVisitor
);
583 // Only add front versions of grid and helplines since no visibility test is done,
584 // so adding the back incarnations is not necessary. This makes the Front
585 // visualisation the default when no visibility tests are done.
587 // Since we have no view here, no grid and helpline definitions are available currently. The used
588 // methods at ViewContactOfHelplines and ViewContactOfGrid return only empty sequences and
589 // do not need to be called ATM. This may change later if grid or helpline info gets
590 // model data (it should not). Keeping the lines commented to hold this hint.
592 // drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, maViewContactOfGridFront.getViewIndependentPrimitive2DContainer());
593 // drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, maViewContactOfHelplinesFront.getViewIndependentPrimitive2DContainer());
598 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */