sc/inc/miscuno.hxx | 44 +++++++++++++++++++++++++++++---------- sc/source/core/data/dptabsrc.cxx | 6 +++-- 2 files changed, 37 insertions(+), 13 deletions(-)
New commits: commit 14fef320301f71f68547af1c0527677cc0ef6f88 Author: Eike Rathke <er...@redhat.com> AuthorDate: Wed Apr 29 00:35:52 2020 +0200 Commit: Eike Rathke <er...@redhat.com> CommitDate: Wed Apr 29 02:13:21 2020 +0200 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.gelm...@gelma.net> Change-Id: I289ec8a17b131bd013dd4b69327aed41e488d4f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92938 Tested-by: Jenkins Reviewed-by: Eike Rathke <er...@redhat.com> 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" ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits