diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-16 19:25:05 -0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-17 14:43:28 +0200 |
commit | 3d3293144b0e0d2d28136b1b2c7154d6352463b8 (patch) | |
tree | 1ef57838dc7fa88515a69dce12612e6071bc08b9 /oox | |
parent | 6fe26facd06d4d1e5e37384d25d83209209229fa (diff) |
fdo#54938: Adapt svtools and comphelper module ...
to use cppu::supportsService and other pieces.
Change-Id: I16893b3d31a8055acd214ff23d01e63d38fe0826
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/fasttokenhandler.cxx | 16 | ||||
-rw-r--r-- | oox/source/core/filterdetect.cxx | 6 | ||||
-rw-r--r-- | oox/source/docprop/ooxmldocpropimport.cxx | 19 |
3 files changed, 7 insertions, 34 deletions
diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx index c71f966b587c..f57739c92d1c 100644 --- a/oox/source/core/fasttokenhandler.cxx +++ b/oox/source/core/fasttokenhandler.cxx @@ -22,17 +22,13 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include "oox/helper/helper.hxx" #include "oox/token/tokenmap.hxx" +#include <cppuhelper/supportsservice.hxx> namespace oox { namespace core { -// ============================================================================ - using namespace ::com::sun::star::uno; - -// ============================================================================ - OUString SAL_CALL FastTokenHandler_getImplementationName() { return OUString( "com.sun.star.comp.oox.core.FastTokenHandler" ); @@ -50,8 +46,6 @@ Reference< XInterface > SAL_CALL FastTokenHandler_createInstance( const Referenc return static_cast< ::cppu::OWeakObject* >( new FastTokenHandler ); } -// ============================================================================ - FastTokenHandler::FastTokenHandler() : mrTokenMap( StaticTokenMap::get() ) { @@ -62,7 +56,6 @@ FastTokenHandler::~FastTokenHandler() } // XServiceInfo - OUString SAL_CALL FastTokenHandler::getImplementationName() throw (RuntimeException) { return FastTokenHandler_getImplementationName(); @@ -70,11 +63,7 @@ OUString SAL_CALL FastTokenHandler::getImplementationName() throw (RuntimeExcept sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aServiceNames = FastTokenHandler_getSupportedServiceNames(); - for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex ) - if( aServiceNames[ nIndex ] == rServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, rServiceName); } Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames() throw (RuntimeException) @@ -83,7 +72,6 @@ Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames() throw } // XFastTokenHandler - sal_Int32 FastTokenHandler::getToken( const OUString& rIdentifier ) throw( RuntimeException ) { return mrTokenMap.getTokenFromUnicode( rIdentifier ); diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx index 154cee0d8bde..ffa44a39c56f 100644 --- a/oox/source/core/filterdetect.cxx +++ b/oox/source/core/filterdetect.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/io/XStream.hpp> #include <comphelper/docpasswordhelper.hxx> #include <comphelper/mediadescriptor.hxx> +#include <cppuhelper/supportsservice.hxx> #include "oox/core/fastparser.hxx" #include "oox/helper/attributelist.hxx" @@ -382,10 +383,7 @@ OUString SAL_CALL FilterDetect::getImplementationName() throw( RuntimeException sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName ) throw( RuntimeException ) { - const Sequence< OUString > aServices = FilterDetect_getSupportedServiceNames(); - const OUString* pArray = aServices.getConstArray(); - const OUString* pArrayEnd = pArray + aServices.getLength(); - return ::std::find( pArray, pArrayEnd, rServiceName ) != pArrayEnd; + return cppu::supportsService(this, rServiceName); } Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames() throw( RuntimeException ) diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx index f4d3092e83ee..2361bd1ccd74 100644 --- a/oox/source/docprop/ooxmldocpropimport.cxx +++ b/oox/source/docprop/ooxmldocpropimport.cxx @@ -30,11 +30,11 @@ #include "oox/helper/helper.hxx" #include "docprophandler.hxx" +#include <cppuhelper/supportsservice.hxx> + namespace oox { namespace docprop { -// ============================================================================ - using namespace ::com::sun::star::beans; using namespace ::com::sun::star::document; using namespace ::com::sun::star::embed; @@ -43,9 +43,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; - -// ============================================================================ - OUString SAL_CALL DocumentPropertiesImport_getImplementationName() { return OUString( "com.sun.star.comp.oox.docprop.DocumentPropertiesImporter" ); @@ -63,8 +60,6 @@ Reference< XInterface > SAL_CALL DocumentPropertiesImport_createInstance( const return static_cast< ::cppu::OWeakObject* >( new DocumentPropertiesImport( rxContext ) ); } -// ============================================================================ - namespace { Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxStorage, const OUString& rStreamType ) throw (RuntimeException) @@ -103,15 +98,12 @@ Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxSto } // namespace -// ============================================================================ - DocumentPropertiesImport::DocumentPropertiesImport( const Reference< XComponentContext >& rxContext ) : mxContext( rxContext ) { } // XServiceInfo - OUString SAL_CALL DocumentPropertiesImport::getImplementationName() throw (RuntimeException) { return DocumentPropertiesImport_getImplementationName(); @@ -119,11 +111,7 @@ OUString SAL_CALL DocumentPropertiesImport::getImplementationName() throw (Runti sal_Bool SAL_CALL DocumentPropertiesImport::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aServiceNames = DocumentPropertiesImport_getSupportedServiceNames(); - for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex ) - if( aServiceNames[ nIndex ] == rServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, rServiceName); } Sequence< OUString > SAL_CALL DocumentPropertiesImport::getSupportedServiceNames() throw (RuntimeException) @@ -132,7 +120,6 @@ Sequence< OUString > SAL_CALL DocumentPropertiesImport::getSupportedServiceNames } // XOOXMLDocumentPropertiesImporter - void SAL_CALL DocumentPropertiesImport::importProperties( const Reference< XStorage >& rxSource, const Reference< XDocumentProperties >& rxDocumentProperties ) throw (RuntimeException, IllegalArgumentException, SAXException, Exception) |