Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3662

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/62/3662/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.

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



diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 35b89c0..f7045fe 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -567,12 +567,24 @@
 
 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

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id37593fe5578afe06cd967bf0b0b7d56922fe4af
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Luke Deller <luke@deller.id.au>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.