diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-09-06 00:50:24 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-09-06 11:55:50 +0200 |
commit | f599c31fe68882f510cf3d101102e71f9bf795c8 (patch) | |
tree | ced0a58620c5aea8420638847192f298d139297b /dbaccess | |
parent | 8811516e2e9e71dd45198081d26c748cdf4d831a (diff) |
tdf#39593 use isUnoTunnelId
Adapt getUnoTunnelId methods where required: rename or make public.
Change-Id: I0fd2120bf9f0ff1aa690329a65ff64a154c89315
Reviewed-on: https://gerrit.libreoffice.org/78680
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/RowSet.cxx | 13 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSet.hxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/api/TableDeco.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/core/api/table.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/ContentHelper.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/databasecontext.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/databasedocument.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/inc/TableDeco.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/inc/databasecontext.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/inc/table.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/JoinExchange.hxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/JoinExchange.cxx | 7 |
12 files changed, 29 insertions, 24 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index c2cf6e568ac4..334afad81836 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -59,6 +59,7 @@ #include <comphelper/property.hxx> #include <comphelper/seqstream.hxx> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> #include <comphelper/types.hxx> #include <comphelper/uno3.hxx> #include <connectivity/BlobHelper.hxx> @@ -443,13 +444,13 @@ void SAL_CALL ORowSet::release() throw() // css::XUnoTunnel sal_Int64 SAL_CALL ORowSet::getSomething( const Sequence< sal_Int8 >& rId ) { - if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) + if (isUnoTunnelId<ORowSet>(rId)) return reinterpret_cast<sal_Int64>(this); return 0; } -Sequence< sal_Int8 > ORowSet::getUnoTunnelImplementationId() +Sequence< sal_Int8 > ORowSet::getUnoTunnelId() { static ::cppu::OImplementationId s_Id; @@ -2146,7 +2147,7 @@ void ORowSet::notifyRowSetAndClonesRowDelete( const Any& _rBookmark ) Reference< XUnoTunnel > xTunnel(elem.get(),UNO_QUERY); if(xTunnel.is()) { - ORowSetClone* pClone = reinterpret_cast<ORowSetClone*>(xTunnel->getSomething(ORowSetClone::getUnoTunnelImplementationId())); + ORowSetClone* pClone = reinterpret_cast<ORowSetClone*>(xTunnel->getSomething(ORowSetClone::getUnoTunnelId())); if(pClone) pClone->onDeleteRow( _rBookmark ); } @@ -2163,7 +2164,7 @@ void ORowSet::notifyRowSetAndClonesRowDeleted( const Any& _rBookmark, sal_Int32 Reference< XUnoTunnel > xTunnel(clone.get(),UNO_QUERY); if(xTunnel.is()) { - ORowSetClone* pClone = reinterpret_cast<ORowSetClone*>(xTunnel->getSomething(ORowSetClone::getUnoTunnelImplementationId())); + ORowSetClone* pClone = reinterpret_cast<ORowSetClone*>(xTunnel->getSomething(ORowSetClone::getUnoTunnelId())); if(pClone) pClone->onDeletedRow( _rBookmark, _nPos ); } @@ -2909,7 +2910,7 @@ void ORowSetClone::close() return *::comphelper::OPropertyArrayUsageHelper<ORowSetClone>::getArrayHelper(); } -Sequence< sal_Int8 > ORowSetClone::getUnoTunnelImplementationId() +Sequence< sal_Int8 > ORowSetClone::getUnoTunnelId() { static ::cppu::OImplementationId implId; @@ -2919,7 +2920,7 @@ Sequence< sal_Int8 > ORowSetClone::getUnoTunnelImplementationId() // css::XUnoTunnel sal_Int64 SAL_CALL ORowSetClone::getSomething( const Sequence< sal_Int8 >& rId ) { - if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) + if (isUnoTunnelId<ORowSetClone>(rId)) return reinterpret_cast<sal_Int64>(this); return 0; diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index 74d54cd409f9..a0c7b6fca6d5 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -259,7 +259,7 @@ namespace dbaccess // 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(); // css::uno::XAggregation virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override; @@ -491,7 +491,7 @@ namespace dbaccess // 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(); // OComponentHelper virtual void SAL_CALL disposing() override; diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index 6b632e135e12..c2c99f269e91 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -29,6 +29,7 @@ #include <cppuhelper/typeprovider.hxx> #include <comphelper/property.hxx> +#include <comphelper/servicehelper.hxx> #include <comphelper/types.hxx> #include <com/sun/star/util/XRefreshListener.hpp> #include <com/sun/star/sdbc/SQLException.hpp> @@ -452,7 +453,7 @@ OUString SAL_CALL ODBTableDecorator::getName() sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >& rId ) { - if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) + if (isUnoTunnelId<ODBTableDecorator>(rId)) return reinterpret_cast<sal_Int64>(this); sal_Int64 nRet = 0; @@ -462,7 +463,7 @@ sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >& return nRet; } -Sequence< sal_Int8 > ODBTableDecorator::getUnoTunnelImplementationId() +Sequence< sal_Int8 > ODBTableDecorator::getUnoTunnelId() { static ::cppu::OImplementationId implId; diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx index ea0055404d64..3007b03c9fc1 100644 --- a/dbaccess/source/core/api/table.cxx +++ b/dbaccess/source/core/api/table.cxx @@ -28,6 +28,7 @@ #include <osl/diagnose.h> #include <cppuhelper/typeprovider.hxx> +#include <comphelper/servicehelper.hxx> #include <comphelper/types.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/util/XRefreshListener.hpp> @@ -306,7 +307,7 @@ void SAL_CALL ODBTable::alterColumnByName( const OUString& _rName, const Referen sal_Int64 SAL_CALL ODBTable::getSomething( const Sequence< sal_Int8 >& rId ) { sal_Int64 nRet(0); - if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) + if (isUnoTunnelId<ODBTable>(rId)) nRet = reinterpret_cast<sal_Int64>(this); else nRet = OTable_Base::getSomething(rId); @@ -314,7 +315,7 @@ sal_Int64 SAL_CALL ODBTable::getSomething( const Sequence< sal_Int8 >& rId ) return nRet; } -Sequence< sal_Int8 > ODBTable::getUnoTunnelImplementationId() +Sequence< sal_Int8 > ODBTable::getUnoTunnelId() { static ::cppu::OImplementationId s_Id; diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index b8e7502247f6..7737ac0b2825 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -32,6 +32,7 @@ #include <ucbhelper/contentidentifier.hxx> #include "myucp_resultset.hxx" #include <com/sun/star/container/XNameContainer.hpp> +#include <comphelper/servicehelper.hxx> #include <sdbcoretools.hxx> #include <stringconstants.hxx> @@ -541,7 +542,7 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent // css::lang::XUnoTunnel sal_Int64 OContentHelper::getSomething( const Sequence< sal_Int8 > & rId ) { - if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) + if (isUnoTunnelId<OContentHelper>(rId)) return reinterpret_cast<sal_Int64>(this); return 0; diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index 6e9a38da6552..c37994d7c0ba 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -54,6 +54,7 @@ #include <comphelper/enumhelper.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> @@ -731,13 +732,13 @@ void ODatabaseContext::databaseDocumentURLChange( const OUString& _rOldURL, cons sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& rId ) { - if (rId.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) ) + if (isUnoTunnelId<ODatabaseContext>(rId)) return reinterpret_cast<sal_Int64>(this); return 0; } -Sequence< sal_Int8 > ODatabaseContext::getUnoTunnelImplementationId() +Sequence< sal_Int8 > ODatabaseContext::getUnoTunnelId() { static ::cppu::OImplementationId implId; diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index f1f5b8a1b881..30ffe0cfadda 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -2205,7 +2205,7 @@ com_sun_star_comp_dba_ODatabaseDocument(css::uno::XComponentContext* context, Reference<XUnoTunnel> xDBContextTunnel(DatabaseContext::create(context), UNO_QUERY_THROW); dbaccess::ODatabaseContext* pContext = reinterpret_cast<dbaccess::ODatabaseContext*>( xDBContextTunnel->getSomething( - dbaccess::ODatabaseContext::getUnoTunnelImplementationId())); + dbaccess::ODatabaseContext::getUnoTunnelId())); rtl::Reference pImpl( new dbaccess::ODatabaseModelImpl(context, *pContext)); diff --git a/dbaccess/source/core/inc/TableDeco.hxx b/dbaccess/source/core/inc/TableDeco.hxx index 52d6fb05e0bb..cd1bb3161c20 100644 --- a/dbaccess/source/core/inc/TableDeco.hxx +++ b/dbaccess/source/core/inc/TableDeco.hxx @@ -147,7 +147,7 @@ namespace dbaccess virtual void SAL_CALL setName( const OUString& aName ) override; // 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(); // XColumnsSupplier virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override; diff --git a/dbaccess/source/core/inc/databasecontext.hxx b/dbaccess/source/core/inc/databasecontext.hxx index c69c35084e47..19c59a953f9d 100644 --- a/dbaccess/source/core/inc/databasecontext.hxx +++ b/dbaccess/source/core/inc/databasecontext.hxx @@ -167,7 +167,7 @@ public: // 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(); void registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl); void revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl); diff --git a/dbaccess/source/core/inc/table.hxx b/dbaccess/source/core/inc/table.hxx index 0b4b284558df..883849c90156 100644 --- a/dbaccess/source/core/inc/table.hxx +++ b/dbaccess/source/core/inc/table.hxx @@ -124,7 +124,7 @@ namespace dbaccess //XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); + static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); // css::lang::XServiceInfo DECLARE_SERVICE_INFO(); diff --git a/dbaccess/source/ui/inc/JoinExchange.hxx b/dbaccess/source/ui/inc/JoinExchange.hxx index 0d750a444e81..72aa0d1de73e 100644 --- a/dbaccess/source/ui/inc/JoinExchange.hxx +++ b/dbaccess/source/ui/inc/JoinExchange.hxx @@ -50,6 +50,7 @@ namespace dbaui virtual void SAL_CALL release( ) throw() override; // XUnoTunnel + static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& _rIdentifier ) override; void StartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions, IDragTransferableListener* _pListener ); @@ -62,8 +63,6 @@ namespace dbaui virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; virtual void DragFinished( sal_Int8 nDropAction ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); - using TransferableHelper::StartDrag; }; } diff --git a/dbaccess/source/ui/querydesign/JoinExchange.cxx b/dbaccess/source/ui/querydesign/JoinExchange.cxx index 036943fac4df..3ee2e4d34b1f 100644 --- a/dbaccess/source/ui/querydesign/JoinExchange.cxx +++ b/dbaccess/source/ui/querydesign/JoinExchange.cxx @@ -19,6 +19,7 @@ #include <JoinExchange.hxx> #include <sot/formats.hxx> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/typeprovider.hxx> namespace dbaui @@ -70,14 +71,14 @@ namespace dbaui Reference< XUnoTunnel > xTunnel(_rxObject, UNO_QUERY); if (xTunnel.is()) { - OJoinExchObj* pImplementation = reinterpret_cast<OJoinExchObj*>(xTunnel->getSomething(getUnoTunnelImplementationId())); + OJoinExchObj* pImplementation = reinterpret_cast<OJoinExchObj*>(xTunnel->getSomething(getUnoTunnelId())); if (pImplementation) aReturn = pImplementation->m_jxdSourceDescription; } return aReturn; } - Sequence< sal_Int8 > OJoinExchObj::getUnoTunnelImplementationId() + Sequence< sal_Int8 > OJoinExchObj::getUnoTunnelId() { static ::cppu::OImplementationId implId; @@ -86,7 +87,7 @@ namespace dbaui sal_Int64 SAL_CALL OJoinExchObj::getSomething( const Sequence< sal_Int8 >& _rIdentifier ) { - if (_rIdentifier.getLength() == 16 && 0 == memcmp(getUnoTunnelImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 ) ) + if (isUnoTunnelId<OJoinExchObj>(_rIdentifier)) return reinterpret_cast<sal_Int64>(this); return 0; |