summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-03 15:22:50 +0100
committerAndras Timar <andras.timar@collabora.com>2016-10-10 10:33:11 +0200
commitfe9fd49ffccb6bee448c87515ae69ddde3b179c3 (patch)
tree38caf1d2853e7032870862fd3e733db39c13ec3f /sd
parente649c9ce40f7425fb4a4670201a1f36e028c5022 (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 'sd')
-rw-r--r--sd/source/core/drawdoc3.cxx20
-rw-r--r--sd/source/ui/func/undoback.cxx43
-rw-r--r--sd/source/ui/inc/undoback.hxx6
3 files changed, 5 insertions, 64 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 8b0c53d7012b..55c84863ce2d 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -800,17 +800,8 @@ bool SdDrawDocument::InsertBookmarkAsPage(
aTest == aMPLayout &&
eKind == pTest->GetPageKind() )
{
- if (bUndo)
- {
- bool bSoleOwnerOfStyleSheet = true;
- if (pRefPage->IsMasterPage())
- {
- const SfxStyleSheet* pRefSheet = pRefPage->getSdrPageProperties().GetStyleSheet();
- const SfxStyleSheet* pTestSheet = pTest->getSdrPageProperties().GetStyleSheet();
- bSoleOwnerOfStyleSheet = pRefSheet != pTestSheet;
- }
- AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pRefPage, bSoleOwnerOfStyleSheet));
- }
+ if( bUndo )
+ AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pRefPage));
RemoveMasterPage(nPage);
@@ -1249,7 +1240,6 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
{
// Do not delete master pages that have their precious flag set
bool bDeleteMaster = !pMaster->IsPrecious();
- bool bSoleOwnerOfStyleSheet = true;
OUString aLayoutName = pMaster->GetLayoutName();
if(bOnlyDuplicatePages )
@@ -1264,10 +1254,6 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
{
// duplicate page found -> remove it
bDeleteMaster = true;
-
- const SfxStyleSheet* pRefSheet = pMaster->getSdrPageProperties().GetStyleSheet();
- const SfxStyleSheet* pTestSheet = pMPg->getSdrPageProperties().GetStyleSheet();
- bSoleOwnerOfStyleSheet = pRefSheet != pTestSheet;
}
}
}
@@ -1301,7 +1287,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
delete pNotesMaster;
if( bUndo )
- AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pMaster, bSoleOwnerOfStyleSheet));
+ AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pMaster));
RemoveMasterPage( pMaster->GetPageNum() );
diff --git a/sd/source/ui/func/undoback.cxx b/sd/source/ui/func/undoback.cxx
index 704b551c7469..126101fba2be 100644
--- a/sd/source/ui/func/undoback.cxx
+++ b/sd/source/ui/func/undoback.cxx
@@ -21,14 +21,8 @@
#include "sdpage.hxx"
#include "sdresid.hxx"
#include "strings.hrc"
-
-#include <com/sun/star/drawing/FillStyle.hpp>
-
-#include <o3tl/make_unique.hxx>
-
#include <svl/itemset.hxx>
-#include <svx/xfillit0.hxx>
SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
SdDrawDocument& rDoc,
@@ -36,12 +30,10 @@ SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
const SfxItemSet& rItenSet)
: SdUndoAction(&rDoc),
mrPage(rPage),
- mpItemSet(new SfxItemSet(rItenSet)),
- mbHasFillBitmap(false)
+ mpItemSet(new SfxItemSet(rItenSet))
{
OUString aString( SdResId( STR_UNDO_CHANGE_PAGEFORMAT ) );
SetComment( aString );
- saveFillBitmap(*mpItemSet);
}
SdBackgroundObjUndoAction::~SdBackgroundObjUndoAction()
@@ -53,14 +45,9 @@ void SdBackgroundObjUndoAction::ImplRestoreBackgroundObj()
{
SfxItemSet* pNew = new SfxItemSet(mrPage.getSdrPageProperties().GetItemSet());
mrPage.getSdrPageProperties().ClearItem();
- if (bool(mpFillBitmapItem))
- restoreFillBitmap(*mpItemSet);
- mpFillBitmapItem.reset();
- mbHasFillBitmap = false;
mrPage.getSdrPageProperties().PutItemSet(*mpItemSet);
delete mpItemSet;
mpItemSet = pNew;
- saveFillBitmap(*mpItemSet);
// tell the page that it's visualization has changed
mrPage.ActionChanged();
@@ -78,33 +65,7 @@ void SdBackgroundObjUndoAction::Redo()
SdUndoAction* SdBackgroundObjUndoAction::Clone() const
{
- std::unique_ptr<SdBackgroundObjUndoAction> pCopy = o3tl::make_unique<SdBackgroundObjUndoAction>(*mpDoc, mrPage, *mpItemSet);
- if (mpFillBitmapItem)
- pCopy->mpFillBitmapItem.reset(mpFillBitmapItem->Clone());
- pCopy->mbHasFillBitmap = mbHasFillBitmap;
- return pCopy.release();
-}
-
-void SdBackgroundObjUndoAction::saveFillBitmap(SfxItemSet &rItemSet)
-{
- const SfxPoolItem *pItem = nullptr;
- if (rItemSet.GetItemState(XATTR_FILLBITMAP, false, &pItem) == SfxItemState::SET)
- mpFillBitmapItem.reset(pItem->Clone());
- if (bool(mpFillBitmapItem))
- {
- if (rItemSet.GetItemState(XATTR_FILLSTYLE, false, &pItem) == SfxItemState::SET)
- mbHasFillBitmap = static_cast<const XFillStyleItem*>(pItem)->GetValue() == css::drawing::FillStyle_BITMAP;
- rItemSet.ClearItem(XATTR_FILLBITMAP);
- if (mbHasFillBitmap)
- rItemSet.ClearItem(XATTR_FILLSTYLE);
- }
-}
-
-void SdBackgroundObjUndoAction::restoreFillBitmap(SfxItemSet &rItemSet)
-{
- rItemSet.Put(*mpFillBitmapItem);
- if (mbHasFillBitmap)
- rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP));
+ return new SdBackgroundObjUndoAction(*mpDoc, mrPage, *mpItemSet);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/undoback.hxx b/sd/source/ui/inc/undoback.hxx
index 35370ca01627..3b1553b4d239 100644
--- a/sd/source/ui/inc/undoback.hxx
+++ b/sd/source/ui/inc/undoback.hxx
@@ -20,13 +20,11 @@
#ifndef INCLUDED_SD_SOURCE_UI_INC_UNDOBACK_HXX
#define INCLUDED_SD_SOURCE_UI_INC_UNDOBACK_HXX
-#include <memory>
#include "sdundo.hxx"
class SdDrawDocument;
class SdPage;
class SfxItemSet;
-class SfxPoolItem;
// SdBackgroundObjUndoAction
class SdBackgroundObjUndoAction : public SdUndoAction
@@ -35,12 +33,8 @@ private:
SdPage& mrPage;
SfxItemSet* mpItemSet;
- std::unique_ptr<SfxPoolItem> mpFillBitmapItem;
- bool mbHasFillBitmap;
void ImplRestoreBackgroundObj();
- void saveFillBitmap(SfxItemSet &rItemSet);
- void restoreFillBitmap(SfxItemSet &rItemSet);
public: