summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/textuno.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-04-02 15:12:00 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-04-02 17:22:21 +0200
commit86d298f87f00fe70d31a65b7e98f9b17fa80cb6b (patch)
tree0b7a389105ead641d092e56ff6fb1d49180f6265 /sc/source/ui/unoobj/textuno.cxx
parent711ec7b6c71410b850cdf6d1411d054ca34ec5a0 (diff)
Simplify some static variable initializations
Change-Id: I6cdd44aa66b9597ccc51fc3fd69b57485ccb3230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113515 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/ui/unoobj/textuno.cxx')
-rw-r--r--sc/source/ui/unoobj/textuno.cxx28
1 files changed, 13 insertions, 15 deletions
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 8af20f45485b..18f40a764ce1 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -51,18 +51,16 @@ using namespace com::sun::star;
static const SvxItemPropertySet * lcl_GetHdFtPropertySet()
{
- static SfxItemPropertyMapEntry aHdFtPropertyMap_Impl[] =
- {
- SVX_UNOEDIT_CHAR_PROPERTIES,
- SVX_UNOEDIT_FONT_PROPERTIES,
- SVX_UNOEDIT_PARA_PROPERTIES,
- SVX_UNOEDIT_NUMBERING_PROPERTIE, // for completeness of service ParagraphProperties
- { u"", 0, css::uno::Type(), 0, 0 }
- };
- static bool bTwipsSet = false;
-
- if (!bTwipsSet)
- {
+ static const SvxItemPropertySet aHdFtPropertySet_Impl = [] {
+ SfxItemPropertyMapEntry aHdFtPropertyMap_Impl[] =
+ {
+ SVX_UNOEDIT_CHAR_PROPERTIES,
+ SVX_UNOEDIT_FONT_PROPERTIES,
+ SVX_UNOEDIT_PARA_PROPERTIES,
+ SVX_UNOEDIT_NUMBERING_PROPERTIE, // for completeness of service ParagraphProperties
+ { u"", 0, css::uno::Type(), 0, 0 }
+ };
+
// modify PropertyMap to include CONVERT_TWIPS flag for font height
// (headers/footers are in twips)
@@ -79,9 +77,9 @@ static const SvxItemPropertySet * lcl_GetHdFtPropertySet()
++pEntry;
}
- bTwipsSet = true;
- }
- static SvxItemPropertySet aHdFtPropertySet_Impl( aHdFtPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
+
+ return SvxItemPropertySet(aHdFtPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool());
+ }();
return &aHdFtPropertySet_Impl;
}