summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/a11y
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-09-22 17:17:34 +0200
committerMichael Stahl <mstahl@redhat.com>2017-09-25 15:15:55 +0200
commit974d65aed528783bb06b96e5400b5ab347e0b258 (patch)
tree3211b6344488908ce5556e04770dfa9ce9077f04 /vcl/unx/gtk/a11y
parent1de71f95047630c1488e0a63a3a43cea8dfb8507 (diff)
vcl: [loplugin:badstatics] aDocumentFocusListener
Move it into class GtkSalData; have to use 2 variables because the class is only defined in atkutil.cxx but the ~GtkSalData is in gtkdata.cxx. Change-Id: I3b12f02a1a5454f39206cbd0fe224d3f08a44c73 Reviewed-on: https://gerrit.libreoffice.org/42673 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'vcl/unx/gtk/a11y')
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index c30a41905302..14bb6045c376 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -38,6 +38,7 @@
#include <vcl/menu.hxx>
#include <vcl/toolbox.hxx>
+#include <unx/gtk/gtkdata.hxx>
#include "atkwrapper.hxx"
#include "atkutil.hxx"
@@ -512,10 +513,22 @@ WindowList g_aWindowList;
}
+DocumentFocusListener & GtkSalData::GetDocumentFocusListener()
+{
+ if (!m_pDocumentFocusListener)
+ {
+ m_pDocumentFocusListener = new DocumentFocusListener;
+ m_xDocumentFocusListener.set(m_pDocumentFocusListener);
+ }
+ return *m_pDocumentFocusListener;
+}
+
static void handle_get_focus(::VclWindowEvent const * pEvent)
{
- static rtl::Reference< DocumentFocusListener > aDocumentFocusListener =
- new DocumentFocusListener;
+ GtkSalData *const pSalData(GetGtkSalData());
+ assert(pSalData);
+
+ DocumentFocusListener & rDocumentFocusListener(pSalData->GetDocumentFocusListener());
vcl::Window *pWindow = pEvent->GetWindow();
@@ -566,7 +579,7 @@ static void handle_get_focus(::VclWindowEvent const * pEvent)
g_aWindowList.list.insert(pWindow);
try
{
- aDocumentFocusListener->attachRecursive(xAccessible, xContext, xStateSet);
+ rDocumentFocusListener.attachRecursive(xAccessible, xContext, xStateSet);
}
catch (const uno::Exception&)
{