summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-06-21 00:43:56 +0300
committerArkadiy Illarionov <qarkai@gmail.com>2019-06-21 19:32:06 +0200
commitfbead41b7d6c0346ff3373279f9c01dc4c7e61fd (patch)
tree4d37870f6abad5e34b6b02c08ba4d176db3ae209 /forms
parentac246d6ea1bc43bfc82c9b4c69c9c0f1fd678129 (diff)
tdf#39593 Remove frm::OGridControlModel::getColumnImplementation
Replace with comphelper::getUnoTunnelImplementation. Change-Id: I3b662136778340a95216ac08035f7c25d5882349 Reviewed-on: https://gerrit.libreoffice.org/74472 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/Columns.cxx4
-rw-r--r--forms/source/component/Columns.hxx2
-rw-r--r--forms/source/component/Grid.cxx16
-rw-r--r--forms/source/component/Grid.hxx2
4 files changed, 7 insertions, 17 deletions
diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx
index 42de375a20b9..5fd625f3191c 100644
--- a/forms/source/component/Columns.cxx
+++ b/forms/source/component/Columns.cxx
@@ -115,7 +115,7 @@ namespace
class theOGridColumnImplementationId : public rtl::Static< UnoTunnelIdInit, theOGridColumnImplementationId > {};
}
-const Sequence<sal_Int8>& OGridColumn::getUnoTunnelImplementationId()
+const Sequence<sal_Int8>& OGridColumn::getUnoTunnelId()
{
return theOGridColumnImplementationId::get().getSeq();
}
@@ -126,7 +126,7 @@ sal_Int64 SAL_CALL OGridColumn::getSomething( const Sequence<sal_Int8>& _rIdenti
sal_Int64 nReturn(0);
if ( (_rIdentifier.getLength() == 16)
- && (0 == memcmp( getUnoTunnelImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 ))
+ && (0 == memcmp( getUnoTunnelId().getConstArray(), _rIdentifier.getConstArray(), 16 ))
)
{
nReturn = reinterpret_cast<sal_Int64>(this);
diff --git a/forms/source/component/Columns.hxx b/forms/source/component/Columns.hxx
index d98fdbd02e0e..2db0bfb2218a 100644
--- a/forms/source/component/Columns.hxx
+++ b/forms/source/component/Columns.hxx
@@ -70,7 +70,7 @@ public:
DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OGridColumn_BASE)
virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& _rType ) override;
- static const css::uno::Sequence<sal_Int8>& getUnoTunnelImplementationId();
+ static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence<sal_Int8>& _rIdentifier) override;
diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx
index ba3bfd222bf8..80294635082f 100644
--- a/forms/source/component/Grid.cxx
+++ b/forms/source/component/Grid.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/text/WritingMode2.hpp>
#include <comphelper/basicio.hxx>
#include <comphelper/property.hxx>
+#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <vcl/unohelp.hxx>
@@ -688,15 +689,6 @@ Any OGridControlModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const
return aReturn;
}
-OGridColumn* OGridControlModel::getColumnImplementation(const css::uno::Reference<css::uno::XInterface>& _rxIFace)
-{
- OGridColumn* pImplementation = nullptr;
- Reference< XUnoTunnel > xUnoTunnel( _rxIFace, UNO_QUERY );
- if ( xUnoTunnel.is() )
- pImplementation = reinterpret_cast<OGridColumn*>(xUnoTunnel->getSomething(OGridColumn::getUnoTunnelImplementationId()));
- return pImplementation;
-}
-
void OGridControlModel::gotColumn( const Reference< XInterface >& _rxColumn )
{
Reference< XSQLErrorBroadcaster > xBroadcaster( _rxColumn, UNO_QUERY );
@@ -753,7 +745,7 @@ ElementDescription* OGridControlModel::createElementMetaData( )
void OGridControlModel::approveNewElement( const Reference< XPropertySet >& _rxObject, ElementDescription* _pElement )
{
- OGridColumn* pCol = getColumnImplementation( _rxObject );
+ OGridColumn* pCol = comphelper::getUnoTunnelImplementation<OGridColumn>( _rxObject );
if ( !pCol )
throw IllegalArgumentException();
OInterfaceContainer::approveNewElement( _rxObject, _pElement );
@@ -777,7 +769,7 @@ void OGridControlModel::write(const Reference<XObjectOutputStream>& _rxOutStream
for (sal_Int32 i = 0; i < nLen; i++)
{
// first the service name for the underlying model
- OGridColumn* pCol = getColumnImplementation(m_aItems[i]);
+ OGridColumn* pCol = comphelper::getUnoTunnelImplementation<OGridColumn>(m_aItems[i]);
DBG_ASSERT(pCol != nullptr, "OGridControlModel::write : such items should never reach it into my container !");
_rxOutStream << pCol->getModelName();
// then the object itself
@@ -881,7 +873,7 @@ void OGridControlModel::read(const Reference<XObjectInputStream>& _rxInStream)
sal_Int32 nMark = xMark->createMark();
if (xCol.is())
{
- OGridColumn* pCol = getColumnImplementation(xCol);
+ OGridColumn* pCol = comphelper::getUnoTunnelImplementation<OGridColumn>(xCol);
pCol->read(_rxInStream);
}
xMark->jumpToMark(nMark);
diff --git a/forms/source/component/Grid.hxx b/forms/source/component/Grid.hxx
index 43c3d277d064..6afaeb171472 100644
--- a/forms/source/component/Grid.hxx
+++ b/forms/source/component/Grid.hxx
@@ -172,8 +172,6 @@ private:
css::uno::Reference< css::beans::XPropertySet> createColumnById(sal_Int32 nTypeId) const;
- static OGridColumn* getColumnImplementation(const css::uno::Reference<css::uno::XInterface>& _rxIFace);
-
virtual ElementDescription* createElementMetaData( ) override;
virtual void implRemoved(const css::uno::Reference<css::uno::XInterface>& _rxObject) override;