diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-06-01 20:50:37 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-06-03 09:32:50 +0200 |
commit | 09c657ebe69fe1c2516a10a4452996870f4237d2 (patch) | |
tree | 1e0d6154aa3674599994bd8a4a90e1e4a83af813 /sc | |
parent | 675a3928e1cab27cf310c316be65acdbb764ed65 (diff) |
tdf#39593 use UNO3_GETIMPLEMENTATION* macros
Change-Id: I4e9af3b43a5baf19e100f42b3f37a2ade89ada5d
Reviewed-on: https://gerrit.libreoffice.org/73320
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/afmtuno.hxx | 7 | ||||
-rw-r--r-- | sc/inc/cellsuno.hxx | 12 | ||||
-rw-r--r-- | sc/inc/datauno.hxx | 6 | ||||
-rw-r--r-- | sc/inc/fielduno.hxx | 6 | ||||
-rw-r--r-- | sc/inc/fmtuno.hxx | 11 | ||||
-rw-r--r-- | sc/inc/srchuno.hxx | 7 | ||||
-rw-r--r-- | sc/inc/styleuno.hxx | 7 | ||||
-rw-r--r-- | sc/inc/textuno.hxx | 16 | ||||
-rw-r--r-- | sc/inc/viewuno.hxx | 7 | ||||
-rw-r--r-- | sc/source/ui/unoobj/afmtuno.cxx | 32 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 64 | ||||
-rw-r--r-- | sc/source/ui/unoobj/datauno.cxx | 32 | ||||
-rw-r--r-- | sc/source/ui/unoobj/fielduno.cxx | 32 | ||||
-rw-r--r-- | sc/source/ui/unoobj/fmtuno.cxx | 63 | ||||
-rw-r--r-- | sc/source/ui/unoobj/srchuno.cxx | 32 | ||||
-rw-r--r-- | sc/source/ui/unoobj/styleuno.cxx | 31 | ||||
-rw-r--r-- | sc/source/ui/unoobj/textuno.cxx | 94 | ||||
-rw-r--r-- | sc/source/ui/unoobj/viewuno.cxx | 32 |
18 files changed, 35 insertions, 456 deletions
diff --git a/sc/inc/afmtuno.hxx b/sc/inc/afmtuno.hxx index 5e13886815d7..d39e5e41a294 100644 --- a/sc/inc/afmtuno.hxx +++ b/sc/inc/afmtuno.hxx @@ -28,6 +28,7 @@ #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> class ScAutoFormatFieldObj; @@ -145,11 +146,7 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< - sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScAutoFormatObj* getImplementation(const css::uno::Reference<css::uno::XInterface>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScAutoFormatObj) }; class ScAutoFormatFieldObj : public ::cppu::WeakImplHelper< diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 865a5d5433b0..4abc19c6b7d9 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -84,6 +84,7 @@ #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp> #include <com/sun/star/sheet/XExternalSheetName.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/weakref.hxx> @@ -382,10 +383,7 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScCellRangesBase* getImplementation(const css::uno::Reference<css::uno::XInterface>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScCellRangesBase) // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; @@ -968,11 +966,7 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< - sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScTableSheetObj* getImplementation(const css::uno::Reference< css::uno::XInterface>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScTableSheetObj); // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; diff --git a/sc/inc/datauno.hxx b/sc/inc/datauno.hxx index 95b79b220243..92f172532a4c 100644 --- a/sc/inc/datauno.hxx +++ b/sc/inc/datauno.hxx @@ -42,6 +42,7 @@ #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/util/XRefreshable.hpp> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include <rtl/ref.hxx> #include <svl/itemprop.hxx> @@ -161,10 +162,7 @@ public: const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScSubTotalDescriptorBase* getImplementation(const css::uno::Reference<css::sheet::XSubTotalDescriptor>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScSubTotalDescriptorBase) // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; diff --git a/sc/inc/fielduno.hxx b/sc/inc/fielduno.hxx index a1678d68ee8e..f5e4f45a2fbe 100644 --- a/sc/inc/fielduno.hxx +++ b/sc/inc/fielduno.hxx @@ -34,6 +34,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/util/XRefreshable.hpp> #include <com/sun/star/util/DateTime.hpp> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/component.hxx> #include <cppuhelper/implbase.hxx> #include <osl/mutex.hxx> @@ -199,9 +200,6 @@ private: void setPropertyValueSheet(const OUString& rName, const css::uno::Any& rVal); public: - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScEditFieldObj* getImplementation(const css::uno::Reference<css::text::XTextContent>& xObj); - ScEditFieldObj( const css::uno::Reference<css::text::XTextRange>& rContent, std::unique_ptr<ScEditSource> pEditSrc, sal_Int32 eType, const ESelection& rSel); @@ -244,7 +242,7 @@ public: const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; + UNO3_GETIMPLEMENTATION_DECL(ScEditFieldObj) // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; diff --git a/sc/inc/fmtuno.hxx b/sc/inc/fmtuno.hxx index 9d82f81c95cb..a8344bcd4d88 100644 --- a/sc/inc/fmtuno.hxx +++ b/sc/inc/fmtuno.hxx @@ -36,6 +36,7 @@ #include <com/sun/star/sheet/XMultiFormulaTokens.hpp> #include <com/sun/star/sheet/FormulaToken.hpp> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include "address.hxx" @@ -108,10 +109,7 @@ public: virtual sal_Bool SAL_CALL hasElements() override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScTableConditionalFormat* getImplementation(const css::uno::Reference<css::sheet::XSheetConditionalEntries>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScTableConditionalFormat) // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; @@ -235,10 +233,7 @@ public: const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScTableValidationObj* getImplementation(const css::uno::Reference<css::beans::XPropertySet>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScTableValidationObj) // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; diff --git a/sc/inc/srchuno.hxx b/sc/inc/srchuno.hxx index d2c94846209c..7d485ba688b4 100644 --- a/sc/inc/srchuno.hxx +++ b/sc/inc/srchuno.hxx @@ -25,6 +25,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <svl/itemprop.hxx> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> class SvxSearchItem; @@ -71,11 +72,7 @@ public: const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< - sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScCellSearchObj* getImplementation(const css::uno::Reference<css::util::XSearchDescriptor>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScCellSearchObj) // XServiceInfo virtual OUString SAL_CALL getImplementationName() override; diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx index 34fa814451db..5552ef28c9a8 100644 --- a/sc/inc/styleuno.hxx +++ b/sc/inc/styleuno.hxx @@ -32,6 +32,7 @@ #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/beans/XMultiPropertyStates.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> namespace com { namespace sun { namespace star { namespace container { class XIndexReplace; } } } } @@ -264,11 +265,7 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScStyleObj* getImplementation(const css::uno::Reference<css::uno::XInterface>& rObj); - + UNO3_GETIMPLEMENTATION_DECL(ScStyleObj) }; #endif diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx index 5467c4eb6726..7666c2691249 100644 --- a/sc/inc/textuno.hxx +++ b/sc/inc/textuno.hxx @@ -27,6 +27,7 @@ #include <com/sun/star/sheet/XHeaderFooterContent.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/weakref.hxx> @@ -236,10 +237,7 @@ public: getEnd() override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScCellTextCursor* getImplementation(const css::uno::Reference< css::uno::XInterface>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScCellTextCursor) }; class ScHeaderFooterTextCursor : public SvxUnoTextCursor @@ -265,10 +263,7 @@ public: getEnd() override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScHeaderFooterTextCursor* getImplementation(const css::uno::Reference<css::uno::XInterface>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScHeaderFooterTextCursor) }; class ScDrawTextCursor : public SvxUnoTextCursor @@ -295,10 +290,7 @@ public: getEnd() override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScDrawTextCursor* getImplementation(const css::uno::Reference<css::uno::XInterface>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScDrawTextCursor) }; // ScAnnotationTextCursor isn't needed anymore - SvxUnoTextCursor is used instead diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx index 1846ca6cb844..3546b50fc5ed 100644 --- a/sc/inc/viewuno.hxx +++ b/sc/inc/viewuno.hxx @@ -38,6 +38,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/datatransfer/XTransferableSupplier.hpp> +#include <comphelper/servicehelper.hxx> #include "types.hxx" @@ -268,11 +269,7 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< - sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - static ScTabViewObj* getImplementation(const css::uno::Reference<css::uno::XInterface>& rObj); + UNO3_GETIMPLEMENTATION_DECL(ScTabViewObj) // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index 56c711623df0..2ca01d150496 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -26,7 +26,6 @@ #include <vcl/svapp.hxx> #include <svx/unomid.hxx> #include <unowids.hxx> -#include <comphelper/servicehelper.hxx> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/table/BorderLine.hpp> #include <com/sun/star/table/CellVertJustify2.hpp> @@ -379,36 +378,7 @@ void ScAutoFormatObj::InitFormat( sal_uInt16 nNewIndex ) // XUnoTunnel -sal_Int64 SAL_CALL ScAutoFormatObj::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return 0; -} - -namespace -{ - class theScAutoFormatObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScAutoFormatObjUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScAutoFormatObj::getUnoTunnelId() -{ - return theScAutoFormatObjUnoTunnelId::get().getSeq(); -} - -ScAutoFormatObj* ScAutoFormatObj::getImplementation(const uno::Reference<uno::XInterface>& rObj) -{ - ScAutoFormatObj* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScAutoFormatObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION_IMPL(ScAutoFormatObj); // XTableAutoFormat diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 2948db62e5c3..fe61b8b6b5b6 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -42,7 +42,6 @@ #include <sfx2/bindings.hxx> #include <svl/zforlist.hxx> #include <svl/zformat.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <float.h> @@ -4067,36 +4066,7 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const uno::Reference<util::XSea // XUnoTunnel -sal_Int64 SAL_CALL ScCellRangesBase::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return 0; -} - -namespace -{ - class theScCellRangesBaseUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScCellRangesBaseUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScCellRangesBase::getUnoTunnelId() -{ - return theScCellRangesBaseUnoTunnelId::get().getSeq(); -} - -ScCellRangesBase* ScCellRangesBase::getImplementation(const uno::Reference<uno::XInterface>& rObj) -{ - ScCellRangesBase* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScCellRangesBase*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION_IMPL(ScCellRangesBase); typedef std::vector<ScNamedEntry> ScNamedEntryArr_Impl; @@ -8423,37 +8393,7 @@ uno::Sequence<OUString> SAL_CALL ScTableSheetObj::getSupportedServiceNames() // XUnoTunnel -sal_Int64 SAL_CALL ScTableSheetObj::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - - return ScCellRangeObj::getSomething( rId ); -} - -namespace -{ - class theScTableSheetObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScTableSheetObjUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScTableSheetObj::getUnoTunnelId() -{ - return theScTableSheetObjUnoTunnelId::get().getSeq(); -} - -ScTableSheetObj* ScTableSheetObj::getImplementation(const uno::Reference<uno::XInterface>& rObj) -{ - ScTableSheetObj* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScTableSheetObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION2_IMPL(ScTableSheetObj, ScCellRangeObj); ScTableColumnObj::ScTableColumnObj( ScDocShell* pDocSh, SCCOL nCol, SCTAB nTab ) : ScCellRangeObj( pDocSh, ScRange(nCol,0,nTab, nCol,MAXROW,nTab) ), diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index cafc2522bb07..83b69c87480f 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -57,7 +57,6 @@ #include <dpobject.hxx> #include <comphelper/extract.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <svx/dataaccessdescriptor.hxx> @@ -740,36 +739,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScSubTotalDescriptorBase ) // XUnoTunnel -sal_Int64 SAL_CALL ScSubTotalDescriptorBase::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return 0; -} - -namespace -{ - class theScSubTotalDescriptorBaseUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScSubTotalDescriptorBaseUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScSubTotalDescriptorBase::getUnoTunnelId() -{ - return theScSubTotalDescriptorBaseUnoTunnelId::get().getSeq(); -} - -ScSubTotalDescriptorBase* ScSubTotalDescriptorBase::getImplementation(const uno::Reference<sheet::XSubTotalDescriptor>& rObj) -{ - ScSubTotalDescriptorBase* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScSubTotalDescriptorBase*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION_IMPL(ScSubTotalDescriptorBase); ScSubTotalDescriptor::ScSubTotalDescriptor() { diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index c8baf225cd99..a80a5f48abd6 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -38,7 +38,6 @@ #include <editeng/editobj.hxx> #include <editeng/flditem.hxx> #include <comphelper/sequence.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -1284,36 +1283,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScEditFieldObj ) // XUnoTunnel -sal_Int64 SAL_CALL ScEditFieldObj::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return 0; -} - -namespace -{ - class theScEditFieldObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScEditFieldObjUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScEditFieldObj::getUnoTunnelId() -{ - return theScEditFieldObjUnoTunnelId::get().getSeq(); -} - -ScEditFieldObj* ScEditFieldObj::getImplementation(const uno::Reference<text::XTextContent>& xObj) -{ - ScEditFieldObj* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT( xObj, uno::UNO_QUERY ); - if (xUT.is()) - pRet = reinterpret_cast<ScEditFieldObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION_IMPL(ScEditFieldObj); // XServiceInfo diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx index 4cd31ca6aae9..1e7464858111 100644 --- a/sc/source/ui/unoobj/fmtuno.cxx +++ b/sc/source/ui/unoobj/fmtuno.cxx @@ -21,7 +21,6 @@ #include <osl/diagnose.h> #include <vcl/svapp.hxx> -#include <comphelper/servicehelper.hxx> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/sheet/ConditionOperator2.hpp> #include <com/sun/star/sheet/ValidationAlertStyle.hpp> @@ -453,36 +452,7 @@ sal_Bool SAL_CALL ScTableConditionalFormat::hasByName( const OUString& aName ) // XUnoTunnel -sal_Int64 SAL_CALL ScTableConditionalFormat::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return 0; -} - -namespace -{ - class theScTableConditionalFormatUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScTableConditionalFormatUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScTableConditionalFormat::getUnoTunnelId() -{ - return theScTableConditionalFormatUnoTunnelId::get().getSeq(); -} - -ScTableConditionalFormat* ScTableConditionalFormat::getImplementation(const uno::Reference<sheet::XSheetConditionalEntries>& rObj) -{ - ScTableConditionalFormat* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScTableConditionalFormat*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION_IMPL(ScTableConditionalFormat); ScTableConditionalEntry::ScTableConditionalEntry(const ScCondFormatEntryItem& aItem) : aData( aItem ) @@ -951,35 +921,6 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScTableValidationObj ) // XUnoTunnel -sal_Int64 SAL_CALL ScTableValidationObj::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return 0; -} - -namespace -{ - class theScTableValidationObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScTableValidationObjUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScTableValidationObj::getUnoTunnelId() -{ - return theScTableValidationObjUnoTunnelId::get().getSeq(); -} - -ScTableValidationObj* ScTableValidationObj::getImplementation(const uno::Reference<beans::XPropertySet>& rObj) -{ - ScTableValidationObj* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScTableValidationObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION_IMPL(ScTableValidationObj); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx index 177c0453f5ee..d7d42b70bddb 100644 --- a/sc/source/ui/unoobj/srchuno.cxx +++ b/sc/source/ui/unoobj/srchuno.cxx @@ -20,7 +20,6 @@ #include <scitems.hxx> #include <svl/srchitem.hxx> #include <vcl/svapp.hxx> -#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> @@ -198,35 +197,6 @@ uno::Sequence<OUString> SAL_CALL ScCellSearchObj::getSupportedServiceNames() // XUnoTunnel -sal_Int64 SAL_CALL ScCellSearchObj::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return 0; -} - -namespace -{ - class theScCellSearchObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScCellSearchObjUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScCellSearchObj::getUnoTunnelId() -{ - return theScCellSearchObjUnoTunnelId::get().getSeq(); -} - -ScCellSearchObj* ScCellSearchObj::getImplementation(const uno::Reference<util::XSearchDescriptor>& rObj) -{ - ScCellSearchObj* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScCellSearchObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION_IMPL(ScCellSearchObj); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 7785d4b984c1..6ef7d575aeb2 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -956,36 +956,7 @@ ScStyleObj::~ScStyleObj() // XUnoTunnel -sal_Int64 SAL_CALL ScStyleObj::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return 0; -} - -namespace -{ - class theScStyleObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScStyleObjUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScStyleObj::getUnoTunnelId() -{ - return theScStyleObjUnoTunnelId::get().getSeq(); -} - -ScStyleObj* ScStyleObj::getImplementation(const uno::Reference<uno::XInterface>& rObj) -{ - ScStyleObj* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScStyleObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION_IMPL(ScStyleObj); void ScStyleObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) { diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 5fad23d0df1a..fd35986dcda8 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -613,36 +613,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScCellTextCursor::getEnd() // XUnoTunnel -sal_Int64 SAL_CALL ScCellTextCursor::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return SvxUnoTextCursor::getSomething( rId ); -} - -namespace -{ - class theScCellTextCursorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScCellTextCursorUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScCellTextCursor::getUnoTunnelId() -{ - return theScCellTextCursorUnoTunnelId::get().getSeq(); -} - -ScCellTextCursor* ScCellTextCursor::getImplementation(const uno::Reference<uno::XInterface>& rObj) -{ - ScCellTextCursor* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScCellTextCursor*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION2_IMPL(ScCellTextCursor, SvxUnoTextCursor); ScHeaderFooterTextCursor::ScHeaderFooterTextCursor(rtl::Reference<ScHeaderFooterTextObj> const & rText) : SvxUnoTextCursor( rText->GetUnoText() ), @@ -695,37 +666,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextCursor::getEnd() // XUnoTunnel -sal_Int64 SAL_CALL ScHeaderFooterTextCursor::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return SvxUnoTextCursor::getSomething( rId ); -} - -namespace -{ - class theScHeaderFooterTextCursorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScHeaderFooterTextCursorUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScHeaderFooterTextCursor::getUnoTunnelId() -{ - return theScHeaderFooterTextCursorUnoTunnelId::get().getSeq(); -} - -ScHeaderFooterTextCursor* ScHeaderFooterTextCursor::getImplementation( - const uno::Reference<uno::XInterface>& rObj) -{ - ScHeaderFooterTextCursor* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScHeaderFooterTextCursor*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION2_IMPL(ScHeaderFooterTextCursor, SvxUnoTextCursor); ScDrawTextCursor::ScDrawTextCursor( const uno::Reference<text::XText>& xParent, const SvxUnoTextBase& rText ) : @@ -783,36 +724,7 @@ uno::Reference<text::XTextRange> SAL_CALL ScDrawTextCursor::getEnd() // XUnoTunnel -sal_Int64 SAL_CALL ScDrawTextCursor::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return SvxUnoTextCursor::getSomething( rId ); -} - -namespace -{ - class theScDrawTextCursorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScDrawTextCursorUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScDrawTextCursor::getUnoTunnelId() -{ - return theScDrawTextCursorUnoTunnelId::get().getSeq(); -} - -ScDrawTextCursor* ScDrawTextCursor::getImplementation(const uno::Reference<uno::XInterface>& rObj) -{ - ScDrawTextCursor* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScDrawTextCursor*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION2_IMPL(ScDrawTextCursor, SvxUnoTextCursor); ScSimpleEditSourceHelper::ScSimpleEditSourceHelper() { diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index ebf219248295..080d70d4f75b 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -40,7 +40,6 @@ #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> #include <comphelper/profilezone.hxx> -#include <comphelper/servicehelper.hxx> #include <comphelper/processfactory.hxx> #include <cppuhelper/supportsservice.hxx> #include <toolkit/helper/convert.hxx> @@ -2063,36 +2062,7 @@ uno::Sequence<OUString> SAL_CALL ScTabViewObj::getSupportedServiceNames() // XUnoTunnel -sal_Int64 SAL_CALL ScTabViewObj::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - if ( rId.getLength() == 16 && - 0 == memcmp( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); - } - return 0; -} - -namespace -{ - class theScTabViewObjUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theScTabViewObjUnoTunnelId> {}; -} - -const uno::Sequence<sal_Int8>& ScTabViewObj::getUnoTunnelId() -{ - return theScTabViewObjUnoTunnelId::get().getSeq(); -} - -ScTabViewObj* ScTabViewObj::getImplementation(const uno::Reference<uno::XInterface>& rObj) -{ - ScTabViewObj* pRet = nullptr; - uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY); - if (xUT.is()) - pRet = reinterpret_cast<ScTabViewObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId()))); - return pRet; -} +UNO3_GETIMPLEMENTATION_IMPL(ScTabViewObj); css::uno::Reference< css::datatransfer::XTransferable > SAL_CALL ScTabViewObj::getTransferable() { |