summaryrefslogtreecommitdiff
path: root/sw/source/ui/dialog
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-22 13:11:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-22 13:34:17 +0100
commit0d653000a6c07327d6db1f95be3d21d50d505423 (patch)
tree31c38f67117af9f72664dbba170eb822fc4e1193 /sw/source/ui/dialog
parent7f91d6cceeeafb588f545be4c383e312d9e42bf7 (diff)
improve function-local statics in sw
Change-Id: I36b0e9b2819a442f01182f551dbc2bf7d5c878f4 Reviewed-on: https://gerrit.libreoffice.org/63788 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui/dialog')
-rw-r--r--sw/source/ui/dialog/swuiexp.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/sw/source/ui/dialog/swuiexp.cxx b/sw/source/ui/dialog/swuiexp.cxx
index ba351e57ced5..c016cc6189a4 100644
--- a/sw/source/ui/dialog/swuiexp.cxx
+++ b/sw/source/ui/dialog/swuiexp.cxx
@@ -52,12 +52,10 @@
namespace swui
{
- static SwAbstractDialogFactory_Impl* pFactory=nullptr;
- SwAbstractDialogFactory * GetFactory()
+ SwAbstractDialogFactory& GetFactory()
{
- if ( !pFactory )
- pFactory = new SwAbstractDialogFactory_Impl;
- return pFactory;
+ static SwAbstractDialogFactory_Impl aFactory;
+ return aFactory;
}
}
@@ -65,7 +63,7 @@ extern "C"
{
SAL_DLLPUBLIC_EXPORT SwAbstractDialogFactory* SwCreateDialogFactory()
{
- return ::swui::GetFactory();
+ return &::swui::GetFactory();
}
}