[PATCH] fdo#60910: discard UNO shape object in SdrObject::SetPage

Luke Deller (via Code Review) gerrit at gerrit.libreoffice.org
Sat Apr 27 14:20:59 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3642

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/42/3642/1

fdo#60910: discard UNO shape object in SdrObject::SetPage

The creation of the UNO shape in SdrObject::getUnoShape is influenced
by pPage, so when the page changes we need to discard the cached UNO
shape so that a new one will be created with the new page.

This replaces my first shot at a fix for fdo#60910 which reinstated a
line to discard the custom shape engine (and consequently the UNO shape) in
SdrObjCustomShape::InvalidateRenderGeometry.  That worked but did more
discarding than was necessary.

Change-Id: I665fb6f9e1563bbc4eced046f027a53991a7e45f
---
M svx/source/svdraw/svdobj.cxx
1 file changed, 6 insertions(+), 0 deletions(-)



diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 8385b07..1f7cba6 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -568,6 +568,12 @@
 
 void SdrObject::SetPage(SdrPage* pNewPage)
 {
+    // The creation of the UNO shape in SdrObject::getUnoShape is influenced
+    // by pPage, so when the page changes we need to discard the cached UNO
+    // shape so that a new one will be created.
+    if (pPage != pNewPage)
+        setUnoShape(NULL);
+
     pPage=pNewPage;
     if (pPage!=NULL) {
         SdrModel* pMod=pPage->GetModel();

-- 
To view, visit https://gerrit.libreoffice.org/3642
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I665fb6f9e1563bbc4eced046f027a53991a7e45f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Luke Deller <luke at deller.id.au>



More information about the LibreOffice mailing list