[Libreoffice-commits] core.git: xmloff/source
Caolán McNamara
caolanm at redhat.com
Thu Nov 19 01:31:27 PST 2015
xmloff/source/text/XMLTextFrameContext.cxx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit de0432a9256188c7b5cd1a83858311e68c890ebf
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 11 13:34:43 2015 +0000
Incredible slowness and crashes with document with vast num of frame dups
it looks like draw:name values are supposed to be unique in ODF, even
if it's not spelled out explicitly, since it exists so the frame can be
referenced, which sort of implies that it has to be unique, so a
document where the values aren't unique can be considered invalid
19.197.10 <draw:frame>
The draw:name attribute specifies a name by which a <draw:frame>
element can be referenced.
So reject duplicate frames
Change-Id: I83f6d72fd969f667f0a8c2c85d2ffeeed672387a
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 7df2aa5..2b4727e 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -585,6 +585,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
(!sName.isEmpty() && sOrigName != sName) )
{
OUString sOldName( sName );
+
sal_Int32 i = 0;
while( xTextImportHelper->HasFrameByName( sName ) )
{
@@ -593,8 +594,15 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
}
xNamed->setName( sName );
if( sName != sOldName )
- xTextImportHelper->GetRenameMap().Add( XML_TEXT_RENAME_TYPE_FRAME,
+ {
+ bool bSuccess = xTextImportHelper->GetRenameMap().Add( XML_TEXT_RENAME_TYPE_FRAME,
sOldName, sName );
+ if (!bSuccess)
+ {
+ bCreateFailed = true;
+ return;
+ }
+ }
}
}
More information about the Libreoffice-commits
mailing list