[Libreoffice-commits] .: desktop/source sfx2/source

Muthu Subramanian sumuthu at kemper.freedesktop.org
Mon May 2 04:25:09 PDT 2011


 desktop/source/app/dispatchwatcher.cxx |   11 ++++++++---
 sfx2/source/bastyp/fltfnc.cxx          |    4 ++++
 2 files changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 926c6c068af6cd12bd61cd5408d65f78d3f6e46b
Author: Muthu Subramanian <sumuthu at novell.com>
Date:   Mon May 2 16:57:21 2011 +0530

    n#690798: Fixed a crasher. Also, improved batch conversion.
    
    * The pointer is not removed from the array before 'delete'
    * FilterMatcher now uses (input) content to guess better.

diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index f89e662..87ae3d3 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -33,6 +33,7 @@
 #include <sfx2/docfilt.hxx>
 #include <sfx2/fcontnr.hxx>
 #include "osl/file.hxx"
+#include "sfx2/app.hxx"
 #include <svl/fstathelper.hxx>
 
 #include "dispatchwatcher.hxx"
@@ -96,10 +97,14 @@ static String impl_GetFilterFromExt( OUString aUrl, SfxFilterFlags nFlags,
     SfxMedium* pMedium = new SfxMedium( aUrl,
                                         STREAM_STD_READ, sal_False );
     const SfxFilter *pSfxFilter = NULL;
-    SfxFilterMatcher aMatcher;
     if( nFlags == SFX_FILTER_EXPORT )
-        aMatcher = SfxFilterMatcher( aAppl );
-    aMatcher.GuessFilterIgnoringContent( *pMedium, &pSfxFilter, nFlags, 0 );
+    {
+        SfxFilterMatcher( aAppl ).GuessFilterIgnoringContent( *pMedium, &pSfxFilter, nFlags, 0 );
+    }
+    else
+    {
+        SFX_APP()->GetFilterMatcher().GuessFilter( *pMedium, &pSfxFilter, nFlags, 0 );
+    }
     if( pSfxFilter )
         aFilter = ( nFlags == SFX_FILTER_EXPORT ) ? pSfxFilter->GetFilterName() :
                                                     pSfxFilter->GetServiceName();
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 42a9203..356a58c 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -308,8 +308,12 @@ SfxFilterMatcher::SfxFilterMatcher()
 SfxFilterMatcher::~SfxFilterMatcher()
 {
     if ( !pImpl->aName.getLength() )
+    {
         // only the global Matcher owns his ImplData
+        if( pImplArr )
+            pImplArr->Remove( pImpl );
         delete pImpl;
+    }
 }
 
 void SfxFilterMatcher_Impl::Update()


More information about the Libreoffice-commits mailing list