summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-08-04 15:55:12 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-08-05 09:48:03 +0200
commitf0390929d3e71ab434f9ce8d88c2dc2f4cc0ea6e (patch)
tree7cfa32c4e5fe717930be117eb10a52a9f2eb0441
parent1b5c7007f4304c9816cf810aa6ca2f11ba8e295f (diff)
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@redhat.com>
-rw-r--r--connectivity/source/sdbcx/VCollection.cxx3
-rw-r--r--connectivity/source/sdbcx/VDescriptor.cxx16
-rw-r--r--include/connectivity/sdbcx/VDescriptor.hxx3
3 files changed, 7 insertions, 15 deletions
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 );
};