basctl/source/basicide/basicrenderable.cxx                  |    2 
 chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx |    2 
 chart2/source/controller/main/ChartController.cxx           |    2 
 chart2/source/controller/main/ChartController_Window.cxx    |    2 
 chart2/source/tools/NumberFormatterWrapper.cxx              |    2 
 chart2/source/view/axes/VCartesianAxis.cxx                  |    2 
 chart2/source/view/charttypes/BarChart.cxx                  |    2 
 chart2/source/view/main/ChartView.cxx                       |    4 -
 dbaccess/source/ui/browser/brwview.cxx                      |    2 
 dbaccess/source/ui/browser/genericcontroller.cxx            |    2 
 dbaccess/source/ui/browser/sbagrid.cxx                      |    2 
 dbaccess/source/ui/control/FieldDescControl.cxx             |    2 
 dbaccess/source/ui/misc/TokenWriter.cxx                     |    2 
 dbaccess/source/ui/uno/ColumnControl.cxx                    |    2 
 drawinglayer/source/primitive2d/controlprimitive2d.cxx      |    2 
 editeng/source/uno/unofield.cxx                             |    2 
 editeng/source/uno/unonrule.cxx                             |    6 -
 editeng/source/uno/unotext.cxx                              |   29 +++------
 editeng/source/uno/unotext2.cxx                             |    2 
 extensions/source/bibliography/bibload.cxx                  |    2 
 extensions/source/propctrlr/propcontroller.cxx              |    2 
 filter/source/msfilter/eschesdo.cxx                         |    4 -
 filter/source/svg/svgexport.cxx                             |    8 +-
 filter/source/svg/svgfilter.cxx                             |    2 
 forms/source/richtext/richtextcontrol.cxx                   |    2 
 forms/source/solar/component/navbarcontrol.cxx              |    2 
 framework/source/layoutmanager/layoutmanager.cxx            |    4 -
 framework/source/uielement/controlmenucontroller.cxx        |    8 +-
 framework/source/uielement/fontmenucontroller.cxx           |    2 
 framework/source/uielement/fontsizemenucontroller.cxx       |    4 -
 framework/source/uielement/headermenucontroller.cxx         |    2 
 framework/source/uielement/langselectionmenucontroller.cxx  |    2 
 framework/source/uielement/macrosmenucontroller.cxx         |    2 
 framework/source/uielement/newmenucontroller.cxx            |    6 -
 framework/source/uielement/objectmenucontroller.cxx         |    2 
 framework/source/uielement/popuptoolbarcontroller.cxx       |    4 -
 framework/source/uielement/recentfilesmenucontroller.cxx    |    2 
 framework/source/uielement/resourcemenucontroller.cxx       |    8 +-
 framework/source/uielement/thesaurusmenucontroller.cxx      |    2 
 framework/source/uielement/toolbarmodemenucontroller.cxx    |    4 -
 framework/source/uielement/toolbarsmenucontroller.cxx       |    8 +-
 include/comphelper/servicehelper.hxx                        |   27 +++++---
 oox/source/drawingml/shape.cxx                              |    4 -
 oox/source/export/chartexport.cxx                           |    2 
 reportdesign/source/core/api/Shape.cxx                      |    2 
 reportdesign/source/core/sdr/RptObject.cxx                  |    2 
 reportdesign/source/core/sdr/RptPage.cxx                    |    2 
 reportdesign/source/core/sdr/UndoActions.cxx                |    2 
 reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx |    6 -
 reportdesign/source/ui/misc/RptUndo.cxx                     |    2 
 reportdesign/source/ui/report/ReportSection.cxx             |    4 -
 reportdesign/source/ui/report/ViewsWindow.cxx               |    2 
 sc/source/filter/xml/XMLTableShapeImportHelper.cxx          |    4 -
 sc/source/filter/xml/xmlexprt.cxx                           |    8 +-
 sc/source/filter/xml/xmlstyli.cxx                           |    4 -
 sc/source/filter/xml/xmlwrap.cxx                            |    2 
 sc/source/ui/Accessibility/AccessibleDocument.cxx           |    2 
 sc/source/ui/app/transobj.cxx                               |    4 -
 sc/source/ui/unoobj/afmtuno.cxx                             |    2 
 sc/source/ui/unoobj/cellsuno.cxx                            |   38 ++++++------
 sc/source/ui/unoobj/docuno.cxx                              |   16 ++---
 sc/source/ui/unoobj/funcuno.cxx                             |    2 
 sc/source/ui/unoobj/shapeuno.cxx                            |   12 +--
 sc/source/ui/unoobj/styleuno.cxx                            |    2 
 sc/source/ui/unoobj/textuno.cxx                             |    6 -
 sc/source/ui/unoobj/viewuno.cxx                             |    8 +-
 sc/source/ui/vba/excelvbahelper.cxx                         |    2 
 sc/source/ui/vba/vbaeventshelper.cxx                        |    4 -
 sc/source/ui/vba/vbaformat.cxx                              |    2 
 sc/source/ui/vba/vbarange.cxx                               |    8 +-
 sc/source/ui/vba/vbasheetobject.cxx                         |    4 -
 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 
 sd/source/core/text/textapi.cxx                             |    2 
 sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx   |   10 +--
 sd/source/ui/unoidl/SdUnoDrawView.cxx                       |   14 ++--
 sd/source/ui/unoidl/SdUnoOutlineView.cxx                    |    2 
 sd/source/ui/unoidl/unocpres.cxx                            |    6 -
 sd/source/ui/unoidl/unolayer.cxx                            |   10 +--
 sd/source/ui/unoidl/unomodel.cxx                            |   21 +-----
 sd/source/ui/unoidl/unopage.cxx                             |   18 ++---
 sd/source/ui/unoidl/unosrch.cxx                             |   10 +--
 sd/source/ui/view/DocumentRenderer.cxx                      |    2 
 sfx2/source/control/dispatch.cxx                            |    2 
 sfx2/source/doc/guisaveas.cxx                               |    2 
 sfx2/source/doc/objserv.cxx                                 |    2 
 sfx2/source/notebookbar/NotebookbarTabControl.cxx           |    2 
 starmath/source/unomodel.cxx                                |    2 
 svl/source/numbers/numfmuno.cxx                             |    2 
 svtools/source/hatchwindow/hatchwindow.cxx                  |    2 
 svtools/source/uno/unoiface.cxx                             |    2 
 svtools/source/uno/unoimap.cxx                              |    4 -
 svx/source/accessibility/ShapeTypeHandler.cxx               |    2 
 svx/source/customshapes/EnhancedCustomShapeEngine.cxx       |    2 
 svx/source/fmcomp/fmgridif.cxx                              |    4 -
 svx/source/fmcomp/gridcell.cxx                              |    4 -
 svx/source/mnuctrls/smarttagmenu.cxx                        |    2 
 svx/source/svdraw/svdedxv.cxx                               |    2 
 svx/source/svdraw/svdobj.cxx                                |    4 -
 svx/source/unodraw/UnoGraphicExporter.cxx                   |    4 -
 svx/source/unodraw/unomod.cxx                               |    2 
 svx/source/unodraw/unopage.cxx                              |   10 +--
 svx/source/unodraw/unoshap2.cxx                             |    8 +-
 svx/source/unodraw/unoshap3.cxx                             |    4 -
 svx/source/unodraw/unoshape.cxx                             |   15 ----
 svx/source/unogallery/unogaltheme.cxx                       |    4 -
 sw/source/core/view/printdata.cxx                           |    2 
 sw/source/uibase/uno/unotxdoc.cxx                           |    2 
 toolkit/source/awt/vclxgraphics.cxx                         |    2 
 toolkit/source/awt/vclxmenu.cxx                             |    2 
 toolkit/source/awt/vclxtoolkit.cxx                          |    2 
 toolkit/source/awt/vclxtopwindow.cxx                        |    2 
 toolkit/source/awt/vclxwindow.cxx                           |    2 
 toolkit/source/controls/stdtabcontroller.cxx                |    2 
 toolkit/source/helper/unowrapper.cxx                        |    2 
 toolkit/source/helper/vclunohelper.cxx                      |   16 ++---
 xmloff/source/core/attrlist.cxx                             |    2 
 xmloff/source/core/xmlimp.cxx                               |    2 
 xmloff/source/style/xmlnumfe.cxx                            |    4 -
 xmloff/source/style/xmlnumfi.cxx                            |    4 -
 124 files changed, 279 insertions(+), 303 deletions(-)

New commits:
commit adc295a1b2e1f2ed43e7eb587fc89d7229e0f122
Author:     Arkadiy Illarionov <qar...@gmail.com>
AuthorDate: Sat Jun 15 21:46:13 2019 +0300
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Jun 17 08:56:36 2019 +0200

    Add comphelper::getUnoTunnelImplementation template
    
    Use it instead of classname::getImplementation from UNO3_GETIMPLEMENTATION_*
    
    Change-Id: Ifcc8cfcd6369c576250008c76ce31ba79ea3a596
    Reviewed-on: https://gerrit.libreoffice.org/74107
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/basctl/source/basicide/basicrenderable.cxx 
b/basctl/source/basicide/basicrenderable.cxx
index cdaa36a13093..b32925317547 100644
--- a/basctl/source/basicide/basicrenderable.cxx
+++ b/basctl/source/basicide/basicrenderable.cxx
@@ -83,7 +83,7 @@ VclPtr< Printer > Renderable::getPrinter()
 
     if( aValue >>= xRenderDevice )
     {
-        VCLXDevice* pDevice = VCLXDevice::getImplementation(xRenderDevice);
+        VCLXDevice* pDevice = 
comphelper::getUnoTunnelImplementation<VCLXDevice>(xRenderDevice);
         VclPtr< OutputDevice > pOut = pDevice ? pDevice->GetOutputDevice() : 
VclPtr< OutputDevice >();
         pPrinter = dynamic_cast<Printer*>(pOut.get());
     }
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx 
b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index cd972a3119d7..11d5f45e886b 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -167,7 +167,7 @@ void CreationWizardUnoDlg::createDialogOnDemand()
         }
         if( m_xParentWindow.is() )
         {
-            VCLXWindow* pImplementation = 
VCLXWindow::getImplementation(m_xParentWindow);
+            VCLXWindow* pImplementation = 
comphelper::getUnoTunnelImplementation<VCLXWindow>(m_xParentWindow);
             if (pImplementation)
                 pParent = pImplementation->GetWindow().get();
         }
diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index 0fd4cfc311d7..15a30767c63c 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -430,7 +430,7 @@ void SAL_CALL ChartController::attachFrame(
     if(xFrame.is())
     {
         uno::Reference< awt::XWindow > xContainerWindow = 
xFrame->getContainerWindow();
-        VCLXWindow* pParentComponent = 
VCLXWindow::getImplementation(xContainerWindow);
+        VCLXWindow* pParentComponent = 
comphelper::getUnoTunnelImplementation<VCLXWindow>(xContainerWindow);
         assert(pParentComponent);
         if (pParentComponent)
             pParentComponent->setVisible(true);
diff --git a/chart2/source/controller/main/ChartController_Window.cxx 
b/chart2/source/controller/main/ChartController_Window.cxx
index 90e441b68a19..97f515895741 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1269,7 +1269,7 @@ void ChartController::execute_Command( const 
CommandEvent& rCEvt )
 
         if (comphelper::LibreOfficeKit::isActive())
         {
-            PopupMenu* pPopupMenu = 
static_cast<PopupMenu*>(VCLXMenu::getImplementation(xPopupMenu)->GetMenu());
+            PopupMenu* pPopupMenu = 
static_cast<PopupMenu*>(comphelper::getUnoTunnelImplementation<VCLXMenu>(xPopupMenu)->GetMenu());
             pPopupMenu->SetLOKNotifier(SfxViewShell::Current());
 
             // the context menu expects a position related to the document 
window,
diff --git a/chart2/source/tools/NumberFormatterWrapper.cxx 
b/chart2/source/tools/NumberFormatterWrapper.cxx
index a1085c4dac06..a585c04b7dc3 100644
--- a/chart2/source/tools/NumberFormatterWrapper.cxx
+++ b/chart2/source/tools/NumberFormatterWrapper.cxx
@@ -56,7 +56,7 @@ NumberFormatterWrapper::NumberFormatterWrapper( const 
uno::Reference< util::XNum
     OUString sNullDate( "NullDate" );
     if ( xProp.is() && 
xProp->getPropertySetInfo()->hasPropertyByName(sNullDate) )
         m_aNullDate = xProp->getPropertyValue(sNullDate);
-    SvNumberFormatsSupplierObj* pSupplierObj = 
SvNumberFormatsSupplierObj::getImplementation( xSupplier );
+    SvNumberFormatsSupplierObj* pSupplierObj = 
comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( xSupplier );
     if( pSupplierObj )
         m_pNumberFormatter = pSupplierObj->GetNumberFormatter();
     SAL_WARN_IF(!m_pNumberFormatter,"chart2.tools","need a numberformatter");
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx 
b/chart2/source/view/axes/VCartesianAxis.cxx
index b80f1b97ebd3..483411c4c605 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -371,7 +371,7 @@ static bool lcl_hasWordBreak( const 
Reference<drawing::XShape>& xShape )
     if (!xShape.is())
         return false;
 
-    SvxShape* pShape = SvxShape::getImplementation(xShape);
+    SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>(xShape);
     SvxShapeText* pShapeText = dynamic_cast<SvxShapeText*>(pShape);
     if (!pShapeText)
         return false;
diff --git a/chart2/source/view/charttypes/BarChart.cxx 
b/chart2/source/view/charttypes/BarChart.cxx
index 28dde06bf071..d732a683d0e6 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -439,7 +439,7 @@ static E3dScene* 
lcl_getE3dScene(uno::Reference<uno::XInterface> const & xInterf
 {
     E3dScene* pScene = nullptr;
 
-    SvxShape* pSvxShape = SvxShape::getImplementation(xInterface);
+    SvxShape* pSvxShape = 
comphelper::getUnoTunnelImplementation<SvxShape>(xInterface);
     if (pSvxShape)
     {
         SdrObject* pObject = pSvxShape->GetSdrObject();
diff --git a/chart2/source/view/main/ChartView.cxx 
b/chart2/source/view/main/ChartView.cxx
index 44a70013bf64..18c9380e6db8 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1805,7 +1805,7 @@ awt::Rectangle ChartView::getRectangleOfObject( const 
OUString& rObjectCID, bool
         if( eObjectType == OBJECTTYPE_AXIS || eObjectType == 
OBJECTTYPE_DIAGRAM )
         {
             SolarMutexGuard aSolarGuard;
-            SvxShape* pRoot = SvxShape::getImplementation( xShape );
+            SvxShape* pRoot = 
comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
             if( pRoot )
             {
                 SdrObject* pRootSdrObject = pRoot->GetSdrObject();
@@ -1831,7 +1831,7 @@ awt::Rectangle ChartView::getRectangleOfObject( const 
OUString& rObjectCID, bool
         if( bSnapRect )
         {
             //for rotated objects the shape size and position differs from the 
visible rectangle
-            SvxShape* pShape = SvxShape::getImplementation( xShape );
+            SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
             if( pShape )
             {
                 SdrObject* pSdrObject = pShape->GetSdrObject();
diff --git a/dbaccess/source/ui/browser/brwview.cxx 
b/dbaccess/source/ui/browser/brwview.cxx
index bc9cd3b2cae1..a20291fb5e01 100644
--- a/dbaccess/source/ui/browser/brwview.cxx
+++ b/dbaccess/source/ui/browser/brwview.cxx
@@ -257,7 +257,7 @@ SbaGridControl* UnoDataBrowserView::getVclControl() const
             Reference< css::awt::XWindowPeer >  xPeer = m_xGrid->getPeer();
             if ( xPeer.is() )
             {
-                SbaXGridPeer* pPeer = SbaXGridPeer::getImplementation(xPeer);
+                SbaXGridPeer* pPeer = 
comphelper::getUnoTunnelImplementation<SbaXGridPeer>(xPeer);
                 UnoDataBrowserView* pTHIS = 
const_cast<UnoDataBrowserView*>(this);
                 if ( pPeer )
                 {
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx 
b/dbaccess/source/ui/browser/genericcontroller.cxx
index 73a97288dee8..d4d5b03a0c6b 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -251,7 +251,7 @@ void SAL_CALL OGenericUnoController::initialize( const 
Sequence< Any >& aArgumen
             throw IllegalArgumentException("need a frame", *this, 1 );
 
         xParent = xFrame->getContainerWindow();
-        VCLXWindow* pParentComponent = VCLXWindow::getImplementation(xParent);
+        VCLXWindow* pParentComponent = 
comphelper::getUnoTunnelImplementation<VCLXWindow>(xParent);
         VclPtr< vcl::Window > pParentWin = pParentComponent ? 
pParentComponent->GetWindow() : VclPtr< vcl::Window >();
         if (!pParentWin)
         {
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx 
b/dbaccess/source/ui/browser/sbagrid.cxx
index 3b855aa82b44..0a8eabdc1d53 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -737,7 +737,7 @@ SvNumberFormatter* SbaGridControl::GetDatasourceFormatter()
 {
     Reference< css::util::XNumberFormatsSupplier >  xSupplier = 
::dbtools::getNumberFormats(::dbtools::getConnection(Reference< XRowSet > 
(getDataSource(),UNO_QUERY)), true, getContext());
 
-    SvNumberFormatsSupplierObj* pSupplierImpl = 
SvNumberFormatsSupplierObj::getImplementation( xSupplier );
+    SvNumberFormatsSupplierObj* pSupplierImpl = 
comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( xSupplier );
     if ( !pSupplierImpl )
         return nullptr;
 
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx 
b/dbaccess/source/ui/control/FieldDescControl.cxx
index 37296494d91f..1c45ddc3c97d 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -533,7 +533,7 @@ IMPL_LINK_NOARG( OFieldDescControl, FormatClickHdl, Button 
*, void )
     sal_Int32 nOldFormatKey(pActFieldDescr->GetFormatKey());
     SvxCellHorJustify rOldJustify = pActFieldDescr->GetHorJustify();
     Reference< XNumberFormatsSupplier >  xSupplier = 
GetFormatter()->getNumberFormatsSupplier();
-    SvNumberFormatsSupplierObj* pSupplierImpl = 
SvNumberFormatsSupplierObj::getImplementation( xSupplier );
+    SvNumberFormatsSupplierObj* pSupplierImpl = 
comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( xSupplier );
     if (!pSupplierImpl)
         return;
 
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx 
b/dbaccess/source/ui/misc/TokenWriter.cxx
index 56d2246e501d..5a56d78dcc18 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -871,7 +871,7 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat, 
sal_Int32 nWidthPixel, sal
     aStrTD = aStrTD + "=";
     aStrTD = aStrTD + pChar;
 
-    SvNumberFormatsSupplierObj* pSupplierImpl = m_xFormatter.is() ? 
SvNumberFormatsSupplierObj::getImplementation(m_xFormatter->getNumberFormatsSupplier())
 : nullptr;
+    SvNumberFormatsSupplierObj* pSupplierImpl = m_xFormatter.is() ? 
comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>(m_xFormatter->getNumberFormatsSupplier())
 : nullptr;
     SvNumberFormatter* pFormatter = pSupplierImpl ? 
pSupplierImpl->GetNumberFormatter() : nullptr;
     if(pFormatter)
     {
diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx 
b/dbaccess/source/ui/uno/ColumnControl.cxx
index f8fa6d7ec836..e3fb806a0872 100644
--- a/dbaccess/source/ui/uno/ColumnControl.cxx
+++ b/dbaccess/source/ui/uno/ColumnControl.cxx
@@ -68,7 +68,7 @@ void SAL_CALL OColumnControl::createPeer(const Reference< 
XToolkit >& /*rToolkit
         vcl::Window* pParentWin = nullptr;
         if (rParentPeer.is())
         {
-            VCLXWindow* pParent = VCLXWindow::getImplementation(rParentPeer);
+            VCLXWindow* pParent = 
comphelper::getUnoTunnelImplementation<VCLXWindow>(rParentPeer);
             if (pParent)
                 pParentWin = pParent->GetWindow().get();
         }
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx 
b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index 343c99c3a81b..3de3043086bc 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -150,7 +150,7 @@ namespace drawinglayer
 
                                     if(xWindowPeer.is())
                                     {
-                                        VCLXWindow* pVCLXWindow = 
VCLXWindow::getImplementation(xWindowPeer);
+                                        VCLXWindow* pVCLXWindow = 
comphelper::getUnoTunnelImplementation<VCLXWindow>(xWindowPeer);
 
                                         if(pVCLXWindow)
                                         {
diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx
index 5e0eae732fd3..5a30627a3d7b 100644
--- a/editeng/source/uno/unofield.cxx
+++ b/editeng/source/uno/unofield.cxx
@@ -663,7 +663,7 @@ OUString SAL_CALL SvxUnoTextField::getPresentation( 
sal_Bool bShowCommand )
 // Interface text::XTextContent
 void SAL_CALL SvxUnoTextField::attach( const uno::Reference< text::XTextRange 
>& xTextRange )
 {
-    SvxUnoTextRangeBase* pRange = SvxUnoTextRange::getImplementation( 
xTextRange );
+    SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRange>( xTextRange );
     if(pRange == nullptr)
         throw lang::IllegalArgumentException();
 
diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index e3a3d5111706..a046910b1068 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -473,7 +473,7 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex(const 
Sequence<beans::Propert
 
 const SvxNumRule& SvxGetNumRule( Reference< XIndexReplace > const & xRule )
 {
-    SvxUnoNumberingRules* pRule = SvxUnoNumberingRules::getImplementation( 
xRule );
+    SvxUnoNumberingRules* pRule = 
comphelper::getUnoTunnelImplementation<SvxUnoNumberingRules>( xRule );
     if( pRule == nullptr )
         throw IllegalArgumentException();
 
@@ -513,10 +513,10 @@ sal_Int16 SvxUnoNumberingRules::Compare( const Any& Any1, 
const Any& Any2 )
         if( x1.get() == x2.get() )
             return 0;
 
-        SvxUnoNumberingRules* pRule1 = 
SvxUnoNumberingRules::getImplementation( x1 );
+        SvxUnoNumberingRules* pRule1 = 
comphelper::getUnoTunnelImplementation<SvxUnoNumberingRules>( x1 );
         if( pRule1 )
         {
-            SvxUnoNumberingRules* pRule2 = 
SvxUnoNumberingRules::getImplementation( x2 );
+            SvxUnoNumberingRules* pRule2 = 
comphelper::getUnoTunnelImplementation<SvxUnoNumberingRules>( x2 );
             if( pRule2 )
             {
                 const SvxNumRule& rRule1 = pRule1->getNumRule();
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index d37b4fdaebec..07c27d701e57 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -315,7 +315,7 @@ uno::Reference< text::XTextRange > SAL_CALL 
SvxUnoTextRangeBase::getStart()
     {
         CheckSelection( maSelection, pForwarder );
 
-        SvxUnoTextBase* pText = SvxUnoTextBase::getImplementation( getText() );
+        SvxUnoTextBase* pText = 
comphelper::getUnoTunnelImplementation<SvxUnoTextBase>( getText() );
 
         if(pText == nullptr)
             throw uno::RuntimeException();
@@ -343,7 +343,7 @@ uno::Reference< text::XTextRange > SAL_CALL 
SvxUnoTextRangeBase::getEnd()
     {
         CheckSelection( maSelection, pForwarder );
 
-        SvxUnoTextBase* pText = SvxUnoTextBase::getImplementation( getText() );
+        SvxUnoTextBase* pText = 
comphelper::getUnoTunnelImplementation<SvxUnoTextBase>( getText() );
 
         if(pText == nullptr)
             throw uno::RuntimeException();
@@ -1452,8 +1452,8 @@ uno::Sequence< OUString > 
SvxUnoTextRangeBase::getSupportedServiceNames_Static()
 // XTextRangeCompare
 sal_Int16 SAL_CALL SvxUnoTextRangeBase::compareRegionStarts( const 
uno::Reference< text::XTextRange >& xR1, const uno::Reference< text::XTextRange 
>& xR2 )
 {
-    SvxUnoTextRangeBase* pR1 = SvxUnoTextRangeBase::getImplementation( xR1 );
-    SvxUnoTextRangeBase* pR2 = SvxUnoTextRangeBase::getImplementation( xR2 );
+    SvxUnoTextRangeBase* pR1 = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRangeBase>( xR1 );
+    SvxUnoTextRangeBase* pR2 = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRangeBase>( xR2 );
 
     if( (pR1 == nullptr) || (pR2 == nullptr) )
         throw lang::IllegalArgumentException();
@@ -1476,8 +1476,8 @@ sal_Int16 SAL_CALL 
SvxUnoTextRangeBase::compareRegionStarts( const uno::Referenc
 
 sal_Int16 SAL_CALL SvxUnoTextRangeBase::compareRegionEnds( const 
uno::Reference< text::XTextRange >& xR1, const uno::Reference< text::XTextRange 
>& xR2 )
 {
-    SvxUnoTextRangeBase* pR1 = SvxUnoTextRangeBase::getImplementation( xR1 );
-    SvxUnoTextRangeBase* pR2 = SvxUnoTextRangeBase::getImplementation( xR2 );
+    SvxUnoTextRangeBase* pR1 = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRangeBase>( xR1 );
+    SvxUnoTextRangeBase* pR2 = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRangeBase>( xR2 );
 
     if( (pR1 == nullptr) || (pR2 == nullptr) )
         throw lang::IllegalArgumentException();
@@ -1723,7 +1723,7 @@ uno::Reference< text::XTextCursor > SAL_CALL 
SvxUnoTextBase::createTextCursorByR
 
     if( aTextPosition.is() )
     {
-        SvxUnoTextRangeBase* pRange = SvxUnoTextRangeBase::getImplementation( 
aTextPosition );
+        SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRangeBase>( aTextPosition );
         if(pRange)
             xCursor = createTextCursorBySelection( pRange->GetSelection() );
     }
@@ -1745,7 +1745,7 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
         SetSelection( aSelection );
     }
 
-    SvxUnoTextRangeBase* pRange = SvxUnoTextRange::getImplementation( xRange );
+    SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRange>( xRange );
     if(pRange)
     {
         // setString on SvxUnoTextRangeBase instead of itself QuickInsertText
@@ -1785,7 +1785,7 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( 
const uno::Reference< text
         }
         case text::ControlCharacter::LINE_BREAK:
         {
-            SvxUnoTextRangeBase* pRange = SvxUnoTextRange::getImplementation( 
xRange );
+            SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRange>( xRange );
             if(pRange)
             {
                 ESelection aRange = pRange->GetSelection();
@@ -1816,7 +1816,7 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( 
const uno::Reference< text
         }
         case text::ControlCharacter::APPEND_PARAGRAPH:
         {
-            SvxUnoTextRangeBase* pRange = SvxUnoTextRange::getImplementation( 
xRange );
+            SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRange>( xRange );
             if(pRange)
             {
                 ESelection aRange = pRange->GetSelection();
@@ -2180,15 +2180,6 @@ const uno::Sequence< sal_Int8 > & 
SvxUnoTextBase::getUnoTunnelId() throw()
     return theSvxUnoTextBaseUnoTunnelId::get().getSeq();
 }
 
-SvxUnoTextBase* SvxUnoTextBase::getImplementation( const uno::Reference< 
uno::XInterface >& xInt )
-{
-    uno::Reference< lang::XUnoTunnel > xUT( xInt, uno::UNO_QUERY );
-    if( xUT.is() )
-        return 
reinterpret_cast<SvxUnoTextBase*>(sal::static_int_cast<sal_uIntPtr>(xUT->getSomething(
 SvxUnoTextBase::getUnoTunnelId())));
-    else
-        return nullptr;
-}
-
 sal_Int64 SAL_CALL SvxUnoTextBase::getSomething( const uno::Sequence< sal_Int8 
>& rId )
 {
     if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index cf2a7f8aa4b9..1fa6e212dc90 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -588,7 +588,7 @@ void SAL_CALL SvxUnoTextCursor::gotoRange( const 
uno::Reference< text::XTextRang
     if( !xRange.is() )
         return;
 
-    SvxUnoTextRangeBase* pRange = SvxUnoTextRangeBase::getImplementation( 
xRange );
+    SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRangeBase>( xRange );
 
     if( pRange )
     {
diff --git a/extensions/source/bibliography/bibload.cxx 
b/extensions/source/bibliography/bibload.cxx
index 938dcc65a391..55a02482ec40 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -266,7 +266,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > 
& rFrame,
     Reference< XForm > xForm = m_xDatMan->createDatabaseForm( aBibDesc );
 
     Reference< awt::XWindow >  aWindow = rFrame->getContainerWindow();
-    VCLXWindow* pParentComponent = VCLXWindow::getImplementation(aWindow);
+    VCLXWindow* pParentComponent = 
comphelper::getUnoTunnelImplementation<VCLXWindow>(aWindow);
     assert(pParentComponent);
 
     VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( aWindow );
diff --git a/extensions/source/propctrlr/propcontroller.cxx 
b/extensions/source/propctrlr/propcontroller.cxx
index 21bd8ddbca69..238eaf937f3b 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -359,7 +359,7 @@ namespace pcr
         // Maybe it is intended to only announce the frame to the controller, 
and the instance doing this
         // announcement is responsible for calling setComponent, too.
         Reference< XWindow > xContainerWindow = m_xFrame->getContainerWindow();
-        VCLXWindow* pContainerWindow = 
VCLXWindow::getImplementation(xContainerWindow);
+        VCLXWindow* pContainerWindow = 
comphelper::getUnoTunnelImplementation<VCLXWindow>(xContainerWindow);
         VclPtr<vcl::Window> pParentWin = pContainerWindow ? 
pContainerWindow->GetWindow() : VclPtr<vcl::Window>();
         if (!pParentWin)
             throw RuntimeException("The frame is invalid. Unable to extract 
the container window.",*this);
diff --git a/filter/source/msfilter/eschesdo.cxx 
b/filter/source/msfilter/eschesdo.cxx
index 365a620f5a4c..ff9ef46333c1 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -877,7 +877,7 @@ bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage )
         mpSolverContainer.reset( new EscherSolverContainer );
     }
     else
-        pSvxDrawPage = SvxDrawPage::getImplementation(mXDrawPage);
+        pSvxDrawPage = 
comphelper::getUnoTunnelImplementation<SvxDrawPage>(mXDrawPage);
 
     return pSvxDrawPage != nullptr;
 }
@@ -988,7 +988,7 @@ sal_uInt32 EscherEx::AddDummyShape()
 const SdrObject* EscherEx::GetSdrObject( const Reference< XShape >& rShape )
 {
     const SdrObject* pRet = nullptr;
-    const SvxShape* pSvxShape = SvxShape::getImplementation( rShape );
+    const SvxShape* pSvxShape = 
comphelper::getUnoTunnelImplementation<SvxShape>( rShape );
     DBG_ASSERT( pSvxShape, "EscherEx::GetSdrObject: no SvxShape" );
     if( pSvxShape )
     {
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 92c344485e94..9b17fb382a05 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -582,7 +582,7 @@ bool SVGFilter::implExportImpressOrDraw( const Reference< 
XOutputStream >& rxOSt
 
                     if( mxDefaultPage.is() )
                     {
-                        SvxDrawPage* pSvxDrawPage = 
SvxDrawPage::getImplementation( mxDefaultPage );
+                        SvxDrawPage* pSvxDrawPage = 
comphelper::getUnoTunnelImplementation<SvxDrawPage>( mxDefaultPage );
 
                         if( pSvxDrawPage )
                         {
@@ -700,7 +700,7 @@ bool SVGFilter::implExportWriterTextGraphic( const 
Reference< view::XSelectionSu
         Size  aSize( OutputDevice::LogicToLogic(aGraphic.GetPrefSize(), 
aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) );
 
         assert(mSelectedPages.size() == 1);
-        SvxDrawPage* 
pSvxDrawPage(SvxDrawPage::getImplementation(mSelectedPages[0]));
+        SvxDrawPage* 
pSvxDrawPage(comphelper::getUnoTunnelImplementation<SvxDrawPage>(mSelectedPages[0]));
         if(pSvxDrawPage == nullptr || pSvxDrawPage->GetSdrPage() == nullptr)
             return false;
 
@@ -1053,7 +1053,7 @@ void SVGFilter::implGenerateMetaData()
         // NOTE: at present pSdrModel->GetPageNumType() returns always 
css::style::NumberingType::ARABIC
         // so the following code fragment is pretty useless
         sal_Int32 nPageNumberingType = css::style::NumberingType::ARABIC;
-        SvxDrawPage* pSvxDrawPage = SvxDrawPage::getImplementation( 
mSelectedPages[0] );
+        SvxDrawPage* pSvxDrawPage = 
comphelper::getUnoTunnelImplementation<SvxDrawPage>( mSelectedPages[0] );
         if( pSvxDrawPage )
         {
             SdrPage* pSdrPage = pSvxDrawPage->GetSdrPage();
@@ -1518,7 +1518,7 @@ void SVGFilter::implGetPagePropSet( const Reference< 
css::drawing::XDrawPage > &
 
             if( mVisiblePagePropSet.bIsPageNumberFieldVisible )
             {
-                SvxDrawPage* pSvxDrawPage = SvxDrawPage::getImplementation( 
rxPage );
+                SvxDrawPage* pSvxDrawPage = 
comphelper::getUnoTunnelImplementation<SvxDrawPage>( rxPage );
                 if( pSvxDrawPage )
                 {
                     SdrPage* pSdrPage = pSvxDrawPage->GetSdrPage();
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 482c3ba7eb2f..9bb57068dfea 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -213,7 +213,7 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< 
PropertyValue >& rDescripto
             }
 
             // get that DrawPage's UNO API implementation
-            SvxDrawPage* 
pSvxDrawPage(SvxDrawPage::getImplementation(xDrawPage));
+            SvxDrawPage* 
pSvxDrawPage(comphelper::getUnoTunnelImplementation<SvxDrawPage>(xDrawPage));
 
             if(nullptr == pSvxDrawPage || nullptr == 
pSvxDrawPage->GetSdrPage())
             {
diff --git a/forms/source/richtext/richtextcontrol.cxx 
b/forms/source/richtext/richtextcontrol.cxx
index aa3afe77fd29..5b8158fba565 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -174,7 +174,7 @@ namespace frm
             vcl::Window* pParentWin = nullptr;
             if ( _rParentPeer.is() )
             {
-                VCLXWindow* pParentXWin = VCLXWindow::getImplementation( 
_rParentPeer );
+                VCLXWindow* pParentXWin = 
comphelper::getUnoTunnelImplementation<VCLXWindow>( _rParentPeer );
                 if ( pParentXWin )
                     pParentWin = pParentXWin->GetWindow().get();
                 DBG_ASSERT( pParentWin, "ORichTextControl::createPeer: could 
not obtain the VCL-level parent window!" );
diff --git a/forms/source/solar/component/navbarcontrol.cxx 
b/forms/source/solar/component/navbarcontrol.cxx
index 8d50352baa02..f9f6fdbd8adb 100644
--- a/forms/source/solar/component/navbarcontrol.cxx
+++ b/forms/source/solar/component/navbarcontrol.cxx
@@ -123,7 +123,7 @@ namespace frm
             vcl::Window* pParentWin = nullptr;
             if ( _rParentPeer.is() )
             {
-                VCLXWindow* pParentXWin = VCLXWindow::getImplementation( 
_rParentPeer );
+                VCLXWindow* pParentXWin = 
comphelper::getUnoTunnelImplementation<VCLXWindow>( _rParentPeer );
                 if ( pParentXWin )
                     pParentWin = pParentXWin->GetWindow().get();
                 DBG_ASSERT( pParentWin, "ONavigationBarControl::createPeer: 
could not obtain the VCL-level parent window!" );
diff --git a/framework/source/layoutmanager/layoutmanager.cxx 
b/framework/source/layoutmanager/layoutmanager.cxx
index 608ecb710f01..46620bbdfc13 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -194,7 +194,7 @@ void LayoutManager::implts_createMenuBar(const OUString& 
rMenuBarName)
 
                 if ( xMenuBar.is() )
                 {
-                    VCLXMenu* pAwtMenuBar = VCLXMenu::getImplementation( 
xMenuBar );
+                    VCLXMenu* pAwtMenuBar = 
comphelper::getUnoTunnelImplementation<VCLXMenu>( xMenuBar );
                     if ( pAwtMenuBar )
                     {
                         MenuBar* pMenuBar = 
static_cast<MenuBar*>(pAwtMenuBar->GetMenu());
@@ -246,7 +246,7 @@ void LayoutManager::impl_clearUpMenuBar()
                     }
                 }
 
-                VCLXMenu* pAwtMenuBar = VCLXMenu::getImplementation( xMenuBar 
);
+                VCLXMenu* pAwtMenuBar = 
comphelper::getUnoTunnelImplementation<VCLXMenu>( xMenuBar );
                 if ( pAwtMenuBar )
                     pSetMenuBar = 
static_cast<MenuBar*>(pAwtMenuBar->GetMenu());
             }
diff --git a/framework/source/uielement/controlmenucontroller.cxx 
b/framework/source/uielement/controlmenucontroller.cxx
index 22c25105d5de..26154c2e8071 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -193,8 +193,8 @@ void ControlMenuController::updateImagesPopupMenu( 
PopupMenu* pPopupMenu )
 // private function
 void ControlMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > 
const & rPopupMenu )
 {
-    VCLXPopupMenu*                                     pPopupMenu        = 
static_cast<VCLXPopupMenu *>(VCLXMenu::getImplementation( rPopupMenu ));
-    PopupMenu*                                         pVCLPopupMenu     = 
nullptr;
+    VCLXPopupMenu* pPopupMenu        = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu ));
+    PopupMenu*     pVCLPopupMenu     = nullptr;
 
     SolarMutexGuard aSolarMutexGuard;
 
@@ -244,7 +244,7 @@ void SAL_CALL ControlMenuController::statusChanged( const 
FeatureStateEvent& Eve
 
     if (!sIdent.isEmpty() && m_xResPopupMenu)
     {
-        pPopupMenu = static_cast<VCLXPopupMenu *>(VCLXMenu::getImplementation( 
m_xPopupMenu ));
+        pPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu ));
         nMenuId = m_xResPopupMenu->GetItemId(sIdent);
     }
 
@@ -299,7 +299,7 @@ void SAL_CALL ControlMenuController::itemActivated( const 
css::awt::MenuEvent& )
         {
             m_bShowMenuImages   = bShowMenuImages;
 
-            VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXPopupMenu::getImplementation( m_xPopupMenu ));
+            VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu ));
             if ( pPopupMenu )
             {
                 PopupMenu* pVCLPopupMenu = static_cast<PopupMenu 
*>(pPopupMenu->GetMenu());
diff --git a/framework/source/uielement/fontmenucontroller.cxx 
b/framework/source/uielement/fontmenucontroller.cxx
index 20c8387bb968..d54385931fdd 100644
--- a/framework/source/uielement/fontmenucontroller.cxx
+++ b/framework/source/uielement/fontmenucontroller.cxx
@@ -76,7 +76,7 @@ FontMenuController::~FontMenuController()
 void FontMenuController::fillPopupMenu( const Sequence< OUString >& 
rFontNameSeq, Reference< css::awt::XPopupMenu > const & rPopupMenu )
 {
     const OUString*    pFontNameArray = rFontNameSeq.getConstArray();
-    VCLXPopupMenu*     pPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXMenu::getImplementation( rPopupMenu ));
+    VCLXPopupMenu*     pPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu ));
     PopupMenu*         pVCLPopupMenu = nullptr;
 
     SolarMutexGuard aSolarMutexGuard;
diff --git a/framework/source/uielement/fontsizemenucontroller.cxx 
b/framework/source/uielement/fontsizemenucontroller.cxx
index d84bfdd3d911..7d75282c5983 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -124,8 +124,8 @@ void FontSizeMenuController::setCurHeight( long nHeight, 
Reference< css::awt::XP
 // private function
 void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > 
const & rPopupMenu )
 {
-    VCLXPopupMenu*          pPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXMenu::getImplementation( rPopupMenu ));
-    PopupMenu*              pVCLPopupMenu = nullptr;
+    VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu ));
+    PopupMenu*     pVCLPopupMenu = nullptr;
 
     resetPopupMenu( rPopupMenu );
     if ( pPopupMenu )
diff --git a/framework/source/uielement/headermenucontroller.cxx 
b/framework/source/uielement/headermenucontroller.cxx
index b7354d37027d..f846b0ba429e 100644
--- a/framework/source/uielement/headermenucontroller.cxx
+++ b/framework/source/uielement/headermenucontroller.cxx
@@ -73,7 +73,7 @@ HeaderMenuController::~HeaderMenuController()
 // private function
 void HeaderMenuController::fillPopupMenu( const Reference< css::frame::XModel 
>& rModel, Reference< css::awt::XPopupMenu > const & rPopupMenu )
 {
-    VCLXPopupMenu*       pPopupMenu        = static_cast<VCLXPopupMenu 
*>(VCLXMenu::getImplementation( rPopupMenu ));
+    VCLXPopupMenu*       pPopupMenu        = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu ));
     PopupMenu*           pVCLPopupMenu     = nullptr;
 
     SolarMutexGuard aSolarMutexGuard;
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx 
b/framework/source/uielement/langselectionmenucontroller.cxx
index 721e061bdf15..33a59f8e1d97 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -156,7 +156,7 @@ void LanguageSelectionMenuController::impl_setPopupMenu()
 
 void LanguageSelectionMenuController::fillPopupMenu( Reference< 
css::awt::XPopupMenu > const & rPopupMenu , const Mode eMode )
 {
-    VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXMenu::getImplementation( rPopupMenu ));
+    VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu ));
     PopupMenu*     pPopupMenu    = nullptr;
 
     SolarMutexGuard aSolarMutexGuard;
diff --git a/framework/source/uielement/macrosmenucontroller.cxx 
b/framework/source/uielement/macrosmenucontroller.cxx
index e8be467d0a59..c1335518f31f 100644
--- a/framework/source/uielement/macrosmenucontroller.cxx
+++ b/framework/source/uielement/macrosmenucontroller.cxx
@@ -64,7 +64,7 @@ MacrosMenuController::~MacrosMenuController()
 // private function
 void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > 
const & rPopupMenu )
 {
-    VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXMenu::getImplementation( rPopupMenu ));
+    VCLXPopupMenu* pVCLPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu ));
     PopupMenu*     pPopupMenu    = nullptr;
 
     SolarMutexGuard aSolarMutexGuard;
diff --git a/framework/source/uielement/newmenucontroller.cxx 
b/framework/source/uielement/newmenucontroller.cxx
index 138042ad614a..eb84177a2fee 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -302,7 +302,7 @@ NewMenuController::~NewMenuController()
 // private function
 void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const 
& rPopupMenu )
 {
-    VCLXPopupMenu* pPopupMenu    = static_cast<VCLXPopupMenu 
*>(VCLXMenu::getImplementation( rPopupMenu ));
+    VCLXPopupMenu* pPopupMenu    = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu ));
     PopupMenu*     pVCLPopupMenu = nullptr;
 
     SolarMutexGuard aSolarMutexGuard;
@@ -400,7 +400,7 @@ void SAL_CALL NewMenuController::itemSelected( const 
css::awt::MenuEvent& rEvent
 
     if ( xPopupMenu.is() )
     {
-        VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXPopupMenu::getImplementation( xPopupMenu ));
+        VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( xPopupMenu ));
         if ( pPopupMenu )
         {
             OUString aURL;
@@ -430,7 +430,7 @@ void SAL_CALL NewMenuController::itemActivated( const 
css::awt::MenuEvent& )
     SolarMutexGuard aSolarMutexGuard;
     if ( m_xFrame.is() && m_xPopupMenu.is() )
     {
-        VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXPopupMenu::getImplementation( m_xPopupMenu ));
+        VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu ));
         if ( pPopupMenu )
         {
             const StyleSettings& rSettings = 
Application::GetSettings().GetStyleSettings();
diff --git a/framework/source/uielement/objectmenucontroller.cxx 
b/framework/source/uielement/objectmenucontroller.cxx
index ad4ff3cb4885..772bb4ec81e9 100644
--- a/framework/source/uielement/objectmenucontroller.cxx
+++ b/framework/source/uielement/objectmenucontroller.cxx
@@ -89,7 +89,7 @@ ObjectMenuController::ObjectMenuController( const 
css::uno::Reference< css::uno:
 void ObjectMenuController::fillPopupMenu( const Sequence< 
css::embed::VerbDescriptor >& rVerbCommandSeq, Reference< css::awt::XPopupMenu 
> const & rPopupMenu )
 {
     const css::embed::VerbDescriptor* pVerbCommandArray = 
rVerbCommandSeq.getConstArray();
-    VCLXPopupMenu*                    pPopupMenu        = 
static_cast<VCLXPopupMenu *>(VCLXMenu::getImplementation( rPopupMenu ));
+    VCLXPopupMenu*                    pPopupMenu        = 
static_cast<VCLXPopupMenu *>(comphelper::getUnoTunnelImplementation<VCLXMenu>( 
rPopupMenu ));
     PopupMenu*                        pVCLPopupMenu     = nullptr;
 
     SolarMutexGuard aSolarMutexGuard;
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx 
b/framework/source/uielement/popuptoolbarcontroller.cxx
index 5e85bf7ddde7..5defb5e88ea2 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -330,7 +330,7 @@ void GenericPopupToolbarController::statusChanged( const 
css::frame::FeatureStat
 
     if ( m_bReplaceWithLast && !rEvent.IsEnabled && m_xPopupMenu.is() )
     {
-        Menu* pVclMenu = VCLXMenu::getImplementation( m_xPopupMenu 
)->GetMenu();
+        Menu* pVclMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( 
m_xPopupMenu )->GetMenu();
 
         ToolBox* pToolBox = nullptr;
         sal_uInt16 nId = 0;
@@ -664,7 +664,7 @@ void SAL_CALL NewToolbarController::execute( sal_Int16 
/*KeyModifier*/ )
         // TODO investigate how to wrap Get/SetUserValue in css::awt::XMenu
         MenuAttributes* pMenuAttributes( nullptr );
         VCLXPopupMenu*  pTkPopupMenu =
-            static_cast<VCLXPopupMenu *>( VCLXMenu::getImplementation( 
m_xPopupMenu ) );
+            static_cast<VCLXPopupMenu *>( 
comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu ) );
 
         SolarMutexGuard aSolarMutexGuard;
         PopupMenu* pVCLPopupMenu = pTkPopupMenu ?
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx 
b/framework/source/uielement/recentfilesmenucontroller.cxx
index 67d5d931c161..5d6581a37bef 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -118,7 +118,7 @@ RecentFilesMenuController::RecentFilesMenuController( const 
uno::Reference< uno:
 // private function
 void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu 
> const & rPopupMenu )
 {
-    VCLXPopupMenu* pPopupMenu    = static_cast<VCLXPopupMenu 
*>(VCLXMenu::getImplementation( rPopupMenu ));
+    VCLXPopupMenu* pPopupMenu    = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu ));
     PopupMenu*     pVCLPopupMenu = nullptr;
 
     SolarMutexGuard aSolarMutexGuard;
diff --git a/framework/source/uielement/resourcemenucontroller.cxx 
b/framework/source/uielement/resourcemenucontroller.cxx
index 887dbc5dec2b..c499cf928f8b 100644
--- a/framework/source/uielement/resourcemenucontroller.cxx
+++ b/framework/source/uielement/resourcemenucontroller.cxx
@@ -205,7 +205,7 @@ void ResourceMenuController::updatePopupMenu()
 
     // Now fill the menu with the configuration data.
     css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( 
m_xFrame, css::uno::UNO_QUERY );
-    framework::MenuBarManager::FillMenu( m_nNewMenuId, 
VCLXMenu::getImplementation( m_xPopupMenu )->GetMenu(), m_aModuleName, 
m_xMenuContainer, xDispatchProvider );
+    framework::MenuBarManager::FillMenu( m_nNewMenuId, 
comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu )->GetMenu(), 
m_aModuleName, m_xMenuContainer, xDispatchProvider );
 
     // For context menus, add object verbs.
     if ( m_bContextMenu )
@@ -238,7 +238,7 @@ void ResourceMenuController::addVerbs( const 
css::uno::Sequence< css::embed::Ver
         xStorable.set( xController->getModel(), css::uno::UNO_QUERY );
 
     bool bReadOnly = xStorable.is() && xStorable->isReadonly();
-    VCLXMenu* pAwtMenu = VCLXMenu::getImplementation( m_xPopupMenu );
+    VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( 
m_xPopupMenu );
     Menu* pVCLMenu = pAwtMenu->GetMenu();
 
     for ( const auto& rVerb : rVerbs )
@@ -258,7 +258,7 @@ void ResourceMenuController::itemActivated( const 
css::awt::MenuEvent& /*rEvent*
     // Must initialize MenuBarManager here, because we want to let the app do 
context menu interception before.
     if ( !m_xMenuBarManager.is() )
     {
-        VCLXMenu* pAwtMenu = VCLXMenu::getImplementation( m_xPopupMenu );
+        VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( 
m_xPopupMenu );
         css::uno::Reference< css::frame::XDispatchProvider > 
xDispatchProvider( m_xFrame, css::uno::UNO_QUERY );
         m_xMenuBarManager.set( new framework::MenuBarManager(
             m_xContext, m_xFrame, m_xURLTransformer, xDispatchProvider, 
m_aModuleName, pAwtMenu->GetMenu(), false, !m_bContextMenu && !m_bInToolbar ) );
@@ -360,7 +360,7 @@ SaveAsMenuController::SaveAsMenuController( const 
css::uno::Reference< css::uno:
 
 void SaveAsMenuController::impl_setPopupMenu()
 {
-    VCLXMenu* pPopupMenu    = VCLXMenu::getImplementation( m_xPopupMenu );
+    VCLXMenu* pPopupMenu    = 
comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu );
     Menu*     pVCLPopupMenu = nullptr;
 
     SolarMutexGuard aGuard;
diff --git a/framework/source/uielement/thesaurusmenucontroller.cxx 
b/framework/source/uielement/thesaurusmenucontroller.cxx
index 16478b50ddd4..da833b1cf1e9 100644
--- a/framework/source/uielement/thesaurusmenucontroller.cxx
+++ b/framework/source/uielement/thesaurusmenucontroller.cxx
@@ -77,7 +77,7 @@ void ThesaurusMenuController::fillPopupMenu()
     css::lang::Locale aLocale = LanguageTag::convertToLocale( aIsoLang );
     getMeanings( aSynonyms, aText, aLocale, 7 /*max number of synonyms to 
retrieve*/ );
 
-    VCLXMenu* pAwtMenu = VCLXMenu::getImplementation( m_xPopupMenu );
+    VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( 
m_xPopupMenu );
     Menu* pVCLMenu = pAwtMenu->GetMenu();
     pVCLMenu->SetMenuFlags( MenuFlags::NoAutoMnemonics );
     if ( !aSynonyms.empty() )
diff --git a/framework/source/uielement/toolbarmodemenucontroller.cxx 
b/framework/source/uielement/toolbarmodemenucontroller.cxx
index dca4cadd2e15..e94b89587077 100644
--- a/framework/source/uielement/toolbarmodemenucontroller.cxx
+++ b/framework/source/uielement/toolbarmodemenucontroller.cxx
@@ -177,7 +177,7 @@ void SAL_CALL ToolbarModeMenuController::statusChanged( 
const FeatureStateEvent&
     if ( xPopupMenu.is() )
     {
         SolarMutexGuard aGuard;
-        VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXMenu::getImplementation( xPopupMenu ));
+        VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( xPopupMenu ));
         PopupMenu*     pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu 
*>(pXPopupMenu->GetMenu()) : nullptr;
 
         SAL_WARN_IF(!pVCLPopupMenu, "fwk.uielement", "worrying lack of popup 
menu");
@@ -232,7 +232,7 @@ void SAL_CALL ToolbarModeMenuController::itemSelected( 
const css::awt::MenuEvent
 
     if ( xPopupMenu.is() )
     {
-        VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXPopupMenu::getImplementation( xPopupMenu ));
+        VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( xPopupMenu ));
         if ( pPopupMenu )
         {
             SolarMutexGuard aSolarMutexGuard;
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx 
b/framework/source/uielement/toolbarsmenucontroller.cxx
index 7a66796a9b84..13f9a4b803cf 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -170,7 +170,7 @@ void ToolbarsMenuController::addCommand(
     if ( rSettings.GetUseImagesInMenus() )
         aImage = vcl::CommandInfoProvider::GetImageForCommand(rCommandURL, 
m_xFrame);
 
-    VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXPopupMenu::getImplementation( rPopupMenu ));
+    VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( rPopupMenu ));
     if ( pPopupMenu )
     {
         PopupMenu* pVCLPopupMenu = static_cast<PopupMenu 
*>(pPopupMenu->GetMenu());
@@ -385,7 +385,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< 
css::awt::XPopupMenu > co
 
             {
                 SolarMutexGuard aGuard;
-                VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXMenu::getImplementation( m_xPopupMenu ));
+                VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu ));
                 PopupMenu* pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu 
*>(pXPopupMenu->GetMenu()) : nullptr;
                 assert(pVCLPopupMenu);
                 if (pVCLPopupMenu)
@@ -480,7 +480,7 @@ void SAL_CALL ToolbarsMenuController::statusChanged( const 
FeatureStateEvent& Ev
     if ( xPopupMenu.is() )
     {
         SolarMutexGuard aGuard;
-        VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXMenu::getImplementation( xPopupMenu ));
+        VCLXPopupMenu* pXPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( xPopupMenu ));
         PopupMenu*     pVCLPopupMenu = pXPopupMenu ? static_cast<PopupMenu 
*>(pXPopupMenu->GetMenu()) : nullptr;
 
         SAL_WARN_IF(!pVCLPopupMenu, "fwk.uielement", "worrying lack of popup 
menu");
@@ -539,7 +539,7 @@ void SAL_CALL ToolbarsMenuController::itemSelected( const 
css::awt::MenuEvent& r
 
     if ( xPopupMenu.is() )
     {
-        VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(VCLXPopupMenu::getImplementation( xPopupMenu ));
+        VCLXPopupMenu* pPopupMenu = static_cast<VCLXPopupMenu 
*>(comphelper::getUnoTunnelImplementation<VCLXMenu>( xPopupMenu ));
         if ( pPopupMenu )
         {
             SolarMutexGuard aSolarMutexGuard;
diff --git a/include/comphelper/servicehelper.hxx 
b/include/comphelper/servicehelper.hxx
index 466e1761f7d2..82c3585a9a7a 100644
--- a/include/comphelper/servicehelper.hxx
+++ b/include/comphelper/servicehelper.hxx
@@ -22,6 +22,7 @@
 
 #include <rtl/uuid.h>
 #include <rtl/instance.hxx>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <com/sun/star/uno/Sequence.hxx>
 
 class UnoTunnelIdInit
@@ -36,12 +37,26 @@ public:
     const css::uno::Sequence< sal_Int8 >& getSeq() const { return m_aSeq; }
 };
 
+namespace comphelper {
+
+    template<class T>
+    T* getUnoTunnelImplementation( const css::uno::Reference< 
css::uno::XInterface >& xIface )
+    {
+        css::uno::Reference< css::lang::XUnoTunnel > xUT( xIface, 
css::uno::UNO_QUERY );
+        if (!xUT.is())
+            return nullptr;
+
+        return 
reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething( 
T::getUnoTunnelId() )));
+    }
+
+}
+
 /** the UNO3_GETIMPLEMENTATION_* macros  implement a static helper function
     that gives access to your implementation for a given interface reference,
     if possible.
 
     Example:
-        MyClass* pClass = MyClass::getImplementation( xRef );
+        MyClass* pClass = comphelper::getUnoTunnelImplementation<MyClass>( 
xRef );
 
     Usage:
         Put a UNO3_GETIMPLEMENTATION_DECL( classname ) inside your class
@@ -52,7 +67,6 @@ public:
 */
 #define UNO3_GETIMPLEMENTATION_DECL( classname ) \
     static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); \
-    static classname* getImplementation( const css::uno::Reference< 
css::uno::XInterface >& xInt ); \
     virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
 
 #define UNO3_GETIMPLEMENTATION_BASE_IMPL( classname ) \
@@ -63,15 +77,6 @@ namespace \
 const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() throw() \
 { \
     return the##classname##UnoTunnelId::get().getSeq(); \
-} \
-\
-classname* classname::getImplementation( const css::uno::Reference< 
css::uno::XInterface >& xInt ) \
-{ \
-    css::uno::Reference< css::lang::XUnoTunnel > xUT( xInt, 
css::uno::UNO_QUERY ); \
-    if( xUT.is() ) \
-        return 
reinterpret_cast<classname*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(
 classname::getUnoTunnelId() ))); \
-    else \
-        return nullptr; \
 }
 
 #define UNO3_GETIMPLEMENTATION_IMPL( classname )\
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 164de7d8a140..99ba7b9f3568 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -558,7 +558,7 @@ static void lcl_createPresetShape(const 
uno::Reference<drawing::XShape>& xShape,
             if (pParagraph->getProperties().getParaAdjust())
                 eAdjust = pParagraph->getProperties().getParaAdjust().get();
             xSet->setPropertyValue( "ParaAdjust", uno::makeAny( eAdjust ) );
-            SvxShape* pShape = SvxShape::getImplementation( xShape );
+            SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
             assert(pShape);
             SdrTextHorzAdjust eHorzAdjust = lcl_convertAdjust( eAdjust );
             pShape->GetSdrObject()->SetMergedItem( SdrTextHorzAdjustItem( 
eHorzAdjust ) );
@@ -567,7 +567,7 @@ static void lcl_createPresetShape(const 
uno::Reference<drawing::XShape>& xShape,
 
     // Apply vertical adjustment for text on arc
     // ToDo: The property is currently not evaluated.
-    SvxShape* pShape = SvxShape::getImplementation(xShape);
+    SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>(xShape);
     assert(pShape);
     if (rClass == "fontwork-arch-up-curve")
         pShape->GetSdrObject()->SetMergedItem( SdrTextVertAdjustItem( 
SdrTextVertAdjust::SDRTEXTVERTADJUST_BOTTOM ) );
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index cf5b645bd937..ae16670ebe56 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3761,7 +3761,7 @@ OUString ChartExport::getNumberFormatCode(sal_Int32 nKey) 
const
 
     OUString aCode("General");  // init with fallback
     uno::Reference<util::XNumberFormatsSupplier> 
xNumberFormatsSupplier(mxChartModel, uno::UNO_QUERY_THROW);
-    SvNumberFormatsSupplierObj* pSupplierObj = 
SvNumberFormatsSupplierObj::getImplementation( xNumberFormatsSupplier);
+    SvNumberFormatsSupplierObj* pSupplierObj = 
comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( 
xNumberFormatsSupplier);
     if (!pSupplierObj)
         return aCode;
 
diff --git a/reportdesign/source/core/api/Shape.cxx 
b/reportdesign/source/core/api/Shape.cxx
index 5b59b8924b30..99f9d21ab1de 100644
--- a/reportdesign/source/core/api/Shape.cxx
+++ b/reportdesign/source/core/api/Shape.cxx
@@ -306,7 +306,7 @@ uno::Reference< util::XCloneable > SAL_CALL 
OShape::createClone(  )
     uno::Reference< report::XReportComponent> xSet;
     try
     {
-        SvxShape* pShape = SvxShape::getImplementation( xSource );
+        SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( 
xSource );
         if ( pShape )
         {
             SdrObject* pObject = pShape->GetSdrObject();
diff --git a/reportdesign/source/core/sdr/RptObject.cxx 
b/reportdesign/source/core/sdr/RptObject.cxx
index 0fe29d2d0252..bbfc0e47d41e 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -447,7 +447,7 @@ void OObjectBase::ensureSdrObjectOwnership( const 
uno::Reference< uno::XInterfac
     // which are removed from it, which is deadly for us. To prevent this,
     // we give the XShape implementation the ownership of the SdrObject, which
     // ensures the SvxDrawPage won't delete it.
-    SvxShape* pShape = SvxShape::getImplementation( _rxShape );
+    SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( 
_rxShape );
     OSL_ENSURE( pShape, "OObjectBase::ensureSdrObjectOwnership: can't access 
the SvxShape!" );
     if ( pShape )
     {
diff --git a/reportdesign/source/core/sdr/RptPage.cxx 
b/reportdesign/source/core/sdr/RptPage.cxx
index d344397bd6db..c20f11f363cd 100644
--- a/reportdesign/source/core/sdr/RptPage.cxx
+++ b/reportdesign/source/core/sdr/RptPage.cxx
@@ -114,7 +114,7 @@ void OReportPage::insertObject(const uno::Reference< 
report::XReportComponent >&
     if ( nPos < GetObjCount() )
         return; // Object already in list
 
-    SvxShape* pShape = SvxShape::getImplementation( _xObject );
+    SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( 
_xObject );
     OObjectBase* pObject = pShape ? dynamic_cast< OObjectBase* >( 
pShape->GetSdrObject() ) : nullptr;
     OSL_ENSURE( pObject, "OReportPage::insertObject: no implementation object 
found for the given shape/component!" );
     if ( pObject )
diff --git a/reportdesign/source/core/sdr/UndoActions.cxx 
b/reportdesign/source/core/sdr/UndoActions.cxx
index db4418c4b34c..2c6ea11629b3 100644
--- a/reportdesign/source/core/sdr/UndoActions.cxx
+++ b/reportdesign/source/core/sdr/UndoActions.cxx
@@ -129,7 +129,7 @@ OUndoContainerAction::~OUndoContainerAction()
             rEnv.RemoveElement( m_xOwnElement );
 
 #if OSL_DEBUG_LEVEL > 0
-            SvxShape* pShape = SvxShape::getImplementation( xChild );
+            SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>( xChild );
             SdrObject* pObject = pShape ? pShape->GetSdrObject() : nullptr;
             OSL_ENSURE( pObject == nullptr || (pShape->HasSdrObjectOwnership() 
&& !pObject->IsInserted()),
                 "OUndoContainerAction::~OUndoContainerAction: inconsistency in 
the shape/object ownership!" );
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx 
b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index 86b29c1f4e99..b2c4ace59a14 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -59,7 +59,7 @@ OUString lcl_createAttribute(const 
xmloff::token::XMLTokenEnum& _eNamespace,cons
 
 static void lcl_correctCellAddress(const OUString & _sName, const 
uno::Reference< xml::sax::XAttributeList > & xAttribs)
 {
-    SvXMLAttributeList* pList = 
SvXMLAttributeList::getImplementation(xAttribs);
+    SvXMLAttributeList* pList = 
comphelper::getUnoTunnelImplementation<SvXMLAttributeList>(xAttribs);
     OUString sCellAddress = pList->getValueByName(_sName);
     const sal_Int32 nPos = sCellAddress.lastIndexOf('$');
     if ( nPos != -1 )
@@ -206,7 +206,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const 
OUString & _sName, const
         bExport = false;
     else if ( _sName == "chart:plot-area" )
     {
-        SvXMLAttributeList* pList = 
SvXMLAttributeList::getImplementation(xAttribs);
+        SvXMLAttributeList* pList = 
comphelper::getUnoTunnelImplementation<SvXMLAttributeList>(xAttribs);
         pList->RemoveAttribute("table:cell-range-address");
     }
     else if ( _sName == "chart:categories" )
@@ -221,7 +221,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const 
OUString & _sName, const
     }
     else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName == 
"table:table-cell" )
     {
-        SvXMLAttributeList* pList = 
SvXMLAttributeList::getImplementation(xAttribs);
+        SvXMLAttributeList* pList = 
comphelper::getUnoTunnelImplementation<SvXMLAttributeList>(xAttribs);
         static OUString s_sValue(lcl_createAttribute(XML_NP_OFFICE,XML_VALUE));
         pList->RemoveAttribute(s_sValue);
     }
diff --git a/reportdesign/source/ui/misc/RptUndo.cxx 
b/reportdesign/source/ui/misc/RptUndo.cxx
index 3bfd9d22ca80..1f53e763207a 100644
--- a/reportdesign/source/ui/misc/RptUndo.cxx
+++ b/reportdesign/source/ui/misc/RptUndo.cxx
@@ -131,7 +131,7 @@ OSectionUndo::~OSectionUndo()
             rEnv.RemoveElement(xShape);
 
 #if OSL_DEBUG_LEVEL > 0
-            SvxShape* pShape = SvxShape::getImplementation( xShape );
+            SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
             SdrObject* pObject = pShape ? pShape->GetSdrObject() : nullptr;
             OSL_ENSURE( pShape && pShape->HasSdrObjectOwnership() && pObject 
&& !pObject->IsInserted(),
                 "OSectionUndo::~OSectionUndo: inconsistency in the 
shape/object ownership!" );
diff --git a/reportdesign/source/ui/report/ReportSection.cxx 
b/reportdesign/source/ui/report/ReportSection.cxx
index d064f485f328..20cb5428e5c4 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -257,7 +257,7 @@ void OReportSection::Paste(const uno::Sequence< 
beans::NamedValue >& _aAllreadyC
                     const uno::Reference<report::XReportComponent>* pCopiesEnd 
= pCopiesIter + aCopies.getLength();
                     for (;pCopiesIter != pCopiesEnd ; ++pCopiesIter)
                     {
-                        SvxShape* pShape = SvxShape::getImplementation( 
*pCopiesIter );
+                        SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>( *pCopiesIter );
                         SdrObject* pObject = pShape ? pShape->GetSdrObject() : 
nullptr;
                         if ( pObject )
                         {
@@ -507,7 +507,7 @@ void 
OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I
             uno::Reference< report::XReportComponent> 
xReportComponent(m_xSection->getByIndex(i),uno::UNO_QUERY_THROW);
             awt::Point aPos = xReportComponent->getPosition();
             awt::Size aSize = xReportComponent->getSize();
-            SvxShape* pShape = SvxShape::getImplementation( xReportComponent );
+            SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>( xReportComponent );
             SdrObject* pObject = pShape ? pShape->GetSdrObject() : nullptr;
             if ( pObject )
             {
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx 
b/reportdesign/source/ui/report/ViewsWindow.cxx
index 6204f2808d8e..0ce9ecf3b984 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -617,7 +617,7 @@ void OViewsWindow::setMarked(const uno::Sequence< 
uno::Reference< report::XRepor
             OSectionWindow* pSectionWindow = getSectionWindow(xSection);
             if ( pSectionWindow )
             {
-                SvxShape* pShape = SvxShape::getImplementation( *pIter );
+                SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>( *pIter );
                 SdrObject* pObject = pShape ? pShape->GetSdrObject() : nullptr;
                 OSL_ENSURE( pObject, "OViewsWindow::setMarked: no SdrObject 
for the shape!" );
                 if ( pObject )
diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx 
b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
index 2e651b5de4c9..3089291f0aa8 100644
--- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
@@ -140,7 +140,7 @@ void XMLTableShapeImportHelper::finishShape(
             }
             SetLayer(rShape, nLayerID, rShape->getShapeType());
 
-            if (SvxShape* pShapeImp = SvxShape::getImplementation(rShape))
+            if (SvxShape* pShapeImp = 
comphelper::getUnoTunnelImplementation<SvxShape>(rShape))
             {
                 if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
                 {
@@ -198,7 +198,7 @@ void XMLTableShapeImportHelper::finishShape(
             // the group
             Point aStartPoint( rShape->getPosition().X,rShape->getPosition().Y 
);
             uno::Reference< drawing::XShape > xChild( rShapes, uno::UNO_QUERY 
);
-            if (SvxShape* pGroupShapeImp = xChild.is() ? 
SvxShape::getImplementation(lcl_getTopLevelParent(xChild)) : nullptr)
+            if (SvxShape* pGroupShapeImp = xChild.is() ? 
comphelper::getUnoTunnelImplementation<SvxShape>(lcl_getTopLevelParent(xChild)) 
: nullptr)
             {
                 if (SdrObject *pSdrObj = pGroupShapeImp->GetSdrObject())
                 {
diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 06917c278589..db6554592668 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -527,7 +527,7 @@ void ScXMLExport::CollectSharedData(SCTAB& nTableCount, 
sal_Int32& nShapesCount)
 
             ++nShapesCount;
 
-            SvxShape* pShapeImp = SvxShape::getImplementation(xShape);
+            SvxShape* pShapeImp = 
comphelper::getUnoTunnelImplementation<SvxShape>(xShape);
             if (!pShapeImp)
                 continue;
 
@@ -2433,7 +2433,7 @@ void ScXMLExport::collectAutoStyles()
                         SdrCaptionObj* pDrawObj = pNote->GetOrCreateCaption( 
aPos );
                         uno::Reference<text::XSimpleText> 
xCellText(pDrawObj->getUnoShape(), uno::UNO_QUERY);
                         uno::Reference<beans::XPropertySet> 
xCursorProp(xCellText->createTextCursor(), uno::UNO_QUERY);
-                        ScDrawTextCursor* pCursor = 
ScDrawTextCursor::getImplementation( xCursorProp );
+                        ScDrawTextCursor* pCursor = 
comphelper::getUnoTunnelImplementation<ScDrawTextCursor>( xCursorProp );
                         if (pCursor)
                         {
                             pCursor->SetSelection( rNoteTextEntry.maSelection 
);
@@ -2474,7 +2474,7 @@ void ScXMLExport::collectAutoStyles()
                     uno::Reference<text::XSimpleText> 
xCellText(xCellRange->getCellByPosition(aPos.Col(), aPos.Row()), 
uno::UNO_QUERY);
                     xCursorProp.set(xCellText->createTextCursor(), 
uno::UNO_QUERY);
                 }
-                ScCellTextCursor* pCursor = 
ScCellTextCursor::getImplementation( xCursorProp );
+                ScCellTextCursor* pCursor = 
comphelper::getUnoTunnelImplementation<ScCellTextCursor>( xCursorProp );
                 if (!pCursor)
                     continue;
                 pCursor->SetSelection( rTextEntry.maSelection );
@@ -2681,7 +2681,7 @@ void ScXMLExport::ExportMasterStyles_()
 void ScXMLExport::CollectInternalShape( uno::Reference< drawing::XShape > 
const & xShape )
 {
     // detective objects and notes
-    if( SvxShape* pShapeImp = SvxShape::getImplementation( xShape ) )
+    if( SvxShape* pShapeImp = 
comphelper::getUnoTunnelImplementation<SvxShape>( xShape ) )
     {
         if( SdrObject* pObject = pShapeImp->GetSdrObject() )
         {
diff --git a/sc/source/filter/xml/xmlstyli.cxx 
b/sc/source/filter/xml/xmlstyli.cxx
index 71f3aca3fa25..72555fc3321c 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -1026,7 +1026,7 @@ void ScCellTextStyleContext::FillPropertySet( const 
uno::Reference<beans::XPrope
 
     ScXMLImport& rXMLImport = GetScImport();
 
-    ScCellTextCursor* pCellImp = ScCellTextCursor::getImplementation( xPropSet 
);
+    ScCellTextCursor* pCellImp = 
comphelper::getUnoTunnelImplementation<ScCellTextCursor>( xPropSet );
     if (pCellImp)
     {
         ScAddress aPos = pCellImp->GetCellObj().GetPosition();
@@ -1042,7 +1042,7 @@ void ScCellTextStyleContext::FillPropertySet( const 
uno::Reference<beans::XPrope
     }
     else if ( rXMLImport.GetTables().GetCurrentSheet() != nLastSheet )
     {
-        ScDrawTextCursor* pDrawImp = ScDrawTextCursor::getImplementation( 
xPropSet );
+        ScDrawTextCursor* pDrawImp = 
comphelper::getUnoTunnelImplementation<ScDrawTextCursor>( xPropSet );
         if (pDrawImp)
         {
             XMLTableShapeImportHelper* pTableShapeImport = 
static_cast<XMLTableShapeImportHelper*>(GetScImport().GetShapeImport().get());
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 0d5419c49e51..71ed6ac6345d 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -672,7 +672,7 @@ bool ScXMLImportWrapper::ExportToComponent(const 
uno::Reference<uno::XComponentC
 
     if ( xFilter.is() )
     {
-        ScXMLExport* pExport = 
static_cast<ScXMLExport*>(SvXMLExport::getImplementation(xFilter));
+        ScXMLExport* pExport = 
static_cast<ScXMLExport*>(comphelper::getUnoTunnelImplementation<SvXMLExport>(xFilter));
         pExport->SetSharedData(std::move(pSharedData));
 
         // if there are sheets to copy, get the source stream
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx 
b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 565de0e65fec..d6ccb9ea32cc 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1087,7 +1087,7 @@ boost::optional<ScAddress> 
ScChildrenShapes::GetAnchor(const uno::Reference<draw
 {
     if (mpViewShell)
     {
-        SvxShape* pShapeImp = SvxShape::getImplementation(xShape);
+        SvxShape* pShapeImp = 
comphelper::getUnoTunnelImplementation<SvxShape>(xShape);
         uno::Reference<beans::XPropertySet> xShapeProp(xShape, uno::UNO_QUERY);
         if (pShapeImp && xShapeProp.is())
         {
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 3a9faa1bcae3..c78e8ae9e859 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -620,7 +620,7 @@ ScDocument* ScTransferObj::GetSourceDocument()
 
 ScDocShell* ScTransferObj::GetSourceDocShell()
 {
-    ScCellRangesBase* pRangesObj = ScCellRangesBase::getImplementation( 
m_xDragSourceRanges );
+    ScCellRangesBase* pRangesObj = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( m_xDragSourceRanges );
     if (pRangesObj)
         return pRangesObj->GetDocShell();
 
@@ -630,7 +630,7 @@ ScDocShell* ScTransferObj::GetSourceDocShell()
 ScMarkData ScTransferObj::GetSourceMarkData()
 {
     ScMarkData aMarkData;
-    ScCellRangesBase* pRangesObj = ScCellRangesBase::getImplementation( 
m_xDragSourceRanges );
+    ScCellRangesBase* pRangesObj = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( m_xDragSourceRanges );
     if (pRangesObj)
     {
         const ScRangeList& rRanges = pRangesObj->GetRangeList();
diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx
index 2ca01d150496..bdfc277ab911 100644
--- a/sc/source/ui/unoobj/afmtuno.cxx
+++ b/sc/source/ui/unoobj/afmtuno.cxx
@@ -212,7 +212,7 @@ void SAL_CALL ScAutoFormatsObj::insertByName( const 
OUString& aName, const uno::
     uno::Reference< uno::XInterface > xInterface(aElement, uno::UNO_QUERY);
     if ( xInterface.is() )
     {
-        ScAutoFormatObj* pFormatObj = ScAutoFormatObj::getImplementation( 
xInterface );
+        ScAutoFormatObj* pFormatObj = 
comphelper::getUnoTunnelImplementation<ScAutoFormatObj>( xInterface );
         if ( pFormatObj && !pFormatObj->IsInserted() )
         {
             ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat();
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index fe61b8b6b5b6..46455f1793a1 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1568,7 +1568,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const 
SfxHint& rHint )
         {
             if (  rRef.GetMode() == URM_INSDEL
                && aRanges.size() == 1
-               && ScTableSheetObj::getImplementation(xThis)
+               && 
comphelper::getUnoTunnelImplementation<ScTableSheetObj>(xThis)
                )
             {
                 // #101755#; the range size of a sheet does not change
@@ -2363,7 +2363,7 @@ void ScCellRangesBase::SetOnePropertyValue( const 
SfxItemPropertySimpleEntry* pE
                         if ( !aRanges.empty() && xInterface.is() )  // empty = 
nothing to do
                         {
                             ScTableConditionalFormat* pFormat =
-                                    
ScTableConditionalFormat::getImplementation( xInterface );
+                                    
comphelper::getUnoTunnelImplementation<ScTableConditionalFormat>( xInterface );
                             if (pFormat)
                             {
                                 ScDocument& rDoc = pDocShell->GetDocument();
@@ -2410,7 +2410,7 @@ void ScCellRangesBase::SetOnePropertyValue( const 
SfxItemPropertySimpleEntry* pE
                         if ( !aRanges.empty() && xInterface.is() )  // empty = 
nothing to do
                         {
                             ScTableValidationObj* pValidObj =
-                                    ScTableValidationObj::getImplementation( 
xInterface );
+                                    
comphelper::getUnoTunnelImplementation<ScTableValidationObj>( xInterface );
                             if (pValidObj)
                             {
                                 ScDocument& rDoc = pDocShell->GetDocument();
@@ -3869,7 +3869,7 @@ uno::Reference<container::XIndexAccess> SAL_CALL 
ScCellRangesBase::findAll(
     uno::Reference<container::XIndexAccess> xRet;
     if ( pDocShell && xDesc.is() )
     {
-        ScCellSearchObj* pSearch = ScCellSearchObj::getImplementation( xDesc );
+        ScCellSearchObj* pSearch = 
comphelper::getUnoTunnelImplementation<ScCellSearchObj>( xDesc );
         if (pSearch)
         {
             SvxSearchItem* pSearchItem = pSearch->GetSearchItem();
@@ -3907,7 +3907,7 @@ uno::Reference<uno::XInterface> 
ScCellRangesBase::Find_Impl(
     uno::Reference<uno::XInterface> xRet;
     if ( pDocShell && xDesc.is() )
     {
-        ScCellSearchObj* pSearch = ScCellSearchObj::getImplementation( xDesc );
+        ScCellSearchObj* pSearch = 
comphelper::getUnoTunnelImplementation<ScCellSearchObj>( xDesc );
         if (pSearch)
         {
             SvxSearchItem* pSearchItem = pSearch->GetSearchItem();
@@ -3960,7 +3960,7 @@ uno::Reference<uno::XInterface> SAL_CALL 
ScCellRangesBase::findNext(
     SolarMutexGuard aGuard;
     if ( xStartAt.is() )
     {
-        ScCellRangesBase* pRangesImp = ScCellRangesBase::getImplementation( 
xStartAt );
+        ScCellRangesBase* pRangesImp = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xStartAt );
         if ( pRangesImp && pRangesImp->GetDocShell() == pDocShell )
         {
             const ScRangeList& rStartRanges = pRangesImp->GetRangeList();
@@ -3988,7 +3988,7 @@ sal_Int32 SAL_CALL ScCellRangesBase::replaceAll( const 
uno::Reference<util::XSea
     sal_Int32 nReplaced = 0;
     if ( pDocShell && xDesc.is() )
     {
-        ScCellSearchObj* pSearch = ScCellSearchObj::getImplementation( xDesc );
+        ScCellSearchObj* pSearch = 
comphelper::getUnoTunnelImplementation<ScCellSearchObj>( xDesc );
         if (pSearch)
         {
             SvxSearchItem* pSearchItem = pSearch->GetSearchItem();
@@ -4323,7 +4323,7 @@ void SAL_CALL ScCellRangesObj::insertByName( const 
OUString& aName, const uno::A
     uno::Reference<uno::XInterface> xInterface(aElement, uno::UNO_QUERY);
     if ( pDocSh && xInterface.is() )
     {
-        ScCellRangesBase* pRangesImp = ScCellRangesBase::getImplementation( 
xInterface );
+        ScCellRangesBase* pRangesImp = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xInterface );
         if ( pRangesImp && pRangesImp->GetDocShell() == pDocSh )
         {
             //  if explicit name is given and already existing, throw exception
@@ -4953,7 +4953,7 @@ void ScCellRangeObj::SetArrayFormula_Impl(const OUString& 
rFormula,
     {
         if ( !rFormula.isEmpty() )
         {
-            if ( ScTableSheetObj::getImplementation( 
static_cast<cppu::OWeakObject*>(this) ) )
+            if ( comphelper::getUnoTunnelImplementation<ScTableSheetObj>( 
static_cast<cppu::OWeakObject*>(this) ) )
             {
                 //  don't set array formula for sheet object
                 throw uno::RuntimeException();
@@ -5022,7 +5022,7 @@ void SAL_CALL ScCellRangeObj::setArrayTokens( const 
uno::Sequence<sheet::Formula
     {
         if ( rTokens.hasElements() )
         {
-            if ( ScTableSheetObj::getImplementation( 
static_cast<cppu::OWeakObject*>(this) ) )
+            if ( comphelper::getUnoTunnelImplementation<ScTableSheetObj>( 
static_cast<cppu::OWeakObject*>(this) ) )
             {
                 throw uno::RuntimeException();
             }
@@ -5053,7 +5053,7 @@ uno::Sequence< uno::Sequence<uno::Any> > SAL_CALL 
ScCellRangeObj::getDataArray()
 {
     SolarMutexGuard aGuard;
 
-    if ( ScTableSheetObj::getImplementation( 
static_cast<cppu::OWeakObject*>(this) ) )
+    if ( comphelper::getUnoTunnelImplementation<ScTableSheetObj>( 
static_cast<cppu::OWeakObject*>(this) ) )
     {
         //  don't create a data array for the sheet
         throw uno::RuntimeException();
@@ -5098,7 +5098,7 @@ uno::Sequence< uno::Sequence<OUString> > SAL_CALL 
ScCellRangeObj::getFormulaArra
 {
     SolarMutexGuard aGuard;
 
-    if ( ScTableSheetObj::getImplementation( 
static_cast<cppu::OWeakObject*>(this) ) )
+    if ( comphelper::getUnoTunnelImplementation<ScTableSheetObj>( 
static_cast<cppu::OWeakObject*>(this) ) )
     {
         //  don't create a data array for the sheet
         throw uno::RuntimeException();
@@ -5656,7 +5656,7 @@ void SAL_CALL ScCellRangeObj::applySubTotals(
 
     ScDocShell* pDocSh = GetDocShell();
     ScSubTotalDescriptorBase* pImp =
-        ScSubTotalDescriptorBase::getImplementation( xDescriptor );
+        comphelper::getUnoTunnelImplementation<ScSubTotalDescriptorBase>( 
xDescriptor );
 
     if (pDocSh && pImp)
     {
@@ -6090,12 +6090,12 @@ uno::Reference<text::XTextCursor> SAL_CALL 
ScCellObj::createTextCursorByRange(
     SvxUnoTextCursor* pCursor = new ScCellTextCursor( *this );
     uno::Reference<text::XTextCursor> xCursor(pCursor);
 
-    SvxUnoTextRangeBase* pRange = SvxUnoTextRangeBase::getImplementation( 
aTextPosition );
+    SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRangeBase>( aTextPosition );
     if(pRange)
         pCursor->SetSelection( pRange->GetSelection() );
     else
     {
-        ScCellTextCursor* pOther = ScCellTextCursor::getImplementation( 
aTextPosition );
+        ScCellTextCursor* pOther = 
comphelper::getUnoTunnelImplementation<ScCellTextCursor>( aTextPosition );
         if(!pOther)
             throw uno::RuntimeException();
 
@@ -6147,8 +6147,8 @@ void SAL_CALL ScCellObj::insertTextContent( const 
uno::Reference<text::XTextRang
     ScDocShell* pDocSh = GetDocShell();
     if ( pDocSh && xContent.is() )
     {
-        ScEditFieldObj* pCellField = 
ScEditFieldObj::getImplementation(xContent);
-        SvxUnoTextRangeBase* pTextRange = ScCellTextCursor::getImplementation( 
xRange );
+        ScEditFieldObj* pCellField = 
comphelper::getUnoTunnelImplementation<ScEditFieldObj>(xContent);
+        SvxUnoTextRangeBase* pTextRange = 
comphelper::getUnoTunnelImplementation<ScCellTextCursor>( xRange );
 
         if ( pCellField && !pCellField->IsInserted() && pTextRange )
         {
@@ -6197,7 +6197,7 @@ void SAL_CALL ScCellObj::removeTextContent( const 
uno::Reference<text::XTextCont
     SolarMutexGuard aGuard;
     if ( xContent.is() )
     {
-        ScEditFieldObj* pCellField = 
ScEditFieldObj::getImplementation(xContent);
+        ScEditFieldObj* pCellField = 
comphelper::getUnoTunnelImplementation<ScEditFieldObj>(xContent);
         if ( pCellField && pCellField->IsInserted() )
         {
             //! Check if field is in this cell
@@ -6829,7 +6829,7 @@ uno::Reference<sheet::XSheetCellCursor> SAL_CALL 
ScTableSheetObj::createCursorBy
     ScDocShell* pDocSh = GetDocShell();
     if ( pDocSh && xCellRange.is() )
     {
-        ScCellRangesBase* pRangesImp = ScCellRangesBase::getImplementation( 
xCellRange );
+        ScCellRangesBase* pRangesImp = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xCellRange );
         if (pRangesImp)
         {
             const ScRangeList& rRanges = pRangesImp->GetRangeList();
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 119683f8a9a2..4ceb2c03f711 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1228,7 +1228,7 @@ void ScModelObj::Notify( SfxBroadcaster& rBC, const 
SfxHint& rHint )
         if (xNumberAgg.is())
         {
             SvNumberFormatsSupplierObj* pNumFmt =
-                SvNumberFormatsSupplierObj::getImplementation(
+                
comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>(
                         
uno::Reference<util::XNumberFormatsSupplier>(xNumberAgg, uno::UNO_QUERY) );
             if ( pNumFmt )
                 pNumFmt->SetNumberFormatter( nullptr );
@@ -1314,7 +1314,7 @@ static OutputDevice* lcl_GetRenderDevice( const 
uno::Sequence<beans::PropertyVal
             uno::Reference<awt::XDevice> xRenderDevice(rProp.Value, 
uno::UNO_QUERY);
             if ( xRenderDevice.is() )
             {
-                VCLXDevice* pDevice = VCLXDevice::getImplementation( 
xRenderDevice );
+                VCLXDevice* pDevice = 
comphelper::getUnoTunnelImplementation<VCLXDevice>( xRenderDevice );
                 if ( pDevice )
                 {
                     pRet = pDevice->GetOutputDevice().get();
@@ -1469,11 +1469,11 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& 
aSelection,
     uno::Reference<uno::XInterface> xInterface(aSelection, uno::UNO_QUERY);
     if ( xInterface.is() )
     {
-        ScCellRangesBase* pSelObj = ScCellRangesBase::getImplementation( 
xInterface );
+        ScCellRangesBase* pSelObj = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xInterface );
         uno::Reference< drawing::XShapes > xShapes( xInterface, uno::UNO_QUERY 
);
         if ( pSelObj && pSelObj->GetDocShell() == pDocShell )
         {
-            bool bSheet = ( ScTableSheetObj::getImplementation( xInterface ) 
!= nullptr );
+            bool bSheet = ( 
comphelper::getUnoTunnelImplementation<ScTableSheetObj>( xInterface ) != 
nullptr );
             bool bCursor = pSelObj->IsCursorOnly();
             const ScRangeList& rRanges = pSelObj->GetRangeList();
 
@@ -1515,7 +1515,7 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& 
aSelection,
             {
                 // multi selection isn't supported yet
                 uno::Reference< drawing::XShape > xShape( 
xIndexAccess->getByIndex(0), uno::UNO_QUERY );
-                SvxShape* pShape = SvxShape::getImplementation( xShape );
+                SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
                 if( pShape )
                 {
                     SdrObject *pSdrObj = pShape->GetSdrObject();
@@ -3332,7 +3332,7 @@ uno::Reference<drawing::XDrawPage> SAL_CALL 
ScDrawPagesObj::insertNewByIndex( sa
 void SAL_CALL ScDrawPagesObj::remove( const 
uno::Reference<drawing::XDrawPage>& xPage )
 {
     SolarMutexGuard aGuard;
-    SvxDrawPage* pImp = SvxDrawPage::getImplementation( xPage );
+    SvxDrawPage* pImp = comphelper::getUnoTunnelImplementation<SvxDrawPage>( 
xPage );
     if ( pDocShell && pImp )
     {
         SdrPage* pPage = pImp->GetSdrPage();
@@ -3488,7 +3488,7 @@ void SAL_CALL ScTableSheetsObj::insertByName( const 
OUString& aName, const uno::
         uno::Reference<uno::XInterface> xInterface(aElement, uno::UNO_QUERY);
         if ( xInterface.is() )
         {
-            ScTableSheetObj* pSheetObj = ScTableSheetObj::getImplementation( 
xInterface );
+            ScTableSheetObj* pSheetObj = 
comphelper::getUnoTunnelImplementation<ScTableSheetObj>( xInterface );
             if ( pSheetObj && !pSheetObj->GetDocShell() )   // not inserted 
yet?
             {
                 ScDocument& rDoc = pDocShell->GetDocument();
@@ -3534,7 +3534,7 @@ void SAL_CALL ScTableSheetsObj::replaceByName( const 
OUString& aName, const uno:
         uno::Reference<uno::XInterface> xInterface(aElement, uno::UNO_QUERY);
         if ( xInterface.is() )
         {
-            ScTableSheetObj* pSheetObj = ScTableSheetObj::getImplementation( 
xInterface );
+            ScTableSheetObj* pSheetObj = 
comphelper::getUnoTunnelImplementation<ScTableSheetObj>( xInterface );
             if ( pSheetObj && !pSheetObj->GetDocShell() )   // not inserted 
yet?
             {
                 SCTAB nPosition;
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 5d9495b3199e..6fe460bf478e 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -544,7 +544,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const 
OUString& aName,
             // currently, only our own cell ranges are supported
 
             uno::Reference<table::XCellRange> xRange(rArg, uno::UNO_QUERY);
-            ScCellRangesBase* pImpl = ScCellRangesBase::getImplementation( 
xRange );
+            ScCellRangesBase* pImpl = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xRange );
             if ( pImpl )
             {
                 ScDocument* pSrcDoc = pImpl->GetDocument();
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 592f612608fa..fbb8a173aa96 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -102,7 +102,7 @@ ScShapeObj::ScShapeObj( uno::Reference<drawing::XShape>& 
xShape ) :
 
         xShape.set(uno::Reference<drawing::XShape>( mxShapeAgg, uno::UNO_QUERY 
));
 
-        bIsTextShape = ( SvxUnoTextBase::getImplementation( mxShapeAgg ) != 
nullptr );
+        bIsTextShape = ( 
comphelper::getUnoTunnelImplementation<SvxUnoTextBase>( mxShapeAgg ) != nullptr 
);
     }
 
     {
@@ -1093,7 +1093,7 @@ void SAL_CALL ScShapeObj::insertTextContent( const 
uno::Reference<text::XTextRan
 
     uno::Reference<text::XTextContent> xEffContent;
 
-    ScEditFieldObj* pCellField = ScEditFieldObj::getImplementation( xContent );
+    ScEditFieldObj* pCellField = 
comphelper::getUnoTunnelImplementation<ScEditFieldObj>( xContent );
     if ( pCellField )
     {
         //  createInstance("TextField.URL") from the document creates a 
ScCellFieldObj.
@@ -1136,7 +1136,7 @@ uno::Reference<text::XTextCursor> SAL_CALL 
ScShapeObj::createTextCursor()
     {
         //  ScDrawTextCursor must be used to ensure the ScShapeObj is returned 
by getText
 
-        SvxUnoTextBase* pText = SvxUnoTextBase::getImplementation( mxShapeAgg 
);
+        SvxUnoTextBase* pText = 
comphelper::getUnoTunnelImplementation<SvxUnoTextBase>( mxShapeAgg );
         if (pText)
             return new ScDrawTextCursor( this, *pText );
     }
@@ -1153,8 +1153,8 @@ uno::Reference<text::XTextCursor> SAL_CALL 
ScShapeObj::createTextCursorByRange(
     {
         //  ScDrawTextCursor must be used to ensure the ScShapeObj is returned 
by getText
 
-        SvxUnoTextBase* pText = SvxUnoTextBase::getImplementation( mxShapeAgg 
);
-        SvxUnoTextRangeBase* pRange = SvxUnoTextRangeBase::getImplementation( 
aTextPosition );
+        SvxUnoTextBase* pText = 
comphelper::getUnoTunnelImplementation<SvxUnoTextBase>( mxShapeAgg );
+        SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation<SvxUnoTextRangeBase>( aTextPosition );
         if ( pText && pRange )
         {
             SvxUnoTextCursor* pCursor = new ScDrawTextCursor( this, *pText );
@@ -1312,7 +1312,7 @@ SdrObject* ScShapeObj::GetSdrObject() const throw()
 {
     if(mxShapeAgg.is())
     {
-        SvxShape* pShape = SvxShape::getImplementation( mxShapeAgg );
+        SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( 
mxShapeAgg );
         if(pShape)
             return pShape->GetSdrObject();
     }
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 6ef7d575aeb2..1e6f5abbe675 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -668,7 +668,7 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const 
OUString& aName, const uno::
     uno::Reference< uno::XInterface > xInterface(aElement, uno::UNO_QUERY);
     if ( xInterface.is() )
     {
-        ScStyleObj* pStyleObj = ScStyleObj::getImplementation( xInterface );
+        ScStyleObj* pStyleObj = 
comphelper::getUnoTunnelImplementation<ScStyleObj>( xInterface );
         if ( pStyleObj && pStyleObj->GetFamily() == eFamily &&
                 !pStyleObj->IsInserted() )  // not yet inserted?
         {
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index fd35986dcda8..252a0bfee513 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -398,10 +398,10 @@ void SAL_CALL ScHeaderFooterTextObj::insertTextContent(
     SolarMutexGuard aGuard;
     if ( xContent.is() && xRange.is() )
     {
-        ScEditFieldObj* pHeaderField = ScEditFieldObj::getImplementation( 
xContent );
+        ScEditFieldObj* pHeaderField = 
comphelper::getUnoTunnelImplementation<ScEditFieldObj>( xContent );
 
         SvxUnoTextRangeBase* pTextRange =
-            ScHeaderFooterTextCursor::getImplementation( xRange );
+            comphelper::getUnoTunnelImplementation<ScHeaderFooterTextCursor>( 
xRange );
 
         if ( pHeaderField && !pHeaderField->IsInserted() && pTextRange )
         {
@@ -468,7 +468,7 @@ void SAL_CALL ScHeaderFooterTextObj::removeTextContent(
     SolarMutexGuard aGuard;
     if ( xContent.is() )
     {
-        ScEditFieldObj* pHeaderField = 
ScEditFieldObj::getImplementation(xContent);
+        ScEditFieldObj* pHeaderField = 
comphelper::getUnoTunnelImplementation<ScEditFieldObj>(xContent);
         if ( pHeaderField && pHeaderField->IsInserted() )
         {
             //! check if the field is in this cell
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 080d70d4f75b..e9654f90e147 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -681,10 +681,10 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& 
aSelection )
     if (bRet)
         return bRet;
 
-    ScCellRangesBase* pRangesImp = ScCellRangesBase::getImplementation( 
xInterface );
+    ScCellRangesBase* pRangesImp = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xInterface );
     uno::Reference<drawing::XShapes> xShapeColl( xInterface, uno::UNO_QUERY );
     uno::Reference<drawing::XShape> xShapeSel( xInterface, uno::UNO_QUERY );
-    SvxShape* pShapeImp = SvxShape::getImplementation( xShapeSel );
+    SvxShape* pShapeImp = comphelper::getUnoTunnelImplementation<SvxShape>( 
xShapeSel );
 
     if (pRangesImp)                                     // Cell ranges
     {
@@ -779,7 +779,7 @@ sal_Bool SAL_CALL ScTabViewObj::select( const uno::Any& 
aSelection )
                         uno::Reference<drawing::XShape> 
xShapeInt(xShapeColl->getByIndex(i), uno::UNO_QUERY);
                         if (xShapeInt.is())
                         {
-                            SvxShape* pShape = SvxShape::getImplementation( 
xShapeInt );
+                            SvxShape* pShape = 
comphelper::getUnoTunnelImplementation<SvxShape>( xShapeInt );
                             if (pShape)
                             {
                                 SdrObject *pObj = pShape->GetSdrObject();
@@ -1057,7 +1057,7 @@ void SAL_CALL ScTabViewObj::setActiveSheet( const 
uno::Reference<sheet::XSpreads
     {
         //  XSpreadsheet and ScCellRangesBase -> has to be the same sheet
 
-        ScCellRangesBase* pRangesImp = ScCellRangesBase::getImplementation( 
xActiveSheet );
+        ScCellRangesBase* pRangesImp = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xActiveSheet );
         if ( pRangesImp && pViewSh->GetViewData().GetDocShell() == 
pRangesImp->GetDocShell() )
         {
             const ScRangeList& rRanges = pRangesImp->GetRangeList();
diff --git a/sc/source/ui/vba/excelvbahelper.cxx 
b/sc/source/ui/vba/excelvbahelper.cxx
index ebfda3fc7942..4528c7fa8013 100644
--- a/sc/source/ui/vba/excelvbahelper.cxx
+++ b/sc/source/ui/vba/excelvbahelper.cxx
@@ -85,7 +85,7 @@ GetAutoFiltRange( const ScDocShell* pShell, sal_Int16 nSheet )
 
 ScDocShell* GetDocShellFromRange( const uno::Reference< uno::XInterface >& 
xRange )
 {
-    ScCellRangesBase* pScCellRangesBase = ScCellRangesBase::getImplementation( 
xRange );
+    ScCellRangesBase* pScCellRangesBase = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xRange );
     if ( !pScCellRangesBase )
     {
         throw uno::RuntimeException("Failed to access underlying doc shell uno 
range object" );
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx 
b/sc/source/ui/vba/vbaeventshelper.cxx
index 2b48c47b3c10..a8a0ea59865e 100644
--- a/sc/source/ui/vba/vbaeventshelper.cxx
+++ b/sc/source/ui/vba/vbaeventshelper.cxx
@@ -846,8 +846,8 @@ bool ScVbaEventsHelper::isSelectionChanged( const 
uno::Sequence< uno::Any >& rAr
 {
     uno::Reference< uno::XInterface > xOldSelection( maOldSelection, 
uno::UNO_QUERY );
     uno::Reference< uno::XInterface > xNewSelection = getXSomethingFromArgs< 
uno::XInterface >( rArgs, nIndex, false );
-    ScCellRangesBase* pOldCellRanges = ScCellRangesBase::getImplementation( 
xOldSelection );
-    ScCellRangesBase* pNewCellRanges = ScCellRangesBase::getImplementation( 
xNewSelection );
+    ScCellRangesBase* pOldCellRanges = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xOldSelection );
+    ScCellRangesBase* pNewCellRanges = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xNewSelection );
     bool bChanged = !pOldCellRanges || !pNewCellRanges || lclSelectionChanged( 
pOldCellRanges->GetRangeList(), pNewCellRanges->GetRangeList() );
     maOldSelection <<= xNewSelection;
     return bChanged;
diff --git a/sc/source/ui/vba/vbaformat.cxx b/sc/source/ui/vba/vbaformat.cxx
index 206163306f45..47ddfcaaefad 100644
--- a/sc/source/ui/vba/vbaformat.cxx
+++ b/sc/source/ui/vba/vbaformat.cxx
@@ -795,7 +795,7 @@ template< typename... Ifc >
 ScCellRangesBase*
 ScVbaFormat< Ifc... >::getCellRangesBase()
 {
-    return ScCellRangesBase::getImplementation( mxPropertySet );
+    return comphelper::getUnoTunnelImplementation<ScCellRangesBase>( 
mxPropertySet );
 }
 
 template< typename... Ifc >
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index dfe74c5f694e..1836cbdd5088 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -258,9 +258,9 @@ static uno::Reference< excel::XRange > 
lcl_makeXRangeFromSheetCellRanges( const
 ScCellRangesBase* ScVbaRange::getCellRangesBase()
 {
     if( mxRanges.is() )
-        return ScCellRangesBase::getImplementation( mxRanges );
+        return comphelper::getUnoTunnelImplementation<ScCellRangesBase>( 
mxRanges );
     if( mxRange.is() )
-        return ScCellRangesBase::getImplementation( mxRange );
+        return comphelper::getUnoTunnelImplementation<ScCellRangesBase>( 
mxRange );
     throw uno::RuntimeException("General Error creating range - Unknown" );
 }
 
@@ -391,7 +391,7 @@ ScVbaRangeAreas::createCollectionObject( const uno::Any& 
aSource )
 static ScDocShell*
 getDocShellFromIf( const uno::Reference< uno::XInterface >& xIf )
 {
-    ScCellRangesBase* pUno = ScCellRangesBase::getImplementation( xIf );
+    ScCellRangesBase* pUno = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xIf );
     if ( !pUno )
             throw uno::RuntimeException("Failed to access underlying uno range 
object"  );
     return pUno->GetDocShell();
@@ -536,7 +536,7 @@ public:
     OUString getNumberFormatString()
     {
         uno::Reference< uno::XInterface > xIf( mxRangeProps, 
uno::UNO_QUERY_THROW );
-        ScCellRangesBase* pUnoCellRange = ScCellRangesBase::getImplementation( 
xIf );
+        ScCellRangesBase* pUnoCellRange = 
comphelper::getUnoTunnelImplementation<ScCellRangesBase>( xIf );
         if ( pUnoCellRange )
         {
 
diff --git a/sc/source/ui/vba/vbasheetobject.cxx 
b/sc/source/ui/vba/vbasheetobject.cxx
index 28d55a14c4e5..d371bf2ed35b 100644
--- a/sc/source/ui/vba/vbasheetobject.cxx
+++ b/sc/source/ui/vba/vbasheetobject.cxx
@@ -232,7 +232,7 @@ sal_Int32 SAL_CALL ScVbaSheetObjectBase::getPlacement()
 {
     sal_Int32 const nRet = excel::XlPlacement::xlMoveAndSize;
 #if 0 // TODO: not working at the moment.
-    SvxShape* pShape = SvxShape::getImplementation( mxShape );
+    SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( 
mxShape );
     if(pShape)
     {
         SdrObject* pObj = pShape->GetSdrObject();
@@ -250,7 +250,7 @@ sal_Int32 SAL_CALL ScVbaSheetObjectBase::getPlacement()
 void SAL_CALL ScVbaSheetObjectBase::setPlacement( sal_Int32 /*nPlacement*/ )
 {
 #if 0 // TODO: not working at the moment.
-    SvxShape* pShape = SvxShape::getImplementation( mxShape );
+    SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( 
mxShape );
     if(pShape)
     {
         SdrObject* pObj = pShape->GetSdrObject();
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 544644341a6b..b16ba1b75f5b 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -531,7 +531,7 @@ void ScDrawView::MarkListHasChanged()
         uno::Reference<frame::XController> xController = 
rFrame.GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = ScTabViewObj::getImplementation( xController 
);
+            ScTabViewObj* pImp = 
comphelper::getUnoTunnelImplementation<ScTabViewObj>( xController );
             if (pImp)
                 pImp->SelectionChanged();
         }
@@ -579,7 +579,7 @@ bool ScDrawView::SdrBeginTextEdit(
         uno::Reference< frame::XController > xController = 
rFrame.GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = ScTabViewObj::getImplementation( xController 
);
+            ScTabViewObj* pImp = 
comphelper::getUnoTunnelImplementation<ScTabViewObj>( xController );
             if (pImp)
                 pImp->SelectionChanged();
         }
@@ -603,7 +603,7 @@ SdrEndTextEditKind ScDrawView::SdrEndTextEdit( bool 
bDontDeleteReally )
         uno::Reference< frame::XController > xController = 
rFrame.GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = ScTabViewObj::getImplementation( xController 
);
+            ScTabViewObj* pImp = 
comphelper::getUnoTunnelImplementation<ScTabViewObj>( xController );
             if (pImp)
                 pImp->SelectionChanged();
         }
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index e043cfc4d857..85b2caa970b3 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2584,7 +2584,7 @@ bool ScGridWindow::PreNotify( NotifyEvent& rNEvt )
                 css::uno::Reference<css::frame::XController> xController = 
pViewFrame->GetFrame().GetController();
                 if (xController.is())
                 {
-                    ScTabViewObj* pImp = ScTabViewObj::getImplementation( 
xController );
+                    ScTabViewObj* pImp = 
comphelper::getUnoTunnelImplementation<ScTabViewObj>( xController );
                     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 95d0b9a4e876..b13234bd2adb 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2178,7 +2178,7 @@ void ScTabView::SetNewVisArea()
         css::uno::Reference<css::frame::XController> xController = 
rFrame.GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = ScTabViewObj::getImplementation( xController 
);
+            ScTabViewObj* pImp = 
comphelper::getUnoTunnelImplementation<ScTabViewObj>( xController );
             if (pImp)
                 pImp->VisAreaChanged();
         }
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index bfdc208bf128..03f1067638a2 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -529,7 +529,7 @@ void ScTabView::SelectionChanged()
         uno::Reference<frame::XController> xController = 
pViewFrame->GetFrame().GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = ScTabViewObj::getImplementation( xController 
);
+            ScTabViewObj* pImp = 
comphelper::getUnoTunnelImplementation<ScTabViewObj>( xController );
             if (pImp)
                 pImp->SelectionChanged();
         }
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 560c4b584e5e..fcf4e9b91f43 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -314,7 +314,7 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
         uno::Reference<frame::XController> xController = 
pViewFrame->GetFrame().GetController();
         if (xController.is())
         {
-            ScTabViewObj* pImp = ScTabViewObj::getImplementation( xController 
);
+            ScTabViewObj* pImp = 
comphelper::getUnoTunnelImplementation<ScTabViewObj>( xController );
             if (pImp)
                 pImp->SheetChanged( bSameTabButMoved );
         }
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index b1a24d27df93..fce0a758df33 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1099,7 +1099,7 @@ static ScTabViewObj* lcl_GetViewObj( const 
ScTabViewShell& rShell )
         SfxFrame& rFrame = pViewFrame->GetFrame();
         uno::Reference<frame::XController> xController = 
rFrame.GetController();
         if (xController.is())
-            pRet = ScTabViewObj::getImplementation( xController );
+            pRet = comphelper::getUnoTunnelImplementation<ScTabViewObj>( 
xController );
     }
     return pRet;
 }
diff --git a/sd/source/core/text/textapi.cxx b/sd/source/core/text/textapi.cxx
index 2bf1177f0abd..9ee84929196f 100644
--- a/sd/source/core/text/textapi.cxx
+++ b/sd/source/core/text/textapi.cxx
@@ -177,7 +177,7 @@ TextApiObject* TextApiObject::getImplementation( const 
css::uno::Reference< css:
     TextApiObject* pImpl = dynamic_cast< TextApiObject* >( xText.get() );
 
     if( !pImpl )
-        pImpl = dynamic_cast< TextApiObject* >(  
SvxUnoTextBase::getImplementation( xText ) );
+        pImpl = dynamic_cast< TextApiObject* >(  
comphelper::getUnoTunnelImplementation<SvxUnoTextBase>( xText ) );
 
     return pImpl;
 }
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx 
b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index a9d7ca12e4fd..4a03e06b83b9 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -433,7 +433,7 @@ uno::Sequence< sal_Int32 > SAL_CALL
     {
         return aRet;
     }
-    AccessibleShape* pAcc = AccessibleShape::getImplementation( xAccContent );

... etc. - the rest is truncated
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to