summaryrefslogtreecommitdiff
path: root/odk/examples/cpp/custompanel
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-10-24 14:55:08 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-25 08:07:04 +0000
commitda5449da0c056a3a0da239eff2e2b8b66cfd6224 (patch)
tree6f6698e676726bd8a07f281a9707e448a711d983 /odk/examples/cpp/custompanel
parent01a13519e2a12e1e9b61bab1437d340e389e44bf (diff)
fdo#54938: More uses of cppu::supportsService
Change-Id: Id6bed78d92eba52283a17ab3ca66e751c225e48d Reviewed-on: https://gerrit.libreoffice.org/6423 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'odk/examples/cpp/custompanel')
-rw-r--r--odk/examples/cpp/custompanel/ctp_factory.cxx20
1 files changed, 2 insertions, 18 deletions
diff --git a/odk/examples/cpp/custompanel/ctp_factory.cxx b/odk/examples/cpp/custompanel/ctp_factory.cxx
index 581e13135479..e2829029f168 100644
--- a/odk/examples/cpp/custompanel/ctp_factory.cxx
+++ b/odk/examples/cpp/custompanel/ctp_factory.cxx
@@ -24,12 +24,10 @@
#include <com/sun/star/lang/NotInitializedException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/XComponent.hpp>
+#include <cppuhelper/supportsservice.hxx>
-//......................................................................................................................
namespace sd { namespace colortoolpanel
{
-//......................................................................................................................
-
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::uno::UNO_QUERY;
@@ -102,40 +100,26 @@ namespace sd { namespace colortoolpanel
return xUIElement;
}
- //------------------------------------------------------------------------------------------------------------------
OUString SAL_CALL ToolPanelFactory::getImplementationName( ) throw (RuntimeException)
{
return getImplementationName_static();
}
- //------------------------------------------------------------------------------------------------------------------
OUString SAL_CALL ToolPanelFactory::getImplementationName_static( ) throw (RuntimeException)
{
return OUString( "org.openoffice.comp.example.custompanel.ToolPanelFactory" );
}
- //------------------------------------------------------------------------------------------------------------------
::sal_Bool SAL_CALL ToolPanelFactory::supportsService( const OUString& i_rServiceName ) throw (RuntimeException)
{
- const Sequence< OUString > aServiceNames( getSupportedServiceNames() );
- for ( const OUString* serviceName = aServiceNames.getConstArray();
- serviceName != aServiceNames.getConstArray() + aServiceNames.getLength();
- ++serviceName
- )
- {
- if ( i_rServiceName == *serviceName )
- return sal_True;
- }
- return sal_False;
+ return cppu::supportsService(this, i_rServiceName);
}
- //------------------------------------------------------------------------------------------------------------------
Sequence< OUString > SAL_CALL ToolPanelFactory::getSupportedServiceNames() throw (RuntimeException)
{
return getSupportedServiceNames_static();
}
- //------------------------------------------------------------------------------------------------------------------
Sequence< OUString > SAL_CALL ToolPanelFactory::getSupportedServiceNames_static() throw (RuntimeException)
{
Sequence< OUString > aServiceNames(1);