From fc64c335be26ebd4828973168fd69265c6285872 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 7 Nov 2016 13:18:03 +0000 Subject: ensure checkForUniqueItem on inserting a new slide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svx/source/svdraw/svdpage.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'svx/source') 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()); -- cgit