[Libreoffice-commits] core.git: starmath/source

Marcos Paulo de Souza marcos.souza.org at gmail.com
Mon Dec 9 09:03:05 PST 2013


 starmath/source/accessibility.cxx |   11 +++--------
 starmath/source/unomodel.cxx      |    6 ++----
 2 files changed, 5 insertions(+), 12 deletions(-)

New commits:
commit b4b623c10ca4dbb94cdd7fd8189b40e50fbf9b6e
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Thu Dec 5 12:51:11 2013 -0200

    fdo#54938: Convert starmath to use cppu::supportsService
    
    Change-Id: If5ba86d421ce876071df39ce8dec1bebe7ebae81
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index f80f1c6..7b6a2c4 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -26,12 +26,12 @@
 #include <com/sun/star/awt/XFocusListener.hpp>
 #include <unotools/accessiblerelationsethelper.hxx>
 
-
 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
 #include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
 #include <com/sun/star/i18n/WordType.hpp>
 #include <unotools/accessiblestatesethelper.hxx>
 #include <comphelper/accessibleeventnotifier.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/diagnose.h>
 #include <vcl/svapp.hxx>
 #include <vcl/window.hxx>
@@ -794,10 +794,7 @@ sal_Bool SAL_CALL SmGraphicAccessible::supportsService(
         const OUString& rServiceName )
     throw (RuntimeException)
 {
-    return  rServiceName == "com::sun::star::accessibility::Accessible" ||
-            rServiceName == "com::sun::star::accessibility::AccessibleComponent" ||
-            rServiceName == "com::sun::star::accessibility::AccessibleContext" ||
-            rServiceName == "com::sun::star::accessibility::AccessibleText";
+    return  cppu::supportsService(this, rServiceName);
 }
 
 Sequence< OUString > SAL_CALL SmGraphicAccessible::getSupportedServiceNames()
@@ -1945,9 +1942,7 @@ sal_Bool SAL_CALL SmEditAccessible::supportsService(
         const OUString& rServiceName )
     throw (RuntimeException)
 {
-    return  rServiceName == "com::sun::star::accessibility::Accessible" ||
-            rServiceName == "com::sun::star::accessibility::AccessibleComponent" ||
-            rServiceName == "com::sun::star::accessibility::AccessibleContext";
+    return  cppu::supportsService(this, rServiceName);
 }
 
 Sequence< OUString > SAL_CALL SmEditAccessible::getSupportedServiceNames()
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index c3b9a9d..bd06768 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -37,6 +37,7 @@
 #include <rtl/ustrbuf.hxx>
 #include <comphelper/propertysetinfo.hxx>
 #include <comphelper/servicehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <unotools/moduleoptions.hxx>
 
 #include <unomodel.hxx>
@@ -416,10 +417,7 @@ OUString SmModel::getImplementationName_Static()
 
 sal_Bool SmModel::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
 {
-    return (
-            rServiceName == "com.sun.star.document.OfficeDocument" ||
-            rServiceName == "com.sun.star.formula.FormulaProperties"
-           );
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > SmModel::getSupportedServiceNames(void) throw( uno::RuntimeException )


More information about the Libreoffice-commits mailing list