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