Skip to content

Commit

Permalink
tdf#39593 Drop ScDataPilotDescriptorBase::getImplementation
Browse files Browse the repository at this point in the history
Replace with comphelper::getUnoTunnelImplementation.

Change-Id: Ice068fcce262014a812a9e0a5d92b8bac173fa39
Reviewed-on: https://gerrit.libreoffice.org/79112
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
  • Loading branch information
qarkai committed Sep 20, 2019
1 parent 4b49aaf commit 4342aae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
3 changes: 1 addition & 2 deletions sc/inc/dapiuno.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ public:
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence<
sal_Int8 >& aIdentifier ) override;

static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
SC_DLLPUBLIC static ScDataPilotDescriptorBase* getImplementation(const css::uno::Reference<css::sheet::XDataPilotDescriptor>& rObj);
SC_DLLPUBLIC static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();

// XTypeProvider (override in ScDataPilotTableObj)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
Expand Down
2 changes: 1 addition & 1 deletion sc/source/filter/oox/pivottablebuffer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ void PivotTable::finalizeImport()
mxDPDescriptor->setTag( maDefModel.maTag );

// TODO: This is a hack. Eventually we need to convert the whole thing to the internal API.
ScDataPilotDescriptorBase* pImpl = ScDataPilotDescriptorBase::getImplementation(mxDPDescriptor);
auto pImpl = comphelper::getUnoTunnelImplementation<ScDataPilotDescriptorBase>(mxDPDescriptor);
if (!pImpl)
return;

Expand Down
11 changes: 1 addition & 10 deletions sc/source/ui/unoobj/dapiuno.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ void SAL_CALL ScDataPilotTablesObj::insertNewByName( const OUString& aNewName,
if (!pDocShell)
throw RuntimeException("DocShell is null", static_cast<cppu::OWeakObject*>(this));

ScDataPilotDescriptorBase* pImp = ScDataPilotDescriptorBase::getImplementation( xDescriptor );
auto pImp = comphelper::getUnoTunnelImplementation<ScDataPilotDescriptorBase>( xDescriptor );
if (!pImp)
throw RuntimeException("Failed to get ScDataPilotDescriptor", static_cast<cppu::OWeakObject*>(this));

Expand Down Expand Up @@ -1041,15 +1041,6 @@ const Sequence<sal_Int8>& ScDataPilotDescriptorBase::getUnoTunnelId()
return theScDataPilotDescriptorBaseUnoTunnelId::get().getSeq();
}

ScDataPilotDescriptorBase* ScDataPilotDescriptorBase::getImplementation(const Reference<XDataPilotDescriptor>& rObj )
{
ScDataPilotDescriptorBase* pRet = nullptr;
Reference<lang::XUnoTunnel> xUT(rObj, UNO_QUERY);
if (xUT.is())
pRet = reinterpret_cast<ScDataPilotDescriptorBase*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething(getUnoTunnelId())));
return pRet;
}

ScDataPilotTableObj::ScDataPilotTableObj(ScDocShell* pDocSh, SCTAB nT, const OUString& rN) :
ScDataPilotDescriptorBase( pDocSh ),
nTab( nT ),
Expand Down

0 comments on commit 4342aae

Please sign in to comment.