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/source | |
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/source')
-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 |
9 files changed, 13 insertions, 399 deletions
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() { |