sc/inc/srchuno.hxx               |    5 -----
 sc/inc/viewuno.hxx               |    5 -----
 sc/source/ui/unoobj/cellsuno.cxx |    6 +++---
 sc/source/ui/unoobj/srchuno.cxx  |    4 ----
 sc/source/ui/unoobj/viewuno.cxx  |    3 ---
 sc/source/ui/view/drawview.cxx   |    6 +++---
 sc/source/ui/view/gridwin.cxx    |    2 +-
 sc/source/ui/view/tabview.cxx    |    2 +-
 sc/source/ui/view/tabview3.cxx   |    2 +-
 sc/source/ui/view/tabview5.cxx   |    2 +-
 sc/source/ui/view/tabvwsh4.cxx   |    2 +-
 11 files changed, 11 insertions(+), 28 deletions(-)

New commits:
commit f94dc655ec37ec8f40de70f9105a8427a362f266
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jan 20 13:51:27 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Jan 22 19:11:04 2023 +0000

    XUnoTunnel->dynamic_cast in ScCellSearchObj
    
    Change-Id: I6f2eda6daf92959973d97a4be38f58a11415776f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145973
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/inc/srchuno.hxx b/sc/inc/srchuno.hxx
index de3ac50cc925..90381fa48579 100644
--- a/sc/inc/srchuno.hxx
+++ b/sc/inc/srchuno.hxx
@@ -22,7 +22,6 @@
 #include <memory>
 #include <com/sun/star/util/XReplaceDescriptor.hpp>
 #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>
@@ -31,7 +30,6 @@ class SvxSearchItem;
 
 class ScCellSearchObj final : public cppu::WeakImplHelper<
                                 css::util::XReplaceDescriptor,
-                                css::lang::XUnoTunnel,
                                 css::lang::XServiceInfo >
 {
 private:
@@ -70,9 +68,6 @@ public:
     virtual void SAL_CALL   removeVetoableChangeListener( const OUString& 
PropertyName,
                                     const css::uno::Reference< 
css::beans::XVetoableChangeListener >& aListener ) override;
 
-                                // XUnoTunnel
-    UNO3_GETIMPLEMENTATION_DECL(ScCellSearchObj)
-
                             // XServiceInfo
     virtual OUString SAL_CALL getImplementationName() override;
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) 
override;
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 119486d79768..851c85645351 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -3758,7 +3758,7 @@ uno::Reference<container::XIndexAccess> SAL_CALL 
ScCellRangesBase::findAll(
     uno::Reference<container::XIndexAccess> xRet;
     if ( pDocShell && xDesc.is() )
     {
-        ScCellSearchObj* pSearch = 
comphelper::getFromUnoTunnel<ScCellSearchObj>( xDesc );
+        ScCellSearchObj* pSearch = dynamic_cast<ScCellSearchObj*>( xDesc.get() 
);
         if (pSearch)
         {
             SvxSearchItem* pSearchItem = pSearch->GetSearchItem();
@@ -3797,7 +3797,7 @@ uno::Reference<uno::XInterface> 
ScCellRangesBase::Find_Impl(
     uno::Reference<uno::XInterface> xRet;
     if ( pDocShell && xDesc.is() )
     {
-        ScCellSearchObj* pSearch = 
comphelper::getFromUnoTunnel<ScCellSearchObj>( xDesc );
+        ScCellSearchObj* pSearch = dynamic_cast<ScCellSearchObj*>( xDesc.get() 
);
         if (pSearch)
         {
             SvxSearchItem* pSearchItem = pSearch->GetSearchItem();
@@ -3878,7 +3878,7 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const 
uno::Reference<util::XSea
     sal_uInt64 nReplaced = 0;
     if ( pDocShell && xDesc.is() )
     {
-        ScCellSearchObj* pSearch = 
comphelper::getFromUnoTunnel<ScCellSearchObj>( xDesc );
+        ScCellSearchObj* pSearch = dynamic_cast<ScCellSearchObj*>( xDesc.get() 
);
         if (pSearch)
         {
             SvxSearchItem* pSearchItem = pSearch->GetSearchItem();
diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx
index d5d78d75d6d9..036f6c89817b 100644
--- a/sc/source/ui/unoobj/srchuno.cxx
+++ b/sc/source/ui/unoobj/srchuno.cxx
@@ -189,8 +189,4 @@ uno::Sequence<OUString> SAL_CALL 
ScCellSearchObj::getSupportedServiceNames()
     return {SCSEARCHDESCRIPTOR_SERVICE, SCREPLACEDESCRIPTOR_SERVICE};
 }
 
-// XUnoTunnel
-
-UNO3_GETIMPLEMENTATION_IMPL(ScCellSearchObj);
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit f647691a55554f1a3a02aa4e997246ff7c16bcaa
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jan 20 13:47:35 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Jan 22 19:10:55 2023 +0000

    XUnoTunnel->dynamic_cast in ScTabViewObj
    
    Change-Id: I8400b56dd656fe2a1144696db8578869b2d26cc4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145972
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx
index b4ce26f7fc8d..027b4753a944 100644
--- a/sc/inc/viewuno.hxx
+++ b/sc/inc/viewuno.hxx
@@ -38,7 +38,6 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
 #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>
 
@@ -137,7 +136,6 @@ class ScTabViewObj final : public ScViewPaneBase,
                      public css::sheet::XViewSplitable,
                      public css::sheet::XViewFreezable,
                      public css::sheet::XRangeSelection,
-                     public css::lang::XUnoTunnel,
                      public css::datatransfer::XTransferableSupplier,
                      public css::sheet::XSelectedSheetsSupplier
 {
@@ -269,9 +267,6 @@ public:
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) 
override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
 
-                            // XUnoTunnel
-    UNO3_GETIMPLEMENTATION_DECL(ScTabViewObj)
-
                             // XTypeProvider
     virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
     virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index f8940594746c..c600a01114b8 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -478,7 +478,6 @@ uno::Any SAL_CALL ScTabViewObj::queryInterface( const 
uno::Type& rType )
     SC_QUERYINTERFACE( sheet::XViewSplitable )
     SC_QUERYINTERFACE( sheet::XViewFreezable )
     SC_QUERYINTERFACE( sheet::XRangeSelection )
-    SC_QUERYINTERFACE( lang::XUnoTunnel )
     SC_QUERYINTERFACE( datatransfer::XTransferableSupplier )
     SC_QUERYINTERFACE( sheet::XSelectedSheetsSupplier )
 
@@ -2072,8 +2071,6 @@ uno::Sequence<OUString> SAL_CALL 
ScTabViewObj::getSupportedServiceNames()
 
 // XUnoTunnel
 
-UNO3_GETIMPLEMENTATION_IMPL(ScTabViewObj);
-
 css::uno::Reference< css::datatransfer::XTransferable > SAL_CALL 
ScTabViewObj::getTransferable()
 {
     SolarMutexGuard aGuard;
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 24aec4aa5da2..7c31949bb2dc 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -528,7 +528,7 @@ void ScDrawView::MarkListHasChanged()
         uno::Reference<frame::XController> xController = 
rFrame.GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = comphelper::getFromUnoTunnel<ScTabViewObj>( 
xController );
+            ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( 
xController.get() );
             if (pImp)
                 pImp->SelectionChanged();
         }
@@ -578,7 +578,7 @@ bool ScDrawView::SdrBeginTextEdit(
         uno::Reference< frame::XController > xController = 
rFrame.GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = comphelper::getFromUnoTunnel<ScTabViewObj>( 
xController );
+            ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( 
xController.get() );
             if (pImp)
                 pImp->SelectionChanged();
         }
@@ -602,7 +602,7 @@ SdrEndTextEditKind ScDrawView::SdrEndTextEdit( bool 
bDontDeleteReally )
         uno::Reference< frame::XController > xController = 
rFrame.GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = comphelper::getFromUnoTunnel<ScTabViewObj>( 
xController );
+            ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( 
xController.get() );
             if (pImp)
                 pImp->SelectionChanged();
         }
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 547338589298..3b6cdae18b55 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2803,7 +2803,7 @@ bool ScGridWindow::PreNotify( NotifyEvent& rNEvt )
                 css::uno::Reference<css::frame::XController> xController = 
pViewFrame->GetFrame().GetController();
                 if (xController.is())
                 {
-                    ScTabViewObj* pImp = 
comphelper::getFromUnoTunnel<ScTabViewObj>( xController );
+                    ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( 
xController.get() );
                     if (pImp && pImp->IsMouseListening())
                     {
                         css::awt::MouseEvent aEvent;
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 607e5ddc60d2..048178301f1d 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2247,7 +2247,7 @@ void ScTabView::SetNewVisArea()
         css::uno::Reference<css::frame::XController> xController = 
rFrame.GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = comphelper::getFromUnoTunnel<ScTabViewObj>( 
xController );
+            ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( 
xController.get() );
             if (pImp)
                 pImp->VisAreaChanged();
         }
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index fdf3a3d517dc..0da3ae55b283 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -537,7 +537,7 @@ void ScTabView::SelectionChanged(bool bFromPaste)
         uno::Reference<frame::XController> xController = 
pViewFrame->GetFrame().GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = comphelper::getFromUnoTunnel<ScTabViewObj>( 
xController );
+            ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( 
xController.get() );
             if (pImp)
                 pImp->SelectionChanged();
         }
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index f3569ac9497f..5e4956eb482b 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -312,7 +312,7 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
         uno::Reference<frame::XController> xController = 
pViewFrame->GetFrame().GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = comphelper::getFromUnoTunnel<ScTabViewObj>( 
xController );
+            ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( 
xController.get() );
             if (pImp)
                 pImp->SheetChanged( bSameTabButMoved );
         }
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index c0a8ae702257..63cbf1f2229a 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1136,7 +1136,7 @@ static ScTabViewObj* lcl_GetViewObj( const 
ScTabViewShell& rShell )
         SfxFrame& rFrame = pViewFrame->GetFrame();
         uno::Reference<frame::XController> xController = 
rFrame.GetController();
         if (xController.is())
-            pRet = comphelper::getFromUnoTunnel<ScTabViewObj>( xController );
+            pRet = dynamic_cast<ScTabViewObj*>( xController.get() );
     }
     return pRet;
 }

Reply via email to