Kaydet (Commit) 8171e713 authored tarafından Michael Stahl's avatar Michael Stahl

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 b69d152c)

Change-Id: Ie54d4a830cc23e2853a6efeb81f77dcc788192ea
üst 790896d9
......@@ -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);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment