[Libreoffice-commits] core.git: connectivity/source include/connectivity
Arkadiy Illarionov (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 5 07:48:40 UTC 2019
connectivity/source/sdbcx/VCollection.cxx | 3 ++-
connectivity/source/sdbcx/VDescriptor.cxx | 16 ++++------------
include/connectivity/sdbcx/VDescriptor.hxx | 3 +--
3 files changed, 7 insertions(+), 15 deletions(-)
New commits:
commit f0390929d3e71ab434f9ce8d88c2dc2f4cc0ea6e
Author: Arkadiy Illarionov <qarkai at gmail.com>
AuthorDate: Sun Aug 4 15:55:12 2019 +0300
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Aug 5 09:48:03 2019 +0200
tdf#39593 Drop connectivity::sdbcx::ODescriptor::getImplementation
Replace with comphelper::getUnoTunnelImplementation.
Change-Id: Ia08561c11872a4ede9077863f81040633c30aebc
Reviewed-on: https://gerrit.libreoffice.org/76914
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx
index 7ccb08c4d21c..56060cb2ea9a 100644
--- a/connectivity/source/sdbcx/VCollection.cxx
+++ b/connectivity/source/sdbcx/VCollection.cxx
@@ -28,6 +28,7 @@
#include <comphelper/enumhelper.hxx>
#include <comphelper/types.hxx>
#include <comphelper/property.hxx>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <TConnection.hxx>
#include <rtl/ustrbuf.hxx>
@@ -373,7 +374,7 @@ void SAL_CALL OCollection::appendByDescriptor( const Reference< XPropertySet >&
if ( !xNewlyCreated.is() )
throw RuntimeException();
- ODescriptor* pDescriptor = ODescriptor::getImplementation( xNewlyCreated );
+ ODescriptor* pDescriptor = comphelper::getUnoTunnelImplementation<ODescriptor>( xNewlyCreated );
if ( pDescriptor )
pDescriptor->setNew( false );
diff --git a/connectivity/source/sdbcx/VDescriptor.cxx b/connectivity/source/sdbcx/VDescriptor.cxx
index 0be99ce8b164..cde97530a186 100644
--- a/connectivity/source/sdbcx/VDescriptor.cxx
+++ b/connectivity/source/sdbcx/VDescriptor.cxx
@@ -19,6 +19,7 @@
#include <connectivity/sdbcx/VDescriptor.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <comphelper/servicehelper.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -48,21 +49,12 @@ namespace connectivity
// css::lang::XUnoTunnel
sal_Int64 SAL_CALL ODescriptor::getSomething( const Sequence< sal_Int8 >& rId )
{
- return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
? reinterpret_cast< sal_Int64 >( this )
: 0;
}
- ODescriptor* ODescriptor::getImplementation( const Reference< XInterface >& _rxSomeComp )
- {
- Reference< XUnoTunnel > xTunnel( _rxSomeComp, UNO_QUERY );
- if ( xTunnel.is() )
- return reinterpret_cast< ODescriptor* >( xTunnel->getSomething( getUnoTunnelImplementationId() ) );
- return nullptr;
- }
-
-
namespace
{
struct ResetROAttribute
@@ -98,12 +90,12 @@ namespace connectivity
bool ODescriptor::isNew( const Reference< XInterface >& _rxDescriptor )
{
- ODescriptor* pImplementation = getImplementation( _rxDescriptor );
+ ODescriptor* pImplementation = comphelper::getUnoTunnelImplementation<ODescriptor>( _rxDescriptor );
return pImplementation && pImplementation->isNew();
}
- Sequence< sal_Int8 > ODescriptor::getUnoTunnelImplementationId()
+ Sequence< sal_Int8 > ODescriptor::getUnoTunnelId()
{
static ::cppu::OImplementationId implId;
diff --git a/include/connectivity/sdbcx/VDescriptor.hxx b/include/connectivity/sdbcx/VDescriptor.hxx
index b68689d16035..51737e190f0f 100644
--- a/include/connectivity/sdbcx/VDescriptor.hxx
+++ b/include/connectivity/sdbcx/VDescriptor.hxx
@@ -72,9 +72,8 @@ namespace connectivity
// css::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+ static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
- static ODescriptor* getImplementation( const css::uno::Reference< css::uno::XInterface >& _rxSomeComp );
// retrieves the ODescriptor implementation of a given UNO component, and returns its ->isNew flag
static bool isNew( const css::uno::Reference< css::uno::XInterface >& _rxDescriptor );
};
More information about the Libreoffice-commits
mailing list