summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-06-15 21:46:13 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-06-17 08:56:36 +0200
commitadc295a1b2e1f2ed43e7eb587fc89d7229e0f122 (patch)
treed045a927d1f88d2574bdef441bc1cbc0b81fd16b
parentd39846bfd16ad9873795149c370a95f42363bfd9 (diff)
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 <sbergman@redhat.com>
-rw-r--r--basctl/source/basicide/basicrenderable.cxx2
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx2
-rw-r--r--chart2/source/controller/main/ChartController.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx2
-rw-r--r--chart2/source/tools/NumberFormatterWrapper.cxx2
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx2
-rw-r--r--chart2/source/view/charttypes/BarChart.cxx2
-rw-r--r--chart2/source/view/main/ChartView.cxx4
-rw-r--r--dbaccess/source/ui/browser/brwview.cxx2
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx2
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx2
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx2
-rw-r--r--dbaccess/source/ui/misc/TokenWriter.cxx2
-rw-r--r--dbaccess/source/ui/uno/ColumnControl.cxx2
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx2
-rw-r--r--editeng/source/uno/unofield.cxx2
-rw-r--r--editeng/source/uno/unonrule.cxx6
-rw-r--r--editeng/source/uno/unotext.cxx29
-rw-r--r--editeng/source/uno/unotext2.cxx2
-rw-r--r--extensions/source/bibliography/bibload.cxx2
-rw-r--r--extensions/source/propctrlr/propcontroller.cxx2
-rw-r--r--filter/source/msfilter/eschesdo.cxx4
-rw-r--r--filter/source/svg/svgexport.cxx8
-rw-r--r--filter/source/svg/svgfilter.cxx2
-rw-r--r--forms/source/richtext/richtextcontrol.cxx2
-rw-r--r--forms/source/solar/component/navbarcontrol.cxx2
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx4
-rw-r--r--framework/source/uielement/controlmenucontroller.cxx8
-rw-r--r--framework/source/uielement/fontmenucontroller.cxx2
-rw-r--r--framework/source/uielement/fontsizemenucontroller.cxx4
-rw-r--r--framework/source/uielement/headermenucontroller.cxx2
-rw-r--r--framework/source/uielement/langselectionmenucontroller.cxx2
-rw-r--r--framework/source/uielement/macrosmenucontroller.cxx2
-rw-r--r--framework/source/uielement/newmenucontroller.cxx6
-rw-r--r--framework/source/uielement/objectmenucontroller.cxx2
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx4
-rw-r--r--framework/source/uielement/recentfilesmenucontroller.cxx2
-rw-r--r--framework/source/uielement/resourcemenucontroller.cxx8
-rw-r--r--framework/source/uielement/thesaurusmenucontroller.cxx2
-rw-r--r--framework/source/uielement/toolbarmodemenucontroller.cxx4
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx8
-rw-r--r--include/comphelper/servicehelper.hxx27
-rw-r--r--oox/source/drawingml/shape.cxx4
-rw-r--r--oox/source/export/chartexport.cxx2
-rw-r--r--reportdesign/source/core/api/Shape.cxx2
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx2
-rw-r--r--reportdesign/source/core/sdr/RptPage.cxx2
-rw-r--r--reportdesign/source/core/sdr/UndoActions.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx6
-rw-r--r--reportdesign/source/ui/misc/RptUndo.cxx2
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx4
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx2
-rw-r--r--sc/source/filter/xml/XMLTableShapeImportHelper.cxx4
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx8
-rw-r--r--sc/source/filter/xml/xmlstyli.cxx4
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx2
-rw-r--r--sc/source/ui/app/transobj.cxx4
-rw-r--r--sc/source/ui/unoobj/afmtuno.cxx2
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx38
-rw-r--r--sc/source/ui/unoobj/docuno.cxx16
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx2
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx12
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx2
-rw-r--r--sc/source/ui/unoobj/textuno.cxx6
-rw-r--r--sc/source/ui/unoobj/viewuno.cxx8
-rw-r--r--sc/source/ui/vba/excelvbahelper.cxx2
-rw-r--r--sc/source/ui/vba/vbaeventshelper.cxx4
-rw-r--r--sc/source/ui/vba/vbaformat.cxx2
-rw-r--r--sc/source/ui/vba/vbarange.cxx8
-rw-r--r--sc/source/ui/vba/vbasheetobject.cxx4
-rw-r--r--sc/source/ui/view/drawview.cxx6
-rw-r--r--sc/source/ui/view/gridwin.cxx2
-rw-r--r--sc/source/ui/view/tabview.cxx2
-rw-r--r--sc/source/ui/view/tabview3.cxx2
-rw-r--r--sc/source/ui/view/tabview5.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx2
-rw-r--r--sd/source/core/text/textapi.cxx2
-rw-r--r--sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx10
-rw-r--r--sd/source/ui/unoidl/SdUnoDrawView.cxx14
-rw-r--r--sd/source/ui/unoidl/SdUnoOutlineView.cxx2
-rw-r--r--sd/source/ui/unoidl/unocpres.cxx6
-rw-r--r--sd/source/ui/unoidl/unolayer.cxx10
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx21
-rw-r--r--sd/source/ui/unoidl/unopage.cxx18
-rw-r--r--sd/source/ui/unoidl/unosrch.cxx10
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx2
-rw-r--r--sfx2/source/control/dispatch.cxx2
-rw-r--r--sfx2/source/doc/guisaveas.cxx2
-rw-r--r--sfx2/source/doc/objserv.cxx2
-rw-r--r--sfx2/source/notebookbar/NotebookbarTabControl.cxx2
-rw-r--r--starmath/source/unomodel.cxx2
-rw-r--r--svl/source/numbers/numfmuno.cxx2
-rw-r--r--svtools/source/hatchwindow/hatchwindow.cxx2
-rw-r--r--svtools/source/uno/unoiface.cxx2
-rw-r--r--svtools/source/uno/unoimap.cxx4
-rw-r--r--svx/source/accessibility/ShapeTypeHandler.cxx2
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx2
-rw-r--r--svx/source/fmcomp/fmgridif.cxx4
-rw-r--r--svx/source/fmcomp/gridcell.cxx4
-rw-r--r--svx/source/mnuctrls/smarttagmenu.cxx2
-rw-r--r--svx/source/svdraw/svdedxv.cxx2
-rw-r--r--svx/source/svdraw/svdobj.cxx4
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx4
-rw-r--r--svx/source/unodraw/unomod.cxx2
-rw-r--r--svx/source/unodraw/unopage.cxx10
-rw-r--r--svx/source/unodraw/unoshap2.cxx8
-rw-r--r--svx/source/unodraw/unoshap3.cxx4
-rw-r--r--svx/source/unodraw/unoshape.cxx15
-rw-r--r--svx/source/unogallery/unogaltheme.cxx4
-rw-r--r--sw/source/core/view/printdata.cxx2
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx2
-rw-r--r--toolkit/source/awt/vclxgraphics.cxx2
-rw-r--r--toolkit/source/awt/vclxmenu.cxx2
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx2
-rw-r--r--toolkit/source/awt/vclxtopwindow.cxx2
-rw-r--r--toolkit/source/awt/vclxwindow.cxx2
-rw-r--r--toolkit/source/controls/stdtabcontroller.cxx2
-rw-r--r--toolkit/source/helper/unowrapper.cxx2
-rw-r--r--toolkit/source/helper/vclunohelper.cxx16
-rw-r--r--xmloff/source/core/attrlist.cxx2
-rw-r--r--xmloff/source/core/xmlimp.cxx2
-rw-r--r--xmloff/source/style/xmlnumfe.cxx4
-rw-r--r--xmloff/source/style/xmlnumfi.cxx4
124 files changed, 279 insertions, 303 deletions
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 );
+ AccessibleShape* pAcc = comphelper::getUnoTunnelImplementation<AccessibleShape>( xAccContent );
if ( !pAcc )
{
return aRet;
@@ -497,7 +497,7 @@ OUString AccessibleDrawDocumentView::getObjectLink( const uno::Any& rAny )
{
return aRet;
}
- AccessibleShape* pAcc = AccessibleShape::getImplementation( xAccContent );
+ AccessibleShape* pAcc = comphelper::getUnoTunnelImplementation<AccessibleShape>( xAccContent );
if ( !pAcc )
{
return aRet;
@@ -586,7 +586,7 @@ bool
if( xShapes.is() )
{
- AccessibleShape* pAcc = AccessibleShape::getImplementation( getAccessibleChild( nAccessibleChildIndex ) );
+ AccessibleShape* pAcc = comphelper::getUnoTunnelImplementation<AccessibleShape>( getAccessibleChild( nAccessibleChildIndex ) );
if( pAcc )
{
@@ -633,7 +633,7 @@ void
for(sal_Int32 i = 0, nCount = getAccessibleChildCount(); i < nCount; ++i )
{
- AccessibleShape* pAcc = AccessibleShape::getImplementation( getAccessibleChild( i ) );
+ AccessibleShape* pAcc = comphelper::getUnoTunnelImplementation<AccessibleShape>( getAccessibleChild( i ) );
if( pAcc && pAcc->GetXShape().is() )
xShapes->add( pAcc->GetXShape() );
@@ -650,7 +650,7 @@ void
// Select or deselect only the child with index
// nAccessibleChildIndex.
- AccessibleShape* pAcc = AccessibleShape::getImplementation(
+ AccessibleShape* pAcc = comphelper::getUnoTunnelImplementation<AccessibleShape>(
getAccessibleChild( nAccessibleChildIndex ));
// Add or remove the shape that is made accessible from the
diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx
index db9f7a465864..c714b0f8dce5 100644
--- a/sd/source/ui/unoidl/SdUnoDrawView.cxx
+++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx
@@ -116,7 +116,7 @@ Reference<drawing::XLayer> SdUnoDrawView::getActiveLayer()
// Get the corresponding XLayer object from the implementation
// object of the layer manager.
Reference<drawing::XLayerManager> xManager (pModel->getLayerManager(), uno::UNO_QUERY);
- SdLayerManager* pManager = SdLayerManager::getImplementation (xManager);
+ SdLayerManager* pManager = comphelper::getUnoTunnelImplementation<SdLayerManager> (xManager);
if (pManager != nullptr)
xCurrentLayer = pManager->GetLayer (pLayer);
}
@@ -131,7 +131,7 @@ void SdUnoDrawView::setActiveLayer (const Reference<drawing::XLayer>& rxLayer)
if ( ! rxLayer.is())
return;
- SdLayer* pLayer = SdLayer::getImplementation (rxLayer);
+ SdLayer* pLayer = comphelper::getUnoTunnelImplementation<SdLayer> (rxLayer);
if (pLayer == nullptr)
return;
@@ -159,7 +159,7 @@ sal_Bool SAL_CALL SdUnoDrawView::select( const Any& aSelection )
if(xShape.is())
{
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if( pShape && (pShape->GetSdrObject() != nullptr) )
{
SdrObject* pObj = pShape->GetSdrObject();
@@ -183,7 +183,7 @@ sal_Bool SAL_CALL SdUnoDrawView::select( const Any& aSelection )
xShapes->getByIndex(i) >>= xShape;
if( xShape.is() )
{
- SvxShape* pShape = SvxShape::getImplementation(xShape);
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>(xShape);
if( (pShape == nullptr) || (pShape->GetSdrObject() == nullptr) )
{
bOk = false;
@@ -268,7 +268,7 @@ Any SAL_CALL SdUnoDrawView::getSelection()
if(!xPage.is())
continue;
- SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation( xPage );
+ SvxDrawPage* pDrawPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage );
if(pDrawPage==nullptr)
continue;
@@ -403,7 +403,7 @@ Any SAL_CALL SdUnoDrawView::getFastPropertyValue (
void SAL_CALL SdUnoDrawView::setCurrentPage (
const Reference< drawing::XDrawPage >& xPage )
{
- SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation( xPage );
+ SvxDrawPage* pDrawPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage );
SdrPage *pSdrPage = pDrawPage ? pDrawPage->GetSdrPage() : nullptr;
if(pSdrPage)
@@ -513,7 +513,7 @@ SdXImpressDocument* SdUnoDrawView::GetModel() const throw()
if (mrView.GetDocSh()!=nullptr)
{
Reference<frame::XModel> xModel (mrView.GetDocSh()->GetModel());
- return SdXImpressDocument::getImplementation(xModel);
+ return comphelper::getUnoTunnelImplementation<SdXImpressDocument>(xModel);
}
else
return nullptr;
diff --git a/sd/source/ui/unoidl/SdUnoOutlineView.cxx b/sd/source/ui/unoidl/SdUnoOutlineView.cxx
index 6c16c50d64b8..c75243b5b66d 100644
--- a/sd/source/ui/unoidl/SdUnoOutlineView.cxx
+++ b/sd/source/ui/unoidl/SdUnoOutlineView.cxx
@@ -75,7 +75,7 @@ void SAL_CALL SdUnoOutlineView::removeSelectionChangeListener (
void SAL_CALL SdUnoOutlineView::setCurrentPage (
const Reference< drawing::XDrawPage >& xPage)
{
- SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation( xPage );
+ SvxDrawPage* pDrawPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage );
SdrPage *pSdrPage = pDrawPage ? pDrawPage->GetSdrPage() : nullptr;
SdPage *pSdPage = dynamic_cast<SdPage*>(pSdrPage);
diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx
index 1ad8cc975d3c..49354ae6b097 100644
--- a/sd/source/ui/unoidl/unocpres.cxx
+++ b/sd/source/ui/unoidl/unocpres.cxx
@@ -95,7 +95,7 @@ void SAL_CALL SdXCustomPresentation::insertByIndex( sal_Int32 Index, const uno::
if(!xPage.is())
throw lang::IllegalArgumentException();
- SdDrawPage* pPage = SdDrawPage::getImplementation( xPage );
+ SdDrawPage* pPage = comphelper::getUnoTunnelImplementation<SdDrawPage>( xPage );
if(pPage)
{
@@ -127,7 +127,7 @@ void SAL_CALL SdXCustomPresentation::removeByIndex( sal_Int32 Index )
if( xPage.is() )
{
- SvxDrawPage* pPage = SvxDrawPage::getImplementation( xPage );
+ SvxDrawPage* pPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage );
if(pPage)
{
SdCustomShow::PageVec::iterator it = std::find(
@@ -320,7 +320,7 @@ void SAL_CALL SdXCustomPresentationAccess::insertByName( const OUString& aName,
uno::Reference< container::XIndexContainer > xContainer;
if( (aElement >>= xContainer) && xContainer.is() )
- pXShow = SdXCustomPresentation::getImplementation(xContainer);
+ pXShow = comphelper::getUnoTunnelImplementation<SdXCustomPresentation>(xContainer);
if( nullptr == pXShow )
throw lang::IllegalArgumentException();
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx
index d1750c7eaca8..6c4a16f20ce4 100644
--- a/sd/source/ui/unoidl/unolayer.cxx
+++ b/sd/source/ui/unoidl/unolayer.cxx
@@ -454,7 +454,7 @@ void SAL_CALL SdLayerManager::remove( const uno::Reference< drawing::XLayer >& x
if( mpModel == nullptr )
throw lang::DisposedException();
- SdLayer* pSdLayer = SdLayer::getImplementation(xLayer);
+ SdLayer* pSdLayer = comphelper::getUnoTunnelImplementation<SdLayer>(xLayer);
if(pSdLayer && GetView())
{
@@ -474,12 +474,12 @@ void SAL_CALL SdLayerManager::attachShapeToLayer( const uno::Reference< drawing:
if( mpModel == nullptr )
throw lang::DisposedException();
- SdLayer* pSdLayer = SdLayer::getImplementation(xLayer);
+ SdLayer* pSdLayer = comphelper::getUnoTunnelImplementation<SdLayer>(xLayer);
SdrLayer* pSdrLayer = pSdLayer?pSdLayer->GetSdrLayer():nullptr;
if(pSdrLayer==nullptr)
return;
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
SdrObject* pSdrObject = pShape?pShape->GetSdrObject():nullptr;
if(pSdrObject)
@@ -499,7 +499,7 @@ uno::Reference< drawing::XLayer > SAL_CALL SdLayerManager::getLayerForShape( con
if(mpModel->mpDoc)
{
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
SdrObject* pObj = pShape?pShape->GetSdrObject():nullptr;
if(pObj)
{
@@ -662,7 +662,7 @@ bool compare_layers (const uno::WeakReference<uno::XInterface>& xRef, void const
uno::Reference<uno::XInterface> xLayer (xRef);
if (xLayer.is())
{
- SdLayer* pSdLayer = SdLayer::getImplementation (xRef);
+ SdLayer* pSdLayer = comphelper::getUnoTunnelImplementation<SdLayer> (xRef);
if (pSdLayer != nullptr)
{
SdrLayer* pSdrLayer = pSdLayer->GetSdrLayer ();
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index e6c15f7f1cd0..b13e3d93a2a8 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -348,15 +348,6 @@ const css::uno::Sequence< sal_Int8 > & SdXImpressDocument::getUnoTunnelId() thro
return theSdXImpressDocumentUnoTunnelId::get().getSeq();
}
-SdXImpressDocument* SdXImpressDocument::getImplementation( const uno::Reference< uno::XInterface >& xInt )
-{
- css::uno::Reference< css::lang::XUnoTunnel > xUT( xInt, uno::UNO_QUERY );
- if( xUT.is() )
- return reinterpret_cast<SdXImpressDocument*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething( SdXImpressDocument::getUnoTunnelId() )));
- else
- return nullptr;
-}
-
sal_Int64 SAL_CALL SdXImpressDocument::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier )
{
if( rIdentifier.getLength() == 16 )
@@ -683,7 +674,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdXImpressDocument::duplicate( con
throw lang::DisposedException();
// get pPage from xPage and determine the Id (nPos ) afterwards
- SvxDrawPage* pSvxPage = SvxDrawPage::getImplementation( xPage );
+ SvxDrawPage* pSvxPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage );
if( pSvxPage )
{
SdPage* pPage = static_cast<SdPage*>( pSvxPage->GetSdrPage() );
@@ -1070,7 +1061,7 @@ css::uno::Reference<css::uno::XInterface> SdXImpressDocument::create(
}
uno::Reference< drawing::XShape > xShape( xRet, uno::UNO_QUERY );
- SvxShape* pShape = xShape.is() ? SvxShape::getImplementation(xShape) : nullptr;
+ SvxShape* pShape = xShape.is() ? comphelper::getUnoTunnelImplementation<SvxShape>(xShape) : nullptr;
if (pShape)
{
xRet.clear();
@@ -1906,7 +1897,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
if( !(xRenderDevice.is() && nPageNumber && ( nPageNumber <= mpDoc->GetSdPageCount( ePageKind ) )) )
return;
- VCLXDevice* pDevice = VCLXDevice::getImplementation( xRenderDevice );
+ VCLXDevice* pDevice = comphelper::getUnoTunnelImplementation<VCLXDevice>( xRenderDevice );
VclPtr< OutputDevice> pOut = pDevice ? pDevice->GetOutputDevice() : VclPtr< OutputDevice >();
if( !pOut )
@@ -2200,7 +2191,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
if( xShape.is() )
{
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if( pShape )
{
@@ -2930,7 +2921,7 @@ void SAL_CALL SdDrawPagesAccess::remove( const uno::Reference< drawing::XDrawPag
if( nPageCount > 1 )
{
// get pPage from xPage and determine the Id (nPos ) afterwards
- SdDrawPage* pSvxPage = SdDrawPage::getImplementation( xPage );
+ SdDrawPage* pSvxPage = comphelper::getUnoTunnelImplementation<SdDrawPage>( xPage );
if( pSvxPage )
{
SdPage* pPage = static_cast<SdPage*>(pSvxPage->GetSdrPage());
@@ -3180,7 +3171,7 @@ void SAL_CALL SdMasterPagesAccess::remove( const uno::Reference< drawing::XDrawP
if( nullptr == mpModel || mpModel->mpDoc == nullptr )
throw lang::DisposedException();
- SdMasterPage* pSdPage = SdMasterPage::getImplementation( xPage );
+ SdMasterPage* pSdPage = comphelper::getUnoTunnelImplementation<SdMasterPage>( xPage );
if(pSdPage == nullptr)
return;
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index fcc49edb09ed..9e060647fc53 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -388,7 +388,7 @@ void SdGenericDrawPage::UpdateModel()
if( mpSdrModel )
{
uno::Reference< uno::XInterface > xModel( SvxFmDrawPage::mpModel->getUnoModel() );
- mpDocModel = SdXImpressDocument::getImplementation( xModel );
+ mpDocModel = comphelper::getUnoTunnelImplementation<SdXImpressDocument>( xModel );
}
else
{
@@ -1469,13 +1469,13 @@ Reference< drawing::XShape > SdGenericDrawPage::CreateShape(SdrObject *pObj) co
}
if( !pShape )
- pShape = SvxShape::getImplementation( xShape );
+ pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if( pShape )
pShape->SetShapeType( aShapeType );
}
- SvxShape *pSdShape = SvxShape::getImplementation(xShape);
+ SvxShape *pSdShape = comphelper::getUnoTunnelImplementation<SvxShape>(xShape);
if (pSdShape)
{
// SdXShape aggregates SvxShape
@@ -2335,7 +2335,7 @@ void SAL_CALL SdDrawPage::setMasterPage( const Reference< drawing::XDrawPage >&
if(!SvxFmDrawPage::mpPage)
return;
- SdMasterPage* pMasterPage = SdMasterPage::getImplementation( xMasterPage );
+ SdMasterPage* pMasterPage = comphelper::getUnoTunnelImplementation<SdMasterPage>( xMasterPage );
if( !(pMasterPage && pMasterPage->isValid()) )
return;
@@ -2415,7 +2415,7 @@ void SAL_CALL SdDrawPage::remove( const Reference< drawing::XShape >& xShape )
throwIfDisposed();
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if( pShape )
{
SdrObject* pObj = pShape->GetSdrObject();
@@ -2444,7 +2444,7 @@ void SdDrawPage::setBackground( const Any& rValue )
}
// is it our own implementation?
- SdUnoPageBackground* pBack = SdUnoPageBackground::getImplementation( xSet );
+ SdUnoPageBackground* pBack = comphelper::getUnoTunnelImplementation<SdUnoPageBackground>( xSet );
SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
@@ -2816,7 +2816,7 @@ void SdMasterPage::setBackground( const Any& rValue )
{
// first fill an item set
// is it our own implementation?
- SdUnoPageBackground* pBack = SdUnoPageBackground::getImplementation( xInputSet );
+ SdUnoPageBackground* pBack = comphelper::getUnoTunnelImplementation<SdUnoPageBackground>( xInputSet );
SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
@@ -3024,7 +3024,7 @@ void SAL_CALL SdMasterPage::remove( const Reference< drawing::XShape >& xShape )
throwIfDisposed();
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if( pShape )
{
SdrObject* pObj = pShape->GetSdrObject();
@@ -3041,7 +3041,7 @@ Reference< uno::XInterface > createUnoPageImpl( SdPage* pPage )
if( pPage )
{
- SdXImpressDocument* pModel = SdXImpressDocument::getImplementation( pPage->getSdrModelFromSdrPage().getUnoModel() );
+ SdXImpressDocument* pModel = comphelper::getUnoTunnelImplementation<SdXImpressDocument>( pPage->getSdrModelFromSdrPage().getUnoModel() );
if( pModel )
{
if( pPage->IsMasterPage() )
diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx
index ee6b482b19ab..be11e8d28a7c 100644
--- a/sd/source/ui/unoidl/unosrch.cxx
+++ b/sd/source/ui/unoidl/unosrch.cxx
@@ -100,7 +100,7 @@ uno::Reference< util::XReplaceDescriptor > SAL_CALL SdUnoSearchReplaceShape::cre
sal_Int32 SAL_CALL SdUnoSearchReplaceShape::replaceAll( const uno::Reference< util::XSearchDescriptor >& xDesc )
{
- SdUnoSearchReplaceDescriptor* pDescr = SdUnoSearchReplaceDescriptor::getImplementation( xDesc );
+ SdUnoSearchReplaceDescriptor* pDescr = comphelper::getUnoTunnelImplementation<SdUnoSearchReplaceDescriptor>( xDesc );
if( pDescr == nullptr )
return 0;
@@ -182,7 +182,7 @@ uno::Reference< css::util::XSearchDescriptor > SAL_CALL SdUnoSearchReplaceShape:
uno::Reference< css::container::XIndexAccess > SAL_CALL SdUnoSearchReplaceShape::findAll( const css::uno::Reference< css::util::XSearchDescriptor >& xDesc )
{
- SdUnoSearchReplaceDescriptor* pDescr = SdUnoSearchReplaceDescriptor::getImplementation( xDesc );
+ SdUnoSearchReplaceDescriptor* pDescr = comphelper::getUnoTunnelImplementation<SdUnoSearchReplaceDescriptor>( xDesc );
if( pDescr == nullptr )
return uno::Reference< container::XIndexAccess > ();
@@ -305,7 +305,7 @@ uno::Reference< drawing::XShape > SdUnoSearchReplaceShape::GetCurrentShape() co
uno::Reference< css::uno::XInterface > SAL_CALL SdUnoSearchReplaceShape::findNext( const css::uno::Reference< css::uno::XInterface >& xStartAt, const css::uno::Reference< css::util::XSearchDescriptor >& xDesc )
{
- SdUnoSearchReplaceDescriptor* pDescr = SdUnoSearchReplaceDescriptor::getImplementation( xDesc );
+ SdUnoSearchReplaceDescriptor* pDescr = comphelper::getUnoTunnelImplementation<SdUnoSearchReplaceDescriptor>( xDesc );
uno::Reference< uno::XInterface > xFound;
@@ -562,7 +562,7 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( const uno::
pConvertPara[nEndPos], pConvertPos[nEndPos] );
SvxUnoTextRange *pRange;
- SvxUnoTextBase* pParent = SvxUnoTextBase::getImplementation( xParent );
+ SvxUnoTextBase* pParent = comphelper::getUnoTunnelImplementation<SvxUnoTextBase>( xParent );
if(pParent)
{
@@ -617,7 +617,7 @@ bool SdUnoSearchReplaceShape::Search( const OUString& rText, sal_Int32& nStartPo
ESelection SdUnoSearchReplaceShape::GetSelection( const uno::Reference< text::XTextRange >& xTextRange ) throw()
{
ESelection aSel;
- SvxUnoTextRangeBase* pRange = SvxUnoTextRangeBase::getImplementation( xTextRange );
+ SvxUnoTextRangeBase* pRange = comphelper::getUnoTunnelImplementation<SvxUnoTextRangeBase>( xTextRange );
if(pRange)
aSel = pRange->GetSelection();
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index a79faf8916c5..7b5a894c91f5 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1190,7 +1190,7 @@ public:
if (aDev >>= xRenderDevice)
{
- VCLXDevice* pDevice = VCLXDevice::getImplementation(xRenderDevice);
+ VCLXDevice* pDevice = comphelper::getUnoTunnelImplementation<VCLXDevice>(xRenderDevice);
VclPtr< OutputDevice > pOut = pDevice ? pDevice->GetOutputDevice()
: VclPtr< OutputDevice >();
mpPrinter = dynamic_cast<Printer*>(pOut.get());
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index d2fe1b30ecbb..319570787639 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1836,7 +1836,7 @@ void SfxDispatcher::ExecutePopup( const OUString& rResName, vcl::Window* pWin, c
aEvent.ExecutePosition.Y = aPos.Y();
xPopupController->setPopupMenu( xPopupMenu );
- VCLXMenu* pAwtMenu = VCLXMenu::getImplementation( xPopupMenu );
+ VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( xPopupMenu );
PopupMenu* pVCLMenu = static_cast< PopupMenu* >( pAwtMenu->GetMenu() );
if (comphelper::LibreOfficeKit::isActive())
{
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index fd92486cc1d3..1cf87a410f30 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1840,7 +1840,7 @@ vcl::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XMod
uno::Reference<awt::XWindow> xWindow = GetModelXWindow(xModel);
if ( xWindow.is() )
{
- VCLXWindow* pVCLWindow = VCLXWindow::getImplementation( xWindow );
+ VCLXWindow* pVCLWindow = comphelper::getUnoTunnelImplementation<VCLXWindow>( xWindow );
if ( pVCLWindow )
pWin = pVCLWindow->GetWindow();
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index a7b8368f0034..24eee80787f8 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -531,7 +531,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
css::uno::Reference< css::uno::XInterface > xInterface;
const SfxUnoAnyItem* pUnoAny = pReq->GetArg<SfxUnoAnyItem>(FN_PARAM_2);
AsyncFunc* pAsyncFunc = pUnoAny && (pUnoAny->GetValue() >>= xInterface ) ?
- AsyncFunc::getImplementation(xInterface) : nullptr;
+ comphelper::getUnoTunnelImplementation<AsyncFunc>(xInterface) : nullptr;
if (pAsyncFunc)
pAsyncFunc->Execute();
diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
index 1f3dd0965409..66ece2417be2 100644
--- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx
+++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
@@ -345,7 +345,7 @@ IMPL_LINK(NotebookbarTabControl, OpenNotebookbarPopupMenu, NotebookBar*, pNotebo
return;
xPopupController->setPopupMenu(xPopupMenu);
- VCLXMenu* pAwtMenu = VCLXMenu::getImplementation(xPopupMenu);
+ VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>(xPopupMenu);
PopupMenu* pVCLMenu = static_cast<PopupMenu*>(pAwtMenu->GetMenu());
Point aPos(pNotebookbar->GetSizePixel().getWidth(), NotebookbarTabControl::GetHeaderHeight() - ICON_SIZE + 10);
pVCLMenu->Execute(pNotebookbar, tools::Rectangle(aPos, aPos),PopupMenuFlags::ExecuteDown|PopupMenuFlags::NoMouseUpClose);
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 58f3814bedc9..8042f0e099d7 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -991,7 +991,7 @@ void SAL_CALL SmModel::render(
if (!xRenderDevice.is())
return;
- VCLXDevice* pDevice = VCLXDevice::getImplementation( xRenderDevice );
+ VCLXDevice* pDevice = comphelper::getUnoTunnelImplementation<VCLXDevice>( xRenderDevice );
VclPtr< OutputDevice> pOut = pDevice ? pDevice->GetOutputDevice()
: VclPtr< OutputDevice >();
if (!pOut)
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index 688d4e419a81..66ed4aae0359 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -122,7 +122,7 @@ void SAL_CALL SvNumberFormatterServiceObj::attachNumberFormatsSupplier( const un
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- SvNumberFormatsSupplierObj* pNew = SvNumberFormatsSupplierObj::getImplementation( _xSupplier );
+ SvNumberFormatsSupplierObj* pNew = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( _xSupplier );
if (!pNew)
throw uno::RuntimeException(); // wrong object
diff --git a/svtools/source/hatchwindow/hatchwindow.cxx b/svtools/source/hatchwindow/hatchwindow.cxx
index 90cbb959be88..7d572e50eacb 100644
--- a/svtools/source/hatchwindow/hatchwindow.cxx
+++ b/svtools/source/hatchwindow/hatchwindow.cxx
@@ -48,7 +48,7 @@ void VCLXHatchWindow::initializeWindow( const uno::Reference< awt::XWindowPeer >
SolarMutexGuard aGuard;
VclPtr<vcl::Window> pParent;
- VCLXWindow* pParentComponent = VCLXWindow::getImplementation( xParent );
+ VCLXWindow* pParentComponent = comphelper::getUnoTunnelImplementation<VCLXWindow>( xParent );
if ( pParentComponent )
pParent = pParentComponent->GetWindow();
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index 0f27d4c65a05..dcaa46182e90 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -1312,7 +1312,7 @@ void SVTXFormattedField::setFormatsSupplier(const css::uno::Reference< css::util
}
else
{
- pNew = SvNumberFormatsSupplierObj::getImplementation(xSupplier);
+ pNew = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>(xSupplier);
bIsStandardSupplier = false;
}
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 5e86ecf5c7df..cc0c223c3f9d 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -561,7 +561,7 @@ SvUnoImageMapObject* SvUnoImageMap::getObject( const Any& aElement )
Reference< XInterface > xObject;
aElement >>= xObject;
- SvUnoImageMapObject* pObject = SvUnoImageMapObject::getImplementation( xObject );
+ SvUnoImageMapObject* pObject = comphelper::getUnoTunnelImplementation<SvUnoImageMapObject>( xObject );
if( nullptr == pObject )
throw IllegalArgumentException();
@@ -708,7 +708,7 @@ Reference< XInterface > SvUnoImageMap_createInstance( const ImageMap& rMap, cons
bool SvUnoImageMap_fillImageMap( const Reference< XInterface >& xImageMap, ImageMap& rMap )
{
- SvUnoImageMap* pUnoImageMap = SvUnoImageMap::getImplementation( xImageMap );
+ SvUnoImageMap* pUnoImageMap = comphelper::getUnoTunnelImplementation<SvUnoImageMap>( xImageMap );
if( nullptr == pUnoImageMap )
return false;
diff --git a/svx/source/accessibility/ShapeTypeHandler.cxx b/svx/source/accessibility/ShapeTypeHandler.cxx
index 4899662a0fee..b00fe30c8e3b 100644
--- a/svx/source/accessibility/ShapeTypeHandler.cxx
+++ b/svx/source/accessibility/ShapeTypeHandler.cxx
@@ -272,7 +272,7 @@ OUString ShapeTypeHandler::CreateAccessibleBaseName (const uno::Reference<drawin
case DRAWING_CUSTOM:
pResourceId = STR_ObjNameSingulCUSTOMSHAPE;
- if (SvxShape* pShape = SvxShape::getImplementation(rxShape))
+ if (SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>(rxShape))
{
if (auto pCustomShape = dynamic_cast<SdrObjCustomShape*>(pShape->GetSdrObject()))
{
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 811793458a16..094e353ce350 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -266,7 +266,7 @@ void SetTemporary( uno::Reference< drawing::XShape > const & xShape )
{
if ( xShape.is() )
{
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if ( pShape )
pShape->TakeSdrObjectOwnership();
}
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index ca56f80ae9e6..e270576298c0 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -473,7 +473,7 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< css::awt::XToolkit >&
vcl::Window* pParentWin = nullptr;
if (rParentPeer.is())
{
- VCLXWindow* pParent = VCLXWindow::getImplementation(rParentPeer);
+ VCLXWindow* pParent = comphelper::getUnoTunnelImplementation<VCLXWindow>(rParentPeer);
if (pParent)
pParentWin = pParent->GetWindow().get();
}
@@ -496,7 +496,7 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< css::awt::XToolkit >&
// if (--m_nPeerCreationLevel == 0)
{
DBG_ASSERT(getPeer().is(), "FmXGridControl::createPeer : something went wrong ... no top level peer !");
- pPeer = FmXGridPeer::getImplementation(getPeer());
+ pPeer = comphelper::getUnoTunnelImplementation<FmXGridPeer>(getPeer());
setPosSize( maComponentInfos.nX, maComponentInfos.nY, maComponentInfos.nWidth, maComponentInfos.nHeight, css::awt::PosSize::POSSIZE );
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index dd14bffef58c..7cb4a87cd4d0 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1329,7 +1329,7 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
SvNumberFormatter* pFormatterUsed = nullptr;
if (m_xSupplier.is())
{
- SvNumberFormatsSupplierObj* pImplmentation = SvNumberFormatsSupplierObj::getImplementation(m_xSupplier);
+ SvNumberFormatsSupplierObj* pImplmentation = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>(m_xSupplier);
if (pImplmentation)
pFormatterUsed = pImplmentation->GetNumberFormatter();
else
@@ -1914,7 +1914,7 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe
SvNumberFormatter* pFormatterUsed = nullptr;
if ( xSupplier.is() )
{
- SvNumberFormatsSupplierObj* pImplmentation = SvNumberFormatsSupplierObj::getImplementation( xSupplier );
+ SvNumberFormatsSupplierObj* pImplmentation = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( xSupplier );
pFormatterUsed = pImplmentation ? pImplmentation->GetNumberFormatter() : nullptr;
}
if ( nullptr == pFormatterUsed )
diff --git a/svx/source/mnuctrls/smarttagmenu.cxx b/svx/source/mnuctrls/smarttagmenu.cxx
index 36b1e135af60..2780cf383f95 100644
--- a/svx/source/mnuctrls/smarttagmenu.cxx
+++ b/svx/source/mnuctrls/smarttagmenu.cxx
@@ -107,7 +107,7 @@ void SmartTagMenuController::FillMenu()
sal_uInt16 nMenuId = 1;
sal_uInt16 nSubMenuId = MN_ST_INSERT_START;
- VCLXMenu* pAwtMenu = VCLXMenu::getImplementation( m_xPopupMenu );
+ VCLXMenu* pAwtMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( m_xPopupMenu );
PopupMenu* pVCLMenu = static_cast< PopupMenu* >( pAwtMenu->GetMenu() );
const css::uno::Sequence< css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > >& rActionComponentsSequence = m_pSmartTagItem->GetActionComponentsSequence();
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 8935d2702804..f4d3f8eee8aa 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2385,7 +2385,7 @@ void SdrObjEditView::getTextSelection( css::uno::Any& rSelection )
css::uno::Reference< css::text::XText > xText( pObj->getUnoShape(), css::uno::UNO_QUERY );
if( xText.is() )
{
- SvxUnoTextBase* pRange = SvxUnoTextBase::getImplementation( xText );
+ SvxUnoTextBase* pRange = comphelper::getUnoTunnelImplementation<SvxUnoTextBase>( xText );
if( pRange )
{
rSelection <<= pRange->createTextCursorBySelection( pOutlinerView->GetSelection() );
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index ab3349fe703b..753caf3edd8a 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2746,7 +2746,7 @@ void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUn
}
maWeakUnoShape = _rxUnoShape;
- mpSvxShape = SvxShape::getImplementation( _rxUnoShape );
+ mpSvxShape = comphelper::getUnoTunnelImplementation<SvxShape>( _rxUnoShape );
// I think this may never happen... But I am not sure enough .-)
if ( bTransferOwnership )
@@ -2837,7 +2837,7 @@ css::uno::Reference< css::uno::XInterface > SdrObject::getUnoShape()
uno::Reference< uno::XInterface > xPage(pPageCandidate->getUnoPage());
if( xPage.is() )
{
- SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation(xPage);
+ SvxDrawPage* pDrawPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>(xPage);
if( pDrawPage )
{
// create one
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 3a83e49f3505..bbaf3ac628af 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -554,7 +554,7 @@ void GraphicExporter::ParseSettings( const Sequence< PropertyValue >& aDescripto
pDataValues->Value >>= xPage;
if( xPage.is() )
{
- SvxDrawPage* pUnoPage = SvxDrawPage::getImplementation( xPage );
+ SvxDrawPage* pUnoPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage );
if( pUnoPage && pUnoPage->GetSdrPage() )
mpCurrentPage = pUnoPage->GetSdrPage();
}
@@ -1182,7 +1182,7 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon
if( !mxPage.is() )
break;
- mpUnoPage = SvxDrawPage::getImplementation( mxPage );
+ mpUnoPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( mxPage );
if( nullptr == mpUnoPage || nullptr == mpUnoPage->GetSdrPage() )
break;
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 132f3b6c3fd7..c318442d279d 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -662,7 +662,7 @@ void SAL_CALL SvxUnoDrawPagesAccess::remove( const uno::Reference< drawing::XDra
if( nPageCount > 1 )
{
// get pPage from xPage and get Id (nPos)
- SvxDrawPage* pSvxPage = SvxDrawPage::getImplementation( xPage );
+ SvxDrawPage* pSvxPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage );
if( pSvxPage )
{
SdrPage* pPage = pSvxPage->GetSdrPage();
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 7982ddced061..5f326ceaaf72 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -183,7 +183,7 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape
if ( ( mpModel == nullptr ) || ( mpPage == nullptr ) )
throw lang::DisposedException();
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if( nullptr == pShape )
return;
@@ -254,7 +254,7 @@ void SAL_CALL SvxDrawPage::addBottom( const uno::Reference< drawing::XShape >& x
if ( ( mpModel == nullptr ) || ( mpPage == nullptr ) )
throw lang::DisposedException();
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if( nullptr == pShape )
return;
@@ -289,7 +289,7 @@ void SAL_CALL SvxDrawPage::remove( const Reference< drawing::XShape >& xShape )
if( (mpModel == nullptr) || (mpPage == nullptr) )
throw lang::DisposedException();
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if (pShape)
{
@@ -381,7 +381,7 @@ namespace
{
void lcl_markSdrObjectOfShape( const Reference< drawing::XShape >& _rxShape, SdrView& _rView, SdrPageView& _rPageView )
{
- SvxShape* pShape = SvxShape::getImplementation( _rxShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( _rxShape );
if ( !pShape )
return;
@@ -892,7 +892,7 @@ SdrPage* GetSdrPageFromXDrawPage( const uno::Reference< drawing::XDrawPage >& xD
{
if(xDrawPage.is())
{
- SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation( xDrawPage );
+ SvxDrawPage* pDrawPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xDrawPage );
if(pDrawPage)
{
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 760b6eb4da6a..13e8205e353d 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -190,7 +190,7 @@ void SvxShapeGroup::addUnoShape( const uno::Reference< drawing::XShape >& xShape
return;
}
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if (!pShape)
{
OSL_FAIL("could not add XShape to group shape!");
@@ -240,7 +240,7 @@ void SAL_CALL SvxShapeGroup::remove( const uno::Reference< drawing::XShape >& xS
::SolarMutexGuard aGuard;
SdrObject* pSdrShape = nullptr;
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if( pShape )
pSdrShape = pShape->GetSdrObject();
@@ -438,7 +438,7 @@ void SAL_CALL SvxShapeConnector::connectStart( const uno::Reference< drawing::XC
::SolarMutexGuard aGuard;
Reference< drawing::XShape > xRef( xShape, UNO_QUERY );
- SvxShape* pShape = SvxShape::getImplementation( xRef );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xRef );
if( pShape )
GetSdrObject()->ConnectToNode( true, pShape->GetSdrObject() );
@@ -452,7 +452,7 @@ void SAL_CALL SvxShapeConnector::connectEnd( const uno::Reference< drawing::XCon
::SolarMutexGuard aGuard;
Reference< drawing::XShape > xRef( xShape, UNO_QUERY );
- SvxShape* pShape = SvxShape::getImplementation( xRef );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xRef );
if( HasSdrObject() && pShape )
GetSdrObject()->ConnectToNode( false, pShape->GetSdrObject() );
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index 394300ebae6d..39b04d480752 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -117,7 +117,7 @@ void SAL_CALL Svx3DSceneObject::add( const Reference< drawing::XShape >& xShape
{
SolarMutexGuard aGuard;
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if(!HasSdrObject() || !mxPage.is() || pShape == nullptr || nullptr != pShape->GetSdrObject() )
throw uno::RuntimeException();
@@ -142,7 +142,7 @@ void SAL_CALL Svx3DSceneObject::remove( const Reference< drawing::XShape >& xSha
{
SolarMutexGuard aGuard;
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
if(!HasSdrObject() || pShape == nullptr)
throw uno::RuntimeException();
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 9cd0d2ea520c..929e0350ec22 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -295,17 +295,6 @@ const css::uno::Sequence< sal_Int8 > & SvxShape::getUnoTunnelId() throw()
return theSvxShapeUnoTunnelId::get().getSeq();
}
-
-SvxShape* SvxShape::getImplementation( const uno::Reference< uno::XInterface >& xInt )
-{
- uno::Reference< lang::XUnoTunnel > xUT( xInt, css::uno::UNO_QUERY );
- if( xUT.is() )
- return reinterpret_cast<SvxShape*>(sal::static_int_cast<sal_uIntPtr>(xUT->getSomething( SvxShape::getUnoTunnelId())));
- else
- return nullptr;
-}
-
-
sal_Int64 SAL_CALL SvxShape::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
@@ -4100,14 +4089,14 @@ uno::Reference< drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) throw
/** returns the SdrObject from the given StarOffice API wrapper */
SdrObject* GetSdrObjectFromXShape( const uno::Reference< drawing::XShape >& xShape ) throw()
{
- SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape );
return pShape ? pShape->GetSdrObject() : nullptr;
}
SdrObject* SdrObject::getSdrObjectFromXShape( const css::uno::Reference< css::uno::XInterface >& xInt )
{
- SvxShape* pSvxShape = SvxShape::getImplementation( xInt );
+ SvxShape* pSvxShape = comphelper::getUnoTunnelImplementation<SvxShape>( xInt );
return pSvxShape ? pSvxShape->GetSdrObject() : nullptr;
}
diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx
index 32f111d6a200..88a8bff8cae8 100644
--- a/svx/source/unogallery/unogaltheme.cxx
+++ b/svx/source/unogallery/unogaltheme.cxx
@@ -231,7 +231,7 @@ void SAL_CALL GalleryTheme::update( )
if( mpTheme )
{
- GalleryDrawingModel* pModel = GalleryDrawingModel::getImplementation( Drawing );
+ GalleryDrawingModel* pModel = comphelper::getUnoTunnelImplementation<GalleryDrawingModel>( Drawing );
if( pModel && dynamic_cast<const FmFormModel*>(pModel->GetDoc()) )
{
@@ -250,7 +250,7 @@ void SAL_CALL GalleryTheme::update( )
uno::Reference< drawing::XDrawPagesSupplier > xDrawPagesSupplier( Drawing, uno::UNO_QUERY_THROW );
uno::Reference< drawing::XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), uno::UNO_SET_THROW );
uno::Reference< drawing::XDrawPage > xPage( xDrawPages->getByIndex( 0 ), uno::UNO_QUERY_THROW );
- SvxDrawPage* pUnoPage = xPage.is() ? SvxDrawPage::getImplementation( xPage ) : nullptr;
+ SvxDrawPage* pUnoPage = xPage.is() ? comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage ) : nullptr;
SdrModel* pOrigModel = pUnoPage ? &pUnoPage->GetSdrPage()->getSdrModelFromSdrPage() : nullptr;
SdrPage* pOrigPage = pUnoPage ? pUnoPage->GetSdrPage() : nullptr;
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 9970cd602ff4..a92f3661c990 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -443,7 +443,7 @@ bool SwPrintUIOptions::processPropertiesAndCheckFormat( const uno::Sequence< bea
VclPtr< OutputDevice > pOut;
if (xRenderDevice.is())
{
- VCLXDevice* pDevice = VCLXDevice::getImplementation( xRenderDevice );
+ VCLXDevice* pDevice = comphelper::getUnoTunnelImplementation<VCLXDevice>( xRenderDevice );
if (pDevice)
pOut = pDevice->GetOutputDevice();
}
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 78f7ab1adadd..8d53dd08701b 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2331,7 +2331,7 @@ static VclPtr< OutputDevice > lcl_GetOutputDevice( const SwPrintUIOptions &rPrin
aAny >>= xRenderDevice;
if (xRenderDevice.is())
{
- VCLXDevice* pDevice = VCLXDevice::getImplementation( xRenderDevice );
+ VCLXDevice* pDevice = comphelper::getUnoTunnelImplementation<VCLXDevice>( xRenderDevice );
pOut = pDevice ? pDevice->GetOutputDevice() : VclPtr< OutputDevice >();
}
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index d4e158838923..f8cd331f668f 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -286,7 +286,7 @@ void VCLXGraphics::copy( const uno::Reference< awt::XDevice >& rxSource, sal_Int
if ( mpOutputDevice )
{
- VCLXDevice* pFromDev = VCLXDevice::getImplementation( rxSource );
+ VCLXDevice* pFromDev = comphelper::getUnoTunnelImplementation<VCLXDevice>( rxSource );
DBG_ASSERT( pFromDev, "VCLXGraphics::copy - invalid device" );
if ( pFromDev )
{
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index a757b0a7647e..52ee47d42ac2 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -387,7 +387,7 @@ void VCLXMenu::setPopupMenu(
SolarMutexGuard aSolarGuard;
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- VCLXMenu* pVCLMenu = VCLXMenu::getImplementation( rxPopupMenu );
+ VCLXMenu* pVCLMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( rxPopupMenu );
DBG_ASSERT( pVCLMenu && pVCLMenu->GetMenu() && pVCLMenu->IsPopupMenu(), "setPopupMenu: Invalid Menu!" );
if ( mpMenu && pVCLMenu && pVCLMenu->GetMenu() && pVCLMenu->IsPopupMenu() )
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index e09dee3d242c..904f95fd5e38 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1519,7 +1519,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
VclPtr<vcl::Window> pParent;
if ( rDescriptor.Parent.is() )
{
- VCLXWindow* pParentComponent = VCLXWindow::getImplementation( rDescriptor.Parent );
+ VCLXWindow* pParentComponent = comphelper::getUnoTunnelImplementation<VCLXWindow>( rDescriptor.Parent );
// #103939# Don't throw assertion, may be it's a system dependent window, used in ImplCreateWindow.
// DBG_ASSERT( pParentComponent, "ParentComponent not valid" );
diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx
index bd53b7238c92..9eb5ea5f7853 100644
--- a/toolkit/source/awt/vclxtopwindow.cxx
+++ b/toolkit/source/awt/vclxtopwindow.cxx
@@ -154,7 +154,7 @@ void VCLXTopWindow_Base::setMenuBar( const css::uno::Reference< css::awt::XMenuB
pSystemWindow->SetMenuBar( nullptr );
if ( rxMenu.is() )
{
- VCLXMenu* pMenu = VCLXMenu::getImplementation( rxMenu );
+ VCLXMenu* pMenu = comphelper::getUnoTunnelImplementation<VCLXMenu>( rxMenu );
if ( pMenu && !pMenu->IsPopupMenu() )
pSystemWindow->SetMenuBar( static_cast<MenuBar*>( pMenu->GetMenu() ));
}
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index b1e2fc5cf536..04c8cffc2a2b 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -1143,7 +1143,7 @@ void VCLXWindow::setPointer( const css::uno::Reference< css::awt::XPointer >& rx
{
SolarMutexGuard aGuard;
- VCLXPointer* pPointer = VCLXPointer::getImplementation( rxPointer );
+ VCLXPointer* pPointer = comphelper::getUnoTunnelImplementation<VCLXPointer>( rxPointer );
if ( pPointer && GetWindow() )
GetWindow()->SetPointer( pPointer->GetPointer() );
}
diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx
index bdcee66c9ede..f7debf9f0c1a 100644
--- a/toolkit/source/controls/stdtabcontroller.cxx
+++ b/toolkit/source/controls/stdtabcontroller.cxx
@@ -150,7 +150,7 @@ void StdTabController::ImplActivateControl( bool bFirst ) const
Reference< XWindowPeer > xCP = pControls[nCtrl]->getPeer();
if ( xCP.is() )
{
- VCLXWindow* pC = VCLXWindow::getImplementation( xCP );
+ VCLXWindow* pC = comphelper::getUnoTunnelImplementation<VCLXWindow>( xCP );
if ( pC && pC->GetWindow() && ( pC->GetWindow()->GetStyle() & WB_TABSTOP ) )
{
pC->GetWindow()->GrabFocus();
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx
index 1d7ace5837ee..c5184b295425 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -170,7 +170,7 @@ VclPtr<vcl::Window> UnoWrapper::GetWindow(const css::uno::Reference<css::awt::XW
void UnoWrapper::SetWindowInterface( vcl::Window* pWindow, css::uno::Reference< css::awt::XWindowPeer> xIFace )
{
- VCLXWindow* pVCLXWindow = VCLXWindow::getImplementation( xIFace );
+ VCLXWindow* pVCLXWindow = comphelper::getUnoTunnelImplementation<VCLXWindow>( xIFace );
DBG_ASSERT( pVCLXWindow, "SetComponentInterface - unsupported type" );
if ( pVCLXWindow )
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index c3e05cb2e6ac..6ba0ecf1d9d6 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -79,7 +79,7 @@ BitmapEx VCLUnoHelper::GetBitmap( const css::uno::Reference< css::awt::XBitmap>&
}
else if ( rxBitmap.is() )
{
- VCLXBitmap* pVCLBitmap = VCLXBitmap::getImplementation( rxBitmap );
+ VCLXBitmap* pVCLBitmap = comphelper::getUnoTunnelImplementation<VCLXBitmap>( rxBitmap );
if ( pVCLBitmap )
aBmp = pVCLBitmap->GetBitmap();
else
@@ -110,26 +110,26 @@ css::uno::Reference< css::awt::XBitmap> VCLUnoHelper::CreateBitmap( const Bitmap
VclPtr< vcl::Window > VCLUnoHelper::GetWindow( const css::uno::Reference< css::awt::XWindow>& rxWindow )
{
- VCLXWindow* pVCLXWindow = VCLXWindow::getImplementation( rxWindow );
+ VCLXWindow* pVCLXWindow = comphelper::getUnoTunnelImplementation<VCLXWindow>( rxWindow );
return pVCLXWindow ? pVCLXWindow->GetWindow() : VclPtr< vcl::Window >();
}
VclPtr< vcl::Window > VCLUnoHelper::GetWindow( const css::uno::Reference< css::awt::XWindow2>& rxWindow )
{
- VCLXWindow* pVCLXWindow = VCLXWindow::getImplementation( rxWindow );
+ VCLXWindow* pVCLXWindow = comphelper::getUnoTunnelImplementation<VCLXWindow>( rxWindow );
return pVCLXWindow ? pVCLXWindow->GetWindow() : VclPtr< vcl::Window >();
}
VclPtr< vcl::Window > VCLUnoHelper::GetWindow( const css::uno::Reference< css::awt::XWindowPeer>& rxWindow )
{
- VCLXWindow* pVCLXWindow = VCLXWindow::getImplementation( rxWindow );
+ VCLXWindow* pVCLXWindow = comphelper::getUnoTunnelImplementation<VCLXWindow>( rxWindow );
return pVCLXWindow ? pVCLXWindow->GetWindow() : VclPtr< vcl::Window >();
}
vcl::Region VCLUnoHelper::GetRegion( const css::uno::Reference< css::awt::XRegion >& rxRegion )
{
vcl::Region aRegion;
- VCLXRegion* pVCLRegion = VCLXRegion::getImplementation( rxRegion );
+ VCLXRegion* pVCLRegion = comphelper::getUnoTunnelImplementation<VCLXRegion>( rxRegion );
if ( pVCLRegion )
aRegion = pVCLRegion->GetRegion();
else
@@ -156,7 +156,7 @@ css::uno::Reference< css::awt::XWindow> VCLUnoHelper::GetInterface( vcl::Window*
OutputDevice* VCLUnoHelper::GetOutputDevice( const css::uno::Reference< css::awt::XDevice>& rxDevice )
{
VclPtr<OutputDevice> pOutDev;
- VCLXDevice* pDev = VCLXDevice::getImplementation( rxDevice );
+ VCLXDevice* pDev = comphelper::getUnoTunnelImplementation<VCLXDevice>( rxDevice );
if ( pDev )
pOutDev = pDev->GetOutputDevice();
return pOutDev;
@@ -165,7 +165,7 @@ OutputDevice* VCLUnoHelper::GetOutputDevice( const css::uno::Reference< css::awt
OutputDevice* VCLUnoHelper::GetOutputDevice( const css::uno::Reference< css::awt::XGraphics>& rxGraphics )
{
OutputDevice* pOutDev = nullptr;
- VCLXGraphics* pGrf = VCLXGraphics::getImplementation( rxGraphics );
+ VCLXGraphics* pGrf = comphelper::getUnoTunnelImplementation<VCLXGraphics>( rxGraphics );
if ( pGrf )
pOutDev = pGrf->GetOutputDevice();
return pOutDev;
@@ -258,7 +258,7 @@ vcl::Font VCLUnoHelper::CreateFont( const css::awt::FontDescriptor& rDescr, cons
vcl::Font VCLUnoHelper::CreateFont( const css::uno::Reference< css::awt::XFont >& rxFont )
{
vcl::Font aFont;
- VCLXFont* pVCLXFont = VCLXFont::getImplementation( rxFont );
+ VCLXFont* pVCLXFont = comphelper::getUnoTunnelImplementation<VCLXFont>( rxFont );
if ( pVCLXFont )
aFont = pVCLXFont->GetFont();
return aFont;
diff --git a/xmloff/source/core/attrlist.cxx b/xmloff/source/core/attrlist.cxx
index 4d94dff3609f..c99086483d36 100644
--- a/xmloff/source/core/attrlist.cxx
+++ b/xmloff/source/core/attrlist.cxx
@@ -81,7 +81,7 @@ SvXMLAttributeList::SvXMLAttributeList( const uno::Reference<
{
SvXMLAttributeList* pImpl =
- SvXMLAttributeList::getImplementation( rAttrList );
+ comphelper::getUnoTunnelImplementation<SvXMLAttributeList>( rAttrList );
if( pImpl )
*m_pImpl = *(pImpl->m_pImpl);
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 7fac85974fd4..07e008af3e91 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -1066,7 +1066,7 @@ void SAL_CALL SvXMLImport::initialize( const uno::Sequence< uno::Any >& aArgumen
uno::Any aAny = mxImportInfo->getPropertyValue(sPropName);
aAny >>= xIfc;
- StyleMap *pSMap = StyleMap::getImplementation( xIfc );
+ StyleMap *pSMap = comphelper::getUnoTunnelImplementation<StyleMap>( xIfc );
if( pSMap )
{
mpStyleMap = pSMap;
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 80f8511499b3..e4c382a10a38 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -211,7 +211,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
{
// supplier must be SvNumberFormatsSupplierObj
SvNumberFormatsSupplierObj* pObj =
- SvNumberFormatsSupplierObj::getImplementation( rSupp );
+ comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( rSupp );
if (pObj)
pFormatter = pObj->GetNumberFormatter();
@@ -243,7 +243,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
{
// supplier must be SvNumberFormatsSupplierObj
SvNumberFormatsSupplierObj* pObj =
- SvNumberFormatsSupplierObj::getImplementation( rSupp );
+ comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( rSupp );
if (pObj)
pFormatter = pObj->GetNumberFormatter();
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index c621360c2fdf..5663983f35e7 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1615,7 +1615,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert( css::uno::Reference< css::util
{
SvNumberFormatter* pFormatter = nullptr;
SvNumberFormatsSupplierObj* pObj =
- SvNumberFormatsSupplierObj::getImplementation( xFormatsSupplier );
+ comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( xFormatsSupplier );
if (pObj)
pFormatter = pObj->GetNumberFormatter();
@@ -2257,7 +2257,7 @@ SvXMLNumFmtHelper::SvXMLNumFmtHelper(
SvNumberFormatter* pFormatter = nullptr;
SvNumberFormatsSupplierObj* pObj =
- SvNumberFormatsSupplierObj::getImplementation( rSupp );
+ comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>( rSupp );
if (pObj)
pFormatter = pObj->GetNumberFormatter();