diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-14 09:47:38 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-15 06:08:01 +0200 |
commit | 6444b026b4039458d01ada5fee58eae98166585b (patch) | |
tree | e1c697dc90e22fb48609e3d59ea12d4e1f37c060 /package | |
parent | 21a9ec75777f97886aa92a2a8a7c5945a8d0746f (diff) |
Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 3 [API CHANGE]
- Replace all uses of OImplementationId in core with UnoIdInit
- Deprecate OImplementationId in <cppuhelper/typeprovider.hxx>
OImplementationId uses broken double checked locking; additionally,
it uses it at the first call to getImplementationId, not when the
object is constructed. This implementation can't be changed, cince
it's part of published API; it can't rely on C++11, which would be
required for use of thread-safe statics and move the initialization
to ctor.
The class has obsolete _bUseEthernetAddress member, that is unused
and ignored since 4e9fa7e339a1cd6cb2fec643715991bcf5057cec. No need
to implement it when replacing its uses to UnoIdInit.
The deprecation is the API CHANGE. No published API is introduced to
replace it; 3rd-party code should seek alternative solutions, or just
keep using the deprecated functionality.
TODO (in separate commits):
- Change implementations of getSomething to use getSomethingImpl
- Revise uses of getSomething to use getFromUnoTunnel
Change-Id: I8b6e684e5389bc0d5bb3b7f21f72a4c8f684107d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122077
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'package')
-rw-r--r-- | package/source/xstor/owriteablestream.cxx | 5 | ||||
-rw-r--r-- | package/source/xstor/xstorage.cxx | 5 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 5 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageFolder.cxx | 4 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageStream.cxx | 4 |
5 files changed, 12 insertions, 11 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index a049a47a8030..f821fd2494c8 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -42,6 +42,7 @@ #include <osl/diagnose.h> #include <comphelper/processfactory.hxx> +#include <comphelper/servicehelper.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/ofopxmlhelper.hxx> #include <comphelper/multicontainer2.hxx> @@ -1931,8 +1932,8 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() uno::Sequence< sal_Int8 > SAL_CALL OWriteStream::getImplementationId() { - static ::cppu::OImplementationId lcl_ImplId; - return lcl_ImplId.getImplementationId(); + static const comphelper::UnoIdInit lcl_ImplId; + return lcl_ImplId.getSeq(); } sal_Int32 SAL_CALL OWriteStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index e8153d4e79aa..27d84e97fa6f 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -54,6 +54,7 @@ #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/exc_hlp.hxx> +#include <comphelper/servicehelper.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/ofopxmlhelper.hxx> #include <comphelper/multicontainer2.hxx> @@ -2173,8 +2174,8 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes() uno::Sequence< sal_Int8 > SAL_CALL OStorage::getImplementationId() { - static ::cppu::OImplementationId lcl_ImplId; - return lcl_ImplId.getImplementationId(); + static const comphelper::UnoIdInit lcl_ImplId; + return lcl_ImplId.getSeq(); } // XStorage diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index a64413ae4e11..4b220862c0e3 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1676,9 +1676,8 @@ sal_Bool SAL_CALL ZipPackage::supportsService( OUString const & rServiceName ) Sequence< sal_Int8 > ZipPackage::getUnoTunnelId() { - static ::cppu::OImplementationId implId; - - return implId.getImplementationId(); + static const comphelper::UnoIdInit implId; + return implId.getSeq(); } sal_Int64 SAL_CALL ZipPackage::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index 8733fc5c6ac6..1c9207b1c09a 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -150,8 +150,8 @@ void ZipPackageFolder::setChildStreamsTypeByExtension( const beans::StringPair& css::uno::Sequence < sal_Int8 > ZipPackageFolder::getUnoTunnelId() { - static cppu::OImplementationId lcl_CachedImplId; - return lcl_CachedImplId.getImplementationId(); + static const comphelper::UnoIdInit lcl_CachedImplId; + return lcl_CachedImplId.getSeq(); } // XNameContainer diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 13c5758107a8..3facbb48addf 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -76,8 +76,8 @@ using namespace cppu; css::uno::Sequence < sal_Int8 > ZipPackageStream::getUnoTunnelId() { - static cppu::OImplementationId lcl_CachedImplId; - return lcl_CachedImplId.getImplementationId(); + static const comphelper::UnoIdInit lcl_CachedImplId; + return lcl_CachedImplId.getSeq(); } ZipPackageStream::ZipPackageStream ( ZipPackage & rNewPackage, |