summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Deller <luke@deller.id.au>2013-04-25 00:00:54 +1000
committerDavid Tardon <dtardon@redhat.com>2013-04-29 12:40:37 +0000
commit879c36b01d3f806937cfc26b90ebac89e6df87c4 (patch)
tree03874bd842bc775b1448f460fc1ab7dc5d004bd9
parent24eb9d6f32397dabf5e52671090fd7607bcc1cf2 (diff)
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 Reviewed-on: https://gerrit.libreoffice.org/3662 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r--svx/source/svdraw/svdobj.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 35b89c0b9b16..f7045fe10864 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -567,12 +567,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