diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-21 11:46:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-21 12:28:23 +0100 |
commit | 48314f25241e014a634dd5371543b90137ffd2bc (patch) | |
tree | c55d6ef485fee3941bc1d3becb106d0dd77e7f2f /cui | |
parent | e41667762bfff43f95d1ee71b2d67903e4fdab4e (diff) |
improve function-local statics in basic..cui
Change-Id: If737e8478f6f1c8fffb060ce132d80e0f07ef8ee
Reviewed-on: https://gerrit.libreoffice.org/63701
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/numpages.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 07b1c912bf7b..df31d118ae28 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -156,17 +156,16 @@ static bool lcl_IsNumFmtSet(SvxNumRule const * pNum, sal_uInt16 nLevelMask) static const vcl::Font& lcl_GetDefaultBulletFont() { - static bool bInit = false; - static vcl::Font aDefBulletFont("OpenSymbol", "", Size(0, 14)); - if(!bInit) - { - aDefBulletFont.SetCharSet( RTL_TEXTENCODING_SYMBOL ); - aDefBulletFont.SetFamily( FAMILY_DONTKNOW ); - aDefBulletFont.SetPitch( PITCH_DONTKNOW ); - aDefBulletFont.SetWeight( WEIGHT_DONTKNOW ); - aDefBulletFont.SetTransparent( true ); - bInit = true; - } + static vcl::Font aDefBulletFont = [&]() + { + vcl::Font tmp("OpenSymbol", "", Size(0, 14)); + tmp.SetCharSet( RTL_TEXTENCODING_SYMBOL ); + tmp.SetFamily( FAMILY_DONTKNOW ); + tmp.SetPitch( PITCH_DONTKNOW ); + tmp.SetWeight( WEIGHT_DONTKNOW ); + tmp.SetTransparent( true ); + return tmp; + }(); return aDefBulletFont; } |