diff options
author | Luke Deller <luke@deller.id.au> | 2013-04-25 00:00:54 +1000 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-05-07 13:21:02 +0200 |
commit | aae230a987272bc13d1f4df26ab3170b396a2566 (patch) | |
tree | b97cd305b3bac70694d616b55a6927062dff46b1 /svx | |
parent | 2e5ff958092587ee2b742aa3eb70a64e867497a2 (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>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 1d8a83349bbe..2c7d5310de3f 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 |