From 207e171f99cc3bf8adb51af78524c6c64c5f8e4d Mon Sep 17 00:00:00 2001 From: Sven Jacobi Date: Thu, 22 Feb 2001 10:42:31 +0000 Subject: [PATCH] GraphicFilter api changes --- svx/source/dialog/impgrf.cxx | 23 ++--------------------- svx/source/gallery2/galbrws2.cxx | 24 +++--------------------- 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/svx/source/dialog/impgrf.cxx b/svx/source/dialog/impgrf.cxx index d6188c8b9507..24522d6be616 100644 --- a/svx/source/dialog/impgrf.cxx +++ b/svx/source/dialog/impgrf.cxx @@ -2,9 +2,9 @@ * * $RCSfile: impgrf.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: sj $ $Date: 2001-01-25 15:31:53 $ + * last change: $Author: sj $ $Date: 2001-02-22 11:41:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -210,25 +210,6 @@ USHORT FillFilter( GraphicFilter& rFilter ) { ResMgr* pMgr = DIALOG_MGR(); SvtPathOptions aPathOpt; - String aModulesPath( aPathOpt.GetModulePath() ); - String aFullConfigPath; - - for ( xub_StrLen i = 0, nCount = aModulesPath.GetTokenCount(); i < nCount; i++ ) - { - String aToken( aModulesPath.GetToken( i ) ); - ::rtl::OUString aDest; - ::osl::FileBase::normalizePath( aToken, aDest ); - aDest += ::rtl::OUString( sal_Unicode( '/' ) ); - aDest += ::rtl::OUString( DEFINE_CONST_UNICODE(IMPGRF_GRAPHIC_FILTER_FILE) ); - - if ( aFullConfigPath.Len() ) - aFullConfigPath += sal_Unicode(';'); - ::rtl::OUString aNormalizedPath; - ::osl::FileBase::getSystemPathFromNormalizedPath( aDest, aNormalizedPath ); - aFullConfigPath.Append( String( aNormalizedPath ) ); - } - rFilter.SetConfigPath( aFullConfigPath ); - String aURL; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathOpt.GetFilterPath(), aURL ); INetURLObject aFilterPathUrl( aURL ); diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 7cf544e8dd2f..9675e9d19656 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: galbrws2.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: ka $ $Date: 2000-12-09 16:33:21 $ + * last change: $Author: sj $ $Date: 2001-02-22 11:42:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -737,28 +737,10 @@ String GalleryBrowser2::GetFilterName() const { GraphicFilter* pFilter = GetGrfFilter(); INetURLObject aURL; mpCurTheme->GetURL( mnCurActionPos, aURL ); - const String aExt( aURL.GetExtension() ); - Config& rConfig = pFilter->GetConfig(); - const ByteString aOldGroup( rConfig.GetGroup() ); - USHORT nFilter = GRFILTER_FORMAT_DONTKNOW; - - rConfig.SetGroup( IMP_FILTERSECTION ); - - for( USHORT i = 0, nKeyCount = rConfig.GetKeyCount(); i < nKeyCount; i++ ) - { - const String aStr( rConfig.ReadKey( i ).GetToken(2, ',').GetBuffer(), RTL_TEXTENCODING_UTF8 ); - - if( aStr.CompareIgnoreCaseToAscii( aExt ) == COMPARE_EQUAL ) - { - nFilter = i; - break; - } - } + sal_uInt16 nFilter = pFilter->GetImportFormatNumberForShortName( aURL.GetExtension() ); if( GRFILTER_FORMAT_DONTKNOW != nFilter ) aFilterName = pFilter->GetImportFormatName( nFilter ); - - rConfig.SetGroup( aOldGroup ); } }