diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-06-30 12:53:40 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-06-30 12:53:40 +0200 |
commit | 2ea01fb9002c4aceba724cabad663d6026381c0c (patch) | |
tree | 1ca7b124986a0f027190cf504b2929fcd91d3b8d /vcl/unx/gtk/a11y | |
parent | dc93e3330e143113df6cf74861315c15a80324b5 (diff) |
loplugin:badstatics: further (Linux-only) static only found with libc++
Change-Id: I048212e3feb3f548d5a65940dd71ccb71cade778
Diffstat (limited to 'vcl/unx/gtk/a11y')
-rw-r--r-- | vcl/unx/gtk/a11y/atkutil.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index d722936bf755..79d8013af7d4 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -44,6 +44,7 @@ #include <gtk/gtk.h> #include <config_version.h> +#include <cassert> #include <set> using namespace ::com::sun::star; @@ -483,7 +484,19 @@ static void handle_toolbox_buttonchange(VclWindowEvent const *pEvent) /*****************************************************************************/ -static std::set< VclPtr<vcl::Window> > g_aWindowList; +namespace { + +struct WindowList { + ~WindowList() { assert(list.empty()); }; + // needs to be empty already on DeInitVCL, but at least check it's empty + // on exit + + std::set< VclPtr<vcl::Window> > list; +}; + +WindowList g_aWindowList; + +} static void handle_get_focus(::VclWindowEvent const * pEvent) { @@ -534,9 +547,9 @@ static void handle_get_focus(::VclWindowEvent const * pEvent) } else { - if( g_aWindowList.find(pWindow) == g_aWindowList.end() ) + if( g_aWindowList.list.find(pWindow) == g_aWindowList.list.end() ) { - g_aWindowList.insert(pWindow); + g_aWindowList.list.insert(pWindow); try { aDocumentFocusListener->attachRecursive(xAccessible, xContext, xStateSet); @@ -628,7 +641,7 @@ void WindowEventHandler(void *, VclSimpleEvent& rEvent) break; case VCLEVENT_OBJECT_DYING: - g_aWindowList.erase( static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow() ); + g_aWindowList.list.erase( static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow() ); SAL_FALLTHROUGH; case VCLEVENT_TOOLBOX_HIGHLIGHTOFF: handle_toolbox_highlightoff(static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow()); |