summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-30 20:54:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-31 08:55:29 +0200
commita943936eeff04b60ebd0b2552bc18b42606f3321 (patch)
treee3a20ebf81feaa0914e9e5b9a0fe008e0ea61c2e /package
parent620f9649ae55e01700419876ce25ab4e45ed859f (diff)
rtl::Static -> static local
in a handful cases, like a map or a vector, we don't need init on demand at all, the default constructor can be laid out at compile time Change-Id: Ifa3188af7a65cd475ce0f603d15a8c26bcda7e6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119710 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/owriteablestream.cxx6
-rw-r--r--package/source/xstor/xstorage.cxx6
-rw-r--r--package/source/zippackage/ZipPackageFolder.cxx6
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx6
4 files changed, 8 insertions, 16 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 5dd673f29171..1b13d49c79db 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -48,7 +48,6 @@
#include <comphelper/sequence.hxx>
#include <rtl/digest.h>
-#include <rtl/instance.hxx>
#include <tools/diagnose_ex.h>
#include <PackageConstants.hxx>
@@ -1930,11 +1929,10 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes()
return m_pData->m_pTypeCollection->getTypes() ;
}
-namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; }
-
uno::Sequence< sal_Int8 > SAL_CALL OWriteStream::getImplementationId()
{
- return css::uno::Sequence<sal_Int8>();
+ static ::cppu::OImplementationId lcl_ImplId;
+ return lcl_ImplId.getImplementationId();
}
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 24849a6c9062..f7e86b4234ad 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -53,7 +53,6 @@
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/exc_hlp.hxx>
-#include <rtl/instance.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/ofopxmlhelper.hxx>
@@ -2174,11 +2173,10 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes()
return m_pData->m_pTypeCollection->getTypes() ;
}
-namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; }
-
uno::Sequence< sal_Int8 > SAL_CALL OStorage::getImplementationId()
{
- return css::uno::Sequence<sal_Int8>();
+ static ::cppu::OImplementationId lcl_ImplId;
+ return lcl_ImplId.getImplementationId();
}
// XStorage
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index 3e1deee05592..f3099c5b31f3 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -36,7 +36,6 @@
#include <rtl/digest.h>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <EncryptedDataHeader.hxx>
-#include <rtl/instance.hxx>
using namespace com::sun::star;
using namespace com::sun::star::packages::zip::ZipConstants;
@@ -54,8 +53,6 @@ using namespace cppu;
#define THROW_WHERE ""
#endif
-namespace { struct lcl_CachedImplId : public rtl::Static< cppu::OImplementationId, lcl_CachedImplId > {}; }
-
ZipPackageFolder::ZipPackageFolder( const css::uno::Reference < css::uno::XComponentContext >& xContext,
sal_Int32 nFormat,
bool bAllowRemoveOnInsert )
@@ -153,7 +150,8 @@ void ZipPackageFolder::setChildStreamsTypeByExtension( const beans::StringPair&
css::uno::Sequence < sal_Int8 > ZipPackageFolder::getUnoTunnelId()
{
- return lcl_CachedImplId::get().getImplementationId();
+ static cppu::OImplementationId lcl_CachedImplId;
+ return lcl_CachedImplId.getImplementationId();
}
// XNameContainer
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 19cc550a3e85..2077e2f9a77a 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -52,7 +52,6 @@
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
-#include <rtl/instance.hxx>
#include <rtl/random.h>
#include <sal/log.hxx>
#include <tools/diagnose_ex.h>
@@ -75,11 +74,10 @@ using namespace cppu;
#define THROW_WHERE ""
#endif
-namespace { struct lcl_CachedImplId : public rtl::Static< cppu::OImplementationId, lcl_CachedImplId > {}; }
-
css::uno::Sequence < sal_Int8 > ZipPackageStream::getUnoTunnelId()
{
- return lcl_CachedImplId::get().getImplementationId();
+ static cppu::OImplementationId lcl_CachedImplId;
+ return lcl_CachedImplId.getImplementationId();
}
ZipPackageStream::ZipPackageStream ( ZipPackage & rNewPackage,