summaryrefslogtreecommitdiff
path: root/odk/examples/cpp/complextoolbarcontrols
diff options
context:
space:
mode:
authorAlexandre Vicenzi <vicenzi.alexandre@gmail.com>2014-01-31 02:42:47 -0200
committerStephan Bergmann <sbergman@redhat.com>2014-01-31 11:41:05 +0100
commit4f63a5fa269678cdc021f5c280f697e53771545a (patch)
treefdf0bfc0d65835e565d37b4227825575ba038559 /odk/examples/cpp/complextoolbarcontrols
parent3a05aabe4190fc948ebdc94a14a15872f977ba0c (diff)
fdo#54938 Convert odk to cppu::supportsService
Change-Id: Ia5095367be90dd5383e7701ea2587f79a7505a67 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'odk/examples/cpp/complextoolbarcontrols')
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/MyJob.cxx9
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/MyListener.cxx10
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx11
3 files changed, 6 insertions, 24 deletions
diff --git a/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx b/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx
index 3a00c1658e85..bb7580ba75ce 100644
--- a/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <cppuhelper/supportsservice.hxx>
using rtl::OUString;
using com::sun::star::uno::Sequence;
@@ -57,12 +58,6 @@ OUString MyJob_getImplementationName ()
#define SERVICE_NAME "com.sun.star.task.Job"
-sal_Bool SAL_CALL MyJob_supportsService( const OUString& ServiceName )
- throw (RuntimeException)
-{
- return ServiceName == SERVICE_NAME;
-}
-
Sequence< OUString > SAL_CALL MyJob_getSupportedServiceNames( )
throw (RuntimeException)
{
@@ -90,7 +85,7 @@ OUString SAL_CALL MyJob::getImplementationName( )
sal_Bool SAL_CALL MyJob::supportsService( const OUString& rServiceName )
throw (RuntimeException)
{
- return MyJob_supportsService( rServiceName );
+ return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL MyJob::getSupportedServiceNames( )
diff --git a/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx b/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx
index bea997603bf5..82f8d01a303e 100644
--- a/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx
@@ -23,16 +23,15 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <cppuhelper/supportsservice.hxx>
MyListener::MyListener(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
: m_xSMGR(xSMGR)
{}
-
MyListener::~MyListener()
{}
-
css::uno::Any SAL_CALL MyListener::execute(const css::uno::Sequence< css::beans::NamedValue >& lArguments)
throw (css::lang::IllegalArgumentException,
css::uno::Exception,
@@ -105,14 +104,12 @@ css::uno::Any SAL_CALL MyListener::execute(const css::uno::Sequence< css::beans:
return css::uno::Any();
}
-
::rtl::OUString SAL_CALL MyListener::getImplementationName()
throw (css::uno::RuntimeException)
{
return ::rtl::OUString( MYLISTENER_IMPLEMENTATIONNAME );
}
-
css::uno::Sequence< ::rtl::OUString > SAL_CALL MyListener::getSupportedServiceNames()
throw (css::uno::RuntimeException)
{
@@ -121,15 +118,12 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL MyListener::getSupportedServiceNa
return lNames;
}
-
sal_Bool SAL_CALL MyListener::supportsService(const ::rtl::OUString& sServiceName)
throw (css::uno::RuntimeException)
{
- return sServiceName== MYLISTENER_SERVICENAME ||
- sServiceName == "com.sun.star.task.Job";
+ return cppu::supportsService(this, sServiceName);
}
-
css::uno::Reference< css::uno::XInterface > MyListener::st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
{
MyListener* pListener = new MyListener(xSMGR);
diff --git a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx
index 61ab750d3a50..41fc283b202d 100644
--- a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/system/SystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/XSystemShellExecute.hpp>
+#include <cppuhelper/supportsservice.hxx>
using namespace com::sun::star::awt;
using namespace com::sun::star::frame;
@@ -167,13 +168,6 @@ Sequence < Reference< XDispatch > > SAL_CALL MyProtocolHandler::queryDispatches(
return ::rtl::OUString( MYPROTOCOLHANDLER_IMPLEMENTATIONNAME );
}
-sal_Bool SAL_CALL MyProtocolHandler_supportsService( const ::rtl::OUString& ServiceName )
- throw (RuntimeException)
-{
- return ServiceName == MYPROTOCOLHANDLER_SERVICENAME ||
- ServiceName == "com.sun.star.frame.ProtocolHandler";
-}
-
Sequence< ::rtl::OUString > SAL_CALL MyProtocolHandler_getSupportedServiceNames( )
throw (RuntimeException)
{
@@ -200,7 +194,7 @@ Reference< XInterface > SAL_CALL MyProtocolHandler_createInstance( const Referen
sal_Bool SAL_CALL MyProtocolHandler::supportsService( const ::rtl::OUString& rServiceName )
throw (RuntimeException)
{
- return MyProtocolHandler_supportsService( rServiceName );
+ return cppu::supportsService(this, rServiceName);
}
Sequence< ::rtl::OUString > SAL_CALL MyProtocolHandler::getSupportedServiceNames( )
@@ -500,7 +494,6 @@ BaseDispatch::BaseDispatch( const Reference< XComponentContext > &rxContext,
{
}
-
BaseDispatch::~BaseDispatch()
{
mxFrame.clear();