57472ac
From 8aa07967e677433e6af7d16102ffc276b9207d97 Mon Sep 17 00:00:00 2001
57472ac
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
57472ac
Date: Mon, 7 Nov 2016 13:18:03 +0000
57472ac
Subject: [PATCH] ensure checkForUniqueItem on inserting a new slide
57472ac
57472ac
On copying slides from another presentation into one, we end up
57472ac
with two XBitmapItems with the same name and different properties.
57472ac
57472ac
because the names are supposed to be unique, only one gets exported
57472ac
so the presentation looses graphics on export
57472ac
57472ac
there is a bunch of places which use checkForUniqueItem to block
57472ac
this from happening, add another at the point where we insert
57472ac
the new page into the model
57472ac
57472ac
Change-Id: If708b1997c7e83e4787d9d54f84c8b0516e6cf6b
57472ac
---
57472ac
 svx/source/svdraw/svdpage.cxx | 6 +++++-
57472ac
 1 file changed, 5 insertions(+), 1 deletion(-)
57472ac
57472ac
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
57472ac
index 3bb3fe9..91f9859c 100644
57472ac
--- a/svx/source/svdraw/svdpage.cxx
57472ac
+++ b/svx/source/svdraw/svdpage.cxx
57472ac
@@ -1483,7 +1483,11 @@ void SdrPage::SetModel(SdrModel* pNewModel)
57472ac
 
57472ac
         if(!IsMasterPage())
57472ac
         {
57472ac
-            pNew->PutItemSet(getSdrPageProperties().GetItemSet());
57472ac
+            const SfxItemSet& rOldSet = getSdrPageProperties().GetItemSet();
57472ac
+            SfxItemSet* pNewSet = rOldSet.Clone(false, &pNewModel->GetItemPool());
57472ac
+            SdrModel::MigrateItemSet(&rOldSet, pNewSet, pNewModel);
57472ac
+            pNew->PutItemSet(*pNewSet);
57472ac
+            delete pNewSet;
57472ac
         }
57472ac
 
57472ac
         pNew->SetStyleSheet(getSdrPageProperties().GetStyleSheet());
57472ac
-- 
57472ac
2.9.3
57472ac