sw/source/core/inc/unorefmark.hxx   |   10 +---------
 sw/source/core/inc/unosection.hxx   |    8 --------
 sw/source/core/unocore/unorefmk.cxx |   12 ------------
 sw/source/core/unocore/unosect.cxx  |   12 ------------
 sw/source/core/unocore/unotext.cxx  |   26 ++++++--------------------
 5 files changed, 7 insertions(+), 61 deletions(-)

New commits:
commit e3e9f296e34a0d6bba7f13b57286087755a4bf03
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Jan 20 10:34:00 2023 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Jan 21 17:00:55 2023 +0000

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

diff --git a/sw/source/core/inc/unosection.hxx 
b/sw/source/core/inc/unosection.hxx
index a90732e4bd5c..7527a2f11088 100644
--- a/sw/source/core/inc/unosection.hxx
+++ b/sw/source/core/inc/unosection.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNOSECTION_HXX
 #define INCLUDED_SW_SOURCE_CORE_INC_UNOSECTION_HXX
 
-#include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/XPropertyState.hpp>
@@ -38,7 +37,6 @@ class SwSectionFormat;
 
 typedef ::cppu::ImplInheritanceHelper
 <   ::sfx2::MetadatableMixin
-,   css::lang::XUnoTunnel
 ,   css::lang::XServiceInfo
 ,   css::beans::XPropertySet
 ,   css::beans::XPropertyState
@@ -73,12 +71,6 @@ public:
     virtual css::uno::Reference< css::frame::XModel >
         GetModel() override;
 
-    static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
-
-    // XUnoTunnel
-    virtual sal_Int64 SAL_CALL getSomething(
-            const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
-
     // XServiceInfo
     virtual OUString SAL_CALL getImplementationName() override;
     virtual sal_Bool SAL_CALL supportsService(
diff --git a/sw/source/core/unocore/unosect.cxx 
b/sw/source/core/unocore/unosect.cxx
index 5bb3ff0c119d..69ec954d063a 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -225,18 +225,6 @@ SwXTextSection::~SwXTextSection()
 {
 }
 
-const uno::Sequence< sal_Int8 > & SwXTextSection::getUnoTunnelId()
-{
-    static const comphelper::UnoIdInit theSwXTextSectionUnoTunnelId;
-    return theSwXTextSectionUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL
-SwXTextSection::getSomething(const uno::Sequence< sal_Int8 >& rId)
-{
-    return comphelper::getSomethingImpl<SwXTextSection>(rId, this);
-}
-
 uno::Reference< text::XTextSection > SAL_CALL
 SwXTextSection::getParentSection()
 {
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index f0cb0d87a0a8..55270c1d8ee9 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -566,12 +566,10 @@ SwXText::insertTextContent(
 
     // special treatment for Contents that do not replace the range, but
     // instead are "overlaid"
-    const uno::Reference<lang::XUnoTunnel> xContentTunnel(xContent,
-            uno::UNO_QUERY);
     SwXDocumentIndexMark *const pDocumentIndexMark =
         dynamic_cast<SwXDocumentIndexMark*>(xContent.get());
     SwXTextSection *const pSection =
-        comphelper::getFromUnoTunnel<SwXTextSection>(xContentTunnel);
+        dynamic_cast<SwXTextSection*>(xContent.get());
     SwXBookmark *const pBookmark =
         dynamic_cast<SwXBookmark*>(xContent.get());
     SwXReferenceMark *const pReferenceMark =
@@ -633,10 +631,7 @@ SwXText::insertTextContentBefore(
     }
 
     bool bRet = false;
-    const uno::Reference<lang::XUnoTunnel> xSuccTunnel(xSuccessor,
-            uno::UNO_QUERY);
-    SwXTextSection *const pXSection =
-            comphelper::getFromUnoTunnel<SwXTextSection>(xSuccTunnel);
+    SwXTextSection *const pXSection = 
dynamic_cast<SwXTextSection*>(xSuccessor.get());
     SwXTextTable *const pXTable = 
dynamic_cast<SwXTextTable*>(xSuccessor.get());
     SwFrameFormat *const pTableFormat = pXTable ? pXTable->GetFrameFormat() : 
nullptr;
     SwTextNode * pTextNode = nullptr;
@@ -686,10 +681,7 @@ SwXText::insertTextContentAfter(
         throw lang::IllegalArgumentException();
     }
 
-    const uno::Reference<lang::XUnoTunnel> xPredTunnel(xPredecessor,
-            uno::UNO_QUERY);
-    SwXTextSection *const pXSection =
-            comphelper::getFromUnoTunnel<SwXTextSection>(xPredTunnel);
+    SwXTextSection *const pXSection = 
dynamic_cast<SwXTextSection*>(xPredecessor.get());
     SwXTextTable *const pXTable = 
dynamic_cast<SwXTextTable*>(xPredecessor.get());
     SwFrameFormat *const pTableFormat = pXTable ? pXTable->GetFrameFormat() : 
nullptr;
     bool bRet = false;
@@ -735,10 +727,7 @@ SwXText::removeTextContentBefore(
     }
 
     bool bRet = false;
-    const uno::Reference<lang::XUnoTunnel> xSuccTunnel(xSuccessor,
-            uno::UNO_QUERY);
-    SwXTextSection *const pXSection =
-            comphelper::getFromUnoTunnel<SwXTextSection>(xSuccTunnel);
+    SwXTextSection *const pXSection = 
dynamic_cast<SwXTextSection*>(xSuccessor.get());
     SwXTextTable *const pXTable = 
dynamic_cast<SwXTextTable*>(xSuccessor.get());
     SwFrameFormat *const pTableFormat = pXTable ? pXTable->GetFrameFormat() : 
nullptr;
     if(pTableFormat && pTableFormat->GetDoc() == GetDoc())
@@ -786,10 +775,7 @@ SwXText::removeTextContentAfter(
     }
 
     bool bRet = false;
-    const uno::Reference<lang::XUnoTunnel> xPredTunnel(xPredecessor,
-            uno::UNO_QUERY);
-    SwXTextSection *const pXSection =
-            comphelper::getFromUnoTunnel<SwXTextSection>(xPredTunnel);
+    SwXTextSection *const pXSection = 
dynamic_cast<SwXTextSection*>(xPredecessor.get());
     SwXTextTable *const pXTable = 
dynamic_cast<SwXTextTable*>(xPredecessor.get());
     SwFrameFormat *const pTableFormat = pXTable ? pXTable->GetFrameFormat() : 
nullptr;
     if(pTableFormat && pTableFormat->GetDoc() == GetDoc())
commit 0166dc67168a6ac95d527099610d5756d062c0fe
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Jan 20 10:30:28 2023 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Jan 21 17:00:41 2023 +0000

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

diff --git a/sw/source/core/inc/unorefmark.hxx 
b/sw/source/core/inc/unorefmark.hxx
index 057de4f443da..6d5535973c48 100644
--- a/sw/source/core/inc/unorefmark.hxx
+++ b/sw/source/core/inc/unorefmark.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNOREFMARK_HXX
 #define INCLUDED_SW_SOURCE_CORE_INC_UNOREFMARK_HXX
 
-#include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/container/XNamed.hpp>
@@ -34,8 +33,7 @@ class SwDoc;
 class SwFormatRefMark;
 
 typedef ::cppu::WeakImplHelper
-<   css::lang::XUnoTunnel
-,   css::lang::XServiceInfo
+<   css::lang::XServiceInfo
 ,   css::beans::XPropertySet
 ,   css::container::XNamed
 ,   css::text::XTextContent
@@ -59,12 +57,6 @@ public:
     static rtl::Reference<SwXReferenceMark>
         CreateXReferenceMark(SwDoc & rDoc, SwFormatRefMark * pMarkFormat);
 
-    static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
-
-    // XUnoTunnel
-    virtual sal_Int64 SAL_CALL getSomething(
-            const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
-
     // XServiceInfo
     virtual OUString SAL_CALL getImplementationName() override;
     virtual sal_Bool SAL_CALL supportsService(
diff --git a/sw/source/core/unocore/unorefmk.cxx 
b/sw/source/core/unocore/unorefmk.cxx
index f01d1f90e6aa..30bfaa430646 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -145,18 +145,6 @@ SwXReferenceMark::CreateXReferenceMark(
     return xMark;
 }
 
-const uno::Sequence< sal_Int8 > & SwXReferenceMark::getUnoTunnelId()
-{
-    static const comphelper::UnoIdInit theSwXReferenceMarkUnoTunnelId;
-    return theSwXReferenceMarkUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL
-SwXReferenceMark::getSomething(const uno::Sequence< sal_Int8 >& rId)
-{
-    return comphelper::getSomethingImpl<SwXReferenceMark>(rId, this);
-}
-
 OUString SAL_CALL SwXReferenceMark::getImplementationName()
 {
     return "SwXReferenceMark";
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index f4637d4dd987..f0cb0d87a0a8 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -575,7 +575,7 @@ SwXText::insertTextContent(
     SwXBookmark *const pBookmark =
         dynamic_cast<SwXBookmark*>(xContent.get());
     SwXReferenceMark *const pReferenceMark =
-        comphelper::getFromUnoTunnel<SwXReferenceMark>(xContentTunnel);
+        dynamic_cast<SwXReferenceMark*>(xContent.get());
     SwXMeta *const pMeta = dynamic_cast<SwXMeta*>(xContent.get());
     auto* pContentControl = dynamic_cast<SwXContentControl*>(xContent.get());
     SwXTextField* pTextField = dynamic_cast<SwXTextField*>(xContent.get());

Reply via email to