diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-11 13:34:43 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-11-28 14:15:39 +0100 |
commit | ce68f32392c3b771b04233b4c88d72beca8628c6 (patch) | |
tree | f3488944d8495448a048e1569063960e46cb62e2 /xmloff | |
parent | d6e3ced43f73c29c3492b969170b5975b3206ac6 (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 but limit this to document generated with
4.4.X which we believe is the version that created these bogus docs
(cherry picked from commit de0432a9256188c7b5cd1a83858311e68c890ebf)
Change-Id: I83f6d72fd969f667f0a8c2c85d2ffeeed672387a
Reviewed-on: https://gerrit.libreoffice.org/20054
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit df58e60200273d90aab2fcb85df441e487f90fd6)
Diffstat (limited to 'xmloff')
-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 6389d8f27f0c..76e858c5af04 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -593,6 +593,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ ) (!sName.isEmpty() && sOrigName != sName) ) { OUString sOldName( sName ); + sal_Int32 i = 0; while( xTextImportHelper->HasFrameByName( sName ) ) { @@ -601,8 +602,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 && GetImport().getGeneratorVersion() == SvXMLImport::LO_44x) + { + bCreateFailed = true; + return; + } + } } } |