sw/source/core/unocore/unoframe.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit f4743b5e7e6be74c1f399b7726ca85e38c96c132 Author: Michael Stahl <mst...@redhat.com> Date: Fri May 31 12:34:35 2013 +0200 sw: SwXFrame: fix gradient import problem: BaseFrameProperties_Impl::FillBaseProperties: It may happen that checkForUniqueItem returns an item with a name that already exists, if the same gradient appears multiple times; don't crash with unhandled ElementExistException then. (can be reproduced with test3.docx from fdo#41466) (regression from 1a3c90a292c7fc9060604151de9dc51eecf5b6a7) Change-Id: Iace7af4c5679c1c7e978525fa31abf884038567c (cherry picked from commit f5e8f5b0b5410d29b5cb1fb6fbbd8bf3c48a0201) diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index d3d5ed5..0273a1e 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -267,7 +267,10 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SwDoc* pDoc, SfxItemSet& rToSe uno::Reference<frame::XModel> xModel(pDoc->GetDocShell()->GetModel()); uno::Reference<lang::XMultiServiceFactory> xServiceFact(xModel, uno::UNO_QUERY); uno::Reference< container::XNameContainer > xGradients(xServiceFact->createInstance("com.sun.star.drawing.GradientTable"), uno::UNO_QUERY); - xGradients->insertByName(pItem->GetName(), *pFillGradient); + if (!xGradients->hasByName(pItem->GetName())) + { + xGradients->insertByName(pItem->GetName(), *pFillGradient); + } delete pItem; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits