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

Caolán McNamara caolanm at redhat.com
Wed Oct 29 10:14:46 PDT 2014


 include/vcl/layout.hxx       |    1 +
 vcl/source/window/layout.cxx |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 62c125bbb4d27631af6cbcb498e765c0b215b734
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Oct 29 17:12:11 2014 +0000

    Resolves: rhbz#1146169 a11y frames label dies before frame
    
    Change-Id: Ie5650c3a5593dcf68196802169c47270a0c3b0e6

diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 88f1887..edb8d6b 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -459,6 +459,7 @@ private:
 private:
     friend class VclBuilder;
     void designate_label(vcl::Window *pWindow);
+    DECL_LINK(WindowEventListener, VclSimpleEvent*);
 public:
     VclFrame(vcl::Window *pParent)
         : VclBin(pParent)
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 5f5ad67..9d4b167 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1340,10 +1340,21 @@ void VclFrame::setAllocation(const Size &rAllocation)
         setLayoutAllocation(*pChild, aChildPos, aAllocation);
 }
 
+IMPL_LINK(VclFrame, WindowEventListener, VclSimpleEvent*, pEvent)
+{
+    if (pEvent && pEvent->GetId() == VCLEVENT_OBJECT_DYING)
+        designate_label(NULL);
+    return 0;
+}
+
 void VclFrame::designate_label(vcl::Window *pWindow)
 {
-    assert(pWindow->GetParent() == this);
+    assert(!pWindow || pWindow->GetParent() == this);
+    if (m_pLabel)
+        m_pLabel->RemoveEventListener(LINK(this, VclFrame, WindowEventListener));
     m_pLabel = pWindow;
+    if (m_pLabel)
+        m_pLabel->AddEventListener(LINK(this, VclFrame, WindowEventListener));
 }
 
 const vcl::Window *VclFrame::get_label_widget() const


More information about the Libreoffice-commits mailing list