sw/source/core/inc/unoport.hxx         |   13 -------------
 sw/source/core/unocore/unodraw.cxx     |    3 +--
 sw/source/core/unocore/unoobj2.cxx     |    3 +--
 sw/source/core/unocore/unoport.cxx     |   11 -----------
 sw/source/core/unocore/unoportenum.cxx |   12 ------------
 5 files changed, 2 insertions(+), 40 deletions(-)

New commits:
commit c97441a5ee8a86a37fac0b506d0af0c2ae6d51fb
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Jan 20 10:29:04 2023 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Jan 21 16:23:45 2023 +0000

    XUnoTunnel->dynamic_cast in SwXTextPortion
    
    Change-Id: I2994fc3197de34ef756fcba27d111c7597af6aae
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145922
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/source/core/inc/unoport.hxx b/sw/source/core/inc/unoport.hxx
index 3acaafdfee00..1315334d3992 100644
--- a/sw/source/core/inc/unoport.hxx
+++ b/sw/source/core/inc/unoport.hxx
@@ -30,7 +30,6 @@
 #include <com/sun/star/beans/XMultiPropertySet.hpp>
 #include <com/sun/star/beans/XTolerantMultiPropertySet.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
 
 #include <cppuhelper/implbase.hxx>
 
@@ -88,7 +87,6 @@ class SwXTextPortion : public cppu::WeakImplHelper
     css::text::XTextRange,
     css::beans::XPropertyState,
     css::container::XContentEnumerationAccess,
-    css::lang::XUnoTunnel,
     css::lang::XServiceInfo
 >,
     public SvtListener
@@ -200,10 +198,6 @@ public:
     virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) 
override;
     virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& 
aPropertyName ) override;
 
-    //XUnoTunnel
-    static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-    virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-
     //XServiceInfo
     virtual OUString SAL_CALL getImplementationName() override;
     virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) 
override;
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index add34e200e7b..b65f3d855902 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1986,14 +1986,13 @@ void SwXShape::attach(const uno::Reference< 
text::XTextRange > & xTextRange)
     // get access to SwDoc
     // (see also SwXTextRange::XTextRangeToSwPaM)
     const SwDoc* pDoc = nullptr;
-    uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
     if (auto pRange = dynamic_cast<SwXTextRange*>(xTextRange.get()))
         pDoc = &pRange->GetDoc();
     else if (auto pText = dynamic_cast<SwXText*>(xTextRange.get()))
         pDoc = pText->GetDoc();
     else if (auto pCursor = dynamic_cast<OTextCursorHelper*>(xTextRange.get()))
         pDoc = pCursor->GetDoc();
-    else if (auto pPortion = 
comphelper::getFromUnoTunnel<SwXTextPortion>(xRangeTunnel))
+    else if (auto pPortion = dynamic_cast<SwXTextPortion*>(xTextRange.get()))
         pDoc = &pPortion->GetCursor().GetDoc();
     else if (auto pParagraph = dynamic_cast<SwXParagraph*>(xTextRange.get());
              pParagraph && pParagraph->GetTextNode())
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index 38dc4eb8b827..c73c2c34a458 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1093,10 +1093,9 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill,
 {
     bool bRet = false;
 
-    uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
     SwXTextRange* pRange = dynamic_cast<SwXTextRange*>(xTextRange.get());
     OTextCursorHelper* pCursor = 
dynamic_cast<OTextCursorHelper*>(xTextRange.get());
-    SwXTextPortion* pPortion = 
comphelper::getFromUnoTunnel<SwXTextPortion>(xRangeTunnel);
+    SwXTextPortion* pPortion = dynamic_cast<SwXTextPortion*>(xTextRange.get());
     SwXText* pText = dynamic_cast<SwXText*>(xTextRange.get());
     SwXParagraph* pPara = dynamic_cast<SwXParagraph*>(xTextRange.get());
     SwXHeadFootText* pHeadText
diff --git a/sw/source/core/unocore/unoport.cxx 
b/sw/source/core/unocore/unoport.cxx
index 2d5e3b17c7a6..80de35b5f381 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -836,17 +836,6 @@ uno::Reference< container::XEnumeration >  
SwXTextPortion::createContentEnumerat
     return SwXParaFrameEnumeration::Create(rUnoCursor, PARAFRAME_PORTION_CHAR, 
m_pFrameFormat);
 }
 
-const uno::Sequence< sal_Int8 > & SwXTextPortion::getUnoTunnelId()
-{
-    static const comphelper::UnoIdInit theSwXTextPortionUnoTunnelId;
-    return theSwXTextPortionUnoTunnelId.getSeq();
-}
-
-sal_Int64 SwXTextPortion::getSomething( const uno::Sequence< sal_Int8 >& rId )
-{
-    return comphelper::getSomethingImpl(rId, this);
-}
-
 uno::Sequence< OUString > SwXTextPortion::getAvailableServiceNames()
 {
     return { "com.sun.star.text.TextContent" };
commit e4d1c60fbbbfe2bc1cee13c7f794c47d25bb0dbd
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Jan 20 10:27:05 2023 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Jan 21 16:23:34 2023 +0000

    XUnoTunnel->dynamic_cast in SwXTextPortionEnumeration
    
    Change-Id: I85deec68e8ed99eb9fe266ac90da04087ab1e075
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145921
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/source/core/inc/unoport.hxx b/sw/source/core/inc/unoport.hxx
index ff7cb5caaabd..3acaafdfee00 100644
--- a/sw/source/core/inc/unoport.hxx
+++ b/sw/source/core/inc/unoport.hxx
@@ -253,7 +253,6 @@ class SwXTextPortionEnumeration final
     : public ::cppu::WeakImplHelper
         < css::container::XEnumeration
         , css::lang::XServiceInfo
-        , css::lang::XUnoTunnel
         >
 {
     TextRangeList_t m_Portions; // contains all portions, filled by ctor
@@ -270,12 +269,6 @@ public:
     SwXTextPortionEnumeration(SwPaM& rParaCursor,
         TextRangeList_t && rPortions );
 
-    static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
-    //XUnoTunnel
-    virtual sal_Int64 SAL_CALL getSomething(
-            const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
-
     //XEnumeration
     virtual sal_Bool SAL_CALL hasMoreElements() override;
     virtual css::uno::Any SAL_CALL nextElement() override;
diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index fc0239370eaa..39f7c034562f 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -279,18 +279,6 @@ namespace
     }
 }
 
-const uno::Sequence< sal_Int8 > & SwXTextPortionEnumeration::getUnoTunnelId()
-{
-    static const comphelper::UnoIdInit theSwXTextPortionEnumerationUnoTunnelId;
-    return theSwXTextPortionEnumerationUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL SwXTextPortionEnumeration::getSomething(
-        const uno::Sequence< sal_Int8 >& rId )
-{
-    return comphelper::getSomethingImpl(rId, this);
-}
-
 OUString SwXTextPortionEnumeration::getImplementationName()
 {
     return "SwXTextPortionEnumeration";

Reply via email to