diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-14 08:19:47 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-15 06:07:36 +0200 |
commit | 05bc93db2de56000f65764d7e394d03747cac23d (patch) | |
tree | 975de9ae83572aac8a5c3ea8db281e1017ee5be0 /sw/source/core | |
parent | 8cbb414ed737f9ffc76e1258e6671769bf63fc6c (diff) |
Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1
The header got some changes:
1. Move UnoTunnelIdInit and isUnoTunnelId into 'comphelper' namespace
2. Rename UnoTunnelIdInit to UnoIdInit, as a precondition to replace
of uses of OImplementationId with it, including in XTypeProvider
3. Introduce convenience functions 'getSomething_cast' to cast between
sal_Int64 and object pointers uniformly.
4. Rename getUnoTunnelImplementation to getFromUnoTunnel, both to make
it a bit shorter, and to reflect its function better. Templatize it
to take also css::uno::Any for convenience.
5. Introduce getSomethingImpl, inspired by sw::UnoTunnelImpl; allow it
handle cases both with and without fallback to parent.
6. Adjust UNO3_GETIMPLEMENTATION_* macros
TODO (in separate commits):
- Drop sw::UnoTunnelImpl and sw::UnoTunnelGetImplementation
- Replace all uses of OImplementationId in core with UnoIdInit
- Deprecate OImplementationId in <cppuhelper/typeprovider.hxx>
- Change implementations of getSomething to use getSomethingImpl
- Revise uses of getSomething to use getFromUnoTunnel
Change-Id: If4a3cb024130f1f552f988f0479589da1cd066e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122022
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/core')
25 files changed, 60 insertions, 60 deletions
diff --git a/sw/source/core/layout/dumpfilter.cxx b/sw/source/core/layout/dumpfilter.cxx index 073d6a7e69b5..f931b1cc35ad 100644 --- a/sw/source/core/layout/dumpfilter.cxx +++ b/sw/source/core/layout/dumpfilter.cxx @@ -87,7 +87,7 @@ namespace sw uno::Reference< io::XOutputStream >() ); // Actually get the SwRootFrame to call dumpAsXml - auto pXDoc = comphelper::getUnoTunnelImplementation<SwXTextDocument>(m_xSrcDoc); + auto pXDoc = comphelper::getFromUnoTunnel<SwXTextDocument>(m_xSrcDoc); if ( pXDoc ) { SwRootFrame* pLayout = pXDoc->GetDocShell()->GetWrtShell()->GetLayout(); diff --git a/sw/source/core/unocore/TextCursorHelper.cxx b/sw/source/core/unocore/TextCursorHelper.cxx index a8f47e6113cd..bf522698d051 100644 --- a/sw/source/core/unocore/TextCursorHelper.cxx +++ b/sw/source/core/unocore/TextCursorHelper.cxx @@ -24,7 +24,7 @@ using namespace ::com::sun::star; const uno::Sequence< sal_Int8 > & OTextCursorHelper::getUnoTunnelId() { - static const UnoTunnelIdInit theOTextCursorHelperUnoTunnelId; + static const comphelper::UnoIdInit theOTextCursorHelperUnoTunnelId; return theOTextCursorHelperUnoTunnelId.getSeq(); } @@ -32,7 +32,7 @@ const uno::Sequence< sal_Int8 > & OTextCursorHelper::getUnoTunnelId() sal_Int64 SAL_CALL OTextCursorHelper::getSomething( const uno::Sequence< sal_Int8 >& rId ) { - if( isUnoTunnelId<OTextCursorHelper>(rId) ) + if( comphelper::isUnoTunnelId<OTextCursorHelper>(rId) ) { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); } diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 4da8866a27cd..5ee6dac48ab0 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -198,7 +198,7 @@ uno::Reference<text::XTextContent> SwXBookmark::CreateXBookmark( const uno::Sequence< sal_Int8 > & SwXBookmark::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXBookmarkUnoTunnelId; + static const comphelper::UnoIdInit theSwXBookmarkUnoTunnelId; return theSwXBookmarkUnoTunnelId.getSeq(); } diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 7a78239c8ad1..2fc30b19998d 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -1595,7 +1595,7 @@ void SwChartDataProvider::AddRowCols( const sal_Int32 nLen = xRef->getTextualData().getLength(); if (nLen > 1) // value data-sequence ? { - auto pDataSeq = comphelper::getUnoTunnelImplementation<SwChartDataSequence>(xRef); + auto pDataSeq = comphelper::getFromUnoTunnel<SwChartDataSequence>(xRef); if (pDataSeq) { SwRangeDescriptor aDesc; @@ -1874,13 +1874,13 @@ SwChartDataSequence::~SwChartDataSequence() const uno::Sequence< sal_Int8 > & SwChartDataSequence::getUnoTunnelId() { - static const UnoTunnelIdInit theSwChartDataSequenceUnoTunnelId; + static const comphelper::UnoIdInit theSwChartDataSequenceUnoTunnelId; return theSwChartDataSequenceUnoTunnelId.getSeq(); } sal_Int64 SAL_CALL SwChartDataSequence::getSomething( const uno::Sequence< sal_Int8 > &rId ) { - if( isUnoTunnelId<SwChartDataSequence>(rId) ) + if( comphelper::isUnoTunnelId<SwChartDataSequence>(rId) ) { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index e8e6c40ef702..3cdea60b7eb1 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -833,7 +833,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) uno::Reference<XIndexReplace> xIndexReplace; if(rValue >>= xIndexReplace) { - auto pSwNum = comphelper::getUnoTunnelImplementation<SwXNumberingRules>(xIndexReplace); + auto pSwNum = comphelper::getFromUnoTunnel<SwXNumberingRules>(xIndexReplace); if(pSwNum) { SwDoc& rDoc = rPam.GetDoc(); diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index a2a0faf4f1f8..e9e2a67e8174 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -848,13 +848,13 @@ void SwXDrawPage::InvalidateSwDoc() const uno::Sequence< sal_Int8 > & SwXShape::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXShapeUnoTunnelId; + static const comphelper::UnoIdInit theSwXShapeUnoTunnelId; return theSwXShapeUnoTunnelId.getSeq(); } sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId ) { - if( isUnoTunnelId<SwXShape>(rId) ) + if( comphelper::isUnoTunnelId<SwXShape>(rId) ) { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); } @@ -936,7 +936,7 @@ void SwXShape::AddExistingShapeToFormat( SdrObject const & _rObj ) if ( !pCurrent ) continue; - auto pSwShape = comphelper::getUnoTunnelImplementation<SwXShape>(pCurrent->getWeakUnoShape()); + auto pSwShape = comphelper::getFromUnoTunnel<SwXShape>(pCurrent->getWeakUnoShape()); if ( pSwShape ) { if ( pSwShape->m_bDescriptor ) @@ -1060,7 +1060,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a uno::Reference<text::XTextFrame> xFrame; if(aValue >>= xFrame) { - SwXFrame* pFrame = comphelper::getUnoTunnelImplementation<SwXFrame>(xFrame); + SwXFrame* pFrame = comphelper::getFromUnoTunnel<SwXFrame>(xFrame); if(pFrame && pFrame->GetFrameFormat() && pFrame->GetFrameFormat()->GetDoc() == pDoc) { @@ -2192,7 +2192,7 @@ uno::Sequence< OUString > SwXShape::getSupportedServiceNames() SvxShape* SwXShape::GetSvxShape() { if(m_xShapeAgg.is()) - return comphelper::getUnoTunnelImplementation<SvxShape>(m_xShapeAgg); + return comphelper::getFromUnoTunnel<SvxShape>(m_xShapeAgg); return nullptr; } @@ -2308,7 +2308,7 @@ void SAL_CALL SwXShape::setPosition( const awt::Point& aPosition ) // #i34750# // use method <SvxShape->getPosition()> to get the correct // 'Drawing layer' position of the top group shape. - auto pSvxGroupShape = comphelper::getUnoTunnelImplementation<SvxShape>(pTopGroupObj->getUnoShape()); + auto pSvxGroupShape = comphelper::getFromUnoTunnel<SvxShape>(pTopGroupObj->getUnoShape()); const awt::Point aGroupPos = pSvxGroupShape->getPosition(); aNewPos.X = o3tl::saturating_add(aNewPos.X, aGroupPos.X); aNewPos.Y = o3tl::saturating_add(aNewPos.Y, aGroupPos.Y); diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 425258b6741a..fec80e3e7c13 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -461,7 +461,7 @@ protected: const uno::Sequence< sal_Int8 > & SwXFieldMaster::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXFieldMasterUnoTunnelId; + static const comphelper::UnoIdInit theSwXFieldMasterUnoTunnelId; return theSwXFieldMasterUnoTunnelId.getSeq(); } @@ -1173,7 +1173,7 @@ public: const uno::Sequence< sal_Int8 > & SwXTextField::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXTextFieldUnoTunnelId; + static const comphelper::UnoIdInit theSwXTextFieldUnoTunnelId; return theSwXTextFieldUnoTunnelId.getSeq(); } diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 4cf9259dc5b6..daf57af4e417 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -315,7 +315,7 @@ css::uno::Sequence< ::sal_Int32 > SAL_CALL SwXFlatParagraph::getLanguagePortions const uno::Sequence< sal_Int8 >& SwXFlatParagraph::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXFlatParagraphUnoTunnelId; + static const comphelper::UnoIdInit theSwXFlatParagraphUnoTunnelId; return theSwXFlatParagraphUnoTunnelId.getSeq(); } diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 9af79f131220..eb7e22d10a7a 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1161,13 +1161,13 @@ public: const ::uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXFrameUnoTunnelId; + static const comphelper::UnoIdInit theSwXFrameUnoTunnelId; return theSwXFrameUnoTunnelId.getSeq(); } sal_Int64 SAL_CALL SwXFrame::getSomething( const ::uno::Sequence< sal_Int8 >& rId ) { - if( isUnoTunnelId<SwXFrame>(rId) ) + if( comphelper::isUnoTunnelId<SwXFrame>(rId) ) { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); } @@ -1733,7 +1733,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& uno::Reference<text::XTextFrame> xFrame; if(aValue >>= xFrame) { - SwXFrame* pFrame = comphelper::getUnoTunnelImplementation<SwXFrame>(xFrame); + SwXFrame* pFrame = comphelper::getFromUnoTunnel<SwXFrame>(xFrame); if(pFrame && this != pFrame && pFrame->GetFrameFormat() && pFrame->GetFrameFormat()->GetDoc() == pDoc) { SfxItemSet aSet( pDoc->GetAttrPool(), diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 1433f3046d58..2b3d686b8de7 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -168,7 +168,7 @@ SwXFootnote::CreateXFootnote(SwDoc & rDoc, SwFormatFootnote *const pFootnoteForm const uno::Sequence< sal_Int8 > & SwXFootnote::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXFootnoteUnoTunnelId; + static const comphelper::UnoIdInit theSwXFootnoteUnoTunnelId; return theSwXFootnoteUnoTunnelId.getSeq(); } diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 58aba6aef78c..ce461692d85a 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -427,7 +427,7 @@ SwXDocumentIndex::CreateXDocumentIndex( const uno::Sequence< sal_Int8 > & SwXDocumentIndex::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXDocumentIndexUnoTunnelId; + static const comphelper::UnoIdInit theSwXDocumentIndexUnoTunnelId; return theSwXDocumentIndexUnoTunnelId.getSeq(); } @@ -1656,7 +1656,7 @@ namespace const uno::Sequence< sal_Int8 > & SwXDocumentIndexMark::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXDocumentIndexMarkUnoTunnelId; + static const comphelper::UnoIdInit theSwXDocumentIndexMarkUnoTunnelId; return theSwXDocumentIndexMarkUnoTunnelId.getSeq(); } diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index acd5d50f23d0..1f6eaf7d33d4 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -849,7 +849,7 @@ SwXTextCursor::getSupportedServiceNames() const uno::Sequence< sal_Int8 > & SwXTextCursor::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXTextCursorUnoTunnelId; + static const comphelper::UnoIdInit theSwXTextCursorUnoTunnelId; return theSwXTextCursorUnoTunnelId.getSeq(); } @@ -2858,7 +2858,7 @@ SwXTextCursor::createEnumeration() SwUnoCursor & rUnoCursor( GetCursorOrThrow() ); - SwXText* pParentText = comphelper::getUnoTunnelImplementation<SwXText>(m_xParentText); + SwXText* pParentText = comphelper::getFromUnoTunnel<SwXText>(m_xParentText); OSL_ENSURE(pParentText, "parent is not a SwXText"); if (!pParentText) { diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index e99450378bac..1dff3dfe1e2a 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -904,7 +904,7 @@ void SwXTextRange::DeleteAndInsert( const uno::Sequence< sal_Int8 > & SwXTextRange::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXTextRangeUnoTunnelId; + static const comphelper::UnoIdInit theSwXTextRangeUnoTunnelId; return theSwXTextRangeUnoTunnelId.getSeq(); } @@ -1142,7 +1142,7 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill, xTextCursor.set(pHeadText->CreateTextCursor(true)); xTextCursor->gotoEnd(true); pCursor = - comphelper::getUnoTunnelImplementation<OTextCursorHelper>(xTextCursor); + comphelper::getFromUnoTunnel<OTextCursorHelper>(xTextCursor); pCursor->GetPaM()->Normalize(); } else @@ -1151,7 +1151,7 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill, xTextCursor.set( pText->CreateCursor() ); xTextCursor->gotoEnd(true); pCursor = - comphelper::getUnoTunnelImplementation<OTextCursorHelper>(xTextCursor); + comphelper::getFromUnoTunnel<OTextCursorHelper>(xTextCursor); } if(pRange && &pRange->GetDoc() == &rToFill.GetDoc()) { @@ -1633,7 +1633,7 @@ rtl::Reference<SwXTextRanges> SwXTextRanges::Create(SwPaM *const pPaM) const uno::Sequence< sal_Int8 > & SwXTextRanges::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXTextRangesUnoTunnelId; + static const comphelper::UnoIdInit theSwXTextRangesUnoTunnelId; return theSwXTextRangesUnoTunnelId.getSeq(); } diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 5b7d3ab08c17..99132a6fd949 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -287,7 +287,7 @@ bool SwXParagraph::SelectPaM(SwPaM & rPaM) const uno::Sequence< sal_Int8 > & SwXParagraph::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXParagraphUnoTunnelId; + static const comphelper::UnoIdInit theSwXParagraphUnoTunnelId; return theSwXParagraphUnoTunnelId.getSeq(); } diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 243d4fff1d79..b54b049c9393 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -774,13 +774,13 @@ uno::Reference< container::XEnumeration > SwXTextPortion::createContentEnumerat const uno::Sequence< sal_Int8 > & SwXTextPortion::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXTextPortionUnoTunnelId; + static const comphelper::UnoIdInit theSwXTextPortionUnoTunnelId; return theSwXTextPortionUnoTunnelId.getSeq(); } sal_Int64 SwXTextPortion::getSomething( const uno::Sequence< sal_Int8 >& rId ) { - if( isUnoTunnelId<SwXTextPortion>(rId) ) + if( comphelper::isUnoTunnelId<SwXTextPortion>(rId) ) { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); } diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index d573a590497b..bf2bed1d1a70 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -280,14 +280,14 @@ namespace const uno::Sequence< sal_Int8 > & SwXTextPortionEnumeration::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXTextPortionEnumerationUnoTunnelId; + static const comphelper::UnoIdInit theSwXTextPortionEnumerationUnoTunnelId; return theSwXTextPortionEnumerationUnoTunnelId.getSeq(); } sal_Int64 SAL_CALL SwXTextPortionEnumeration::getSomething( const uno::Sequence< sal_Int8 >& rId ) { - if( isUnoTunnelId<SwXTextPortionEnumeration>(rId) ) + if( comphelper::isUnoTunnelId<SwXTextPortionEnumeration>(rId) ) { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) ); } diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 625a991a074a..c5afac478431 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -151,7 +151,7 @@ SwXReferenceMark::CreateXReferenceMark( const uno::Sequence< sal_Int8 > & SwXReferenceMark::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXReferenceMarkUnoTunnelId; + static const comphelper::UnoIdInit theSwXReferenceMarkUnoTunnelId; return theSwXReferenceMarkUnoTunnelId.getSeq(); } @@ -713,7 +713,7 @@ SwXMeta::CreateXMeta(::sw::Meta & rMeta, if (pPortions) // set cache in the XMeta to the given portions { SwXMeta *const pXMeta( - comphelper::getUnoTunnelImplementation<SwXMeta>(xMeta)); + comphelper::getFromUnoTunnel<SwXMeta>(xMeta)); assert(pXMeta); // NB: the meta must always be created with the complete content // if SwXTextPortionEnumeration is created for a selection, @@ -842,7 +842,7 @@ bool SwXMeta::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb) const uno::Sequence< sal_Int8 > & SwXMeta::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXMetaUnoTunnelId; + static const comphelper::UnoIdInit theSwXMetaUnoTunnelId; return theSwXMetaUnoTunnelId.getSeq(); } diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 15c71d7bca61..4cbf679158c7 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -229,7 +229,7 @@ SwXTextSection::~SwXTextSection() const uno::Sequence< sal_Int8 > & SwXTextSection::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXTextSectionUnoTunnelId; + static const comphelper::UnoIdInit theSwXTextSectionUnoTunnelId; return theSwXTextSectionUnoTunnelId.getSeq(); } diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index afc309008ca2..770ef5d4b879 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1020,14 +1020,14 @@ namespace const uno::Sequence< sal_Int8 > & SwXNumberingRules::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXNumberingRulesUnoTunnelId; + static const comphelper::UnoIdInit theSwXNumberingRulesUnoTunnelId; return theSwXNumberingRulesUnoTunnelId.getSeq(); } // return implementation specific data sal_Int64 SwXNumberingRules::getSomething( const uno::Sequence< sal_Int8 > & rId ) { - if( isUnoTunnelId<SwXNumberingRules>(rId) ) + if( comphelper::isUnoTunnelId<SwXNumberingRules>(rId) ) { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); } diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx index d4816e5b009a..666e36b73edc 100644 --- a/sw/source/core/unocore/unosrch.cxx +++ b/sw/source/core/unocore/unosrch.cxx @@ -347,13 +347,13 @@ namespace const uno::Sequence< sal_Int8 > & SwXTextSearch::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXTextSearchUnoTunnelId; + static const comphelper::UnoIdInit theSwXTextSearchUnoTunnelId; return theSwXTextSearchUnoTunnelId.getSeq(); } sal_Int64 SAL_CALL SwXTextSearch::getSomething( const uno::Sequence< sal_Int8 >& rId ) { - if( isUnoTunnelId<SwXTextSearch>(rId) ) + if( comphelper::isUnoTunnelId<SwXTextSearch>(rId) ) { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index ccc815c01e9d..19e0f8d8710e 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1047,7 +1047,7 @@ void XStyleFamily::replaceByName(const OUString& rName, const uno::Any& rElement uno::Reference<style::XStyle> xStyle = FindStyle(pBase->GetName()); if(xStyle.is()) { - SwXStyle* pStyle = comphelper::getUnoTunnelImplementation<SwXStyle>(xStyle); + SwXStyle* pStyle = comphelper::getFromUnoTunnel<SwXStyle>(xStyle); if(pStyle) pStyle->Invalidate(); } @@ -1209,13 +1209,13 @@ namespace const uno::Sequence<sal_Int8>& SwXStyle::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXStyleUnoTunnelId; + static const comphelper::UnoIdInit theSwXStyleUnoTunnelId; return theSwXStyleUnoTunnelId.getSeq(); } sal_Int64 SAL_CALL SwXStyle::getSomething(const uno::Sequence<sal_Int8>& rId) { - if(isUnoTunnelId<SwXStyle>(rId)) + if(comphelper::isUnoTunnelId<SwXStyle>(rId)) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 03b5a88c81ef..92a3aea81a17 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -755,13 +755,13 @@ SwXCell::~SwXCell() const uno::Sequence< sal_Int8 > & SwXCell::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXCellUnoTunnelId; + static const comphelper::UnoIdInit theSwXCellUnoTunnelId; return theSwXCellUnoTunnelId.getSeq(); } sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId ) { - if( isUnoTunnelId<SwXCell>(rId) ) + if( comphelper::isUnoTunnelId<SwXCell>(rId) ) { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); } @@ -1976,13 +1976,13 @@ public: const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXTextTableUnoTunnelId; + static const comphelper::UnoIdInit theSwXTextTableUnoTunnelId; return theSwXTextTableUnoTunnelId.getSeq(); } sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >& rId ) { - if(isUnoTunnelId<SwXTextTable>(rId)) + if(comphelper::isUnoTunnelId<SwXTextTable>(rId)) { return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this)); } @@ -3183,13 +3183,13 @@ namespace const uno::Sequence< sal_Int8 > & SwXCellRange::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXCellRangeUnoTunnelId; + static const comphelper::UnoIdInit theSwXCellRangeUnoTunnelId; return theSwXCellRangeUnoTunnelId.getSeq(); } sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >& rId ) { - if( isUnoTunnelId<SwXCellRange>(rId) ) + if( comphelper::isUnoTunnelId<SwXCellRange>(rId) ) { return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); } diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index fa779d95abd8..57630ebc5388 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -630,7 +630,7 @@ SwXText::insertTextContentBefore( } SwXParagraph *const pPara = - comphelper::getUnoTunnelImplementation<SwXParagraph>(xNewContent); + comphelper::getFromUnoTunnel<SwXParagraph>(xNewContent); if (!pPara || !pPara->IsDescriptor() || !xSuccessor.is()) { throw lang::IllegalArgumentException(); @@ -686,7 +686,7 @@ SwXText::insertTextContentAfter( } SwXParagraph *const pPara = - comphelper::getUnoTunnelImplementation<SwXParagraph>(xNewContent); + comphelper::getFromUnoTunnel<SwXParagraph>(xNewContent); if(!pPara || !pPara->IsDescriptor() || !xPredecessor.is()) { throw lang::IllegalArgumentException(); @@ -978,7 +978,7 @@ bool SwXText::Impl::CheckForOwnMember( const uno::Reference<text::XTextCursor> xOwnCursor(m_rThis.CreateCursor()); OTextCursorHelper *const pOwnCursor = - comphelper::getUnoTunnelImplementation<OTextCursorHelper>(xOwnCursor); + comphelper::getFromUnoTunnel<OTextCursorHelper>(xOwnCursor); OSL_ENSURE(pOwnCursor, "OTextCursorHelper::getUnoTunnelId() ??? "); const SwStartNode* pOwnStartNode = pOwnCursor->GetPaM()->GetNode().StartOfSectionNode(); @@ -1200,7 +1200,7 @@ namespace const uno::Sequence< sal_Int8 > & SwXText::getUnoTunnelId() { - static const UnoTunnelIdInit theSwXTextUnoTunnelId; + static const comphelper::UnoIdInit theSwXTextUnoTunnelId; return theSwXTextUnoTunnelId.getSeq(); } @@ -1571,9 +1571,9 @@ SwXText::convertToTextFrame( pTempStartPam.reset(); SwXTextRange *const pStartRange = - comphelper::getUnoTunnelImplementation<SwXTextRange>(xStart); + comphelper::getFromUnoTunnel<SwXTextRange>(xStart); SwXTextRange *const pEndRange = - comphelper::getUnoTunnelImplementation<SwXTextRange>(xEnd); + comphelper::getFromUnoTunnel<SwXTextRange>(xEnd); // bookmarks have to be removed before the referenced text node // is deleted in DelFullPara if (pStartRange) @@ -1779,7 +1779,7 @@ SwXText::convertToTextFrame( const uno::Reference<text::XTextCursor> xFrameTextCursor = rNewFrame.createTextCursor(); SwXTextCursor *const pFrameCursor = - comphelper::getUnoTunnelImplementation<SwXTextCursor>(xFrameTextCursor); + comphelper::getFromUnoTunnel<SwXTextCursor>(xFrameTextCursor); if (bParaBeforeInserted) { // todo: remove paragraph before frame diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 3daf6f29676c..092d098ca1a2 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -445,7 +445,7 @@ bool SwPrintUIOptions::processPropertiesAndCheckFormat( const uno::Sequence< bea VclPtr< OutputDevice > pOut; if (xRenderDevice.is()) { - VCLXDevice* pDevice = comphelper::getUnoTunnelImplementation<VCLXDevice>( xRenderDevice ); + VCLXDevice* pDevice = comphelper::getFromUnoTunnel<VCLXDevice>( xRenderDevice ); if (pDevice) pOut = pDevice->GetOutputDevice(); } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 45621dc62d74..0670e8e102b4 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1061,7 +1061,7 @@ void SwViewShell::SizeChgNotify() ss << aDocSize.Width() + 2 * DOCUMENTBORDER << ", " << aDocSize.Height() + 2 * DOCUMENTBORDER; OString sSize = ss.str().c_str(); - SwXTextDocument* pModel = comphelper::getUnoTunnelImplementation<SwXTextDocument>(GetSfxViewShell()->GetCurrentDocument()); + SwXTextDocument* pModel = comphelper::getFromUnoTunnel<SwXTextDocument>(GetSfxViewShell()->GetCurrentDocument()); SfxLokHelper::notifyDocumentSizeChanged(GetSfxViewShell(), sSize, pModel); } } |