From 2f50ce6cfab2871cd879c1429e1938d3642616ef Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Thu, 5 Dec 2013 19:17:18 -0200 Subject: fdo#54938: Convert sw to use cppu::supportsService Change-Id: Ic27bf31e5eb991ccceb8b97713d1e50a736709c8 Signed-off-by: Stephan Bergmann --- sw/source/core/access/acccell.cxx | 9 +++---- sw/source/core/access/acccontext.cxx | 7 +++--- sw/source/core/access/accdoc.cxx | 9 +++---- sw/source/core/access/accembedded.cxx | 12 +++------ sw/source/core/access/accfootnote.cxx | 13 +++------- sw/source/core/access/accgraphic.cxx | 16 ++++-------- sw/source/core/access/accheaderfooter.cxx | 19 ++++----------- sw/source/core/access/accpage.cxx | 5 ++-- sw/source/core/access/accpara.cxx | 6 ++--- sw/source/core/access/accpreview.cxx | 6 ++--- sw/source/core/access/acctable.cxx | 13 +++------- sw/source/core/access/acctextframe.cxx | 15 ++++-------- sw/source/core/docnode/finalthreadmanager.cxx | 8 ++---- sw/source/core/layout/dumpfilter.cxx | 12 ++------- sw/source/core/unocore/SwXTextDefaults.cxx | 9 ++----- sw/source/core/unocore/unochart.cxx | 34 ++++++++++---------------- sw/source/core/unocore/unocoll.cxx | 21 ++++++++-------- sw/source/core/unocore/unodraw.cxx | 16 +++--------- sw/source/core/unocore/unofield.cxx | 29 ++++++---------------- sw/source/core/unocore/unoframe.cxx | 15 ++++-------- sw/source/core/unocore/unoidx.cxx | 35 +++++---------------------- sw/source/core/unocore/unoredlines.cxx | 10 ++++---- sw/source/ui/uno/SwXDocumentSettings.cxx | 11 ++------- sw/source/ui/uno/SwXFilterOptions.cxx | 6 ++--- sw/source/ui/uno/swdetect.cxx | 12 ++------- sw/source/ui/uno/unoatxt.cxx | 13 +++------- sw/source/ui/uno/unomailmerge.cxx | 11 +++------ sw/source/ui/uno/unomod.cxx | 13 +++------- sw/source/ui/uno/unomodule.cxx | 12 ++------- sw/source/ui/uno/unotxdoc.cxx | 18 ++++---------- sw/source/ui/uno/unotxvw.cxx | 11 +++------ 31 files changed, 129 insertions(+), 297 deletions(-) diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx index 137fa4c089f8..8bc30eb3f1d5 100644 --- a/sw/source/core/access/acccell.cxx +++ b/sw/source/core/access/acccell.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -247,14 +248,10 @@ OUString SAL_CALL SwAccessibleCell::getImplementationName() return OUString(sImplementationName); } -sal_Bool SAL_CALL SwAccessibleCell::supportsService( - const OUString& sTestServiceName) +sal_Bool SAL_CALL SwAccessibleCell::supportsService(const OUString& sTestServiceName) throw (uno::RuntimeException) { - return sTestServiceName.equalsAsciiL( sServiceName, - sizeof(sServiceName)-1 ) || - sTestServiceName.equalsAsciiL( sAccessibleServiceName, - sizeof(sAccessibleServiceName)-1 ); + return cppu::supportsService(this, sTestServiceName); } uno::Sequence< OUString > SAL_CALL SwAccessibleCell::getSupportedServiceNames() diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx index 893c63c286df..44af38c64875 100644 --- a/sw/source/core/access/acccontext.cxx +++ b/sw/source/core/access/acccontext.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include "accpara.hxx" #include @@ -988,12 +989,10 @@ OUString SAL_CALL SwAccessibleContext::getImplementationName() THROW_RUNTIME_EXCEPTION( lang::XServiceInfo, "implementation name needs to be overloaded" ) } -sal_Bool SAL_CALL - SwAccessibleContext::supportsService (const OUString& ) +sal_Bool SAL_CALL SwAccessibleContext::supportsService (const OUString& ServiceName) throw (uno::RuntimeException) { - OSL_ENSURE( !this, "supports service needs to be overloaded" ); - THROW_RUNTIME_EXCEPTION( lang::XServiceInfo, "supports service needs to be overloaded" ) + return cppu::supportsService(this, ServiceName); } uno::Sequence< OUString > SAL_CALL SwAccessibleContext::getSupportedServiceNames() diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index 74036086e1ea..1d49da212c7b 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -435,14 +436,10 @@ OUString SAL_CALL SwAccessibleDocument::getImplementationName() return OUString(sImplementationName); } -sal_Bool SAL_CALL SwAccessibleDocument::supportsService( - const OUString& sTestServiceName) +sal_Bool SAL_CALL SwAccessibleDocument::supportsService(const OUString& sTestServiceName) throw (uno::RuntimeException) { - return sTestServiceName.equalsAsciiL( sServiceName, - sizeof(sServiceName)-1 ) || - sTestServiceName.equalsAsciiL( sAccessibleServiceName, - sizeof(sAccessibleServiceName)-1 ); + return cppu::supportsService(this, sTestServiceName); } uno::Sequence< OUString > SAL_CALL SwAccessibleDocument::getSupportedServiceNames() diff --git a/sw/source/core/access/accembedded.cxx b/sw/source/core/access/accembedded.cxx index 7744efc25fc3..61680c587fd6 100644 --- a/sw/source/core/access/accembedded.cxx +++ b/sw/source/core/access/accembedded.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "accembedded.hxx" #include "cntfrm.hxx" @@ -34,7 +35,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::lang; 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"; SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject( @@ -80,14 +80,10 @@ OUString SAL_CALL SwAccessibleEmbeddedObject::getImplementationName() return OUString(sImplementationName); } -sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService( - const OUString& sTestServiceName) +sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService(const OUString& sTestServiceName) throw (uno::RuntimeException) { - return sTestServiceName.equalsAsciiL( sServiceName, - sizeof(sServiceName)-1 ) || - sTestServiceName.equalsAsciiL( sAccessibleServiceName, - sizeof(sAccessibleServiceName)-1 ); + return cppu::supportsService(this, sTestServiceName); } uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServiceNames() @@ -95,7 +91,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServi { uno::Sequence< OUString > aRet(2); OUString* pArray = aRet.getArray(); - pArray[0] = OUString( sServiceName ); + pArray[0] = "com.sun.star.text.AccessibleTextEmbeddedObject"; pArray[1] = OUString( sAccessibleServiceName ); return aRet; } diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx index 24afed8948db..b23c07fcf668 100644 --- a/sw/source/core/access/accfootnote.cxx +++ b/sw/source/core/access/accfootnote.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -102,18 +103,10 @@ OUString SAL_CALL SwAccessibleFootnote::getImplementationName() return OUString(sImplementationNameFootnote); } -sal_Bool SAL_CALL SwAccessibleFootnote::supportsService( - const OUString& sTestServiceName) +sal_Bool SAL_CALL SwAccessibleFootnote::supportsService(const OUString& sTestServiceName) throw (uno::RuntimeException) { - if( sTestServiceName.equalsAsciiL( sAccessibleServiceName, - 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 ); - + return cppu::supportsService(this, sTestServiceName); } Sequence< OUString > SAL_CALL SwAccessibleFootnote::getSupportedServiceNames() diff --git a/sw/source/core/access/accgraphic.cxx b/sw/source/core/access/accgraphic.cxx index cc5b63d8aab2..5326df0f6e4a 100644 --- a/sw/source/core/access/accgraphic.cxx +++ b/sw/source/core/access/accgraphic.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include "accgraphic.hxx" @@ -30,9 +31,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; 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( SwAccessibleMap* pInitMap, const SwFlyFrm* pFlyFrm ) : @@ -47,17 +45,13 @@ SwAccessibleGraphic::~SwAccessibleGraphic() OUString SAL_CALL SwAccessibleGraphic::getImplementationName() throw( RuntimeException ) { - return OUString(sImplementationName); + return OUString("com.sun.star.comp.Writer.SwAccessibleGraphic"); } -sal_Bool SAL_CALL SwAccessibleGraphic::supportsService( - const OUString& sTestServiceName) +sal_Bool SAL_CALL SwAccessibleGraphic::supportsService(const OUString& sTestServiceName) throw (uno::RuntimeException) { - return sTestServiceName.equalsAsciiL( sServiceName, - sizeof(sServiceName)-1 ) || - sTestServiceName.equalsAsciiL( sAccessibleServiceName, - sizeof(sAccessibleServiceName)-1 ); + return cppu::supportsService(this, sTestServiceName); } Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames() @@ -65,7 +59,7 @@ Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames() { Sequence< OUString > aRet(2); OUString* pArray = aRet.getArray(); - pArray[0] = OUString( sServiceName ); + pArray[0] = "com.sun.star.text.AccessibleTextGraphicObject"; pArray[1] = OUString( sAccessibleServiceName ); return aRet; } diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx index ed0eba419b0e..38016a388fe8 100644 --- a/sw/source/core/access/accheaderfooter.cxx +++ b/sw/source/core/access/accheaderfooter.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "accheaderfooter.hxx" @@ -32,8 +33,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; 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 sImplementationNameFooter[] = "com.sun.star.comp.Writer.SwAccessibleFooterView"; @@ -88,18 +87,10 @@ OUString SAL_CALL SwAccessibleHeaderFooter::getImplementationName() return OUString(sImplementationNameFooter); } -sal_Bool SAL_CALL SwAccessibleHeaderFooter::supportsService( - const OUString& sTestServiceName) +sal_Bool SAL_CALL SwAccessibleHeaderFooter::supportsService(const OUString& sTestServiceName) throw (uno::RuntimeException) { - if( sTestServiceName.equalsAsciiL( sAccessibleServiceName, - 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 ); - + return cppu::supportsService(this, sTestServiceName); } Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames() @@ -108,9 +99,9 @@ Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames Sequence< OUString > aRet(2); OUString* pArray = aRet.getArray(); if( AccessibleRole::HEADER == GetRole() ) - pArray[0] = OUString( sServiceNameHeader ); + pArray[0] = "com.sun.star.text.AccessibleHeaderView"; else - pArray[0] = OUString( sServiceNameFooter ); + pArray[0] = "com.sun.star.text.AccessibleFooterView"; pArray[1] = OUString( sAccessibleServiceName ); return aRet; } diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx index cc1ee1d38838..b20506a57b93 100644 --- a/sw/source/core/access/accpage.cxx +++ b/sw/source/core/access/accpage.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include "accpage.hxx" #include "access.hrc" @@ -144,9 +145,7 @@ OUString SwAccessiblePage::getImplementationName( ) sal_Bool SwAccessiblePage::supportsService( const OUString& rServiceName) throw( RuntimeException ) { - return rServiceName.equalsAsciiL( sServiceName, sizeof(sServiceName)-1 ) || - rServiceName.equalsAsciiL( sAccessibleServiceName, - sizeof(sAccessibleServiceName)-1 ); + return cppu::supportsService(this, rServiceName); } Sequence SwAccessiblePage::getSupportedServiceNames( ) diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index c2b0671717ac..062e63ab1d78 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -91,6 +91,7 @@ #include #include #include +#include #include #include @@ -1219,10 +1220,7 @@ sal_Bool SAL_CALL SwAccessibleParagraph::supportsService( const OUString& sTestServiceName) throw (uno::RuntimeException) { - return sTestServiceName.equalsAsciiL( sServiceName, - sizeof(sServiceName)-1 ) || - sTestServiceName.equalsAsciiL( sAccessibleServiceName, - sizeof(sAccessibleServiceName)-1 ); + return cppu::supportsService(this, sTestServiceName); } uno::Sequence< OUString > SAL_CALL SwAccessibleParagraph::getSupportedServiceNames() diff --git a/sw/source/core/access/accpreview.cxx b/sw/source/core/access/accpreview.cxx index 9ca0ffea7069..853ed2e2d7b3 100644 --- a/sw/source/core/access/accpreview.cxx +++ b/sw/source/core/access/accpreview.cxx @@ -20,10 +20,10 @@ #include #include #include +#include #include "access.hrc" #include -const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextDocumentPageView"; const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleDocumentPageView"; using ::com::sun::star::lang::IndexOutOfBoundsException; @@ -51,14 +51,14 @@ OUString SwAccessiblePreview::getImplementationName( ) sal_Bool SwAccessiblePreview::supportsService( const OUString& rServiceName ) throw( RuntimeException ) { - return rServiceName == sServiceName || rServiceName == sAccessibleServiceName; + return cppu::supportsService(this, rServiceName); } Sequence SwAccessiblePreview::getSupportedServiceNames( ) throw( RuntimeException ) { Sequence aSeq( 2 ); - aSeq[0] = OUString( sServiceName ); + aSeq[0] = "com.sun.star.text.AccessibleTextDocumentPageView"; aSeq[1] = OUString( sAccessibleServiceName ); return aSeq; } diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx index 92e1b0943126..9233ee927247 100644 --- a/sw/source/core/access/acctable.cxx +++ b/sw/source/core/access/acctable.cxx @@ -53,14 +53,12 @@ #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; 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::set < sal_Int32, Int32Less_Impl > Int32Set_Impl; @@ -1370,17 +1368,14 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumn( OUString SAL_CALL SwAccessibleTable::getImplementationName() throw( uno::RuntimeException ) { - return OUString(sImplementationName); + return OUString("com.sun.star.comp.Writer.SwAccessibleTableView"); } sal_Bool SAL_CALL SwAccessibleTable::supportsService( const OUString& sTestServiceName) throw (uno::RuntimeException) { - return sTestServiceName.equalsAsciiL( sServiceName, - sizeof(sServiceName)-1 ) || - sTestServiceName.equalsAsciiL( sAccessibleServiceName, - sizeof(sAccessibleServiceName)-1 ); + return cppu::supportsService(this, sTestServiceName); } uno::Sequence< OUString > SAL_CALL SwAccessibleTable::getSupportedServiceNames() @@ -1388,7 +1383,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleTable::getSupportedServiceNames() { uno::Sequence< OUString > aRet(2); OUString* pArray = aRet.getArray(); - pArray[0] = OUString( sServiceName ); + pArray[0] = "com.sun.star.table.AccessibleTableView"; pArray[1] = OUString( sAccessibleServiceName ); return aRet; } diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx index 1a2aa61e17fa..dc6bc34e5749 100644 --- a/sw/source/core/access/acctextframe.cxx +++ b/sw/source/core/access/acctextframe.cxx @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -42,8 +43,6 @@ using namespace ::com::sun::star::accessibility; using utl::AccessibleRelationSetHelper; 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( SwAccessibleMap* pInitMap, @@ -288,17 +287,13 @@ OUString SAL_CALL SwAccessibleTextFrame::getAccessibleDescription (void) OUString SAL_CALL SwAccessibleTextFrame::getImplementationName() throw( uno::RuntimeException ) { - return OUString(sImplementationName); + return OUString("com.sun.star.comp.Writer.SwAccessibleTextFrameView"); } -sal_Bool SAL_CALL SwAccessibleTextFrame::supportsService( - const OUString& sTestServiceName) +sal_Bool SAL_CALL SwAccessibleTextFrame::supportsService(const OUString& sTestServiceName) throw (uno::RuntimeException) { - return sTestServiceName.equalsAsciiL( sServiceName, - sizeof(sServiceName)-1 ) || - sTestServiceName.equalsAsciiL( sAccessibleServiceName, - sizeof(sAccessibleServiceName)-1 ); + return cppu::supportsService(this, sTestServiceName); } uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNames() @@ -306,7 +301,7 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNam { uno::Sequence< OUString > aRet(2); OUString* pArray = aRet.getArray(); - pArray[0] = OUString( sServiceName ); + pArray[0] = "com.sun.star.text.AccessibleTextFrameView"; pArray[1] = OUString( sAccessibleServiceName ); return aRet; } diff --git a/sw/source/core/docnode/finalthreadmanager.cxx b/sw/source/core/docnode/finalthreadmanager.cxx index 2fdb442e6131..0dec4ff3f977 100644 --- a/sw/source/core/docnode/finalthreadmanager.cxx +++ b/sw/source/core/docnode/finalthreadmanager.cxx @@ -26,6 +26,7 @@ #include #include #include +#include /** 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) { - css::uno::Sequence< OUString > serviceNames = comp_FinalThreadManager::_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 FinalThreadManager::getSupportedServiceNames() throw (css::uno::RuntimeException) diff --git a/sw/source/core/layout/dumpfilter.cxx b/sw/source/core/layout/dumpfilter.cxx index c6275c3221b9..6e8f14c4acef 100644 --- a/sw/source/core/layout/dumpfilter.cxx +++ b/sw/source/core/layout/dumpfilter.cxx @@ -10,6 +10,7 @@ #include "dumpfilter.hxx" #include +#include #include #include #include @@ -166,16 +167,7 @@ namespace sw sal_Bool LayoutDumpFilter::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException) { - uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames(); - const OUString* pArray = seqServiceNames.getConstArray(); - for ( sal_Int32 nCounter=0; nCounter < seqServiceNames.getLength(); nCounter++ ) - { - if ( pArray[nCounter] == rServiceName ) - { - return sal_True ; - } - } - return sal_False ; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > LayoutDumpFilter::getSupportedServiceNames() diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx index 70712cc74072..1acbf412813f 100644 --- a/sw/source/core/unocore/SwXTextDefaults.cxx +++ b/sw/source/core/unocore/SwXTextDefaults.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -238,22 +239,18 @@ Any SAL_CALL SwXTextDefaults::getPropertyDefault( const OUString& rPropertyName return aRet; } - OUString SAL_CALL SwXTextDefaults::getImplementationName( ) throw (RuntimeException) { return OUString("SwXTextDefaults"); } - sal_Bool SAL_CALL SwXTextDefaults::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - uno::Sequence< OUString > aSeq(getSupportedServiceNames()); - return std::find(aSeq.begin(), aSeq.end(), rServiceName) != aSeq.end(); + return cppu::supportsService(this, rServiceName); } - uno::Sequence< OUString > SAL_CALL SwXTextDefaults::getSupportedServiceNames( ) throw (RuntimeException) { @@ -269,6 +266,4 @@ uno::Sequence< OUString > SAL_CALL SwXTextDefaults::getSupportedServiceNames( ) return aRet; } - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index f996ad50b7c4..dcda8ceed26d 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -46,11 +47,6 @@ #include #include -#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; // from unotbl.cxx @@ -1505,12 +1501,10 @@ OUString SAL_CALL SwChartDataProvider::getImplementationName( ) return OUString("SwChartDataProvider"); } -sal_Bool SAL_CALL SwChartDataProvider::supportsService( - const OUString& rServiceName ) +sal_Bool SAL_CALL SwChartDataProvider::supportsService(const OUString& rServiceName ) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - return rServiceName == SN_DATA_PROVIDER; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames( ) @@ -1518,7 +1512,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames { SolarMutexGuard aGuard; uno::Sequence< OUString > aRes(1); - aRes.getArray()[0] = SN_DATA_PROVIDER; + aRes.getArray()[0] = "com.sun.star.chart2.data.DataProvider"; return aRes; } @@ -1894,12 +1888,10 @@ OUString SAL_CALL SwChartDataSource::getImplementationName( ) return OUString("SwChartDataSource"); } -sal_Bool SAL_CALL SwChartDataSource::supportsService( - const OUString& rServiceName ) +sal_Bool SAL_CALL SwChartDataSource::supportsService(const OUString& rServiceName ) throw (uno::RuntimeException) { - SolarMutexGuard aGuard; - return rServiceName == SN_DATA_SOURCE; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SAL_CALL SwChartDataSource::getSupportedServiceNames( ) @@ -1907,7 +1899,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSource::getSupportedServiceNames( { SolarMutexGuard aGuard; uno::Sequence< OUString > aRes(1); - aRes.getArray()[0] = SN_DATA_SOURCE; + aRes.getArray()[0] = "com.sun.star.chart2.data.DataSource"; return aRes; } @@ -2354,11 +2346,10 @@ OUString SAL_CALL SwChartDataSequence::getImplementationName( ) return OUString("SwChartDataSequence"); } -sal_Bool SAL_CALL SwChartDataSequence::supportsService( - const OUString& rServiceName ) +sal_Bool SAL_CALL SwChartDataSequence::supportsService(const OUString& rServiceName ) throw (uno::RuntimeException) { - return rServiceName == SN_DATA_SEQUENCE; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames( ) @@ -2366,7 +2357,7 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getSupportedServiceNames { SolarMutexGuard aGuard; uno::Sequence< OUString > aRes(1); - aRes.getArray()[0] = SN_DATA_SEQUENCE; + aRes.getArray()[0] = "com.sun.star.chart2.data.DataSequence"; return aRes; } @@ -2867,7 +2858,7 @@ sal_Bool SAL_CALL SwChartLabeledDataSequence::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException) { - return rServiceName == SN_LABELED_DATA_SEQUENCE; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SAL_CALL SwChartLabeledDataSequence::getSupportedServiceNames( ) @@ -2875,7 +2866,8 @@ uno::Sequence< OUString > SAL_CALL SwChartLabeledDataSequence::getSupportedServi { SolarMutexGuard aGuard; uno::Sequence< OUString > aRes(1); - aRes.getArray()[0] = SN_LABELED_DATA_SEQUENCE; + aRes.getArray()[0] = "com.sun.star.chart2.data.LabeledDataSequence"; + return aRes; } diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 58f36a2cae11..0d2254005e00 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -982,7 +983,7 @@ OUString SwXTextTables::getImplementationName(void) 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 ) @@ -1140,7 +1141,7 @@ OUString SwXFrameEnumeration::getImplementationName(void) throw( RuntimeExcep template sal_Bool SwXFrameEnumeration::supportsService(const OUString& ServiceName) throw( RuntimeException ) { - return ServiceName == "com.sun.star.container.XEnumeration"; + return cppu::supportsService(this, ServiceName); } template @@ -1159,7 +1160,7 @@ OUString SwXFrames::getImplementationName(void) throw( RuntimeException ) sal_Bool SwXFrames::supportsService(const OUString& rServiceName) throw( RuntimeException ) { - return rServiceName == "com.sun.star.text.TextFrames"; + return cppu::supportsService(this, rServiceName); } Sequence SwXFrames::getSupportedServiceNames(void) throw( RuntimeException ) @@ -1326,7 +1327,7 @@ OUString SwXTextFrames::getImplementationName(void) 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 ) @@ -1356,7 +1357,7 @@ OUString SwXTextGraphicObjects::getImplementationName(void) throw( RuntimeExcept 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 ) @@ -1386,7 +1387,7 @@ OUString SwXTextEmbeddedObjects::getImplementationName(void) throw( RuntimeExcep 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 ) @@ -1413,7 +1414,7 @@ OUString SwXTextSections::getImplementationName(void) 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 ) @@ -1601,7 +1602,7 @@ OUString SwXBookmarks::getImplementationName(void) 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 ) @@ -1810,7 +1811,7 @@ OUString SwXFootnotes::getImplementationName(void) 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 ) @@ -1909,7 +1910,7 @@ OUString SwXReferenceMarks::getImplementationName(void) 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 ) diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index e832d0887edd..9033c16885c8 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -433,7 +434,7 @@ OUString SwXShapesEnumeration::getImplementationName(void) throw(uno::RuntimeExc 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) @@ -458,7 +459,7 @@ OUString SwXDrawPage::getImplementationName(void) 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 ) @@ -2132,16 +2133,7 @@ OUString SwXShape::getImplementationName(void) throw( uno::RuntimeException ) sal_Bool SwXShape::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { - sal_Bool bRet = sal_False; - 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; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SwXShape::getSupportedServiceNames(void) throw( uno::RuntimeException ) diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 96ba067091ef..5ca5911ebea3 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -489,15 +490,10 @@ OUString getServiceName(const sal_uInt16 aId) } -sal_Bool SAL_CALL -SwXFieldMaster::supportsService(const OUString& rServiceName) +sal_Bool SAL_CALL SwXFieldMaster::supportsService(const OUString& rServiceName) throw (uno::RuntimeException) { - if (rServiceName=="com.sun.star.text.TextFieldMaster") - return sal_True; - - const OUString sName(getServiceName(m_pImpl->m_nResTypeId)); - return !sName.isEmpty() && sName==rServiceName; + return cppu::supportsService(this, rServiceName); } 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) throw (uno::RuntimeException) { - OUString sServiceName = - 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"; + return cppu::supportsService(this, rServiceName); } 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 ) { - return rServiceName == "com.sun.star.text.TextFieldMasters"; + return cppu::supportsService(this, rServiceName); } 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 ) { - return rServiceName == "com.sun.star.text.TextFields"; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames(void) throw( uno::RuntimeException ) @@ -2891,11 +2879,10 @@ SwXFieldEnumeration::getImplementationName() throw (uno::RuntimeException) return OUString("SwXFieldEnumeration"); } -sal_Bool SAL_CALL -SwXFieldEnumeration::supportsService(const OUString& rServiceName) +sal_Bool SAL_CALL SwXFieldEnumeration::supportsService(const OUString& rServiceName) throw (uno::RuntimeException) { - return rServiceName == "com.sun.star.text.FieldEnumeration"; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SAL_CALL diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 035340eb98e1..1688672fa59e 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -110,6 +110,7 @@ #include #include #include +#include // from fefly1.cxx 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 ) { - return rServiceName.equalsAscii("com.sun.star.text.BaseFrame") || - rServiceName.equalsAscii("com.sun.star.text.TextContent") || - rServiceName.equalsAscii("com.sun.star.document.LinkTarget"); + return cppu::supportsService(this, rServiceName); } 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 ) { - return rServiceName == "com.sun.star.text.Text" || - rServiceName == "com.sun.star.text.TextFrame" || - SwXFrame::supportsService(rServiceName); + return cppu::supportsService(this, rServiceName); } 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 ) { - return rServiceName == "com.sun.star.text.TextGraphicObject" || - SwXFrame::supportsService(rServiceName); + return cppu::supportsService(this, rServiceName); } 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 ) { - return rServiceName == "com.sun.star.text.TextEmbeddedObject" || - SwXFrame::supportsService(rServiceName); + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SwXTextEmbeddedObject::getSupportedServiceNames(void) diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 0806e2225fc5..6d265a487554 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -58,7 +58,7 @@ #include #include #include - +#include using namespace ::com::sun::star; @@ -457,16 +457,7 @@ sal_Bool SAL_CALL SwXDocumentIndex::supportsService(const OUString& rServiceName) throw (uno::RuntimeException) { - SolarMutexGuard g; - - 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"); + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SAL_CALL @@ -1674,22 +1665,10 @@ SwXDocumentIndexMark::getImplementationName() throw (uno::RuntimeException) return OUString("SwXDocumentIndexMark"); } -sal_Bool SAL_CALL -SwXDocumentIndexMark::supportsService(const OUString& rServiceName) +sal_Bool SAL_CALL SwXDocumentIndexMark::supportsService(const OUString& rServiceName) throw (uno::RuntimeException) { - SolarMutexGuard g; - - 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)); + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SAL_CALL @@ -2375,8 +2354,7 @@ static char const*const g_ServicesDocumentIndexes[] = "com.sun.star.text.DocumentIndexes", }; -sal_Bool SAL_CALL -SwXDocumentIndexes::supportsService(const OUString& rServiceName) +sal_Bool SAL_CALL SwXDocumentIndexes::supportsService(const OUString& rServiceName) throw (uno::RuntimeException) { return cppu::supportsService(this, rServiceName); @@ -2705,8 +2683,7 @@ static char const*const g_ServicesIndexTokenAccess[] = "com.sun.star.text.DocumentIndexLevelFormat", }; -sal_Bool SAL_CALL -SwXDocumentIndex::TokenAccess_Impl::supportsService( +sal_Bool SAL_CALL SwXDocumentIndex::TokenAccess_Impl::supportsService( const OUString& rServiceName) throw (uno::RuntimeException) { diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx index f726abc0ae01..323f7f783874 100644 --- a/sw/source/core/unocore/unoredlines.cxx +++ b/sw/source/core/unocore/unoredlines.cxx @@ -19,6 +19,7 @@ #include +#include #include #include @@ -99,11 +100,10 @@ OUString SwXRedlines::getImplementationName(void) throw( uno::RuntimeException ) return OUString("SwXRedlines"); } -sal_Bool SwXRedlines::supportsService(const OUString& /*ServiceName*/) +sal_Bool SwXRedlines::supportsService(const OUString& ServiceName) throw( uno::RuntimeException ) { - OSL_FAIL("not implemented"); - return sal_False; + return cppu::supportsService(this, ServiceName); } uno::Sequence< OUString > SwXRedlines::getSupportedServiceNames(void) @@ -166,9 +166,9 @@ OUString SwXRedlineEnumeration::getImplementationName(void) throw( uno::RuntimeE 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 ) diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index c10ddfd5812c..d21805662132 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -1239,15 +1240,7 @@ OUString SAL_CALL SwXDocumentSettings::getImplementationName( ) sal_Bool SAL_CALL SwXDocumentSettings::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - const Sequence< OUString > aSeq( getSupportedServiceNames() ); - sal_Int32 nCount = aSeq.getLength(); - const OUString* pServices = aSeq.getConstArray(); - while( nCount-- ) - { - if( *pServices++ == ServiceName ) - return sal_True; - } - return sal_True; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > SAL_CALL SwXDocumentSettings::getSupportedServiceNames( ) diff --git a/sw/source/ui/uno/SwXFilterOptions.cxx b/sw/source/ui/uno/SwXFilterOptions.cxx index 2ac92626de3f..6f81eb26c9d8 100644 --- a/sw/source/ui/uno/SwXFilterOptions.cxx +++ b/sw/source/ui/uno/SwXFilterOptions.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -37,7 +38,6 @@ using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::document; 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 FILTER_OPTIONS_NAME "FilterOptions" @@ -57,7 +57,7 @@ OUString SwXFilterOptions::getImplementationName_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); } @@ -159,7 +159,7 @@ OUString SwXFilterOptions::getImplementationName() throw(uno::RuntimeException) sal_Bool SwXFilterOptions::supportsService( const OUString& rServiceName ) throw(uno::RuntimeException) { - return rServiceName == SWFILTEROPTIONSOBJ_SERVICE; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SwXFilterOptions::getSupportedServiceNames() diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx index 117a0c0cb257..bdfd3543974c 100644 --- a/sw/source/ui/uno/swdetect.cxx +++ b/sw/source/ui/uno/swdetect.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -426,16 +427,7 @@ OUString SAL_CALL SwFilterDetect::getImplementationName() throw( RuntimeExceptio /* XServiceInfo */ sal_Bool SAL_CALL SwFilterDetect::supportsService( const OUString& sServiceName ) throw( RuntimeException ) { - Sequence< OUString > seqServiceNames = getSupportedServiceNames(); - const OUString* pArray = seqServiceNames.getConstArray(); - for ( sal_Int32 nCounter=0; nCounter #include #include +#include #include @@ -219,13 +220,7 @@ OUString SwXAutoTextContainer::getImplementationName(void) throw( uno::RuntimeEx sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) { - const uno::Sequence< OUString > aNames = SwXAutoTextContainer_getSupportedServiceNames(); - for(sal_Int32 nService = 0; nService < aNames.getLength(); nService++) - { - if(aNames.getConstArray()[nService] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } 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 ) { - return "com.sun.star.text.AutoTextGroup" == rServiceName; + return cppu::supportsService(this, rServiceName); } 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 ) { - return rServiceName == "com.sun.star.text.AutoTextEntry"; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SwXAutoTextEntry::getSupportedServiceNames(void) throw( uno::RuntimeException ) diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx index f1a75fe0bf73..89c896baee88 100644 --- a/sw/source/ui/uno/unomailmerge.cxx +++ b/sw/source/ui/uno/unomailmerge.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -70,9 +71,6 @@ #include -#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::frame; using namespace ::com::sun::star::uno; @@ -1162,8 +1160,7 @@ OUString SAL_CALL SwXMailMerge::getImplementationName() sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName ) throw(RuntimeException) { - SolarMutexGuard aGuard; - return rServiceName == SN_MAIL_MERGE || rServiceName == SN_DATA_ACCESS_DESCRIPTOR; + return cppu::supportsService(this, rServiceName); } uno::Sequence< OUString > SAL_CALL SwXMailMerge::getSupportedServiceNames() @@ -1178,8 +1175,8 @@ uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames() { uno::Sequence< OUString > aNames(2); OUString *pName = aNames.getArray(); - pName[0] = SN_MAIL_MERGE; - pName[1] = SN_DATA_ACCESS_DESCRIPTOR; + pName[0] = "com.sun.star.text.MailMerge"; + pName[1] = "com.sun.star.sdb.DataAccessDescriptor"; return aNames; } diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index 05723abe17fc..2a78e866bc8d 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -253,13 +254,7 @@ OUString SwXModule::getImplementationName(void) throw( RuntimeException ) sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( RuntimeException ) { - const Sequence< OUString > aNames = SwXModule_getSupportedServiceNames(); - for(sal_Int32 nService = 0; nService < aNames.getLength(); nService++) - { - if(aNames.getConstArray()[nService] == rServiceName) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, rServiceName); } 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 ) { - return rServiceName == "com.sun.star.text.PrintSettings"; + return cppu::supportsService(this, rServiceName); } 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 ) { - return rServiceName == "com.sun.star.text.ViewSettings"; + return cppu::supportsService(this, rServiceName); } Sequence< OUString > SwXViewSettings::getSupportedServiceNames(void) throw( RuntimeException ) diff --git a/sw/source/ui/uno/unomodule.cxx b/sw/source/ui/uno/unomodule.cxx index 13a2238ab707..de79abecd844 100644 --- a/sw/source/ui/uno/unomodule.cxx +++ b/sw/source/ui/uno/unomodule.cxx @@ -23,6 +23,7 @@ #include "swmodule.hxx" #include "swdll.hxx" #include "unomodule.hxx" +#include #include #include #include @@ -142,16 +143,7 @@ OUString SAL_CALL SwUnoModule::getImplementationName( ) throw(uno::RuntimeExcep sal_Bool SAL_CALL SwUnoModule::supportsService( const OUString& sServiceName ) throw(uno::RuntimeException) { - uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames(); - const OUString* pArray = seqServiceNames.getConstArray(); - for ( sal_Int32 nCounter=0; nCounter SAL_CALL SwUnoModule::getSupportedServiceNames( ) throw(uno::RuntimeException) diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index b5789f5d244b..095a481c1138 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -101,6 +101,7 @@ #include #include #include +#include // #i12836# enhanced pdf export #include @@ -1772,16 +1773,7 @@ OUString SwXTextDocument::getImplementationName(void) 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 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") ); + return cppu::supportsService(this, rServiceName); } Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( RuntimeException ) @@ -3475,7 +3467,7 @@ OUString SwXLinkTargetSupplier::getImplementationName(void) throw( RuntimeExcept sal_Bool SwXLinkTargetSupplier::supportsService(const OUString& rServiceName) throw( RuntimeException ) { - return (rServiceName == "com.sun.star.document.LinkTargets"); + return cppu::supportsService(this, rServiceName); } Sequence< OUString > SwXLinkTargetSupplier::getSupportedServiceNames(void) @@ -3761,7 +3753,7 @@ OUString SwXLinkNameAccessWrapper::getImplementationName(void) throw( RuntimeExc sal_Bool SwXLinkNameAccessWrapper::supportsService(const OUString& rServiceName) throw( RuntimeException ) { - return (rServiceName == "com.sun.star.document.LinkTargets"); + return cppu::supportsService(this, rServiceName); } Sequence< OUString > SwXLinkNameAccessWrapper::getSupportedServiceNames(void) @@ -3839,7 +3831,7 @@ OUString SwXOutlineTarget::getImplementationName(void) 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 ) diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index f6565e76bb96..6309cdc5b766 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -73,6 +73,7 @@ #include "swdtflvr.hxx" #include #include +#include using namespace ::com::sun::star; 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 ) { - 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 ) @@ -1698,13 +1699,7 @@ OUString SwXTextViewCursor::getImplementationName(void) throw( RuntimeException sal_Bool SwXTextViewCursor::supportsService(const OUString& rServiceName) throw( RuntimeException ) { - return rServiceName.equalsAscii("com.sun.star.text.TextViewCursor") || - 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"); + return cppu::supportsService(this, rServiceName); } Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames(void) throw( RuntimeException ) -- cgit v1.2.3