diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-10-03 15:22:50 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-10-10 10:33:11 +0200 |
commit | fe9fd49ffccb6bee448c87515ae69ddde3b179c3 (patch) | |
tree | 38caf1d2853e7032870862fd3e733db39c13ec3f /svx | |
parent | e649c9ce40f7425fb4a4670201a1f36e028c5022 (diff) |
Resolves: tdf#101711 revert attempt to drop unused bg images
for 5-2/5-1 simply revert the effort
Revert "Related: rhbz#1353069 don't clear XATTR_FILL* from stylesheet if..."
This reverts commit 19c191a0a92b6ae9ca86aa4ee7afb887fd42a209.
Revert "Resolves: rhbz#1353069 don't clear XATTR_FILL* from stylesheet if..."
This reverts commit fad4d7877ac8d04ab82e8acd21205f315d6eab1f.
Revert "rhbz#1326602 avoid exp. bg bitmaps from deleted slides"
This reverts commit fd45334b49c09538598f82f5ffa2f61f6bdd9d24.
Change-Id: I591083b6b1d7b08316ee24c0788386799d01724b
Reviewed-on: https://gerrit.libreoffice.org/29491
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
(cherry picked from commit 8127ac5412b0af8ed7985e07ab11b3241a4e659e)
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 84 |
1 files changed, 4 insertions, 80 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 28064e702f6f..416ee580873b 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <com/sun/star/drawing/FillStyle.hpp> #include <svl/lstner.hxx> @@ -28,7 +27,6 @@ #include <svx/svdlayer.hxx> #include <svx/svdmodel.hxx> #include <svx/svdview.hxx> -#include <svx/xfillit0.hxx> #include "svx/svdstr.hrc" #include "svdglob.hxx" #include <svx/scene3d.hxx> @@ -1455,28 +1453,13 @@ SdrUndoPageList::~SdrUndoPageList() } -SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg, bool bSoleOwnerOfFillBitmapProps) + +SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg) : SdrUndoPageList(rNewPg) , pUndoGroup(nullptr) - , mbHasFillBitmap(false) - , mbSoleOwnerOfFillBitmapProps(bSoleOwnerOfFillBitmapProps) { bItsMine = true; - // keep fill bitmap separately to remove it from pool if not used elsewhere - if (mrPage.IsMasterPage()) - { - SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet(); - if (pStyleSheet) - queryFillBitmap(pStyleSheet->GetItemSet()); - } - else - { - queryFillBitmap(mrPage.getSdrPageProperties().GetItemSet()); - } - if (bool(mpFillBitmapItem)) - clearFillBitmap(); - // now remember the master page relationships if(mrPage.IsMasterPage()) { @@ -1511,8 +1494,6 @@ SdrUndoDelPage::~SdrUndoDelPage() void SdrUndoDelPage::Undo() { - if (bool(mpFillBitmapItem)) - restoreFillBitmap(); ImpInsertPage(nPageNum); if (pUndoGroup!=nullptr) { @@ -1526,8 +1507,6 @@ void SdrUndoDelPage::Undo() void SdrUndoDelPage::Redo() { ImpRemovePage(nPageNum); - if (bool(mpFillBitmapItem)) - clearFillBitmap(); // master page relations are dissolved automatically DBG_ASSERT(!bItsMine,"RedoDeletePage: mrPage already belongs to UndoAction."); bItsMine=true; @@ -1556,61 +1535,6 @@ bool SdrUndoDelPage::CanSdrRepeat(SdrView& /*rView*/) const return false; } -void SdrUndoDelPage::queryFillBitmap(const SfxItemSet& rItemSet) -{ - const SfxPoolItem *pItem = nullptr; - if (rItemSet.GetItemState(XATTR_FILLBITMAP, false, &pItem) == SfxItemState::SET) - mpFillBitmapItem.reset(pItem->Clone()); - if (rItemSet.GetItemState(XATTR_FILLSTYLE, false, &pItem) == SfxItemState::SET) - mbHasFillBitmap = static_cast<const XFillStyleItem*>(pItem)->GetValue() == css::drawing::FillStyle_BITMAP; -} - -void SdrUndoDelPage::clearFillBitmap() -{ - if (mrPage.IsMasterPage()) - { - if (mbSoleOwnerOfFillBitmapProps) - { - SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet(); - assert(bool(pStyleSheet)); // who took away my stylesheet? - SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); - rItemSet.ClearItem(XATTR_FILLBITMAP); - if (mbHasFillBitmap) - rItemSet.ClearItem(XATTR_FILLSTYLE); - } - } - else - { - SdrPageProperties &rPageProps = mrPage.getSdrPageProperties(); - rPageProps.ClearItem(XATTR_FILLBITMAP); - if (mbHasFillBitmap) - rPageProps.ClearItem(XATTR_FILLSTYLE); - } -} - -void SdrUndoDelPage::restoreFillBitmap() -{ - if (mrPage.IsMasterPage()) - { - if (mbSoleOwnerOfFillBitmapProps) - { - SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet(); - assert(bool(pStyleSheet)); // who took away my stylesheet? - SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); - rItemSet.Put(*mpFillBitmapItem); - if (mbHasFillBitmap) - rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP)); - } - } - else - { - SdrPageProperties &rPageProps = mrPage.getSdrPageProperties(); - rPageProps.PutItem(*mpFillBitmapItem); - if (mbHasFillBitmap) - rPageProps.PutItem(XFillStyleItem(css::drawing::FillStyle_BITMAP)); - } -} - void SdrUndoNewPage::Undo() { @@ -1857,9 +1781,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) |