[Libreoffice-commits] core.git: vcl/inc vcl/source

Michael Stahl mstahl at redhat.com
Fri Sep 22 16:01:09 UTC 2017


 vcl/inc/svdata.hxx           |    3 +++
 vcl/source/app/svdata.cxx    |    1 +
 vcl/source/uitest/logger.cxx |   12 ++++++++++--
 3 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit aef3a494de14bf4dcea7c48b1218808e5497f00b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Sep 22 11:17:54 2017 +0200

    vcl: [loplugin:badstatics] aInstance
    
    Move this to struct ImplSVWinData, which is deleted on shutdown.
    
    Change-Id: Ie604c2105f1176858b4050fb34d37cf376f8f82a
    Reviewed-on: https://gerrit.libreoffice.org/42631
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index a1d6fbb5beb1..ad09439f60e1 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -84,6 +84,7 @@ class DockingManager;
 class VclEventListeners2;
 class SalData;
 class OpenGLContext;
+class UITestLogger;
 
 #define SV_ICON_ID_OFFICE                               1
 #define SV_ICON_ID_TEXT                                 2
@@ -216,6 +217,8 @@ struct ImplSVWinData
     StartAutoScrollFlags    mnAutoScrollFlags = StartAutoScrollFlags::NONE; // auto scroll flags
     bool                    mbNoDeactivate = false;         // true: do not execute Deactivate
     bool                    mbNoSaveFocus = false;          // true: menus must not save/restore focus
+
+    std::unique_ptr<UITestLogger> m_pUITestLogger;
 };
 
 typedef std::vector< std::pair< OUString, FieldUnit > > FieldUnitStringList;
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 57d536a5c90c..d5cc3fbac380 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -36,6 +36,7 @@
 #include <vcl/svapp.hxx>
 #include <vcl/virdev.hxx>
 #include <vcl/wrkwin.hxx>
+#include <vcl/uitest/logger.hxx>
 #include <scrwnd.hxx>
 #include <helpwin.hxx>
 #include <vcl/dialog.hxx>
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index 00cfe7ef03fd..a133c6910eb0 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -14,6 +14,7 @@
 #include <rtl/bootstrap.hxx>
 #include <osl/file.hxx>
 #include <vcl/uitest/uiobject.hxx>
+#include <svdata.hxx>
 
 #include <memory>
 
@@ -162,8 +163,15 @@ void UITestLogger::logKeyInput(VclPtr<vcl::Window> const & xUIElement, const Key
 
 UITestLogger& UITestLogger::getInstance()
 {
-    static UITestLogger aInstance;
-    return aInstance;
+    ImplSVData *const pSVData = ImplGetSVData();
+    assert(pSVData);
+
+    if (!pSVData->maWinData.m_pUITestLogger)
+    {
+        pSVData->maWinData.m_pUITestLogger.reset(new UITestLogger);
+    }
+
+    return *pSVData->maWinData.m_pUITestLogger;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list