fdo#54938: Convert sw to use cppu::supportsService

Change-Id: Ic27bf31e5eb991ccceb8b97713d1e50a736709c8
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Marcos Paulo de Souza 2013-12-05 19:17:18 -02:00 committed by Stephan Bergmann
parent 28de078a73
commit 2f50ce6cfa
31 changed files with 129 additions and 297 deletions

View File

@ -23,6 +23,7 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <unotools/accessiblestatesethelper.hxx> #include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <cellfrm.hxx> #include <cellfrm.hxx>
#include <tabfrm.hxx> #include <tabfrm.hxx>
@ -247,14 +248,10 @@ OUString SAL_CALL SwAccessibleCell::getImplementationName()
return OUString(sImplementationName); return OUString(sImplementationName);
} }
sal_Bool SAL_CALL SwAccessibleCell::supportsService( sal_Bool SAL_CALL SwAccessibleCell::supportsService(const OUString& sTestServiceName)
const OUString& sTestServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return sTestServiceName.equalsAsciiL( sServiceName, return cppu::supportsService(this, sTestServiceName);
sizeof(sServiceName)-1 ) ||
sTestServiceName.equalsAsciiL( sAccessibleServiceName,
sizeof(sAccessibleServiceName)-1 );
} }
uno::Sequence< OUString > SAL_CALL SwAccessibleCell::getSupportedServiceNames() uno::Sequence< OUString > SAL_CALL SwAccessibleCell::getSupportedServiceNames()

View File

@ -44,6 +44,7 @@
#include <acccontext.hxx> #include <acccontext.hxx>
#include <svx/AccessibleShape.hxx> #include <svx/AccessibleShape.hxx>
#include <comphelper/accessibleeventnotifier.hxx> #include <comphelper/accessibleeventnotifier.hxx>
#include <cppuhelper/supportsservice.hxx>
#include "accpara.hxx" #include "accpara.hxx"
#include <PostItMgr.hxx> #include <PostItMgr.hxx>
@ -988,12 +989,10 @@ OUString SAL_CALL SwAccessibleContext::getImplementationName()
THROW_RUNTIME_EXCEPTION( lang::XServiceInfo, "implementation name needs to be overloaded" ) THROW_RUNTIME_EXCEPTION( lang::XServiceInfo, "implementation name needs to be overloaded" )
} }
sal_Bool SAL_CALL sal_Bool SAL_CALL SwAccessibleContext::supportsService (const OUString& ServiceName)
SwAccessibleContext::supportsService (const OUString& )
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
OSL_ENSURE( !this, "supports service needs to be overloaded" ); return cppu::supportsService(this, ServiceName);
THROW_RUNTIME_EXCEPTION( lang::XServiceInfo, "supports service needs to be overloaded" )
} }
uno::Sequence< OUString > SAL_CALL SwAccessibleContext::getSupportedServiceNames() uno::Sequence< OUString > SAL_CALL SwAccessibleContext::getSupportedServiceNames()

View File

@ -29,6 +29,7 @@
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <viewsh.hxx> #include <viewsh.hxx>
#include <doc.hxx> #include <doc.hxx>
#include <accmap.hxx> #include <accmap.hxx>
@ -435,14 +436,10 @@ OUString SAL_CALL SwAccessibleDocument::getImplementationName()
return OUString(sImplementationName); return OUString(sImplementationName);
} }
sal_Bool SAL_CALL SwAccessibleDocument::supportsService( sal_Bool SAL_CALL SwAccessibleDocument::supportsService(const OUString& sTestServiceName)
const OUString& sTestServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return sTestServiceName.equalsAsciiL( sServiceName, return cppu::supportsService(this, sTestServiceName);
sizeof(sServiceName)-1 ) ||
sTestServiceName.equalsAsciiL( sAccessibleServiceName,
sizeof(sAccessibleServiceName)-1 );
} }
uno::Sequence< OUString > SAL_CALL SwAccessibleDocument::getSupportedServiceNames() uno::Sequence< OUString > SAL_CALL SwAccessibleDocument::getSupportedServiceNames()

View File

@ -21,6 +21,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/uno/RuntimeException.hpp> #include <com/sun/star/uno/RuntimeException.hpp>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <flyfrm.hxx> #include <flyfrm.hxx>
#include "accembedded.hxx" #include "accembedded.hxx"
#include "cntfrm.hxx" #include "cntfrm.hxx"
@ -34,7 +35,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::lang; using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::accessibility; using namespace ::com::sun::star::accessibility;
const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextEmbeddedObject";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleEmbeddedObject"; const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleEmbeddedObject";
SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject( SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject(
@ -80,14 +80,10 @@ OUString SAL_CALL SwAccessibleEmbeddedObject::getImplementationName()
return OUString(sImplementationName); return OUString(sImplementationName);
} }
sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService( sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService(const OUString& sTestServiceName)
const OUString& sTestServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return sTestServiceName.equalsAsciiL( sServiceName, return cppu::supportsService(this, sTestServiceName);
sizeof(sServiceName)-1 ) ||
sTestServiceName.equalsAsciiL( sAccessibleServiceName,
sizeof(sAccessibleServiceName)-1 );
} }
uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServiceNames() uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServiceNames()
@ -95,7 +91,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServi
{ {
uno::Sequence< OUString > aRet(2); uno::Sequence< OUString > aRet(2);
OUString* pArray = aRet.getArray(); OUString* pArray = aRet.getArray();
pArray[0] = OUString( sServiceName ); pArray[0] = "com.sun.star.text.AccessibleTextEmbeddedObject";
pArray[1] = OUString( sAccessibleServiceName ); pArray[1] = OUString( sAccessibleServiceName );
return aRet; return aRet;
} }

View File

@ -22,6 +22,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblestatesethelper.hxx> #include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <ftnfrm.hxx> #include <ftnfrm.hxx>
#include <fmtftn.hxx> #include <fmtftn.hxx>
@ -102,18 +103,10 @@ OUString SAL_CALL SwAccessibleFootnote::getImplementationName()
return OUString(sImplementationNameFootnote); return OUString(sImplementationNameFootnote);
} }
sal_Bool SAL_CALL SwAccessibleFootnote::supportsService( sal_Bool SAL_CALL SwAccessibleFootnote::supportsService(const OUString& sTestServiceName)
const OUString& sTestServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
if( sTestServiceName.equalsAsciiL( sAccessibleServiceName, return cppu::supportsService(this, sTestServiceName);
sizeof(sAccessibleServiceName)-1 ) )
return sal_True;
else if( AccessibleRole::END_NOTE == GetRole() )
return sTestServiceName.equalsAsciiL( sServiceNameEndnote, sizeof(sServiceNameEndnote)-1 );
else
return sTestServiceName.equalsAsciiL( sServiceNameFootnote, sizeof(sServiceNameFootnote)-1 );
} }
Sequence< OUString > SAL_CALL SwAccessibleFootnote::getSupportedServiceNames() Sequence< OUString > SAL_CALL SwAccessibleFootnote::getSupportedServiceNames()

View File

@ -21,6 +21,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/uno/RuntimeException.hpp> #include <com/sun/star/uno/RuntimeException.hpp>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <flyfrm.hxx> #include <flyfrm.hxx>
#include <fmturl.hxx> #include <fmturl.hxx>
#include "accgraphic.hxx" #include "accgraphic.hxx"
@ -30,9 +31,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility; using namespace ::com::sun::star::accessibility;
const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextGraphicObject";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleGraphic";
SwAccessibleGraphic::SwAccessibleGraphic( SwAccessibleGraphic::SwAccessibleGraphic(
SwAccessibleMap* pInitMap, SwAccessibleMap* pInitMap,
const SwFlyFrm* pFlyFrm ) : const SwFlyFrm* pFlyFrm ) :
@ -47,17 +45,13 @@ SwAccessibleGraphic::~SwAccessibleGraphic()
OUString SAL_CALL SwAccessibleGraphic::getImplementationName() OUString SAL_CALL SwAccessibleGraphic::getImplementationName()
throw( RuntimeException ) throw( RuntimeException )
{ {
return OUString(sImplementationName); return OUString("com.sun.star.comp.Writer.SwAccessibleGraphic");
} }
sal_Bool SAL_CALL SwAccessibleGraphic::supportsService( sal_Bool SAL_CALL SwAccessibleGraphic::supportsService(const OUString& sTestServiceName)
const OUString& sTestServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return sTestServiceName.equalsAsciiL( sServiceName, return cppu::supportsService(this, sTestServiceName);
sizeof(sServiceName)-1 ) ||
sTestServiceName.equalsAsciiL( sAccessibleServiceName,
sizeof(sAccessibleServiceName)-1 );
} }
Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames() Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
@ -65,7 +59,7 @@ Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
{ {
Sequence< OUString > aRet(2); Sequence< OUString > aRet(2);
OUString* pArray = aRet.getArray(); OUString* pArray = aRet.getArray();
pArray[0] = OUString( sServiceName ); pArray[0] = "com.sun.star.text.AccessibleTextGraphicObject";
pArray[1] = OUString( sAccessibleServiceName ); pArray[1] = OUString( sAccessibleServiceName );
return aRet; return aRet;
} }

View File

@ -22,6 +22,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblestatesethelper.hxx> #include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <hffrm.hxx> #include <hffrm.hxx>
#include "accheaderfooter.hxx" #include "accheaderfooter.hxx"
@ -32,8 +33,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility; using namespace ::com::sun::star::accessibility;
const sal_Char sServiceNameHeader[] = "com.sun.star.text.AccessibleHeaderView";
const sal_Char sServiceNameFooter[] = "com.sun.star.text.AccessibleFooterView";
const sal_Char sImplementationNameHeader[] = "com.sun.star.comp.Writer.SwAccessibleHeaderView"; const sal_Char sImplementationNameHeader[] = "com.sun.star.comp.Writer.SwAccessibleHeaderView";
const sal_Char sImplementationNameFooter[] = "com.sun.star.comp.Writer.SwAccessibleFooterView"; const sal_Char sImplementationNameFooter[] = "com.sun.star.comp.Writer.SwAccessibleFooterView";
@ -88,18 +87,10 @@ OUString SAL_CALL SwAccessibleHeaderFooter::getImplementationName()
return OUString(sImplementationNameFooter); return OUString(sImplementationNameFooter);
} }
sal_Bool SAL_CALL SwAccessibleHeaderFooter::supportsService( sal_Bool SAL_CALL SwAccessibleHeaderFooter::supportsService(const OUString& sTestServiceName)
const OUString& sTestServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
if( sTestServiceName.equalsAsciiL( sAccessibleServiceName, return cppu::supportsService(this, sTestServiceName);
sizeof(sAccessibleServiceName)-1 ) )
return sal_True;
else if( AccessibleRole::HEADER == GetRole() )
return sTestServiceName.equalsAsciiL( sServiceNameHeader, sizeof(sServiceNameHeader)-1 );
else
return sTestServiceName.equalsAsciiL( sServiceNameFooter, sizeof(sServiceNameFooter)-1 );
} }
Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames() Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames()
@ -108,9 +99,9 @@ Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames
Sequence< OUString > aRet(2); Sequence< OUString > aRet(2);
OUString* pArray = aRet.getArray(); OUString* pArray = aRet.getArray();
if( AccessibleRole::HEADER == GetRole() ) if( AccessibleRole::HEADER == GetRole() )
pArray[0] = OUString( sServiceNameHeader ); pArray[0] = "com.sun.star.text.AccessibleHeaderView";
else else
pArray[0] = OUString( sServiceNameFooter ); pArray[0] = "com.sun.star.text.AccessibleFooterView";
pArray[1] = OUString( sAccessibleServiceName ); pArray[1] = OUString( sAccessibleServiceName );
return aRet; return aRet;
} }

View File

@ -23,6 +23,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include "accpage.hxx" #include "accpage.hxx"
#include "access.hrc" #include "access.hrc"
@ -144,9 +145,7 @@ OUString SwAccessiblePage::getImplementationName( )
sal_Bool SwAccessiblePage::supportsService( const OUString& rServiceName) sal_Bool SwAccessiblePage::supportsService( const OUString& rServiceName)
throw( RuntimeException ) throw( RuntimeException )
{ {
return rServiceName.equalsAsciiL( sServiceName, sizeof(sServiceName)-1 ) || return cppu::supportsService(this, rServiceName);
rServiceName.equalsAsciiL( sAccessibleServiceName,
sizeof(sAccessibleServiceName)-1 );
} }
Sequence<OUString> SwAccessiblePage::getSupportedServiceNames( ) Sequence<OUString> SwAccessiblePage::getSupportedServiceNames( )

View File

@ -91,6 +91,7 @@
#include <parachangetrackinginfo.hxx> #include <parachangetrackinginfo.hxx>
#include <com/sun/star/text/TextMarkupType.hpp> #include <com/sun/star/text/TextMarkupType.hpp>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <reffld.hxx> #include <reffld.hxx>
#include <docufld.hxx> #include <docufld.hxx>
@ -1219,10 +1220,7 @@ sal_Bool SAL_CALL SwAccessibleParagraph::supportsService(
const OUString& sTestServiceName) const OUString& sTestServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return sTestServiceName.equalsAsciiL( sServiceName, return cppu::supportsService(this, sTestServiceName);
sizeof(sServiceName)-1 ) ||
sTestServiceName.equalsAsciiL( sAccessibleServiceName,
sizeof(sAccessibleServiceName)-1 );
} }
uno::Sequence< OUString > SAL_CALL SwAccessibleParagraph::getSupportedServiceNames() uno::Sequence< OUString > SAL_CALL SwAccessibleParagraph::getSupportedServiceNames()

View File

@ -20,10 +20,10 @@
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include "access.hrc" #include "access.hrc"
#include <accpreview.hxx> #include <accpreview.hxx>
const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextDocumentPageView";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleDocumentPageView"; const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleDocumentPageView";
using ::com::sun::star::lang::IndexOutOfBoundsException; using ::com::sun::star::lang::IndexOutOfBoundsException;
@ -51,14 +51,14 @@ OUString SwAccessiblePreview::getImplementationName( )
sal_Bool SwAccessiblePreview::supportsService( const OUString& rServiceName ) sal_Bool SwAccessiblePreview::supportsService( const OUString& rServiceName )
throw( RuntimeException ) throw( RuntimeException )
{ {
return rServiceName == sServiceName || rServiceName == sAccessibleServiceName; return cppu::supportsService(this, rServiceName);
} }
Sequence<OUString> SwAccessiblePreview::getSupportedServiceNames( ) Sequence<OUString> SwAccessiblePreview::getSupportedServiceNames( )
throw( RuntimeException ) throw( RuntimeException )
{ {
Sequence<OUString> aSeq( 2 ); Sequence<OUString> aSeq( 2 );
aSeq[0] = OUString( sServiceName ); aSeq[0] = "com.sun.star.text.AccessibleTextDocumentPageView";
aSeq[1] = OUString( sAccessibleServiceName ); aSeq[1] = OUString( sAccessibleServiceName );
return aSeq; return aSeq;
} }

View File

@ -53,14 +53,12 @@
#include <frmatr.hxx> #include <frmatr.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility; using namespace ::com::sun::star::accessibility;
using namespace ::sw::access; using namespace ::sw::access;
const sal_Char sServiceName[] = "com.sun.star.table.AccessibleTableView";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleTableView";
typedef ::std::less < sal_Int32 > Int32Less_Impl; typedef ::std::less < sal_Int32 > Int32Less_Impl;
typedef ::std::set < sal_Int32, Int32Less_Impl > Int32Set_Impl; typedef ::std::set < sal_Int32, Int32Less_Impl > Int32Set_Impl;
@ -1370,17 +1368,14 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumn(
OUString SAL_CALL SwAccessibleTable::getImplementationName() OUString SAL_CALL SwAccessibleTable::getImplementationName()
throw( uno::RuntimeException ) throw( uno::RuntimeException )
{ {
return OUString(sImplementationName); return OUString("com.sun.star.comp.Writer.SwAccessibleTableView");
} }
sal_Bool SAL_CALL SwAccessibleTable::supportsService( sal_Bool SAL_CALL SwAccessibleTable::supportsService(
const OUString& sTestServiceName) const OUString& sTestServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return sTestServiceName.equalsAsciiL( sServiceName, return cppu::supportsService(this, sTestServiceName);
sizeof(sServiceName)-1 ) ||
sTestServiceName.equalsAsciiL( sAccessibleServiceName,
sizeof(sAccessibleServiceName)-1 );
} }
uno::Sequence< OUString > SAL_CALL SwAccessibleTable::getSupportedServiceNames() uno::Sequence< OUString > SAL_CALL SwAccessibleTable::getSupportedServiceNames()
@ -1388,7 +1383,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleTable::getSupportedServiceNames()
{ {
uno::Sequence< OUString > aRet(2); uno::Sequence< OUString > aRet(2);
OUString* pArray = aRet.getArray(); OUString* pArray = aRet.getArray();
pArray[0] = OUString( sServiceName ); pArray[0] = "com.sun.star.table.AccessibleTableView";
pArray[1] = OUString( sAccessibleServiceName ); pArray[1] = OUString( sAccessibleServiceName );
return aRet; return aRet;
} }

View File

@ -19,6 +19,7 @@
#include <com/sun/star/accessibility/XAccessibleContext.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp>
@ -42,8 +43,6 @@ using namespace ::com::sun::star::accessibility;
using utl::AccessibleRelationSetHelper; using utl::AccessibleRelationSetHelper;
using ::com::sun::star::accessibility::XAccessibleContext; using ::com::sun::star::accessibility::XAccessibleContext;
const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextFrameView";
const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleTextFrameView";
SwAccessibleTextFrame::SwAccessibleTextFrame( SwAccessibleTextFrame::SwAccessibleTextFrame(
SwAccessibleMap* pInitMap, SwAccessibleMap* pInitMap,
@ -288,17 +287,13 @@ OUString SAL_CALL SwAccessibleTextFrame::getAccessibleDescription (void)
OUString SAL_CALL SwAccessibleTextFrame::getImplementationName() OUString SAL_CALL SwAccessibleTextFrame::getImplementationName()
throw( uno::RuntimeException ) throw( uno::RuntimeException )
{ {
return OUString(sImplementationName); return OUString("com.sun.star.comp.Writer.SwAccessibleTextFrameView");
} }
sal_Bool SAL_CALL SwAccessibleTextFrame::supportsService( sal_Bool SAL_CALL SwAccessibleTextFrame::supportsService(const OUString& sTestServiceName)
const OUString& sTestServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return sTestServiceName.equalsAsciiL( sServiceName, return cppu::supportsService(this, sTestServiceName);
sizeof(sServiceName)-1 ) ||
sTestServiceName.equalsAsciiL( sAccessibleServiceName,
sizeof(sAccessibleServiceName)-1 );
} }
uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNames() uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNames()
@ -306,7 +301,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNam
{ {
uno::Sequence< OUString > aRet(2); uno::Sequence< OUString > aRet(2);
OUString* pArray = aRet.getArray(); OUString* pArray = aRet.getArray();
pArray[0] = OUString( sServiceName ); pArray[0] = "com.sun.star.text.AccessibleTextFrameView";
pArray[1] = OUString( sAccessibleServiceName ); pArray[1] = OUString( sAccessibleServiceName );
return aRet; return aRet;
} }

View File

@ -26,6 +26,7 @@
#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/Desktop.hpp>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <com/sun/star/frame/XFramesSupplier.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp>
#include <cppuhelper/supportsservice.hxx>
/** thread to cancel a give list of cancellable jobs /** thread to cancel a give list of cancellable jobs
@ -283,12 +284,7 @@ OUString SAL_CALL FinalThreadManager::getImplementationName() throw (css::uno::R
::sal_Bool SAL_CALL FinalThreadManager::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException) ::sal_Bool SAL_CALL FinalThreadManager::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException)
{ {
css::uno::Sequence< OUString > serviceNames = comp_FinalThreadManager::_getSupportedServiceNames(); return cppu::supportsService(this, serviceName);
for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
if (serviceNames[i] == serviceName)
return sal_True;
}
return sal_False;
} }
css::uno::Sequence< OUString > SAL_CALL FinalThreadManager::getSupportedServiceNames() throw (css::uno::RuntimeException) css::uno::Sequence< OUString > SAL_CALL FinalThreadManager::getSupportedServiceNames() throw (css::uno::RuntimeException)

View File

@ -10,6 +10,7 @@
#include "dumpfilter.hxx" #include "dumpfilter.hxx"
#include <wrtsh.hxx> #include <wrtsh.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <docsh.hxx> #include <docsh.hxx>
#include <rootfrm.hxx> #include <rootfrm.hxx>
#include <unotxdoc.hxx> #include <unotxdoc.hxx>
@ -166,16 +167,7 @@ namespace sw
sal_Bool LayoutDumpFilter::supportsService( const OUString& rServiceName ) sal_Bool LayoutDumpFilter::supportsService( const OUString& rServiceName )
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames(); return cppu::supportsService(this, rServiceName);
const OUString* pArray = seqServiceNames.getConstArray();
for ( sal_Int32 nCounter=0; nCounter < seqServiceNames.getLength(); nCounter++ )
{
if ( pArray[nCounter] == rServiceName )
{
return sal_True ;
}
}
return sal_False ;
} }
uno::Sequence< OUString > LayoutDumpFilter::getSupportedServiceNames() uno::Sequence< OUString > LayoutDumpFilter::getSupportedServiceNames()

View File

@ -27,6 +27,7 @@
#include <SwStyleNameMapper.hxx> #include <SwStyleNameMapper.hxx>
#include <fchrfmt.hxx> #include <fchrfmt.hxx>
#include <charfmt.hxx> #include <charfmt.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <docstyle.hxx> #include <docstyle.hxx>
#include <doc.hxx> #include <doc.hxx>
#include <docsh.hxx> #include <docsh.hxx>
@ -238,22 +239,18 @@ Any SAL_CALL SwXTextDefaults::getPropertyDefault( const OUString& rPropertyName
return aRet; return aRet;
} }
OUString SAL_CALL SwXTextDefaults::getImplementationName( ) OUString SAL_CALL SwXTextDefaults::getImplementationName( )
throw (RuntimeException) throw (RuntimeException)
{ {
return OUString("SwXTextDefaults"); return OUString("SwXTextDefaults");
} }
sal_Bool SAL_CALL SwXTextDefaults::supportsService( const OUString& rServiceName ) sal_Bool SAL_CALL SwXTextDefaults::supportsService( const OUString& rServiceName )
throw (RuntimeException) throw (RuntimeException)
{ {
uno::Sequence< OUString > aSeq(getSupportedServiceNames()); return cppu::supportsService(this, rServiceName);
return std::find(aSeq.begin(), aSeq.end(), rServiceName) != aSeq.end();
} }
uno::Sequence< OUString > SAL_CALL SwXTextDefaults::getSupportedServiceNames( ) uno::Sequence< OUString > SAL_CALL SwXTextDefaults::getSupportedServiceNames( )
throw (RuntimeException) throw (RuntimeException)
{ {
@ -269,6 +266,4 @@ uno::Sequence< OUString > SAL_CALL SwXTextDefaults::getSupportedServiceNames( )
return aRet; return aRet;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -23,6 +23,7 @@
#include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart2/data/LabelOrigin.hpp> #include <com/sun/star/chart2/data/LabelOrigin.hpp>
#include <cppuhelper/interfacecontainer.hxx> #include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <svl/zforlist.hxx> #include <svl/zforlist.hxx>
@ -46,11 +47,6 @@
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#define SN_DATA_PROVIDER "com.sun.star.chart2.data.DataProvider"
#define SN_DATA_SOURCE "com.sun.star.chart2.data.DataSource"
#define SN_DATA_SEQUENCE "com.sun.star.chart2.data.DataSequence"
#define SN_LABELED_DATA_SEQUENCE "com.sun.star.chart2.data.LabeledDataSequence"
using namespace ::com::sun::star; using namespace ::com::sun::star;
// from unotbl.cxx // from unotbl.cxx
@ -1505,12 +1501,10 @@ OUString SAL_CALL SwChartDataProvider::getImplementationName( )
return OUString("SwChartDataProvider"); return OUString("SwChartDataProvider");
} }
sal_Bool SAL_CALL SwChartDataProvider::supportsService( sal_Bool SAL_CALL SwChartDataProvider::supportsService(const OUString& rServiceName )
const OUString& rServiceName )
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
SolarMutexGuard aGuard; return cppu::supportsService(this, rServiceName);
return rServiceName == SN_DATA_PROVIDER;
} }
uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames( ) uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames( )
@ -1518,7 +1512,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
uno::Sequence< OUString > aRes(1); uno::Sequence< OUString > aRes(1);
aRes.getArray()[0] = SN_DATA_PROVIDER; aRes.getArray()[0] = "com.sun.star.chart2.data.DataProvider";
return aRes; return aRes;
} }
@ -1894,12 +1888,10 @@ OUString SAL_CALL SwChartDataSource::getImplementationName( )
return OUString("SwChartDataSource"); return OUString("SwChartDataSource");
} }
sal_Bool SAL_CALL SwChartDataSource::supportsService( sal_Bool SAL_CALL SwChartDataSource::supportsService(const OUString& rServiceName )
const OUString& rServiceName )
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
SolarMutexGuard aGuard; return cppu::supportsService(this, rServiceName);
return rServiceName == SN_DATA_SOURCE;
} }
uno::Sequence< OUString > SAL_CALL SwChartDataSource::getSupportedServiceNames( ) uno::Sequence< OUString > SAL_CALL SwChartDataSource::getSupportedServiceNames( )
@ -1907,7 +1899,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSource::getSupportedServiceNames(
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
uno::Sequence< OUString > aRes(1); uno::Sequence< OUString > aRes(1);
aRes.getArray()[0] = SN_DATA_SOURCE; aRes.getArray()[0] = "com.sun.star.chart2.data.DataSource";
return aRes; return aRes;
} }
@ -2354,11 +2346,10 @@ OUString SAL_CALL SwChartDataSequence::getImplementationName( )
return OUString("SwChartDataSequence"); return OUString("SwChartDataSequence");
} }
sal_Bool SAL_CALL SwChartDataSequence::supportsService( sal_Bool SAL_CALL SwChartDataSequence::supportsService(const OUString& rServiceName )
const OUString& rServiceName )
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return rServiceName == SN_DATA_SEQUENCE; return cppu::supportsService(this, rServiceName);
} }
uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames( ) uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames( )
@ -2366,7 +2357,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
uno::Sequence< OUString > aRes(1); uno::Sequence< OUString > aRes(1);
aRes.getArray()[0] = SN_DATA_SEQUENCE; aRes.getArray()[0] = "com.sun.star.chart2.data.DataSequence";
return aRes; return aRes;
} }
@ -2867,7 +2858,7 @@ sal_Bool SAL_CALL SwChartLabeledDataSequence::supportsService(
const OUString& rServiceName ) const OUString& rServiceName )
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return rServiceName == SN_LABELED_DATA_SEQUENCE; return cppu::supportsService(this, rServiceName);
} }
uno::Sequence< OUString > SAL_CALL SwChartLabeledDataSequence::getSupportedServiceNames( ) uno::Sequence< OUString > SAL_CALL SwChartLabeledDataSequence::getSupportedServiceNames( )
@ -2875,7 +2866,8 @@ uno::Sequence< OUString > SAL_CALL SwChartLabeledDataSequence::getSupportedServi
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
uno::Sequence< OUString > aRes(1); uno::Sequence< OUString > aRes(1);
aRes.getArray()[0] = SN_LABELED_DATA_SEQUENCE; aRes.getArray()[0] = "com.sun.star.chart2.data.LabeledDataSequence";
return aRes; return aRes;
} }

View File

@ -58,6 +58,7 @@
#include <unochart.hxx> #include <unochart.hxx>
#include <comphelper/makesequence.hxx> #include <comphelper/makesequence.hxx>
#include <comphelper/sequence.hxx> #include <comphelper/sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <list> #include <list>
#include <iterator> #include <iterator>
#include <unosection.hxx> #include <unosection.hxx>
@ -982,7 +983,7 @@ OUString SwXTextTables::getImplementationName(void) throw( uno::RuntimeException
sal_Bool SwXTextTables::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXTextTables::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextTables"; return cppu::supportsService(this, rServiceName);
} }
uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames(void) throw( uno::RuntimeException )
@ -1140,7 +1141,7 @@ OUString SwXFrameEnumeration<T>::getImplementationName(void) throw( RuntimeExcep
template<FlyCntType T> template<FlyCntType T>
sal_Bool SwXFrameEnumeration<T>::supportsService(const OUString& ServiceName) throw( RuntimeException ) sal_Bool SwXFrameEnumeration<T>::supportsService(const OUString& ServiceName) throw( RuntimeException )
{ {
return ServiceName == "com.sun.star.container.XEnumeration"; return cppu::supportsService(this, ServiceName);
} }
template<FlyCntType T> template<FlyCntType T>
@ -1159,7 +1160,7 @@ OUString SwXFrames::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXFrames::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextFrames"; return cppu::supportsService(this, rServiceName);
} }
Sequence<OUString> SwXFrames::getSupportedServiceNames(void) throw( RuntimeException ) Sequence<OUString> SwXFrames::getSupportedServiceNames(void) throw( RuntimeException )
@ -1326,7 +1327,7 @@ OUString SwXTextFrames::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXTextFrames::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextFrames"; return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXTextFrames::getSupportedServiceNames(void) throw( RuntimeException )
@ -1356,7 +1357,7 @@ OUString SwXTextGraphicObjects::getImplementationName(void) throw( RuntimeExcept
sal_Bool SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXTextGraphicObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextGraphicObjects"; return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames(void) throw( RuntimeException )
@ -1386,7 +1387,7 @@ OUString SwXTextEmbeddedObjects::getImplementationName(void) throw( RuntimeExcep
sal_Bool SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextEmbeddedObjects"; return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames(void) throw( RuntimeException )
@ -1413,7 +1414,7 @@ OUString SwXTextSections::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXTextSections::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextSections"; return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXTextSections::getSupportedServiceNames(void) throw( RuntimeException )
@ -1601,7 +1602,7 @@ OUString SwXBookmarks::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXBookmarks::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXBookmarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return OUString("com.sun.star.text.Bookmarks") == rServiceName; return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXBookmarks::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXBookmarks::getSupportedServiceNames(void) throw( RuntimeException )
@ -1810,7 +1811,7 @@ OUString SwXFootnotes::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXFootnotes::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName == "com.sun.star.text.Footnotes"; return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXFootnotes::getSupportedServiceNames(void) throw( RuntimeException )
@ -1909,7 +1910,7 @@ OUString SwXReferenceMarks::getImplementationName(void) throw( RuntimeException
sal_Bool SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName == "com.sun.star.text.ReferenceMarks"; return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames(void) throw( RuntimeException )

View File

@ -55,6 +55,7 @@
#include <crstate.hxx> #include <crstate.hxx>
#include <comphelper/extract.hxx> #include <comphelper/extract.hxx>
#include <comphelper/makesequence.hxx> #include <comphelper/makesequence.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <svx/scene3d.hxx> #include <svx/scene3d.hxx>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <fmtwrapinfluenceonobjpos.hxx> #include <fmtwrapinfluenceonobjpos.hxx>
@ -433,7 +434,7 @@ OUString SwXShapesEnumeration::getImplementationName(void) throw(uno::RuntimeExc
sal_Bool SwXShapesEnumeration::supportsService(const OUString& ServiceName) throw(uno::RuntimeException) sal_Bool SwXShapesEnumeration::supportsService(const OUString& ServiceName) throw(uno::RuntimeException)
{ {
return ServiceName == "com.sun.star.container.XEnumeration"; return cppu::supportsService(this, ServiceName);
} }
uno::Sequence< OUString > SwXShapesEnumeration::getSupportedServiceNames(void) throw(uno::RuntimeException) uno::Sequence< OUString > SwXShapesEnumeration::getSupportedServiceNames(void) throw(uno::RuntimeException)
@ -458,7 +459,7 @@ OUString SwXDrawPage::getImplementationName(void) throw( uno::RuntimeException )
sal_Bool SwXDrawPage::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXDrawPage::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
return rServiceName == "com.sun.star.drawing.GenericDrawPage"; return cppu::supportsService(this, rServiceName);
} }
uno::Sequence< OUString > SwXDrawPage::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXDrawPage::getSupportedServiceNames(void) throw( uno::RuntimeException )
@ -2132,16 +2133,7 @@ OUString SwXShape::getImplementationName(void) throw( uno::RuntimeException )
sal_Bool SwXShape::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXShape::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
sal_Bool bRet = sal_False; return cppu::supportsService(this, rServiceName);
if (rServiceName == "com.sun.star.drawing.Shape")
bRet = sal_True;
else if(xShapeAgg.is())
{
uno::Reference< lang::XUnoTunnel > xShapeTunnel(xShapeAgg, uno::UNO_QUERY);
SvxShape* pSvxShape = GetSvxShape();
bRet = pSvxShape->supportsService(rServiceName);
}
return bRet;
} }
uno::Sequence< OUString > SwXShape::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXShape::getSupportedServiceNames(void) throw( uno::RuntimeException )

View File

@ -43,6 +43,7 @@
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <comphelper/types.hxx> #include <comphelper/types.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/util/Time.hpp> #include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/Date.hpp> #include <com/sun/star/util/Date.hpp>
@ -489,15 +490,10 @@ OUString getServiceName(const sal_uInt16 aId)
} }
sal_Bool SAL_CALL sal_Bool SAL_CALL SwXFieldMaster::supportsService(const OUString& rServiceName)
SwXFieldMaster::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
if (rServiceName=="com.sun.star.text.TextFieldMaster") return cppu::supportsService(this, rServiceName);
return sal_True;
const OUString sName(getServiceName(m_pImpl->m_nResTypeId));
return !sName.isEmpty() && sName==rServiceName;
} }
uno::Sequence< OUString > SAL_CALL uno::Sequence< OUString > SAL_CALL
@ -2476,15 +2472,7 @@ static OUString OldNameToNewName_Impl( const OUString &rOld )
sal_Bool SAL_CALL SwXTextField::supportsService(const OUString& rServiceName) sal_Bool SAL_CALL SwXTextField::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
OUString sServiceName = return cppu::supportsService(this, rServiceName);
SwXServiceProvider::GetProviderName(m_pImpl->m_nServiceId);
// case-corected version of service-name (see #i67811)
// (need to supply both because of compatibility to older versions)
OUString sServiceNameCC( OldNameToNewName_Impl( sServiceName ) );
return sServiceName == rServiceName || sServiceNameCC == rServiceName ||
rServiceName == "com.sun.star.text.TextContent";
} }
uno::Sequence< OUString > SAL_CALL SwXTextField::getSupportedServiceNames() uno::Sequence< OUString > SAL_CALL SwXTextField::getSupportedServiceNames()
@ -2562,7 +2550,7 @@ OUString SwXTextFieldMasters::getImplementationName(void) throw( uno::RuntimeExc
sal_Bool SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXTextFieldMasters::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextFieldMasters"; return cppu::supportsService(this, rServiceName);
} }
uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames(void) throw( uno::RuntimeException )
@ -2778,7 +2766,7 @@ OUString SwXTextFieldTypes::getImplementationName(void) throw( uno::RuntimeExcep
sal_Bool SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextFields"; return cppu::supportsService(this, rServiceName);
} }
uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) throw( uno::RuntimeException )
@ -2891,11 +2879,10 @@ SwXFieldEnumeration::getImplementationName() throw (uno::RuntimeException)
return OUString("SwXFieldEnumeration"); return OUString("SwXFieldEnumeration");
} }
sal_Bool SAL_CALL sal_Bool SAL_CALL SwXFieldEnumeration::supportsService(const OUString& rServiceName)
SwXFieldEnumeration::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return rServiceName == "com.sun.star.text.FieldEnumeration"; return cppu::supportsService(this, rServiceName);
} }
uno::Sequence< OUString > SAL_CALL uno::Sequence< OUString > SAL_CALL

View File

@ -110,6 +110,7 @@
#include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/vclunohelper.hxx>
#include <switerator.hxx> #include <switerator.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
// from fefly1.cxx // from fefly1.cxx
extern sal_Bool sw_ChkAndSetNewAnchor( SwEditShell& rEditShell, const SwFlyFrm& rFly, SfxItemSet& rSet ); extern sal_Bool sw_ChkAndSetNewAnchor( SwEditShell& rEditShell, const SwFlyFrm& rFly, SfxItemSet& rSet );
@ -815,9 +816,7 @@ OUString SwXFrame::getImplementationName(void) throw( uno::RuntimeException )
sal_Bool SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXFrame::supportsService(const :: OUString& rServiceName) throw( uno::RuntimeException )
{ {
return rServiceName.equalsAscii("com.sun.star.text.BaseFrame") || return cppu::supportsService(this, rServiceName);
rServiceName.equalsAscii("com.sun.star.text.TextContent") ||
rServiceName.equalsAscii("com.sun.star.document.LinkTarget");
} }
uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
@ -2743,9 +2742,7 @@ OUString SwXTextFrame::getImplementationName(void) throw( uno::RuntimeException
sal_Bool SwXTextFrame::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXTextFrame::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
return rServiceName == "com.sun.star.text.Text" || return cppu::supportsService(this, rServiceName);
rServiceName == "com.sun.star.text.TextFrame" ||
SwXFrame::supportsService(rServiceName);
} }
uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames(void) throw( uno::RuntimeException )
@ -2905,8 +2902,7 @@ OUString SwXTextGraphicObject::getImplementationName(void) throw( uno::RuntimeEx
sal_Bool SwXTextGraphicObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXTextGraphicObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextGraphicObject" || return cppu::supportsService(this, rServiceName);
SwXFrame::supportsService(rServiceName);
} }
uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void) uno::Sequence< OUString > SwXTextGraphicObject::getSupportedServiceNames(void)
@ -3166,8 +3162,7 @@ OUString SwXTextEmbeddedObject::getImplementationName(void) throw( uno::RuntimeE
sal_Bool SwXTextEmbeddedObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXTextEmbeddedObject::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextEmbeddedObject" || return cppu::supportsService(this, rServiceName);
SwXFrame::supportsService(rServiceName);
} }
uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void) uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void)

View File

@ -58,7 +58,7 @@
#include <SwStyleNameMapper.hxx> #include <SwStyleNameMapper.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
@ -457,16 +457,7 @@ sal_Bool SAL_CALL
SwXDocumentIndex::supportsService(const OUString& rServiceName) SwXDocumentIndex::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
SolarMutexGuard g; return cppu::supportsService(this, rServiceName);
return rServiceName == "com.sun.star.text.BaseIndex"
|| ((TOX_INDEX == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.DocumentIndex")
|| ((TOX_CONTENT == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.ContentIndex")
|| ((TOX_USER == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.UserDefinedIndex")
|| ((TOX_ILLUSTRATIONS == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.IllustrationsIndex")
|| ((TOX_TABLES == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.TableIndex")
|| ((TOX_OBJECTS == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.ObjectIndex")
|| ((TOX_AUTHORITIES == m_pImpl->m_eTOXType) && rServiceName == "com.sun.star.text.Bibliography");
} }
uno::Sequence< OUString > SAL_CALL uno::Sequence< OUString > SAL_CALL
@ -1674,22 +1665,10 @@ SwXDocumentIndexMark::getImplementationName() throw (uno::RuntimeException)
return OUString("SwXDocumentIndexMark"); return OUString("SwXDocumentIndexMark");
} }
sal_Bool SAL_CALL sal_Bool SAL_CALL SwXDocumentIndexMark::supportsService(const OUString& rServiceName)
SwXDocumentIndexMark::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
SolarMutexGuard g; return cppu::supportsService(this, rServiceName);
return rServiceName.equalsAscii(cBaseMark)
|| rServiceName.equalsAscii(cTextContent)
|| ((m_pImpl->m_eTOXType == TOX_USER)
&& rServiceName.equalsAscii(cUserMark))
|| ((m_pImpl->m_eTOXType == TOX_CONTENT)
&& rServiceName.equalsAscii(cContentMark))
|| ((m_pImpl->m_eTOXType == TOX_INDEX)
&& rServiceName.equalsAscii(cIdxMark))
|| ((m_pImpl->m_eTOXType == TOX_INDEX)
&& rServiceName.equalsAscii(cIdxMarkAsian));
} }
uno::Sequence< OUString > SAL_CALL uno::Sequence< OUString > SAL_CALL
@ -2375,8 +2354,7 @@ static char const*const g_ServicesDocumentIndexes[] =
"com.sun.star.text.DocumentIndexes", "com.sun.star.text.DocumentIndexes",
}; };
sal_Bool SAL_CALL sal_Bool SAL_CALL SwXDocumentIndexes::supportsService(const OUString& rServiceName)
SwXDocumentIndexes::supportsService(const OUString& rServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
return cppu::supportsService(this, rServiceName); return cppu::supportsService(this, rServiceName);
@ -2705,8 +2683,7 @@ static char const*const g_ServicesIndexTokenAccess[] =
"com.sun.star.text.DocumentIndexLevelFormat", "com.sun.star.text.DocumentIndexLevelFormat",
}; };
sal_Bool SAL_CALL sal_Bool SAL_CALL SwXDocumentIndex::TokenAccess_Impl::supportsService(
SwXDocumentIndex::TokenAccess_Impl::supportsService(
const OUString& rServiceName) const OUString& rServiceName)
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {

View File

@ -19,6 +19,7 @@
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
@ -99,11 +100,10 @@ OUString SwXRedlines::getImplementationName(void) throw( uno::RuntimeException )
return OUString("SwXRedlines"); return OUString("SwXRedlines");
} }
sal_Bool SwXRedlines::supportsService(const OUString& /*ServiceName*/) sal_Bool SwXRedlines::supportsService(const OUString& ServiceName)
throw( uno::RuntimeException ) throw( uno::RuntimeException )
{ {
OSL_FAIL("not implemented"); return cppu::supportsService(this, ServiceName);
return sal_False;
} }
uno::Sequence< OUString > SwXRedlines::getSupportedServiceNames(void) uno::Sequence< OUString > SwXRedlines::getSupportedServiceNames(void)
@ -166,9 +166,9 @@ OUString SwXRedlineEnumeration::getImplementationName(void) throw( uno::RuntimeE
return OUString("SwXRedlineEnumeration"); return OUString("SwXRedlineEnumeration");
} }
sal_Bool SwXRedlineEnumeration::supportsService(const OUString& /*ServiceName*/) throw( uno::RuntimeException ) sal_Bool SwXRedlineEnumeration::supportsService(const OUString& ServiceName) throw( uno::RuntimeException )
{ {
return sal_False; return cppu::supportsService(this, ServiceName);
} }
uno::Sequence< OUString > SwXRedlineEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXRedlineEnumeration::getSupportedServiceNames(void) throw( uno::RuntimeException )

View File

@ -22,6 +22,7 @@
#include <sfx2/sfxbasecontroller.hxx> #include <sfx2/sfxbasecontroller.hxx>
#include <SwXDocumentSettings.hxx> #include <SwXDocumentSettings.hxx>
#include <comphelper/MasterPropertySetInfo.hxx> #include <comphelper/MasterPropertySetInfo.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/i18n/XForbiddenCharacters.hpp> #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
#include <com/sun/star/document/PrinterIndependentLayout.hpp> #include <com/sun/star/document/PrinterIndependentLayout.hpp>
@ -1239,15 +1240,7 @@ OUString SAL_CALL SwXDocumentSettings::getImplementationName( )
sal_Bool SAL_CALL SwXDocumentSettings::supportsService( const OUString& ServiceName ) sal_Bool SAL_CALL SwXDocumentSettings::supportsService( const OUString& ServiceName )
throw(RuntimeException) throw(RuntimeException)
{ {
const Sequence< OUString > aSeq( getSupportedServiceNames() ); return cppu::supportsService(this, ServiceName);
sal_Int32 nCount = aSeq.getLength();
const OUString* pServices = aSeq.getConstArray();
while( nCount-- )
{
if( *pServices++ == ServiceName )
return sal_True;
}
return sal_True;
} }
Sequence< OUString > SAL_CALL SwXDocumentSettings::getSupportedServiceNames( ) Sequence< OUString > SAL_CALL SwXDocumentSettings::getSupportedServiceNames( )

View File

@ -26,6 +26,7 @@
#include <vcl/msgbox.hxx> #include <vcl/msgbox.hxx>
#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <unotools/ucbstreamhelper.hxx> #include <unotools/ucbstreamhelper.hxx>
#include <unotxdoc.hxx> #include <unotxdoc.hxx>
@ -37,7 +38,6 @@ using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::document; using namespace ::com::sun::star::document;
using namespace ::com::sun::star::lang; using namespace ::com::sun::star::lang;
#define SWFILTEROPTIONSOBJ_SERVICE "com.sun.star.ui.dialogs.FilterOptionsDialog"
#define SWFILTEROPTIONSOBJ_IMPLNAME "com.sun.star.comp.Writer.FilterOptionsDialog" #define SWFILTEROPTIONSOBJ_IMPLNAME "com.sun.star.comp.Writer.FilterOptionsDialog"
#define FILTER_OPTIONS_NAME "FilterOptions" #define FILTER_OPTIONS_NAME "FilterOptions"
@ -57,7 +57,7 @@ OUString SwXFilterOptions::getImplementationName_Static()
uno::Sequence< OUString> SwXFilterOptions::getSupportedServiceNames_Static() uno::Sequence< OUString> SwXFilterOptions::getSupportedServiceNames_Static()
{ {
OUString sService(SWFILTEROPTIONSOBJ_SERVICE); OUString sService("com.sun.star.ui.dialogs.FilterOptionsDialog");
return uno::Sequence< OUString> (&sService, 1); return uno::Sequence< OUString> (&sService, 1);
} }
@ -159,7 +159,7 @@ OUString SwXFilterOptions::getImplementationName() throw(uno::RuntimeException)
sal_Bool SwXFilterOptions::supportsService( const OUString& rServiceName ) sal_Bool SwXFilterOptions::supportsService( const OUString& rServiceName )
throw(uno::RuntimeException) throw(uno::RuntimeException)
{ {
return rServiceName == SWFILTEROPTIONSOBJ_SERVICE; return cppu::supportsService(this, rServiceName);
} }
uno::Sequence< OUString > SwXFilterOptions::getSupportedServiceNames() uno::Sequence< OUString > SwXFilterOptions::getSupportedServiceNames()

View File

@ -24,6 +24,7 @@
#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/task/XInteractionHandler.hpp>
@ -426,16 +427,7 @@ OUString SAL_CALL SwFilterDetect::getImplementationName() throw( RuntimeExceptio
/* XServiceInfo */ /* XServiceInfo */
sal_Bool SAL_CALL SwFilterDetect::supportsService( const OUString& sServiceName ) throw( RuntimeException ) sal_Bool SAL_CALL SwFilterDetect::supportsService( const OUString& sServiceName ) throw( RuntimeException )
{ {
Sequence< OUString > seqServiceNames = getSupportedServiceNames(); return cppu::supportsService(this, sServiceName);
const OUString* pArray = seqServiceNames.getConstArray();
for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ )
{
if ( pArray[nCounter] == sServiceName )
{
return sal_True ;
}
}
return sal_False ;
} }
/* XServiceInfo */ /* XServiceInfo */

View File

@ -47,6 +47,7 @@
#include <editeng/acorrcfg.hxx> #include <editeng/acorrcfg.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <memory> #include <memory>
@ -219,13 +220,7 @@ OUString SwXAutoTextContainer::getImplementationName(void) throw( uno::RuntimeEx
sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
const uno::Sequence< OUString > aNames = SwXAutoTextContainer_getSupportedServiceNames(); return cppu::supportsService(this, rServiceName);
for(sal_Int32 nService = 0; nService < aNames.getLength(); nService++)
{
if(aNames.getConstArray()[nService] == rServiceName)
return sal_True;
}
return sal_False;
} }
uno::Sequence< OUString > SwXAutoTextContainer::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXAutoTextContainer::getSupportedServiceNames(void) throw( uno::RuntimeException )
@ -716,7 +711,7 @@ OUString SwXAutoTextGroup::getImplementationName(void) throw( uno::RuntimeExcept
sal_Bool SwXAutoTextGroup::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXAutoTextGroup::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
return "com.sun.star.text.AutoTextGroup" == rServiceName; return cppu::supportsService(this, rServiceName);
} }
uno::Sequence< OUString > SwXAutoTextGroup::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXAutoTextGroup::getSupportedServiceNames(void) throw( uno::RuntimeException )
@ -997,7 +992,7 @@ OUString SwXAutoTextEntry::getImplementationName(void) throw( uno::RuntimeExcept
sal_Bool SwXAutoTextEntry::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) sal_Bool SwXAutoTextEntry::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{ {
return rServiceName == "com.sun.star.text.AutoTextEntry"; return cppu::supportsService(this, rServiceName);
} }
uno::Sequence< OUString > SwXAutoTextEntry::getSupportedServiceNames(void) throw( uno::RuntimeException ) uno::Sequence< OUString > SwXAutoTextEntry::getSupportedServiceNames(void) throw( uno::RuntimeException )

View File

@ -29,6 +29,7 @@
#include <sfx2/docfilt.hxx> #include <sfx2/docfilt.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/timer.hxx> #include <vcl/timer.hxx>
#include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/text/MailMergeType.hpp> #include <com/sun/star/text/MailMergeType.hpp>
@ -70,9 +71,6 @@
#include <unomid.h> #include <unomid.h>
#define SN_MAIL_MERGE "com.sun.star.text.MailMerge"
#define SN_DATA_ACCESS_DESCRIPTOR "com.sun.star.sdb.DataAccessDescriptor"
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::frame; using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
@ -1162,8 +1160,7 @@ OUString SAL_CALL SwXMailMerge::getImplementationName()
sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName ) sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName )
throw(RuntimeException) throw(RuntimeException)
{ {
SolarMutexGuard aGuard; return cppu::supportsService(this, rServiceName);
return rServiceName == SN_MAIL_MERGE || rServiceName == SN_DATA_ACCESS_DESCRIPTOR;
} }
uno::Sequence< OUString > SAL_CALL SwXMailMerge::getSupportedServiceNames() uno::Sequence< OUString > SAL_CALL SwXMailMerge::getSupportedServiceNames()
@ -1178,8 +1175,8 @@ uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames()
{ {
uno::Sequence< OUString > aNames(2); uno::Sequence< OUString > aNames(2);
OUString *pName = aNames.getArray(); OUString *pName = aNames.getArray();
pName[0] = SN_MAIL_MERGE; pName[0] = "com.sun.star.text.MailMerge";
pName[1] = SN_DATA_ACCESS_DESCRIPTOR; pName[1] = "com.sun.star.sdb.DataAccessDescriptor";
return aNames; return aNames;
} }

View File

@ -38,6 +38,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/view/DocumentZoomType.hpp> #include <com/sun/star/view/DocumentZoomType.hpp>
#include <comphelper/ChainablePropertySetInfo.hxx> #include <comphelper/ChainablePropertySetInfo.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <edtwin.hxx> #include <edtwin.hxx>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
@ -253,13 +254,7 @@ OUString SwXModule::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
const Sequence< OUString > aNames = SwXModule_getSupportedServiceNames(); return cppu::supportsService(this, rServiceName);
for(sal_Int32 nService = 0; nService < aNames.getLength(); nService++)
{
if(aNames.getConstArray()[nService] == rServiceName)
return sal_True;
}
return sal_False;
} }
Sequence< OUString > SwXModule::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXModule::getSupportedServiceNames(void) throw( RuntimeException )
@ -545,7 +540,7 @@ OUString SwXPrintSettings::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXPrintSettings::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXPrintSettings::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName == "com.sun.star.text.PrintSettings"; return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXPrintSettings::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXPrintSettings::getSupportedServiceNames(void) throw( RuntimeException )
@ -984,7 +979,7 @@ OUString SwXViewSettings::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXViewSettings::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXViewSettings::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName == "com.sun.star.text.ViewSettings"; return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXViewSettings::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXViewSettings::getSupportedServiceNames(void) throw( RuntimeException )

View File

@ -23,6 +23,7 @@
#include "swmodule.hxx" #include "swmodule.hxx"
#include "swdll.hxx" #include "swdll.hxx"
#include "unomodule.hxx" #include "unomodule.hxx"
#include <cppuhelper/supportsservice.hxx>
#include <sfx2/objface.hxx> #include <sfx2/objface.hxx>
#include <sfx2/bindings.hxx> #include <sfx2/bindings.hxx>
#include <sfx2/request.hxx> #include <sfx2/request.hxx>
@ -142,16 +143,7 @@ OUString SAL_CALL SwUnoModule::getImplementationName( ) throw(uno::RuntimeExcep
sal_Bool SAL_CALL SwUnoModule::supportsService( const OUString& sServiceName ) throw(uno::RuntimeException) sal_Bool SAL_CALL SwUnoModule::supportsService( const OUString& sServiceName ) throw(uno::RuntimeException)
{ {
uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames(); return cppu::supportsService(this, sServiceName);
const OUString* pArray = seqServiceNames.getConstArray();
for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ )
{
if ( pArray[nCounter] == sServiceName )
{
return sal_True ;
}
}
return sal_False ;
} }
uno::Sequence< OUString > SAL_CALL SwUnoModule::getSupportedServiceNames( ) throw(uno::RuntimeException) uno::Sequence< OUString > SAL_CALL SwUnoModule::getSupportedServiceNames( ) throw(uno::RuntimeException)

View File

@ -101,6 +101,7 @@
#include <SwStyleNameMapper.hxx> #include <SwStyleNameMapper.hxx>
#include <osl/file.hxx> #include <osl/file.hxx>
#include <comphelper/storagehelper.hxx> #include <comphelper/storagehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
// #i12836# enhanced pdf export // #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx> #include <EnhancedPDFExportHelper.hxx>
@ -1772,16 +1773,7 @@ OUString SwXTextDocument::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXTextDocument::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXTextDocument::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
if ( rServiceName == "com.sun.star.document.OfficeDocument" || rServiceName == "com.sun.star.text.GenericTextDocument" ) return cppu::supportsService(this, rServiceName);
return sal_True;
bool bWebDoc = (0 != PTR_CAST(SwWebDocShell, pDocShell));
bool bGlobalDoc = (0 != PTR_CAST(SwGlobalDocShell, pDocShell));
bool bTextDoc = (!bWebDoc && !bGlobalDoc);
return ( (bWebDoc && rServiceName == "com.sun.star.text.WebDocument")
|| (bGlobalDoc && rServiceName == "com.sun.star.text.GlobalDocument")
|| (bTextDoc && rServiceName == "com.sun.star.text.TextDocument") );
} }
Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( RuntimeException )
@ -3475,7 +3467,7 @@ OUString SwXLinkTargetSupplier::getImplementationName(void) throw( RuntimeExcept
sal_Bool SwXLinkTargetSupplier::supportsService(const OUString& rServiceName) sal_Bool SwXLinkTargetSupplier::supportsService(const OUString& rServiceName)
throw( RuntimeException ) throw( RuntimeException )
{ {
return (rServiceName == "com.sun.star.document.LinkTargets"); return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXLinkTargetSupplier::getSupportedServiceNames(void) Sequence< OUString > SwXLinkTargetSupplier::getSupportedServiceNames(void)
@ -3761,7 +3753,7 @@ OUString SwXLinkNameAccessWrapper::getImplementationName(void) throw( RuntimeExc
sal_Bool SwXLinkNameAccessWrapper::supportsService(const OUString& rServiceName) sal_Bool SwXLinkNameAccessWrapper::supportsService(const OUString& rServiceName)
throw( RuntimeException ) throw( RuntimeException )
{ {
return (rServiceName == "com.sun.star.document.LinkTargets"); return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXLinkNameAccessWrapper::getSupportedServiceNames(void) Sequence< OUString > SwXLinkNameAccessWrapper::getSupportedServiceNames(void)
@ -3839,7 +3831,7 @@ OUString SwXOutlineTarget::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXOutlineTarget::supportsService(const OUString& ServiceName) throw( RuntimeException ) sal_Bool SwXOutlineTarget::supportsService(const OUString& ServiceName) throw( RuntimeException )
{ {
return ServiceName == "com.sun.star.document.LinkTarget"; return cppu::supportsService(this, ServiceName);
} }
Sequence< OUString > SwXOutlineTarget::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXOutlineTarget::getSupportedServiceNames(void) throw( RuntimeException )

View File

@ -73,6 +73,7 @@
#include "swdtflvr.hxx" #include "swdtflvr.hxx"
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
@ -856,7 +857,7 @@ OUString SwXTextView::getImplementationName(void) throw( RuntimeException )
sal_Bool SwXTextView::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXTextView::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName == "com.sun.star.text.TextDocumentView" || rServiceName == "com.sun.star.view.OfficeDocumentView"; return cppu::supportsService(this, rServiceName);
} }
Sequence< OUString > SwXTextView::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXTextView::getSupportedServiceNames(void) throw( RuntimeException )
@ -1698,13 +1699,7 @@ OUString SwXTextViewCursor::getImplementationName(void) throw( RuntimeException
sal_Bool SwXTextViewCursor::supportsService(const OUString& rServiceName) throw( RuntimeException ) sal_Bool SwXTextViewCursor::supportsService(const OUString& rServiceName) throw( RuntimeException )
{ {
return rServiceName.equalsAscii("com.sun.star.text.TextViewCursor") || return cppu::supportsService(this, rServiceName);
rServiceName.equalsAscii("com.sun.star.style.CharacterProperties") ||
rServiceName.equalsAscii("com.sun.star.style.CharacterPropertiesAsian") ||
rServiceName.equalsAscii("com.sun.star.style.CharacterPropertiesComplex") ||
rServiceName.equalsAscii("com.sun.star.style.ParagraphProperties") ||
rServiceName.equalsAscii("com.sun.star.style.ParagraphPropertiesAsian") ||
rServiceName.equalsAscii("com.sun.star.style.ParagraphPropertiesComplex");
} }
Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames(void) throw( RuntimeException ) Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames(void) throw( RuntimeException )