summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Deller <luke@deller.id.au>2013-04-28 07:06:11 +1000
committerDavid Tardon <dtardon@redhat.com>2013-04-28 11:52:12 +0000
commit57082b1243e86694b72c5e4fad013bf207bfe81a (patch)
tree2e461c166beecb5b569c966a2aeceb90995a4b85
parent2094610175140023cf8f904f8506c189e36dec06 (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. 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 <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r--svx/source/svdraw/svdoashp.cxx1
-rw-r--r--svx/source/svdraw/svdobj.cxx12
2 files changed, 12 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index fd0c5c826eb4..67bd0a5f7b9e 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 8385b07bb70a..fca7f2a926a2 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