diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-09-22 18:20:39 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-09-23 15:47:12 +0200 |
commit | 1d398fb983d8f8b53a78e7c47b588fc1f1e7f748 (patch) | |
tree | 89e11384ea13d73b3c1dc198c5fee8675036abbe /dbaccess | |
parent | cd6780aae1392d4c1af0b15b311a4966834a9602 (diff) |
tdf#39593 use getUnoTunnelImplementation
Change-Id: I78eb67913a568c610e38e5002f914773c4906dfd
Reviewed-on: https://gerrit.libreoffice.org/79350
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/RowSet.cxx | 20 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/DExport.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinExchange.cxx | 10 |
4 files changed, 11 insertions, 25 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 99c6e56edc0c..2130d6b4acf4 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -2144,13 +2144,9 @@ void ORowSet::notifyRowSetAndClonesRowDelete( const Any& _rBookmark ) // notify the clones for (auto const& elem : m_aClones) { - Reference< XUnoTunnel > xTunnel(elem.get(),UNO_QUERY); - if(xTunnel.is()) - { - ORowSetClone* pClone = reinterpret_cast<ORowSetClone*>(xTunnel->getSomething(ORowSetClone::getUnoTunnelId())); - if(pClone) - pClone->onDeleteRow( _rBookmark ); - } + auto pClone = comphelper::getUnoTunnelImplementation<ORowSetClone>(elem.get()); + if(pClone) + pClone->onDeleteRow( _rBookmark ); } } @@ -2161,13 +2157,9 @@ void ORowSet::notifyRowSetAndClonesRowDeleted( const Any& _rBookmark, sal_Int32 // notify the clones for (auto const& clone : m_aClones) { - Reference< XUnoTunnel > xTunnel(clone.get(),UNO_QUERY); - if(xTunnel.is()) - { - ORowSetClone* pClone = reinterpret_cast<ORowSetClone*>(xTunnel->getSomething(ORowSetClone::getUnoTunnelId())); - if(pClone) - pClone->onDeletedRow( _rBookmark, _nPos ); - } + auto pClone = comphelper::getUnoTunnelImplementation<ORowSetClone>(clone.get()); + if(pClone) + pClone->onDeletedRow( _rBookmark, _nPos ); } } diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index 78117ef9f348..e64ab80b8293 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -786,8 +786,7 @@ void ODatabaseExport::ensureFormatter() if ( !m_pFormatter ) { Reference< XNumberFormatsSupplier > xSupplier = m_xFormatter->getNumberFormatsSupplier(); - Reference< XUnoTunnel > xTunnel(xSupplier,UNO_QUERY); - SvNumberFormatsSupplierObj* pSupplierImpl = reinterpret_cast<SvNumberFormatsSupplierObj*>(xTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId())); + auto pSupplierImpl = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>(xSupplier); m_pFormatter = pSupplierImpl ? pSupplierImpl->GetNumberFormatter() : nullptr; Reference<XPropertySet> xNumberFormatSettings = xSupplier->getNumberFormatSettings(); xNumberFormatSettings->getPropertyValue("NullDate") >>= m_aNullDate; diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 31decd181fe3..417b42eb7aa1 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1080,8 +1080,7 @@ void setEvalDateFormatForFormatter(Reference< css::util::XNumberFormatter > cons { Reference< css::util::XNumberFormatsSupplier > xSupplier = _rxFormatter->getNumberFormatsSupplier(); - Reference< XUnoTunnel > xTunnel(xSupplier,UNO_QUERY); - SvNumberFormatsSupplierObj* pSupplierImpl = reinterpret_cast<SvNumberFormatsSupplierObj*>(xTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId())); + auto pSupplierImpl = comphelper::getUnoTunnelImplementation<SvNumberFormatsSupplierObj>(xSupplier); OSL_ENSURE(pSupplierImpl,"No Supplier!"); if ( pSupplierImpl ) diff --git a/dbaccess/source/ui/querydesign/JoinExchange.cxx b/dbaccess/source/ui/querydesign/JoinExchange.cxx index a22ec381f6ab..9681fdf03710 100644 --- a/dbaccess/source/ui/querydesign/JoinExchange.cxx +++ b/dbaccess/source/ui/querydesign/JoinExchange.cxx @@ -68,13 +68,9 @@ namespace dbaui OJoinExchangeData OJoinExchObj::GetSourceDescription(const Reference< XTransferable >& _rxObject) { OJoinExchangeData aReturn; - Reference< XUnoTunnel > xTunnel(_rxObject, UNO_QUERY); - if (xTunnel.is()) - { - OJoinExchObj* pImplementation = reinterpret_cast<OJoinExchObj*>(xTunnel->getSomething(getUnoTunnelId())); - if (pImplementation) - aReturn = pImplementation->m_jxdSourceDescription; - } + auto pImplementation = comphelper::getUnoTunnelImplementation<OJoinExchObj>(_rxObject); + if (pImplementation) + aReturn = pImplementation->m_jxdSourceDescription; return aReturn; } |