summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@novell.com>2011-05-02 16:57:21 +0530
committerPetr Mladek <pmladek@suse.cz>2011-06-23 18:06:20 +0200
commit48f79d786a01fc51939243e4ad26f76fd183cdd8 (patch)
treea217041de0754431e99edbef6ddf34f6afbe0f01
parent9c17674951760b8a64276ee8e1c6496e21ad756e (diff)
Fixed a crasher. Also, improved batch conversion (fdo#37412, bnc#690798)
* The pointer is not removed from the array before 'delete' * FilterMatcher now uses (input) content to guess better. Signed-off-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r--desktop/source/app/dispatchwatcher.cxx11
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx4
2 files changed, 12 insertions, 3 deletions
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index f89e662c82..87ae3d3dd0 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 93fb392f42..f8fcc108cc 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -302,8 +302,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()