diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-09-30 12:45:03 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-10-03 15:46:28 +0100 |
commit | 1c1d9867b0f789b21730faf76c02d2f86fcee43c (patch) | |
tree | c306acc5a2bf74ae7a8a9c87c5159be23930b5f5 /svx | |
parent | 9e1ee599e00751bc2454a9e2549286f4afca81e5 (diff) |
Resolves: tdf#101711 problems with attempt to remove unused bg images
only do the save, unset (and possibly restore) of a bg image on the
stylesheet if it has one owner, this continue to make the original
scenario function without (so far anyway) the various reported problems
Change-Id: I73382961973b1c53bf2ceff205615727dd378c77
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 0f5c6ab352a1..66192509c0bf 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -1451,11 +1451,10 @@ SdrUndoPageList::~SdrUndoPageList() } -SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg, bool bSoleOwnerOfFillBitmapProps) +SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg) : SdrUndoPageList(rNewPg) , pUndoGroup(nullptr) , mbHasFillBitmap(false) - , mbSoleOwnerOfFillBitmapProps(bSoleOwnerOfFillBitmapProps) { bItsMine = true; @@ -1565,10 +1564,10 @@ void SdrUndoDelPage::clearFillBitmap() { if (mrPage.IsMasterPage()) { - if (mbSoleOwnerOfFillBitmapProps) + SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet(); + assert(bool(pStyleSheet)); // who took away my stylesheet? + if (pStyleSheet->GetListenerCount() == 1) { - SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet(); - assert(bool(pStyleSheet)); // who took away my stylesheet? SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); rItemSet.ClearItem(XATTR_FILLBITMAP); if (mbHasFillBitmap) @@ -1588,10 +1587,10 @@ void SdrUndoDelPage::restoreFillBitmap() { if (mrPage.IsMasterPage()) { - if (mbSoleOwnerOfFillBitmapProps) + SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet(); + assert(bool(pStyleSheet)); // who took away my stylesheet? + if (pStyleSheet->GetListenerCount() == 1) { - SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet(); - assert(bool(pStyleSheet)); // who took away my stylesheet? SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); rItemSet.Put(*mpFillBitmapItem); if (mbHasFillBitmap) @@ -1853,9 +1852,9 @@ SdrUndoAction* SdrUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLaye } // page -SdrUndoAction* SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage, bool bSoleOwnerOfFillBitmapProps) +SdrUndoAction* SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage) { - return new SdrUndoDelPage(rPage, bSoleOwnerOfFillBitmapProps); + return new SdrUndoDelPage(rPage); } SdrUndoAction* SdrUndoFactory::CreateUndoNewPage(SdrPage& rPage) |