[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - xmloff/source

Caolán McNamara caolanm at redhat.com
Fri Nov 20 06:35:02 PST 2015


 xmloff/source/text/XMLTextFrameContext.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit df58e60200273d90aab2fcb85df441e487f90fd6
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 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 at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 6389d8f..76e858c 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;
+                }
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list