summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-12-02 23:28:20 +0100
committerMichael Stahl <mstahl@redhat.com>2013-12-02 23:48:10 +0100
commitae9017f0ba3a3a1fdc55b2f3d57230d04a46808e (patch)
treeded226e4fcb72f5104cdd9b9d619405f33aecd6d /xmloff
parent276eea27c124560422339da47755014a4801a27e (diff)
fdo#71450 fdo#71698: ODF import: fix frame name corner cases
Trying to set a name that is already in use will throw an exception (and set a different, generated name); if there is actually no name in the file then there's no point trying to set anything. (regression from b69d152cfa1da868ba960345d72ba78f9f8e1b35) Change-Id: Ie54d4a830cc23e2853a6efeb81f77dcc788192ea (cherry picked from commit 8171e713e74e3d09e86592c28abfe05d0400c071)
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 6795dcdd5786..37312211a755 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1307,12 +1307,20 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef,
void XMLTextFrameContext_Impl::SetName()
{
Reference<XNamed> xNamed(xPropSet, UNO_QUERY);
- if (xNamed.is())
+ if (!m_sOrigName.isEmpty() && xNamed.is())
{
OUString const name(xNamed->getName());
if (name != m_sOrigName)
{
- xNamed->setName(m_sOrigName);
+ try
+ {
+ xNamed->setName(m_sOrigName);
+ }
+ catch (uno::Exception const& e)
+ { // fdo#71698 document contains 2 frames with same draw:name
+ SAL_INFO("xmloff.text", "SetName(): exception setting \""
+ << m_sOrigName << "\": " << e.Message);
+ }
}
}
}