diff options
Diffstat (limited to 'sfx2/source/bastyp/fltfnc.cxx')
-rw-r--r-- | sfx2/source/bastyp/fltfnc.cxx | 194 |
1 files changed, 70 insertions, 124 deletions
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index a739230d53..6d953aae8c 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,9 +41,7 @@ #include <comphelper/sequenceashashmap.hxx> -#ifndef _EXCHANGE_HXX //autogen #include <sot/exchange.hxx> -#endif #include <tools/config.hxx> #include <basic/sbmeth.hxx> #include <basic/basmgr.hxx> @@ -50,12 +49,8 @@ #include <basic/sbxobj.hxx> #include <basic/sbxmeth.hxx> #include <basic/sbxcore.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif -#ifndef _RTL_USTRING_HXX //autogen #include <rtl/ustring.hxx> -#endif #include <rtl/ustrbuf.hxx> #include <svl/eitem.hxx> #include <svl/intitem.hxx> @@ -84,9 +79,7 @@ #include <com/sun/star/frame/XFilterDetect.hpp> #include <com/sun/star/loader/XImplementationLoader.hpp> #include <com/sun/star/loader/CannotActivateFactoryException.hpp> -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include <comphelper/processfactory.hxx> -#endif #include <com/sun/star/beans/PropertyValue.hpp> #include <sal/types.h> @@ -241,10 +234,9 @@ const SfxFilter* SfxFilterContainer::GetDefaultFilter_Impl( const String& rName if ( bFirstRead ) ReadFilters_Impl(); - sal_uInt16 nCount = ( sal_uInt16 ) pFilterArr->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pFilterArr->size(); i < n; ++i ) { - const SfxFilter* pCheckFilter = pFilterArr->GetObject( n ); + const SfxFilter* pCheckFilter = pFilterArr->at( i ); if ( pCheckFilter->GetServiceName().CompareIgnoreCaseToAscii( sServiceName ) == COMPARE_EQUAL ) { pFilter = pCheckFilter; @@ -322,12 +314,12 @@ void SfxFilterMatcher_Impl::Update() if ( pList ) { // this List was already used - pList->Clear(); - for ( USHORT n=0; n<pFilterArr->Count(); n++ ) + pList->clear(); + for ( size_t i = 0, n = pFilterArr->size(); i < n; ++i ) { - SfxFilter* pFilter = pFilterArr->GetObject(n); + SfxFilter* pFilter = pFilterArr->at( i ); if ( pFilter->GetServiceName() == String(aName) ) - pList->Insert( pFilter, LIST_APPEND ); + pList->push_back( pFilter ); } } } @@ -357,10 +349,9 @@ void SfxFilterMatcher_Impl::InitForIterating() const const SfxFilter* SfxFilterMatcher::GetAnyFilter( SfxFilterFlags nMust, SfxFilterFlags nDont ) const { pImpl->InitForIterating(); - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pImpl->pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); + const SfxFilter* pFilter = pImpl->pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) ) return pFilter; @@ -374,10 +365,10 @@ const SfxFilter* SfxFilterMatcher::GetAnyFilter( SfxFilterFlags nMust, SfxFilter sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter**ppFilter, - SfxFilterFlags /*nMust*/, - SfxFilterFlags /*nDont*/ ) const + SfxFilterFlags nMust, + SfxFilterFlags nDont ) const { - Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection")), UNO_QUERY ); + Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection"))), UNO_QUERY ); ::rtl::OUString sTypeName; try { @@ -390,7 +381,11 @@ sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent( *ppFilter = NULL; if ( sTypeName.getLength() ) - *ppFilter = GetFilter4EA( sTypeName ); + { + // make sure filter list is initialized + pImpl->InitForIterating(); + *ppFilter = GetFilter4EA( sTypeName, nMust, nDont ); + } return *ppFilter ? ERRCODE_NONE : ERRCODE_ABORT; } @@ -425,7 +420,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c const SfxFilter* pOldFilter = *ppFilter; // no detection service -> nothing to do ! - Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection")), UNO_QUERY ); + Reference< XTypeDetection > xDetection( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection"))), UNO_QUERY ); if (!xDetection.is()) return ERRCODE_ABORT; @@ -471,7 +466,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c // The DocumentService property is only a preselection, and all preselections are considered as optional! // This "wrong" type will be sorted out now because we match only allowed filters to the detected type ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > lQuery(1); - lQuery[0].Name = ::rtl::OUString::createFromAscii("Name"); + lQuery[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); lQuery[0].Value <<= sTypeName; const SfxFilter* pFilter = GetFilterForProps(lQuery, nMust, nDont); @@ -493,7 +488,7 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter ) { if ( pFilter->GetFilterFlags() & SFX_FILTER_MUSTINSTALL ) { - // Hier k"onnte noch eine Nachinstallation angeboten werden + // Here could a re-installation be offered String aText( SfxResId( STR_FILTER_NOT_INSTALLED ) ); aText.SearchAndReplaceAscii( "$(FILTER)", pFilter->GetUIName() ); QueryBox aQuery( NULL, WB_YES_NO | WB_DEF_YES, aText ); @@ -501,11 +496,11 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter ) if ( nRet == RET_YES ) { #ifdef DBG_UTIL - // Setup starten - InfoBox( NULL, DEFINE_CONST_UNICODE("Hier soll jetzt das Setup starten!") ).Execute(); + // Start Setup + InfoBox( NULL, DEFINE_CONST_UNICODE("Here should the Setup now be starting!") ).Execute(); #endif - // Installation mu\s hier noch mitteilen, ob es geklappt hat, dann kann das - // Filterflag gel"oscht werden + // Installation must still give feedback if it worked or not, + // then the Filterflag be deleted } return ( !(pFilter->GetFilterFlags() & SFX_FILTER_MUSTINSTALL) ); @@ -523,9 +518,9 @@ sal_Bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter ) sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**ppFilter, sal_Bool /*bPlugIn*/, sal_Bool bAPI ) const -/* [Beschreibung] +/* [Description] - Hier wird noch die Filterauswahlbox hochgezogen. Sonst GuessFilter + Here the Filter selection box is pulled up. Otherwise GuessFilter */ { @@ -564,17 +559,18 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter** { const SfxFilter* pInstallFilter = NULL; - // Jetzt auch Filter testen, die nicht installiert sind ( ErrCode ist irrelevant ) + // Now test the filter which are not installed (ErrCode is irrelevant) GuessFilter( rMedium, &pInstallFilter, SFX_FILTER_IMPORT, SFX_FILTER_CONSULTSERVICE ); if ( pInstallFilter ) { if ( IsFilterInstalled_Impl( pInstallFilter ) ) - // Eventuell wurde der Filter nachinstalliert + // Maybe the filter was installed was installed afterwards. pFilter = pInstallFilter; } else { - // Jetzt auch Filter testen, die erst von Star bezogen werden m"ussen ( ErrCode ist irrelevant ) + // Now test the filter, which first must be obtained by Star + // (ErrCode is irrelevant) GuessFilter( rMedium, &pInstallFilter, SFX_FILTER_IMPORT, 0 ); if ( pInstallFilter ) IsFilterInstalled_Impl( pInstallFilter ); @@ -590,37 +586,7 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter** if( STRING_NOTFOUND != aFlags.Search( 'H' ) ) bHidden = sal_True; } -/* - if ( ( !pFilter || nErr == ERRCODE_SFX_CONSULTUSER ) && !bAPI && !bHidden ) - { - if ( !pFilter ) - pFilter = pOldFilter; - String aTmpName; - if ( pFilter ) - aTmpName = pFilter->GetUIName(); - - SfxFilterMatcher *pMatcher; - if( bPlugIn && pFilter ) - pMatcher = new SfxFilterMatcher( (SfxFilterContainer *) pFilter->GetFilterContainer() ); - else - pMatcher = (SfxFilterMatcher*) this; - - SfxFilterDialog *pDlg = new SfxFilterDialog( 0, &rMedium, *pMatcher, pFilter ? &aTmpName: 0, 0 ); - const sal_Bool bOk = RET_OK == pDlg->Execute(); - if (bOk) - pFilter = pMatcher->GetFilter4UIName( pDlg->GetSelectEntry()); - - if( bPlugIn && pFilter ) - delete pMatcher; - delete pDlg; - - if ( !bOk) - nErr = ERRCODE_ABORT; - else - nErr = ERRCODE_NONE; - } -*/ *ppFilter = pFilter; if ( bHidden || (bAPI && nErr == ERRCODE_SFX_CONSULTUSER) ) @@ -644,7 +610,7 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno: ::rtl::OUString aValue; // try to get the preferred filter (works without loading all filters!) - if ( (aProps[::rtl::OUString::createFromAscii("PreferredFilter")] >>= aValue) && aValue.getLength() ) + if ( (aProps[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter"))] >>= aValue) && aValue.getLength() ) { const SfxFilter* pFilter = SfxFilter::GetFilterByName( aValue ); if ( !pFilter || (pFilter->GetFilterFlags() & nMust) != nMust || (pFilter->GetFilterFlags() & nDont ) ) @@ -660,7 +626,7 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno: { // preferred filter belongs to another document type; now we must search the filter pImpl->InitForIterating(); - aProps[::rtl::OUString::createFromAscii("Name")] >>= aValue; + aProps[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"))] >>= aValue; pFilter = GetFilter4EA( aValue, nMust, nDont ); if ( pFilter ) return pFilter; @@ -681,10 +647,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const String& rMediaType,SfxF { if ( pImpl->pList ) { - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pImpl->pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); + const SfxFilter* pFilter = pImpl->pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetMimeType() == rMediaType ) return pFilter; @@ -694,7 +659,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Mime( const String& rMediaType,SfxF } com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString::createFromAscii("MediaType"); + aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); aSeq[0].Value <<= ::rtl::OUString( rMediaType ); return GetFilterForProps( aSeq, nMust, nDont ); } @@ -703,11 +668,10 @@ const SfxFilter* SfxFilterMatcher::GetFilter4EA( const String& rType,SfxFilterFl { if ( pImpl->pList ) { - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); const SfxFilter* pFirst = 0; - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pImpl->pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); + const SfxFilter* pFilter = pImpl->pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetTypeName() == rType ) { @@ -724,7 +688,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4EA( const String& rType,SfxFilterFl } com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString::createFromAscii("Name"); + aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); aSeq[0].Value <<= ::rtl::OUString( rType ); return GetFilterForProps( aSeq, nMust, nDont ); } @@ -733,10 +697,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const String& rExt, SfxF { if ( pImpl->pList ) { - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pImpl->pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); + const SfxFilter* pFilter = pImpl->pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) ) { @@ -764,7 +727,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const String& rExt, SfxF sExt.Erase(0,1); com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString::createFromAscii("Extensions"); + aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Extensions")); ::com::sun::star::uno::Sequence < ::rtl::OUString > aExts(1); aExts[0] = sExt; aSeq[0].Value <<= aExts; @@ -773,28 +736,12 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const String& rExt, SfxF const SfxFilter* SfxFilterMatcher::GetFilter4ClipBoardId( sal_uInt32 nId, SfxFilterFlags nMust, SfxFilterFlags nDont ) const { - /* - if ( pImpl->pList ) - { - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) - { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); - SfxFilterFlags nFlags = pFilter->GetFilterFlags(); - if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetFormat() == nId ) - return pFilter; - } - - return 0; - } - */ - if (nId == 0) return 0; com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1); ::rtl::OUString aName = SotExchange::GetFormatName( nId ); - aSeq[0].Name = ::rtl::OUString::createFromAscii("ClipboardFormat"); + aSeq[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ClipboardFormat")); aSeq[0].Value <<= aName; return GetFilterForProps( aSeq, nMust, nDont ); } @@ -803,10 +750,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4UIName( const String& rName, SfxFil { pImpl->InitForIterating(); const SfxFilter* pFirstFilter=0; - sal_uInt16 nCount = ( sal_uInt16 ) pImpl->pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pImpl->pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pImpl->pList->GetObject( n ); + const SfxFilter* pFilter = pImpl->pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetUIName() == rName ) @@ -847,9 +793,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const String& rName, Sf CreateFilterArr(); else { - for( sal_uInt16 n=0; n<pFilterArr->Count(); n++ ) + for ( size_t i = 0, n = pFilterArr->size(); i < n; ++i ) { - const SfxFilter* pFilter = pFilterArr->GetObject( n ); + const SfxFilter* pFilter = pFilterArr->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetFilterName().CompareIgnoreCaseToAscii( aName ) == COMPARE_EQUAL ) return pFilter; @@ -864,10 +810,9 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const String& rName, Sf if ( !pList ) pList = pFilterArr; - sal_uInt16 nCount = ( sal_uInt16 ) pList->Count(); - for( sal_uInt16 n = 0; n < nCount; n++ ) + for ( size_t i = 0, n = pList->size(); i < n; ++i ) { - const SfxFilter* pFilter = pList->GetObject( n ); + const SfxFilter* pFilter = pList->at( i ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetFilterName().CompareIgnoreCaseToAscii( aName ) == COMPARE_EQUAL ) return pFilter; @@ -893,7 +838,7 @@ SfxFilterMatcherIter::SfxFilterMatcherIter( : nOrMask( nOrMaskP ), nAndMask( nAndMaskP ), nCurrent(0), pMatch( pMatchP->pImpl) { - if( nOrMask == 0xffff ) //Wg. Fehlbuild auf s + if( nOrMask == 0xffff ) //Due to falty build on s nOrMask = 0; pMatch->InitForIterating(); } @@ -903,9 +848,9 @@ SfxFilterMatcherIter::SfxFilterMatcherIter( const SfxFilter* SfxFilterMatcherIter::Find_Impl() { const SfxFilter* pFilter = 0; - while( nCurrent < pMatch->pList->Count() ) + while( nCurrent < pMatch->pList->size() ) { - pFilter = pMatch->pList->GetObject(nCurrent++); + pFilter = pMatch->pList->at( nCurrent++ ); SfxFilterFlags nFlags = pFilter->GetFilterFlags(); if( ((nFlags & nOrMask) == nOrMask ) && !(nFlags & nAndMask ) ) break; @@ -998,33 +943,33 @@ void SfxFilterContainer::ReadSingleFilter_Impl( sal_Int32 nFilterProperty = 0 ; for( nFilterProperty=0; nFilterProperty<nFilterPropertyCount; ++nFilterProperty ) { - if( lFilterProperties[nFilterProperty].Name.compareToAscii( "FileFormatVersion" ) == 0 ) + if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FileFormatVersion")) ) { lFilterProperties[nFilterProperty].Value >>= nFormatVersion; } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "TemplateName" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TemplateName")) ) { lFilterProperties[nFilterProperty].Value >>= sDefaultTemplate; } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "Flags" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Flags")) ) { lFilterProperties[nFilterProperty].Value >>= nFlags; } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "UIName" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UIName")) ) { lFilterProperties[nFilterProperty].Value >>= sUIName; } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "UserData" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UserData")) ) { ::com::sun::star::uno::Sequence< ::rtl::OUString > lUserData; lFilterProperties[nFilterProperty].Value >>= lUserData; sUserData = implc_convertStringlistToString( lUserData, ',', ::rtl::OUString() ); } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "DocumentService" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DocumentService")) ) { lFilterProperties[nFilterProperty].Value >>= sServiceName; } - else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "Type" ) == 0 ) + else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Type")) ) { lFilterProperties[nFilterProperty].Value >>= sType; // Try to get filter .. but look for any exceptions! @@ -1046,25 +991,25 @@ void SfxFilterContainer::ReadSingleFilter_Impl( sal_Int32 nTypeProperty = 0 ; for( nTypeProperty=0; nTypeProperty<nTypePropertyCount; ++nTypeProperty ) { - if( lTypeProperties[nTypeProperty].Name.compareToAscii( "ClipboardFormat" ) == 0 ) + if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ClipboardFormat")) ) { lTypeProperties[nTypeProperty].Value >>= sHumanName; } - else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "DocumentIconID" ) == 0 ) + else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DocumentIconID")) ) { lTypeProperties[nTypeProperty].Value >>= nDocumentIconId; } - else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "MediaType" ) == 0 ) + else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType")) ) { lTypeProperties[nTypeProperty].Value >>= sMimeType; } - else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "Extensions" ) == 0 ) + else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Extensions")) ) { ::com::sun::star::uno::Sequence< ::rtl::OUString > lExtensions; lTypeProperties[nTypeProperty].Value >>= lExtensions; sExtension = implc_convertStringlistToString( lExtensions, ';', DEFINE_CONST_UNICODE("*.") ); } - else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "URLPattern" ) == 0 ) + else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URLPattern")) ) { ::com::sun::star::uno::Sequence< ::rtl::OUString > lPattern; lTypeProperties[nTypeProperty].Value >>= lPattern; @@ -1138,7 +1083,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( pFilter->SetURLPattern(sPattern); if (bNew) - rList.Insert( pFilter, USHRT_MAX ); + rList.push_back( pFilter ); } } @@ -1176,15 +1121,14 @@ void SfxFilterContainer::ReadFilters_Impl( BOOL bUpdate ) // ReadExternalFilters must work in update mode. // Best way seams to mark all filters NOT_INSTALLED // and change it back for all valid filters afterwards. - if( rList.Count() > 0 ) + if( !rList.empty() ) { bUpdate = TRUE; - USHORT nCount = (USHORT)rList.Count(); SfxFilter* pFilter; - for (USHORT f=0; f<nCount; ++f) + for ( size_t i = 0, n = rList.size(); i < n; ++i ) { pFilter = NULL; - pFilter = rList.GetObject(f); + pFilter = rList[ i ]; pFilter->nFormatType |= SFX_FILTER_NOTINSTALLED; } } @@ -1204,7 +1148,7 @@ void SfxFilterContainer::ReadFilters_Impl( BOOL bUpdate ) // And conditional breakpoints on unicode values seams not to be supported .-( #ifdef DEBUG bool bDBGStop = FALSE; - if (sFilterName.indexOf(::rtl::OUString::createFromAscii("DBG_"))>-1) + if (sFilterName.indexOf(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DBG_")))>-1) bDBGStop = TRUE; #endif @@ -1225,3 +1169,5 @@ void SfxFilterContainer::ReadFilters_Impl( BOOL bUpdate ) pImplArr->GetObject(n)->Update(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |