diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-27 12:30:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-27 15:32:55 +0200 |
commit | 627a9982f25b22520537592e9c7a566e0d9c950a (patch) | |
tree | 3e2e0628d23f68d6dd17f70360acf5f5910c979e | |
parent | 91fac2a32c1c6b784bd33cf664ea64a734b1c776 (diff) |
cid#705053 Dereference after null check
re-arrange the code to help coverity out
Change-Id: Iddc9284cbdcbaae7a0dc17e62d0e8f4b4832297c
-rw-r--r-- | include/vcl/svapp.hxx | 2 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 68dd3c7eebde..7f9dc50c9679 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1546,7 +1546,7 @@ public: private: - static void InitSettings(); + static void InitSettings(ImplSVData* pSVData); DECL_STATIC_LINK( Application, PostEventHandler, void* ); }; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index fd0077eab3b1..0355ec08fac9 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -517,7 +517,7 @@ void Application::SetSettings( const AllSettings& rSettings ) ImplSVData* pSVData = ImplGetSVData(); if ( !pSVData->maAppData.mpSettings ) { - InitSettings(); + InitSettings(pSVData); *pSVData->maAppData.mpSettings = rSettings; ResMgr::SetDefaultLocale( rSettings.GetUILanguageTag() ); } @@ -616,16 +616,14 @@ const AllSettings& Application::GetSettings() ImplSVData* pSVData = ImplGetSVData(); if ( !pSVData->maAppData.mpSettings ) { - InitSettings(); + InitSettings(pSVData); } return *(pSVData->maAppData.mpSettings); } -void Application::InitSettings() +void Application::InitSettings(ImplSVData* pSVData) { - ImplSVData* pSVData = ImplGetSVData(); - assert(!pSVData->maAppData.mpSettings && "initialization should not happen twice!"); pSVData->maAppData.mpCfgListener = new LocaleConfigurationListener; |