summaryrefslogtreecommitdiffstats
path: root/desktop
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-04-06 21:40:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-07 20:09:58 +0200
commit86cadd43f002959d6cfcb7b3e4066076f6d05997 (patch)
tree45833a5083e69fe54d6298338245f27f16c17a69 /desktop
parentlok: add "MacroSecurityLevel" option (diff)
downloadcore-86cadd43f002959d6cfcb7b3e4066076f6d05997.tar.gz
core-86cadd43f002959d6cfcb7b3e4066076f6d05997.zip
rtl::Static -> function local static
Change-Id: Iee030633d2e2b020f38797d0d323680fa552b81a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113713 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx22
-rw-r--r--desktop/source/deployment/misc/dp_misc.cxx10
2 files changed, 12 insertions, 20 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 0d0f609cf013..a3c33f6d639d 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -79,19 +79,6 @@ namespace dp_gui {
#define SHARED_PACKAGE_MANAGER "shared"
#define BUNDLED_PACKAGE_MANAGER "bundled"
-namespace {
-
-struct StrAllFiles : public rtl::StaticWithInit< OUString, StrAllFiles >
-{
- OUString operator () () {
- const SolarMutexGuard guard;
- std::locale loc = Translate::Create("fps");
- return Translate::get(STR_FILTERNAME_ALL, loc);
- }
-};
-
-}
-
// ExtBoxWithBtns_Impl
class ExtBoxWithBtns_Impl : public ExtensionBox_Impl
{
@@ -662,8 +649,15 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker()
}
}
+ static const OUString StrAllFiles = []()
+ {
+ const SolarMutexGuard guard;
+ std::locale loc = Translate::Create("fps");
+ return Translate::get(STR_FILTERNAME_ALL, loc);
+ }();
+
// All files at top:
- xFilePicker->appendFilter( StrAllFiles::get(), "*.*" );
+ xFilePicker->appendFilter( StrAllFiles, "*.*" );
xFilePicker->appendFilter( DpResId(RID_STR_ALL_SUPPORTED), supportedFilters.makeStringAndClear() );
// then supported ones:
for (auto const& elem : title2filter)
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index aafa45e239e0..d24811621d72 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -70,11 +70,7 @@ struct UnoRc : public rtl::StaticWithInit<
}
};
-struct OfficePipeId : public rtl::StaticWithInit<OUString, OfficePipeId> {
- OUString operator () ();
-};
-
-OUString OfficePipeId::operator () ()
+OUString generateOfficePipeId()
{
OUString userPath;
::utl::Bootstrap::PathStatus aLocateResult =
@@ -113,7 +109,9 @@ OUString OfficePipeId::operator () ()
bool existsOfficePipe()
{
- OUString const & pipeId = OfficePipeId::get();
+ static OUString OfficePipeId = generateOfficePipeId();
+
+ OUString const & pipeId = OfficePipeId;
if (pipeId.isEmpty())
return false;
::osl::Security sec;