summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdpage.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-07 13:18:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-07 15:32:43 +0000
commitfc64c335be26ebd4828973168fd69265c6285872 (patch)
treea46a4ed4b36c6e152f2f1fdf5db00de832403372 /svx/source/svdraw/svdpage.cxx
parentba68e6dd7ad99ef2a2720f327813d13550b98966 (diff)
ensure checkForUniqueItem on inserting a new slide
On copying slides from another presentation into one, we end up with two XBitmapItems with the same name and different properties. because the names are supposed to be unique, only one gets exported so the presentation looses graphics on export there is a bunch of places which use checkForUniqueItem to block this from happening, add another at the point where we insert the new page into the model Change-Id: If708b1997c7e83e4787d9d54f84c8b0516e6cf6b Reviewed-on: https://gerrit.libreoffice.org/30664 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/svdraw/svdpage.cxx')
-rw-r--r--svx/source/svdraw/svdpage.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 3bb3fe977f09..147a4ba72701 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1483,7 +1483,14 @@ void SdrPage::SetModel(SdrModel* pNewModel)
if(!IsMasterPage())
{
- pNew->PutItemSet(getSdrPageProperties().GetItemSet());
+ const SfxItemSet& rOldSet = getSdrPageProperties().GetItemSet();
+ SfxItemSet* pNewSet = rOldSet.Clone(false, &pNewModel->GetItemPool());
+ //ensure checkForUniqueItem is called so new pages which have e.g.
+ //XFillBitmapItem set, do not conflict with an existing XFillBitmapItem
+ //with the same name but different properties
+ SdrModel::MigrateItemSet(&rOldSet, pNewSet, pNewModel);
+ pNew->PutItemSet(*pNewSet);
+ delete pNewSet;
}
pNew->SetStyleSheet(getSdrPageProperties().GetStyleSheet());