summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-29 17:12:40 +0000
committerAndras Timar <andras.timar@collabora.com>2014-11-23 14:30:32 +0100
commit61c1b9aee73b718fb73ada5c7393c478a6e21efd (patch)
tree873ac63a3f7de331ebb13eb5f87cbe4bfc398e50
parent9d727208060e413cc7a8e58753b2e31c5e2af9c4 (diff)
Resolves: rhbz#1146169 a11y frames label dies before frame
Change-Id: I2bc45dcb92b8e68bf4ae4df72c0fbd4e3b535604 Reviewed-on: https://gerrit.libreoffice.org/12142 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--include/vcl/layout.hxx1
-rw-r--r--vcl/source/window/layout.cxx13
2 files changed, 13 insertions, 1 deletions
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index c69b44b08248..0ed3e6c5976e 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -459,6 +459,7 @@ private:
private:
friend class VclBuilder;
void designate_label(Window *pWindow);
+ DECL_LINK(WindowEventListener, VclSimpleEvent*);
public:
VclFrame(Window *pParent)
: VclBin(pParent)
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 975df2f3ed97..9f560d56a9fe 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(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 Window *VclFrame::get_label_widget() const