[Libreoffice-commits] core.git: forms/source
Arkadiy Illarionov (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jun 21 17:33:36 UTC 2019
forms/source/component/Columns.cxx | 4 ++--
forms/source/component/Columns.hxx | 2 +-
forms/source/component/Grid.cxx | 16 ++++------------
forms/source/component/Grid.hxx | 2 --
4 files changed, 7 insertions(+), 17 deletions(-)
New commits:
commit fbead41b7d6c0346ff3373279f9c01dc4c7e61fd
Author: Arkadiy Illarionov <qarkai at gmail.com>
AuthorDate: Fri Jun 21 00:43:56 2019 +0300
Commit: Arkadiy Illarionov <qarkai at gmail.com>
CommitDate: Fri Jun 21 19:32:06 2019 +0200
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 at gmail.com>
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;
More information about the Libreoffice-commits
mailing list