summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-06-18 01:12:00 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-06-18 13:21:01 +0200
commite062d42f587ad758ecfc42967bf257a9e2e37a3d (patch)
treec9f73f0dc4863cbedb427c7bd9e593f96e2a0f2e /sc/source/ui
parent086c186209e33faa38403c1d9122fd2e90921b3a (diff)
tdf#39593 Remove ScModelObj::getImplementation
Replace with comphelper::getUnoTunnelImplementation. Change-Id: I06a8db37b5c5c38c52a15a76e6e2df3b431a2040 Reviewed-on: https://gerrit.libreoffice.org/74237 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/docshell/docsh.cxx2
-rw-r--r--sc/source/ui/docshell/docsh4.cxx2
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx2
-rw-r--r--sc/source/ui/inc/docsh.hxx3
-rw-r--r--sc/source/ui/unoobj/docuno.cxx13
-rw-r--r--sc/source/ui/view/tabview.cxx4
-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/viewfun3.cxx2
-rw-r--r--sc/source/ui/view/viewfun7.cxx4
10 files changed, 14 insertions, 22 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 48b0532f73a7..9f9741db2add 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -800,7 +800,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
// check if shared flag is set in shared file
bool bShared = false;
- ScModelObj* pDocObj = ScModelObj::getImplementation( xModel );
+ ScModelObj* pDocObj = comphelper::getUnoTunnelImplementation<ScModelObj>( xModel );
ScDocShell* pSharedDocShell = ( pDocObj ? dynamic_cast< ScDocShell* >( pDocObj->GetObjectShell() ) : nullptr );
if ( pSharedDocShell )
{
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index e2d14daf4220..c036b3ea496b 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1017,7 +1017,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
// check if shared flag is set in shared file
bool bShared = false;
- ScModelObj* pDocObj = ScModelObj::getImplementation( xModel );
+ ScModelObj* pDocObj = comphelper::getUnoTunnelImplementation<ScModelObj>( xModel );
if ( pDocObj )
{
ScDocShell* pDocShell = dynamic_cast< ScDocShell* >( pDocObj->GetEmbeddedObject() );
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 99ce6a6d12c9..a29abd774958 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -512,7 +512,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
if ( bCopy && pDocument && pPage )
{
ScDocShell* pDocShell = rViewData.GetDocShell();
- ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : nullptr );
+ ScModelObj* pModelObj = ( pDocShell ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocShell->GetModel() ) : nullptr );
if ( pModelObj )
{
SCTAB nTab = rViewData.GetTabNo();
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 1a339d3d9552..375d84378eb9 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -25,6 +25,7 @@
#include <sfx2/sfxmodelfactory.hxx>
#include <sfx2/viewsh.hxx>
#include <o3tl/deleter.hxx>
+#include <comphelper/servicehelper.hxx>
#include <scdllapi.h>
#include <document.hxx>
@@ -467,7 +468,7 @@ namespace HelperNotifyChanges
{
inline ScModelObj* getMustPropagateChangesModel(const ScDocShell &rDocShell)
{
- ScModelObj* pModelObj = ScModelObj::getImplementation(rDocShell.GetModel());
+ ScModelObj* pModelObj = comphelper::getUnoTunnelImplementation<ScModelObj>(rDocShell.GetModel());
if (pModelObj && pModelObj->HasChangesListeners())
return pModelObj;
return nullptr;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 4ceb2c03f711..56ace0ee0a74 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1539,7 +1539,7 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
}
}
}
- else if ( ScModelObj::getImplementation( xInterface ) == this )
+ else if ( comphelper::getUnoTunnelImplementation<ScModelObj>( xInterface ) == this )
{
// render the whole document
// -> no selection, all sheets
@@ -2925,15 +2925,6 @@ const uno::Sequence<sal_Int8>& ScModelObj::getUnoTunnelId()
return theScModelObjUnoTunnelId::get().getSeq();
}
-ScModelObj* ScModelObj::getImplementation(const uno::Reference<uno::XInterface>& rObj)
-{
- ScModelObj* pRet = nullptr;
- uno::Reference<lang::XUnoTunnel> xUT(rObj, uno::UNO_QUERY);
- if (xUT.is())
- pRet = reinterpret_cast<ScModelObj*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId())));
- return pRet;
-}
-
// XChangesNotifier
void ScModelObj::addChangesListener( const uno::Reference< util::XChangesListener >& aListener )
@@ -3595,7 +3586,7 @@ sal_Int32 ScTableSheetsObj::importSheet(
// Source document docShell
if ( !xDocSrc.is() )
throw uno::RuntimeException();
- ScModelObj* pObj = ScModelObj::getImplementation(xDocSrc);
+ ScModelObj* pObj = comphelper::getUnoTunnelImplementation<ScModelObj>(xDocSrc);
ScDocShell* pDocShellSrc = static_cast<ScDocShell*>(pObj->GetEmbeddedObject());
// SourceSheet Position and does srcName exists ?
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index b13234bd2adb..0a3c0c3d8893 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2546,7 +2546,7 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle)
if (nEndRow > aViewData.GetMaxTiledRow() - nVisibleRows)
{
ScDocShell* pDocSh = aViewData.GetDocShell();
- ScModelObj* pModelObj = pDocSh ? ScModelObj::getImplementation( pDocSh->GetModel() ) : nullptr;
+ ScModelObj* pModelObj = pDocSh ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocSh->GetModel() ) : nullptr;
Size aOldSize(0, 0);
if (pModelObj)
aOldSize = pModelObj->getDocumentSize();
@@ -2688,7 +2688,7 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle)
if (nEndCol > aViewData.GetMaxTiledCol() - nVisibleCols)
{
ScDocShell* pDocSh = aViewData.GetDocShell();
- ScModelObj* pModelObj = pDocSh ? ScModelObj::getImplementation( pDocSh->GetModel() ) : nullptr;
+ ScModelObj* pModelObj = pDocSh ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocSh->GetModel() ) : nullptr;
Size aOldSize(0, 0);
if (pModelObj)
aOldSize = pModelObj->getDocumentSize();
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 03f1067638a2..adfa1230ec5c 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -389,7 +389,7 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
if (nPosX > aViewData.GetMaxTiledCol() - 10 || nPosY > aViewData.GetMaxTiledRow() - 25)
{
ScDocShell* pDocSh = aViewData.GetDocShell();
- ScModelObj* pModelObj = pDocSh ? ScModelObj::getImplementation( pDocSh->GetModel() ) : nullptr;
+ ScModelObj* pModelObj = pDocSh ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocSh->GetModel() ) : nullptr;
Size aOldSize(0, 0);
if (pModelObj)
aOldSize = pModelObj->getDocumentSize();
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index fcf4e9b91f43..7ab18e937d02 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -323,7 +323,7 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
if (comphelper::LibreOfficeKit::isActive())
{
ScDocShell* pDocSh = GetViewData().GetDocShell();
- ScModelObj* pModelObj = pDocSh ? ScModelObj::getImplementation( pDocSh->GetModel()) : nullptr;
+ ScModelObj* pModelObj = pDocSh ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocSh->GetModel()) : nullptr;
if (pModelObj)
{
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 46bb690d19b8..b2911cabcc9e 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1441,7 +1441,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
if ( nFlags & InsertDeleteFlags::OBJECTS )
{
- ScModelObj* pModelObj = ScModelObj::getImplementation( pDocSh->GetModel() );
+ ScModelObj* pModelObj = comphelper::getUnoTunnelImplementation<ScModelObj>( pDocSh->GetModel() );
if ( pPage && pModelObj )
{
bool bSameDoc = ( rClipParam.getSourceDocID() == pDoc->GetDocumentID() );
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 3466beca42d1..b128516379ff 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -182,7 +182,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
ScDocument* pDocument = GetViewData().GetDocument();
ScDocShell* pDocShell = GetViewData().GetDocShell();
- ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : nullptr );
+ ScModelObj* pModelObj = ( pDocShell ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocShell->GetModel() ) : nullptr );
if ( pDocument && pDestPage && pModelObj && pDrawTrans )
{
const ScRangeListVector& rProtectedChartRangesVector( pDrawTrans->GetProtectedChartRangesVector() );
@@ -251,7 +251,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
ScDocument* pDocument = GetViewData().GetDocument();
ScDocShell* pDocShell = GetViewData().GetDocShell();
- ScModelObj* pModelObj = ( pDocShell ? ScModelObj::getImplementation( pDocShell->GetModel() ) : nullptr );
+ ScModelObj* pModelObj = ( pDocShell ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocShell->GetModel() ) : nullptr );
const ScDrawTransferObj* pTransferObj = ScDrawTransferObj::GetOwnClipboard(ScTabViewShell::GetClipData(GetViewData().GetActiveWin()));
if ( pDocument && pPage && pModelObj && ( pTransferObj || pDrawTrans ) )
{