include/tools/globname.hxx | 21 +++++++++++++++++---- tools/source/ref/globname.cxx | 11 ----------- 2 files changed, 17 insertions(+), 15 deletions(-)
New commits: commit 70153b7350fbd0c12a63e879a93a443672061044 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Mon Dec 11 17:47:43 2023 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Tue Dec 12 08:54:59 2023 +0100 Make some SvGlobalName ctors constexpr Change-Id: Idacca005723b995061dc1df06f98bd584cbfd675 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160606 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/include/tools/globname.hxx b/include/tools/globname.hxx index 50c3fc27b923..d72b6bf1ab51 100644 --- a/include/tools/globname.hxx +++ b/include/tools/globname.hxx @@ -35,17 +35,17 @@ class SvStream; class SAL_WARN_UNUSED TOOLS_DLLPUBLIC SvGlobalName { public: - SvGlobalName() = default; - SvGlobalName(const SvGlobalName& rObj) = default; + constexpr SvGlobalName() = default; + constexpr SvGlobalName(const SvGlobalName& rObj) = default; - SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, + inline constexpr SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11, sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 ); // create SvGlobalName from a platform independent representation SvGlobalName( const css::uno::Sequence< sal_Int8 >& aSeq ); - SvGlobalName( const SvGUID & rId ); + inline constexpr SvGlobalName( const SvGUID & rId ); SvGlobalName & operator = ( const SvGlobalName & rObj ) = default; @@ -72,6 +72,19 @@ private: SvGUID m_aData = {}; }; +inline constexpr SvGlobalName::SvGlobalName(const SvGUID& rId) + : m_aData(rId) +{ +} + +inline constexpr SvGlobalName::SvGlobalName(sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, + sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, + sal_uInt8 b11, sal_uInt8 b12, sal_uInt8 b13, + sal_uInt8 b14, sal_uInt8 b15) + : m_aData{ n1, n2, n3, { b8, b9, b10, b11, b12, b13, b14, b15 } } +{ +} + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx index df8ff10943ea..e5cee830df22 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -27,17 +27,6 @@ #include <tools/globname.hxx> // SvGlobalName ---------------------------------------------------------------- -SvGlobalName::SvGlobalName( const SvGUID & rId ) : - m_aData( rId ) -{ -} - -SvGlobalName::SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, - sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11, - sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 ) : - m_aData{ n1, n2, n3, { b8, b9, b10, b11, b12, b13, b14, b15 } } -{ -} SvGlobalName::SvGlobalName( const css::uno::Sequence < sal_Int8 >& aSeq ) {