summaryrefslogtreecommitdiff
path: root/scripting/source/dlgprov
diff options
context:
space:
mode:
Diffstat (limited to 'scripting/source/dlgprov')
-rw-r--r--scripting/source/dlgprov/DialogModelProvider.cxx8
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx13
2 files changed, 4 insertions, 17 deletions
diff --git a/scripting/source/dlgprov/DialogModelProvider.cxx b/scripting/source/dlgprov/DialogModelProvider.cxx
index aee0a9a16ec5..2c1268bdf910 100644
--- a/scripting/source/dlgprov/DialogModelProvider.cxx
+++ b/scripting/source/dlgprov/DialogModelProvider.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/resource/XStringResourceManager.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <cppuhelper/supportsservice.hxx>
// component helper namespace
namespace comp_DialogModelProvider {
@@ -165,12 +166,7 @@ OUString SAL_CALL DialogModelProvider::getImplementationName() throw (css::uno::
::sal_Bool SAL_CALL DialogModelProvider::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException)
{
- css::uno::Sequence< OUString > serviceNames = comp_DialogModelProvider::_getSupportedServiceNames();
- for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
- if (serviceNames[i] == serviceName)
- return sal_True;
- }
- return sal_False;
+ return cppu::supportsService(this, serviceName);
}
css::uno::Sequence< OUString > SAL_CALL DialogModelProvider::getSupportedServiceNames() throw (css::uno::RuntimeException)
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index e7954d8c2b41..281eb24d8523 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -44,6 +44,7 @@
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
#include <xmlscript/xmldlg_imexp.hxx>
@@ -592,21 +593,11 @@ static OUString aResourceResolverPropName("ResourceResolver");
return getImplementationName_DialogProviderImpl();
}
- // -----------------------------------------------------------------------------
-
sal_Bool DialogProviderImpl::supportsService( const OUString& rServiceName ) throw (RuntimeException)
{
- Sequence< OUString > aNames( getSupportedServiceNames() );
- const OUString* pNames = aNames.getConstArray();
- const OUString* pEnd = pNames + aNames.getLength();
- for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames )
- ;
-
- return pNames != pEnd;
+ return cppu::supportsService(this, rServiceName);
}
- // -----------------------------------------------------------------------------
-
Sequence< OUString > DialogProviderImpl::getSupportedServiceNames( ) throw (RuntimeException)
{
return getSupportedServiceNames_DialogProviderImpl();