diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-11 13:34:43 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-19 09:31:00 +0000 |
commit | de0432a9256188c7b5cd1a83858311e68c890ebf (patch) | |
tree | 0f71c62f403b1fe81915ce336a8ad9be7e8446df /xmloff/source/text | |
parent | 526bbbbd2f8eb227bc0dacd755a6c72511adf976 (diff) |
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
Diffstat (limited to 'xmloff/source/text')
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 7df2aa568acb..2b4727e0c218 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; + } + } } } |