summaryrefslogtreecommitdiff
path: root/svtools/source/hatchwindow
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-10-16 19:25:05 -0300
committerStephan Bergmann <sbergman@redhat.com>2013-10-17 14:43:28 +0200
commit3d3293144b0e0d2d28136b1b2c7154d6352463b8 (patch)
tree1ef57838dc7fa88515a69dce12612e6071bc08b9 /svtools/source/hatchwindow
parent6fe26facd06d4d1e5e37384d25d83209209229fa (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 'svtools/source/hatchwindow')
-rw-r--r--svtools/source/hatchwindow/documentcloser.cxx15
-rw-r--r--svtools/source/hatchwindow/hatchwindowfactory.cxx14
2 files changed, 4 insertions, 25 deletions
diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx
index e0de3c2ed98a..9bd174609642 100644
--- a/svtools/source/hatchwindow/documentcloser.cxx
+++ b/svtools/source/hatchwindow/documentcloser.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/frame/DoubleInitializationException.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx>
#include <osl/thread.hxx>
#include <vcl/svapp.hxx>
@@ -220,29 +221,19 @@ void SAL_CALL ODocumentCloser::initialize( const uno::Sequence< uno::Any >& aArg
m_bInitialized = sal_True;
}
-
// XServiceInfo
-// --------------------------------------------------------
OUString SAL_CALL ODocumentCloser::getImplementationName( )
throw (uno::RuntimeException)
{
return impl_staticGetImplementationName();
}
-// --------------------------------------------------------
::sal_Bool SAL_CALL ODocumentCloser::supportsService( const OUString& ServiceName )
throw (uno::RuntimeException)
{
- uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
- for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName == aSeq[nInd] )
- return sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-// --------------------------------------------------------
uno::Sequence< OUString > SAL_CALL ODocumentCloser::getSupportedServiceNames()
throw (uno::RuntimeException)
{
@@ -250,14 +241,12 @@ uno::Sequence< OUString > SAL_CALL ODocumentCloser::getSupportedServiceNames()
}
// Static methods
-// --------------------------------------------------------
uno::Sequence< OUString > SAL_CALL ODocumentCloser::impl_staticGetSupportedServiceNames()
{
const OUString aServiceName( "com.sun.star.embed.DocumentCloser" );
return uno::Sequence< OUString >( &aServiceName, 1 );
}
-// --------------------------------------------------------
OUString SAL_CALL ODocumentCloser::impl_staticGetImplementationName()
{
return OUString( "com.sun.star.comp.embed.DocumentCloser" );
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index 51566f408fba..b4bb86298104 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -21,6 +21,7 @@
#include "hatchwindowfactory.hxx"
#include "hatchwindow.hxx"
#include "cppuhelper/factory.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
#include "documentcloser.hxx"
@@ -66,35 +67,24 @@ uno::Reference< embed::XHatchWindow > SAL_CALL OHatchWindowFactory::createHatchW
return uno::Reference< embed::XHatchWindow >( static_cast< embed::XHatchWindow* >( pResult ) );
}
-//-------------------------------------------------------------------------
OUString SAL_CALL OHatchWindowFactory::getImplementationName()
throw ( uno::RuntimeException )
{
return impl_staticGetImplementationName();
}
-//-------------------------------------------------------------------------
sal_Bool SAL_CALL OHatchWindowFactory::supportsService( const OUString& ServiceName )
throw ( uno::RuntimeException )
{
- uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
- for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName == aSeq[nInd] )
- return sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-//-------------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL OHatchWindowFactory::getSupportedServiceNames()
throw ( uno::RuntimeException )
{
return impl_staticGetSupportedServiceNames();
}
-//-------------------------------------------------------------------------
-
extern "C"
{