diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-09-30 12:45:03 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-10-05 06:47:34 +0000 |
commit | 0402ba63551b614c9742b198e48232ac87a2b32b (patch) | |
tree | fe5efd4ae77973c34b20c525cc1ed8f62cbf0165 /svx | |
parent | f102e2391a913acef117aed6106e635b7ab1853d (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 914d72ee1edb351e4975a516240a38696f619217.
Revert "Resolves: rhbz#1353069 don't clear XATTR_FILL* from stylesheet if..."
This reverts commit de4908eb4d2f1f2ce38a37eea18a9efc4a0073b1.
Revert "use unique_ptr"
This reverts commit ee4f35090657fdce572c5bc6238aceb4098a6e4e.
Revert "fix typo"
This reverts commit a084962e8c3deaeb3c1b6b9119215b48cf27e76e.
Revert "rbhz#1326602 avoid exp. bg bitmaps from deleted slides"
This reverts commit b876bbe2cacce8af379b10d82da6c7e7d229b361.
Change-Id: I65a2f50d1087d6f8bb94d8bb73d54d3f378c6800
Reviewed-on: https://gerrit.libreoffice.org/29490
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 83 |
1 files changed, 3 insertions, 80 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index ec5f2fe61751..efc5991064ce 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> @@ -1444,28 +1442,12 @@ 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()) { @@ -1500,8 +1482,6 @@ SdrUndoDelPage::~SdrUndoDelPage() void SdrUndoDelPage::Undo() { - if (bool(mpFillBitmapItem)) - restoreFillBitmap(); ImpInsertPage(nPageNum); if (pUndoGroup!=nullptr) { @@ -1515,8 +1495,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; @@ -1545,61 +1523,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() { @@ -1846,9 +1769,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) |