[Libreoffice-commits] core.git: 2 commits - cui/source include/svx svx/inc svx/qa svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 16 19:53:40 UTC 2021
cui/source/tabpages/transfrm.cxx | 2
include/svx/sdr/contact/viewobjectcontact.hxx | 2
svx/inc/sdr/contact/viewobjectcontactofe3dscene.hxx | 2
svx/inc/sdr/contact/viewobjectcontactofgroup.hxx | 2
svx/inc/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx | 2
svx/inc/sdr/contact/viewobjectcontactofsdrpage.hxx | 4
svx/qa/unit/sdr.cxx | 4
svx/qa/unit/svdraw.cxx | 8
svx/qa/unit/unodraw.cxx | 4
svx/source/sdr/contact/objectcontactofobjlistpainter.cxx | 2
svx/source/sdr/contact/objectcontactofpageview.cxx | 4
svx/source/sdr/contact/viewobjectcontact.cxx | 42 +---
svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx | 4
svx/source/sdr/contact/viewobjectcontactofgroup.cxx | 72 +++----
svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx | 6
svx/source/sdr/contact/viewobjectcontactofpageobj.cxx | 2
svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx | 98 ++++------
17 files changed, 126 insertions(+), 134 deletions(-)
New commits:
commit 6dc23567639bebf18ceb8d9a3721228bffe14202
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 16 15:58:11 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Aug 16 21:46:23 2021 +0200
Resolves: tdf#143785 save/restore SdrModel::IsChanged
Change-Id: I253915c359cf72f80b21e21ff34e0ee406e5b3a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120550
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 5ffe490745b6..f9396cfd6ab4 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -628,6 +628,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
*pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()));
//save geometry
+ const bool bOrigModelChangeState = pView->GetModel()->IsChanged();
SdrCustomShapeGeometryItem aInitialGeometry(rSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY));
EnhancedCustomShape2d aShape(rSdrObjCustomShape);
@@ -671,6 +672,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
//restore geometry
rSdrObjCustomShape.SetMergedItem(aInitialGeometry);
+ pView->GetModel()->SetChanged(bOrigModelChangeState);
}
for (int i = 0; i < 2; ++i)
commit 58b2d04ddab5a678921610bf9e9a5a95ae660a17
Author: Noel Grandin <noel at peralex.com>
AuthorDate: Fri Aug 13 12:28:57 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Aug 16 21:40:14 2021 +0200
do less copying when constructing 2d sequence (tdf#105575)
instead of constructing a child sequence, and appending that
a parent sequence, just pass the parent sequence down the call
hierarchy, so we end up doing less copying.
Change-Id: If39a0779e543c6aa01f5e2e3ae63d395e0c85f7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120521
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx b/include/svx/sdr/contact/viewobjectcontact.hxx
index a12cb0b2915e..92dcc7458876 100644
--- a/include/svx/sdr/contact/viewobjectcontact.hxx
+++ b/include/svx/sdr/contact/viewobjectcontact.hxx
@@ -120,7 +120,7 @@ public:
// process this primitive: Eventually also recursively travel an existing hierarchy,
// e.g. for group objects, scenes or pages. This method will test geometrical visibility.
- virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const;
+ virtual void getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer) const;
// just process the sub-hierarchy, used as tooling from getPrimitive2DSequenceHierarchy
drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo) const;
diff --git a/svx/inc/sdr/contact/viewobjectcontactofe3dscene.hxx b/svx/inc/sdr/contact/viewobjectcontactofe3dscene.hxx
index 35aece86a380..ff31409ad9c2 100644
--- a/svx/inc/sdr/contact/viewobjectcontactofe3dscene.hxx
+++ b/svx/inc/sdr/contact/viewobjectcontactofe3dscene.hxx
@@ -37,7 +37,7 @@ namespace sdr::contact
// process this primitive: Eventually also recursively travel an existing hierarchy,
// e.g. for group objects, scenes or pages. This method will test geometrical visibility.
- virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override;
+ virtual void getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer ) const override;
};
} // end of namespace sdr::contact
diff --git a/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx b/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx
index 9b74032a239a..a06eea588545 100644
--- a/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx
+++ b/svx/inc/sdr/contact/viewobjectcontactofgroup.hxx
@@ -32,7 +32,7 @@ namespace sdr::contact
virtual ~ViewObjectContactOfGroup() override;
// This method recursively paints the draw hierarchy.
- virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override;
+ virtual void getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer ) const override;
private:
virtual bool isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet& aLayers) const override;
diff --git a/svx/inc/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx b/svx/inc/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx
index 32035ccc25b1..76f92827ba7b 100644
--- a/svx/inc/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx
+++ b/svx/inc/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx
@@ -35,7 +35,7 @@ namespace sdr::contact
virtual ~ViewObjectContactOfMasterPageDescriptor() override;
virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override;
- virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override;
+ virtual void getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer ) const override;
};
} // end of namespace sdr::contact
diff --git a/svx/inc/sdr/contact/viewobjectcontactofsdrpage.hxx b/svx/inc/sdr/contact/viewobjectcontactofsdrpage.hxx
index 437afbddcf8d..2e0a0de4a280 100644
--- a/svx/inc/sdr/contact/viewobjectcontactofsdrpage.hxx
+++ b/svx/inc/sdr/contact/viewobjectcontactofsdrpage.hxx
@@ -127,7 +127,7 @@ namespace sdr::contact
ViewObjectContactOfPageHierarchy(ObjectContact& rObjectContact, ViewContact& rViewContact);
virtual ~ViewObjectContactOfPageHierarchy() override;
- virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override;
+ virtual void getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer ) const override;
};
} // end of namespace sdr::contact
@@ -167,7 +167,7 @@ namespace sdr::contact
ViewObjectContactOfSdrPage(ObjectContact& rObjectContact, ViewContact& rViewContact);
virtual ~ViewObjectContactOfSdrPage() override;
- virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const override;
+ virtual void getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer ) const override;
};
} // end of namespace sdr::contact
diff --git a/svx/qa/unit/sdr.cxx b/svx/qa/unit/sdr.cxx
index e6ca7f7a87ad..d665987b1179 100644
--- a/svx/qa/unit/sdr.cxx
+++ b/svx/qa/unit/sdr.cxx
@@ -68,7 +68,9 @@ SdrTest::renderPageToPrimitives(const uno::Reference<drawing::XDrawPage>& xDrawP
const sdr::contact::ViewObjectContact& rDrawPageVOContact
= pSdrPage->GetViewContact().GetViewObjectContact(aObjectContact);
sdr::contact::DisplayInfo aDisplayInfo;
- return rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo);
+ drawinglayer::primitive2d::Primitive2DContainer aContainer;
+ rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo, aContainer);
+ return aContainer;
}
CPPUNIT_TEST_FIXTURE(SdrTest, testShadowScaleOrigin)
diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx
index b0e8ed70de9b..bcc62011e3d1 100644
--- a/svx/qa/unit/svdraw.cxx
+++ b/svx/qa/unit/svdraw.cxx
@@ -102,8 +102,8 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testSemiTransparentText)
const sdr::contact::ViewObjectContact& rDrawPageVOContact
= pSdrPage->GetViewContact().GetViewObjectContact(aObjectContact);
sdr::contact::DisplayInfo aDisplayInfo;
- drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence
- = rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo);
+ drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence;
+ rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo, xPrimitiveSequence);
// Make sure the text is semi-transparent.
drawinglayer::Primitive2dXmlDump aDumper;
@@ -274,8 +274,8 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testRectangleObject)
= pPage->GetViewContact().GetViewObjectContact(aObjectContact);
sdr::contact::DisplayInfo aDisplayInfo;
- drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence
- = rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo);
+ drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence;
+ rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo, xPrimitiveSequence);
drawinglayer::Primitive2dXmlDump aDumper;
xmlDocUniquePtr pXmlDoc = aDumper.dumpAndParse(xPrimitiveSequence);
diff --git a/svx/qa/unit/unodraw.cxx b/svx/qa/unit/unodraw.cxx
index 21bb3200ba2c..7e69ba8d4f05 100644
--- a/svx/qa/unit/unodraw.cxx
+++ b/svx/qa/unit/unodraw.cxx
@@ -161,8 +161,8 @@ CPPUNIT_TEST_FIXTURE(UnodrawTest, testTableShadowDirect)
const sdr::contact::ViewObjectContact& rDrawPageVOContact
= pSdrPage->GetViewContact().GetViewObjectContact(aObjectContact);
sdr::contact::DisplayInfo aDisplayInfo;
- drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence
- = rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo);
+ drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence;
+ rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo, xPrimitiveSequence);
// Check the primitives.
drawinglayer::Primitive2dXmlDump aDumper;
diff --git a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
index d59d320acb34..6e775df96a0e 100644
--- a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
+++ b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
@@ -112,7 +112,7 @@ void ObjectContactOfObjListPainter::ProcessDisplay(DisplayInfo& rDisplayInfo)
{
const ViewObjectContact& rViewObjectContact = GetPaintObjectViewContact(a).GetViewObjectContact(*this);
- xPrimitiveSequence.append(rViewObjectContact.getPrimitive2DSequenceHierarchy(rDisplayInfo));
+ rViewObjectContact.getPrimitive2DSequenceHierarchy(rDisplayInfo, xPrimitiveSequence);
}
// if there is something to show, use a vclProcessor to render it
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 150735030ea5..8637f7b2f79d 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -220,7 +220,7 @@ namespace sdr::contact
#if HAVE_FEATURE_DESKTOP || defined( ANDROID )
// get whole Primitive2DContainer; this will already make use of updated ViewInformation2D
// and may use the MapMode from the Target OutDev in the DisplayInfo
- xPrimitiveSequence = rDrawPageVOContact.getPrimitive2DSequenceHierarchy(rDisplayInfo);
+ rDrawPageVOContact.getPrimitive2DSequenceHierarchy(rDisplayInfo, xPrimitiveSequence);
#else
// Hmm, !HAVE_FEATURE_DESKTOP && !ANDROID means iOS,
// right? But does it makes sense to use a different code
@@ -256,7 +256,7 @@ namespace sdr::contact
if (bGetHierarchy)
// get whole Primitive2DContainer; this will already make use of updated ViewInformation2D
// and may use the MapMode from the Target OutDev in the DisplayInfo
- xPrimitiveSequence = rDrawPageVOContact.getPrimitive2DSequenceHierarchy(rDisplayInfo);
+ rDrawPageVOContact.getPrimitive2DSequenceHierarchy(rDisplayInfo, xPrimitiveSequence);
#endif
// if there is something to show, use a primitive processor to render it. There
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx
index 2720404cb58c..b9ed56ed7227 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -404,33 +404,27 @@ bool ViewObjectContact::isPrimitiveGhosted(const DisplayInfo& rDisplayInfo) cons
return (GetObjectContact().DoVisualizeEnteredGroup() && !GetObjectContact().isOutputToPrinter() && rDisplayInfo.IsGhostedDrawModeActive());
}
-drawinglayer::primitive2d::Primitive2DContainer ViewObjectContact::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
+void ViewObjectContact::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer) const
{
- drawinglayer::primitive2d::Primitive2DContainer xRetval;
-
// check model-view visibility
- if(isPrimitiveVisible(rDisplayInfo))
- {
- xRetval = getPrimitive2DSequence(rDisplayInfo);
+ if(!isPrimitiveVisible(rDisplayInfo))
+ return;
- if(!xRetval.empty())
- {
- // get ranges
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
- const basegfx::B2DRange aObjectRange(xRetval.getB2DRange(rViewInformation2D));
- const basegfx::B2DRange& aViewRange(rViewInformation2D.getViewport());
-
- // check geometrical visibility
- bool bVisible = aViewRange.isEmpty() || aViewRange.overlaps(aObjectRange);
- if(!bVisible)
- {
- // not visible, release
- xRetval.clear();
- }
- }
- }
+ drawinglayer::primitive2d::Primitive2DContainer xRetval = getPrimitive2DSequence(rDisplayInfo);
+ if(xRetval.empty())
+ return;
- return xRetval;
+ // get ranges
+ const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
+ const basegfx::B2DRange aObjectRange(xRetval.getB2DRange(rViewInformation2D));
+ const basegfx::B2DRange& aViewRange(rViewInformation2D.getViewport());
+
+ // check geometrical visibility
+ bool bVisible = aViewRange.isEmpty() || aViewRange.overlaps(aObjectRange);
+ if(!bVisible)
+ return;
+
+ rContainer.append(xRetval);
}
drawinglayer::primitive2d::Primitive2DContainer ViewObjectContact::getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo) const
@@ -442,7 +436,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContact::getPrimitive2
{
const ViewObjectContact& rCandidate(GetViewContact().GetViewContact(a).GetViewObjectContact(GetObjectContact()));
- xSeqRetval.append(rCandidate.getPrimitive2DSequenceHierarchy(rDisplayInfo));
+ rCandidate.getPrimitive2DSequenceHierarchy(rDisplayInfo, xSeqRetval);
}
return xSeqRetval;
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
index cc34be5bfbc7..63cbf3bf7853 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
@@ -121,7 +121,7 @@ namespace sdr::contact
return xRetval;
}
- drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfE3dScene::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
+ void ViewObjectContactOfE3dScene::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer) const
{
// To get the VOCs for the contained 3D objects created to get the correct
// Draw hierarchy and ActionChanged() working properly, travel the DrawHierarchy
@@ -129,7 +129,7 @@ namespace sdr::contact
impInternalSubHierarchyTraveller(*this);
// call parent
- return ViewObjectContactOfSdrObj::getPrimitive2DSequenceHierarchy(rDisplayInfo);
+ ViewObjectContactOfSdrObj::getPrimitive2DSequenceHierarchy(rDisplayInfo, rContainer);
}
} // end of namespace
diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
index ee797e11743b..b13e2cbe223f 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
@@ -39,58 +39,58 @@ namespace sdr::contact
{
}
- drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfGroup::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
+ void ViewObjectContactOfGroup::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer) const
{
drawinglayer::primitive2d::Primitive2DContainer xRetval;
// check model-view visibility
- if(isPrimitiveVisible(rDisplayInfo))
+ if(!isPrimitiveVisible(rDisplayInfo))
+ return;
+
+ const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
+ if(nSubHierarchyCount)
{
- const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
+ const bool bDoGhostedDisplaying(
+ GetObjectContact().DoVisualizeEnteredGroup()
+ && !GetObjectContact().isOutputToPrinter()
+ && GetObjectContact().getActiveViewContact() == &GetViewContact());
- if(nSubHierarchyCount)
+ if(bDoGhostedDisplaying)
{
- const bool bDoGhostedDisplaying(
- GetObjectContact().DoVisualizeEnteredGroup()
- && !GetObjectContact().isOutputToPrinter()
- && GetObjectContact().getActiveViewContact() == &GetViewContact());
-
- if(bDoGhostedDisplaying)
- {
- rDisplayInfo.ClearGhostedDrawMode();
- }
+ rDisplayInfo.ClearGhostedDrawMode();
+ }
- // create object hierarchy
- xRetval = getPrimitive2DSequenceSubHierarchy(rDisplayInfo);
+ // create object hierarchy
+ xRetval = getPrimitive2DSequenceSubHierarchy(rDisplayInfo);
- if(!xRetval.empty())
- {
- // get ranges
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
- const ::basegfx::B2DRange aObjectRange(xRetval.getB2DRange(rViewInformation2D));
- const basegfx::B2DRange& aViewRange(rViewInformation2D.getViewport());
-
- // check geometrical visibility
- if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange))
- {
- // not visible, release
- xRetval.clear();
- }
- }
+ if(!xRetval.empty())
+ {
+ // get ranges
+ const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
+ const ::basegfx::B2DRange aObjectRange(xRetval.getB2DRange(rViewInformation2D));
+ const basegfx::B2DRange& aViewRange(rViewInformation2D.getViewport());
- if(bDoGhostedDisplaying)
+ // check geometrical visibility
+ if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange))
{
- rDisplayInfo.SetGhostedDrawMode();
+ // not visible, release
+ xRetval.clear();
}
}
- else
+
+ if(bDoGhostedDisplaying)
{
- // draw replacement object for group. This will use ViewContactOfGroup::createViewIndependentPrimitive2DSequence
- // which creates the replacement primitives for an empty group
- xRetval = ViewObjectContactOfSdrObj::getPrimitive2DSequenceHierarchy(rDisplayInfo);
+ rDisplayInfo.SetGhostedDrawMode();
}
+
+ rContainer.append(xRetval);
+ }
+ else
+ {
+ // draw replacement object for group. This will use ViewContactOfGroup::createViewIndependentPrimitive2DSequence
+ // which creates the replacement primitives for an empty group
+ ViewObjectContactOfSdrObj::getPrimitive2DSequenceHierarchy(rDisplayInfo, rContainer);
}
- return xRetval;
}
bool ViewObjectContactOfGroup::isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet& aLayers) const
diff --git a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
index 0efa4c01750f..4fdb0745683b 100644
--- a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
@@ -54,7 +54,7 @@ namespace sdr::contact
return true;
}
- drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfMasterPageDescriptor::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
+ void ViewObjectContactOfMasterPageDescriptor::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer) const
{
drawinglayer::primitive2d::Primitive2DContainer xRetval;
drawinglayer::primitive2d::Primitive2DContainer xMasterPageSequence;
@@ -97,7 +97,7 @@ namespace sdr::contact
ViewContact& rViewContactOfMasterPage(rDescriptor.GetUsedPage().GetViewContact());
ViewObjectContact& rVOCOfMasterPage(rViewContactOfMasterPage.GetViewObjectContact(GetObjectContact()));
- xMasterPageSequence = rVOCOfMasterPage.getPrimitive2DSequenceHierarchy(rDisplayInfo);
+ rVOCOfMasterPage.getPrimitive2DSequenceHierarchy(rDisplayInfo, xMasterPageSequence);
}
// reset DisplayInfo changes for MasterPage paint
@@ -129,7 +129,7 @@ namespace sdr::contact
}
// return grouped primitive
- return xRetval;
+ rContainer.append(xRetval);
}
} // end of namespace
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index 9e19982b7824..023d46bfba80 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -147,7 +147,7 @@ drawinglayer::primitive2d::Primitive2DContainer PagePrimitiveExtractor::createPr
ViewObjectContact& rDrawPageVOContact = pStartPage->GetViewContact().GetViewObjectContact(*this);
// get whole Primitive2DContainer
- xRetval = rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo);
+ rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo, xRetval);
}
return xRetval;
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
index c6c69d77953f..fefff614ef9d 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
@@ -368,34 +368,30 @@ ViewObjectContactOfPageHierarchy::~ViewObjectContactOfPageHierarchy()
{
}
-drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfPageHierarchy::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
+void ViewObjectContactOfPageHierarchy::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer) const
{
- drawinglayer::primitive2d::Primitive2DContainer xRetval;
-
// process local sub-hierarchy
const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
- if(nSubHierarchyCount)
- {
- xRetval = getPrimitive2DSequenceSubHierarchy(rDisplayInfo);
+ if(!nSubHierarchyCount)
+ return;
- if(!xRetval.empty())
- {
- // get ranges
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
- const basegfx::B2DRange aObjectRange(xRetval.getB2DRange(rViewInformation2D));
- const basegfx::B2DRange& aViewRange(rViewInformation2D.getViewport());
+ drawinglayer::primitive2d::Primitive2DContainer xRetval = getPrimitive2DSequenceSubHierarchy(rDisplayInfo);
- // check geometrical visibility
- if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange))
- {
- // not visible, release
- xRetval.clear();
- }
- }
- }
+ if(xRetval.empty())
+ return;
- return xRetval;
+ // get ranges
+ const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
+ const basegfx::B2DRange aObjectRange(xRetval.getB2DRange(rViewInformation2D));
+ const basegfx::B2DRange& aViewRange(rViewInformation2D.getViewport());
+
+ // check geometrical visibility
+ if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange))
+ // not visible, release
+ return;
+
+ rContainer.append(xRetval);
}
ViewObjectContactOfPageGrid::ViewObjectContactOfPageGrid(ObjectContact& rObjectContact, ViewContact& rViewContact)
@@ -582,50 +578,48 @@ ViewObjectContactOfSdrPage::~ViewObjectContactOfSdrPage()
{
}
-drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfSdrPage::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
+void ViewObjectContactOfSdrPage::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DContainer& rContainer) const
{
- drawinglayer::primitive2d::Primitive2DContainer xRetval;
-
// process local sub-hierarchy
const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
- if(nSubHierarchyCount)
- {
- const bool bDoGhostedDisplaying(
- GetObjectContact().DoVisualizeEnteredGroup()
- && !GetObjectContact().isOutputToPrinter()
- && GetObjectContact().getActiveViewContact() == &GetViewContact());
+ if(!nSubHierarchyCount)
+ return;
- if(bDoGhostedDisplaying)
- {
- rDisplayInfo.ClearGhostedDrawMode();
- }
+ const bool bDoGhostedDisplaying(
+ GetObjectContact().DoVisualizeEnteredGroup()
+ && !GetObjectContact().isOutputToPrinter()
+ && GetObjectContact().getActiveViewContact() == &GetViewContact());
- // create object hierarchy
- xRetval = getPrimitive2DSequenceSubHierarchy(rDisplayInfo);
+ if(bDoGhostedDisplaying)
+ {
+ rDisplayInfo.ClearGhostedDrawMode();
+ }
- if(!xRetval.empty())
- {
- // get ranges
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
- const basegfx::B2DRange aObjectRange(xRetval.getB2DRange(rViewInformation2D));
- const basegfx::B2DRange& aViewRange(rViewInformation2D.getViewport());
+ // create object hierarchy
+ drawinglayer::primitive2d::Primitive2DContainer xRetval = getPrimitive2DSequenceSubHierarchy(rDisplayInfo);
- // check geometrical visibility
- if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange))
- {
- // not visible, release
- xRetval.clear();
- }
- }
+ if(!xRetval.empty())
+ {
+ // get ranges
+ const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
+ const basegfx::B2DRange aObjectRange(xRetval.getB2DRange(rViewInformation2D));
+ const basegfx::B2DRange& aViewRange(rViewInformation2D.getViewport());
- if(bDoGhostedDisplaying)
+ // check geometrical visibility
+ if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange))
{
- rDisplayInfo.SetGhostedDrawMode();
+ // not visible, release
+ xRetval.clear();
}
}
- return xRetval;
+ if(bDoGhostedDisplaying)
+ {
+ rDisplayInfo.SetGhostedDrawMode();
+ }
+
+ rContainer.append(xRetval);
}
}
More information about the Libreoffice-commits
mailing list