summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unofield.cxx
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-12-05 19:17:18 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-12-09 17:25:13 +0100
commit2f50ce6cfab2871cd879c1429e1938d3642616ef (patch)
tree2dfc1793987c36f75e042118dcac4805c85fc667 /sw/source/core/unocore/unofield.cxx
parent28de078a73ad5f8effa7de8b60db2f4cbed14f2a (diff)
fdo#54938: Convert sw to use cppu::supportsService
Change-Id: Ic27bf31e5eb991ccceb8b97713d1e50a736709c8 Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source/core/unocore/unofield.cxx')
-rw-r--r--sw/source/core/unocore/unofield.cxx29
1 files changed, 8 insertions, 21 deletions
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 <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx>
#include <comphelper/types.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/Date.hpp>
@@ -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