summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-06 10:10:27 +0100
committerDavid Tardon <dtardon@redhat.com>2016-07-08 11:50:04 +0000
commit30c152836419f7fabd128142c3ce266b07ba5210 (patch)
treec972656541f6ebdbce6db1600f9acbd60ce5d7d7 /svx
parent18a7d6423db379ce9b4ba146aea20c55f1bda32f (diff)
Resolves: rhbz#1353069 don't clear XATTR_FILL* from stylesheet if...
the master page is not the sole owner. Which happens when copying and pasting slides which bring along a duplicate master page to an already existing one, and the attempt to remove the duplicate strips the fill properties from the shared stylesheet in use by the other regression from... commit b876bbe2cacce8af379b10d82da6c7e7d229b361 Author: David Tardon <dtardon@redhat.com> Date: Tue Apr 26 09:17:11 2016 +0200 rbhz#1326602 avoid exp. bg bitmaps from deleted slides Change-Id: I91fb8f622a0e35741ecc37cef14fc93199bb730b (cherry picked from commit de4908eb4d2f1f2ce38a37eea18a9efc4a0073b1) Reviewed-on: https://gerrit.libreoffice.org/26975 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdundo.cxx37
1 files changed, 22 insertions, 15 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index abc459fdfddb..ec5f2fe61751 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -1444,10 +1444,11 @@ SdrUndoPageList::~SdrUndoPageList()
}
-SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg)
+SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg, bool bSoleOwnerOfFillBitmapProps)
: SdrUndoPageList(rNewPg)
, pUndoGroup(nullptr)
, mbHasFillBitmap(false)
+ , mbSoleOwnerOfFillBitmapProps(bSoleOwnerOfFillBitmapProps)
{
bItsMine = true;
@@ -1557,12 +1558,15 @@ void SdrUndoDelPage::clearFillBitmap()
{
if (mrPage.IsMasterPage())
{
- 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);
+ 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
{
@@ -1577,12 +1581,15 @@ void SdrUndoDelPage::restoreFillBitmap()
{
if (mrPage.IsMasterPage())
{
- 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));
+ 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
{
@@ -1839,9 +1846,9 @@ SdrUndoAction* SdrUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLaye
}
// page
-SdrUndoAction* SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
+SdrUndoAction* SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage, bool bSoleOwnerOfFillBitmapProps)
{
- return new SdrUndoDelPage( rPage );
+ return new SdrUndoDelPage(rPage, bSoleOwnerOfFillBitmapProps);
}
SdrUndoAction* SdrUndoFactory::CreateUndoNewPage(SdrPage& rPage)