summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-11-11 13:34:43 +0000
committerMichael Stahl <mstahl@redhat.com>2015-11-20 14:34:33 +0000
commitdf58e60200273d90aab2fcb85df441e487f90fd6 (patch)
treee4cceff753ef173263ca8bc75473c3ba3d481236
parente3ee6df32e9e1ce93213b16c9e672ed89046b4f6 (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>
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx10
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;
+ }
+ }
}
}