summaryrefslogtreecommitdiff
path: root/cppuhelper/source/factory.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-14 19:27:00 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-14 19:32:30 +0200
commit2171077c0c3c43a61546ab2c0ae68ba63c5112f7 (patch)
tree09461b7faec131f25b223b4bcbb2bf5b2a701763 /cppuhelper/source/factory.cxx
parent3ed834ae87eca0f6c486666699112a95edb74abb (diff)
Introduce cppu::supportsService helper, adapt some call-sites
...more to follow (easy hack?) Change-Id: Icb02626495701a3905c124c7368b98c3258e91b2
Diffstat (limited to 'cppuhelper/source/factory.cxx')
-rw-r--r--cppuhelper/source/factory.cxx13
1 files changed, 3 insertions, 10 deletions
diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx
index dc46aa8a09f5..6747892e3efc 100644
--- a/cppuhelper/source/factory.cxx
+++ b/cppuhelper/source/factory.cxx
@@ -34,6 +34,7 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/shlib.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <rtl/instance.hxx>
#include <rtl/unload.h>
@@ -258,13 +259,7 @@ sal_Bool OSingleFactoryHelper::supportsService(
const OUString& ServiceName )
throw(::com::sun::star::uno::RuntimeException)
{
- Sequence< OUString > seqServices = getSupportedServiceNames();
- const OUString * pServices = seqServices.getConstArray();
- for( sal_Int32 i = 0; i < seqServices.getLength(); i++ )
- if( pServices[i] == ServiceName )
- return sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
// XServiceInfo
@@ -1012,9 +1007,7 @@ sal_Bool OFactoryProxyHelper::supportsService(const OUString& ServiceName)
throw(::com::sun::star::uno::RuntimeException)
{
Reference<XServiceInfo > xInfo( xFactory, UNO_QUERY );
- if( xInfo.is() )
- return xInfo->supportsService( ServiceName );
- return sal_False;
+ return xInfo.is() && xInfo->supportsService( ServiceName );
}
// XServiceInfo