[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - svx/source
Luke Deller
luke at deller.id.au
Mon Apr 29 05:40:57 PDT 2013
svx/source/svdraw/svdobj.cxx | 12 ++++++++++++
1 file changed, 12 insertions(+)
New commits:
commit 879c36b01d3f806937cfc26b90ebac89e6df87c4
Author: Luke Deller <luke at deller.id.au>
Date: Thu Apr 25 00:00:54 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.
Change-Id: Id37593fe5578afe06cd967bf0b0b7d56922fe4af
Reviewed-on: https://gerrit.libreoffice.org/3662
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
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 @@ 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
More information about the Libreoffice-commits
mailing list