[Libreoffice-commits] core.git: 2 commits - oox/source sfx2/source

Armin Le Grand alg at apache.org
Tue Feb 25 04:25:21 PST 2014


 oox/source/core/xmlfilterbase.cxx |   13 +++++++++++++
 sfx2/source/doc/doctemplates.cxx  |    4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit b071ce32befcc84a57a7ecd39667cb6658c0c866
Author: Armin Le Grand <alg at apache.org>
Date:   Mon Feb 24 20:25:26 2014 +0000

    Resolves: #i118640# force early destruction of last FragmentHandler...
    
    to not let it use an already destroyed RelationsMap instance
    (cherry picked from commit 190444f7fd3fa9cfcd1955b3f5dcd916184d02f4)
    
    Conflicts:
    	oox/source/core/xmlfilterbase.cxx
    
    Change-Id: Ibd09ff9fcba8f919df0704c8e3a64423518b932f

diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index fdee37b..29221c1 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -163,6 +163,7 @@ struct XmlFilterBaseImpl
     TextFieldStack                 maTextFieldStack;
 
     explicit            XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException );
+    ~XmlFilterBaseImpl();
 };
 
 XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
@@ -174,6 +175,10 @@ XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxCo
     registerNamespaces(maFastParser);
 }
 
+XmlFilterBaseImpl::~XmlFilterBaseImpl()
+{
+}
+
 XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
     FilterBase( rxContext ),
     mxImpl( new XmlFilterBaseImpl( rxContext ) ),
@@ -184,6 +189,14 @@ XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext )
 
 XmlFilterBase::~XmlFilterBase()
 {
+    // #i118640# Reset the DocumentHandler at the FastSaxParser manually; this is
+    // needed since the mechanism is that instances of FragmentHandler execute
+    // their stuff (creating objects, setting attributes, ...) on being destroyed.
+    // They get destroyed by setting a new DocumentHandler. This also happens in
+    // the following implicit destruction chain of ~XmlFilterBaseImpl, but in that
+    // case it's member RelationsMap maRelationsMap will be destroyed, but maybe
+    // still be used by ~FragmentHandler -> crash.
+    mxImpl->maFastParser.setDocumentHandler( 0 );
 }
 
 
commit 5eb95b2623a647134d4974c7977eb2340b3d84d7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 25 11:47:28 2014 +0000

    writeble->writable
    
    Change-Id: If1617d6cbdafa989fa3134842dd2238d06a1d06e

diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 47b8fed..cea14a6 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1566,7 +1566,7 @@ sal_Bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName )
         if ( !maTemplateDirs.getLength() )
             return sal_False;
 
-        // check that the fs location is in writeble folder and this is not a "My templates" folder
+        // check that the fs location is in writable folder and this is not a "My templates" folder
         INetURLObject aGroupParentFolder( aGroupTargetURL );
         if (!aGroupParentFolder.removeSegment())
             return sal_False;
@@ -1683,7 +1683,7 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
     if ( !maTemplateDirs.getLength() )
         return sal_False;
 
-    // check that the fs location is in writeble folder and this is not a "My templates" folder
+    // check that the fs location is in writable folder and this is not a "My templates" folder
     INetURLObject aGroupParentFolder( aGroupTargetURL );
     if (!aGroupParentFolder.removeSegment() ||
         isInternalTemplateDir(aGroupParentFolder.GetMainURL(INetURLObject::NO_DECODE)))


More information about the Libreoffice-commits mailing list