svx/source/svdraw/svdoashp.cxx |    1 -
 svx/source/svdraw/svdobj.cxx   |   12 ++++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 57082b1243e86694b72c5e4fad013bf207bfe81a
Author: Luke Deller <l...@deller.id.au>
Date:   Sun Apr 28 07:06:11 2013 +1000

    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
    Reviewed-on: https://gerrit.libreoffice.org/3642
    Reviewed-by: David Tardon <dtar...@redhat.com>
    Tested-by: David Tardon <dtar...@redhat.com>

diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index fd0c5c8..67bd0a5 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -3217,7 +3217,6 @@ bool SdrObjCustomShape::doConstructOrthogonal(const 
OUString& rName)
 void SdrObjCustomShape::InvalidateRenderGeometry()
 {
     mXRenderedCustomShape = 0L;
-    mxCustomShapeEngine = 0L;
     SdrObject::Free( mpLastShadowGeometry );
     mpLastShadowGeometry = 0L;
 }
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 8385b07..fca7f2a 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -568,12 +568,24 @@ SdrObjList* SdrObject::GetObjList() const
 
 void SdrObject::SetPage(SdrPage* pNewPage)
 {
+    SdrModel* pOldModel = pModel;
+    SdrPage* pOldPage = pPage;
+
     pPage=pNewPage;
     if (pPage!=NULL) {
         SdrModel* pMod=pPage->GetModel();
         if (pMod!=pModel && pMod!=NULL) {
             SetModel(pMod);
         }}
+
+    // 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 the page is changing to another page with the same model, we
+    // assume they create compatible UNO shape objects so we shouldn't have
+    // to invalidate.
+    if (pOldPage != pPage && !(pOldPage && pPage && pOldModel == pModel))
+        setUnoShape(NULL);
 }
 
 SdrPage* SdrObject::GetPage() const
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to