summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2020-04-29 00:35:52 +0200
committerEike Rathke <erack@redhat.com>2020-04-29 02:13:21 +0200
commit14fef320301f71f68547af1c0527677cc0ef6f88 (patch)
tree86bd51328c1ed9814a100db27f51cf51102642fa /sc
parentf845f74afaf087a46c82ee4209e29caca0980b71 (diff)
Fix typo in code
... and provide a compatibility mechanism for supported service names, as the typo was long standing since the beginning and existing extensions may rely on it. Co-authored-by: Andrea Gelmini <andrea.gelmini@gelma.net> Change-Id: I289ec8a17b131bd013dd4b69327aed41e488d4f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92938 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/miscuno.hxx44
-rw-r--r--sc/source/core/data/dptabsrc.cxx6
2 files changed, 37 insertions, 13 deletions
diff --git a/sc/inc/miscuno.hxx b/sc/inc/miscuno.hxx
index 62a6f4cd9350..9e2963e08027 100644
--- a/sc/inc/miscuno.hxx
+++ b/sc/inc/miscuno.hxx
@@ -32,22 +32,44 @@
#include <osl/diagnose.h>
#include "scdllapi.h"
-#define SC_SIMPLE_SERVICE_INFO( ClassName, ClassNameAscii, ServiceAscii ) \
-OUString SAL_CALL ClassName::getImplementationName() \
-{ \
- return ClassNameAscii; \
-} \
+#define SC_SIMPLE_SERVICE_INFO_IMPL( ClassName, ClassNameAscii ) \
+OUString SAL_CALL ClassName::getImplementationName() \
+{ \
+ return ClassNameAscii; \
+} \
sal_Bool SAL_CALL ClassName::supportsService( const OUString& ServiceName ) \
+{ \
+ return cppu::supportsService(this, ServiceName); \
+}
+
+#define SC_SIMPLE_SERVICE_INFO_NAME( ClassName, ServiceAscii ) \
+css::uno::Sequence< OUString > \
+ SAL_CALL ClassName::getSupportedServiceNames() \
+{ \
+ css::uno::Sequence< OUString > aRet { ServiceAscii }; \
+ return aRet; \
+}
+
+// Place the old mistyped variant as first element so existing code can
+// continue to ask aRet[0] if it doesn't iterate; new code can iterate over the
+// sequence. This mostly should be used by supportsService() iterating anyway.
+#define SC_SIMPLE_SERVICE_INFO_TYPO( ClassName, ServiceAscii, ServiceAsciiMistyped ) \
+css::uno::Sequence< OUString > \
+ SAL_CALL ClassName::getSupportedServiceNames() \
{ \
- return cppu::supportsService(this, ServiceName); \
-} \
-css::uno::Sequence< OUString > \
- SAL_CALL ClassName::getSupportedServiceNames() \
-{ \
- css::uno::Sequence< OUString > aRet { ServiceAscii }; \
+ css::uno::Sequence< OUString > aRet { ServiceAsciiMistyped, ServiceAscii }; \
return aRet; \
}
+#define SC_SIMPLE_SERVICE_INFO( ClassName, ClassNameAscii, ServiceAscii ) \
+ SC_SIMPLE_SERVICE_INFO_IMPL( ClassName, ClassNameAscii ) \
+ SC_SIMPLE_SERVICE_INFO_NAME( ClassName, ServiceAscii )
+
+#define SC_SIMPLE_SERVICE_INFO_COMPAT( ClassName, ClassNameAscii, ServiceAscii, ServiceAsciiMistyped ) \
+ SC_SIMPLE_SERVICE_INFO_IMPL( ClassName, ClassNameAscii ) \
+ SC_SIMPLE_SERVICE_INFO_TYPO( ClassName, ServiceAscii, ServiceAsciiMistyped )
+
+
#define SC_IMPL_DUMMY_PROPERTY_LISTENER( ClassName ) \
void SAL_CALL ClassName::addPropertyChangeListener( const OUString&, \
const uno::Reference<beans::XPropertyChangeListener>&) \
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 01f50ea55805..a2e4171a3be9 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -68,8 +68,10 @@ using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo;
SC_SIMPLE_SERVICE_INFO( ScDPSource, "ScDPSource", "com.sun.star.sheet.DataPilotSource" )
SC_SIMPLE_SERVICE_INFO( ScDPDimensions, "ScDPDimensions", "com.sun.star.sheet.DataPilotSourceDimensions" )
SC_SIMPLE_SERVICE_INFO( ScDPDimension, "ScDPDimension", "com.sun.star.sheet.DataPilotSourceDimension" )
-SC_SIMPLE_SERVICE_INFO( ScDPHierarchies, "ScDPHierarchies", "com.sun.star.sheet.DataPilotSourceHierarcies" )
-SC_SIMPLE_SERVICE_INFO( ScDPHierarchy, "ScDPHierarchy", "com.sun.star.sheet.DataPilotSourceHierarcy" )
+SC_SIMPLE_SERVICE_INFO_COMPAT( ScDPHierarchies, "ScDPHierarchies",
+ "com.sun.star.sheet.DataPilotSourceHierarchies", "com.sun.star.sheet.DataPilotSourceHierarcies" )
+SC_SIMPLE_SERVICE_INFO_COMPAT( ScDPHierarchy, "ScDPHierarchy",
+ "com.sun.star.sheet.DataPilotSourceHierarchy", "com.sun.star.sheet.DataPilotSourceHierarcy" )
SC_SIMPLE_SERVICE_INFO( ScDPLevels, "ScDPLevels", "com.sun.star.sheet.DataPilotSourceLevels" )
SC_SIMPLE_SERVICE_INFO( ScDPLevel, "ScDPLevel", "com.sun.star.sheet.DataPilotSourceLevel" )
SC_SIMPLE_SERVICE_INFO( ScDPMembers, "ScDPMembers", "com.sun.star.sheet.DataPilotSourceMembers" )