[Libreoffice-commits] core.git: Branch 'libreoffice-4-1-4' - xmloff/source
Michael Stahl
mstahl at redhat.com
Wed Dec 4 02:28:41 PST 2013
xmloff/source/text/XMLTextFrameContext.cxx | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 3da29e6813a64b97fb56436a80dae7fafc39eba3
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Dec 2 23:28:20 2013 +0100
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)
Reviewed-on: https://gerrit.libreoffice.org/6907
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
(cherry picked from commit 0763cf6ed7bdc629e59b5df757b9ef4f5273f393)
Reviewed-on: https://gerrit.libreoffice.org/6911
Reviewed-by: Eike Rathke <erack at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 3ca7e86..745ff63 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1291,12 +1291,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);
+ }
}
}
}
More information about the Libreoffice-commits
mailing list