Kaydet (Commit) 86915eb7 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#122656 keypress handled twice

Change-Id: I8a9ec82d46a3df04554c139264755c8f28f5e897
Reviewed-on: https://gerrit.libreoffice.org/66336
Tested-by: Jenkins
Tested-by: 's avatarXisco Faulí <xiscofauli@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b095e8f3
...@@ -2615,7 +2615,7 @@ bool SvtValueSet::KeyInput( const KeyEvent& rKeyEvent ) ...@@ -2615,7 +2615,7 @@ bool SvtValueSet::KeyInput( const KeyEvent& rKeyEvent )
} }
if ( nItemPos == VALUESET_ITEM_NOTFOUND ) if ( nItemPos == VALUESET_ITEM_NOTFOUND )
return false; return true;
if ( nItemPos!=VALUESET_ITEM_NONEITEM && nItemPos<nLastItem ) if ( nItemPos!=VALUESET_ITEM_NONEITEM && nItemPos<nLastItem )
{ {
......
...@@ -224,6 +224,9 @@ private: ...@@ -224,6 +224,9 @@ private:
} }
} }
protected:
virtual void HandleEventListener(VclWindowEvent& rEvent);
public: public:
SalInstanceWidget(vcl::Window* pWidget, bool bTakeOwnership) SalInstanceWidget(vcl::Window* pWidget, bool bTakeOwnership)
: m_xWidget(pWidget) : m_xWidget(pWidget)
...@@ -532,7 +535,7 @@ public: ...@@ -532,7 +535,7 @@ public:
} }
}; };
IMPL_LINK(SalInstanceWidget, EventListener, VclWindowEvent&, rEvent, void) void SalInstanceWidget::HandleEventListener(VclWindowEvent& rEvent)
{ {
if (rEvent.GetId() == VclEventId::WindowGetFocus || rEvent.GetId() == VclEventId::WindowActivate) if (rEvent.GetId() == VclEventId::WindowGetFocus || rEvent.GetId() == VclEventId::WindowActivate)
m_aFocusInHdl.Call(*this); m_aFocusInHdl.Call(*this);
...@@ -552,6 +555,11 @@ IMPL_LINK(SalInstanceWidget, EventListener, VclWindowEvent&, rEvent, void) ...@@ -552,6 +555,11 @@ IMPL_LINK(SalInstanceWidget, EventListener, VclWindowEvent&, rEvent, void)
} }
} }
IMPL_LINK(SalInstanceWidget, EventListener, VclWindowEvent&, rEvent, void)
{
HandleEventListener(rEvent);
}
namespace namespace
{ {
Image createImage(const OUString& rImage) Image createImage(const OUString& rImage)
...@@ -2804,6 +2812,20 @@ private: ...@@ -2804,6 +2812,20 @@ private:
DECL_LINK(PopupMenuHdl, const Point&, bool); DECL_LINK(PopupMenuHdl, const Point&, bool);
DECL_LINK(QueryTooltipHdl, tools::Rectangle&, OUString); DECL_LINK(QueryTooltipHdl, tools::Rectangle&, OUString);
// SalInstanceWidget has a generic listener for all these
// events, ignore the ones we have specializations for
// in VclDrawingArea
virtual void HandleEventListener(VclWindowEvent& rEvent) override
{
if (rEvent.GetId() == VclEventId::WindowResize ||
rEvent.GetId() == VclEventId::WindowKeyInput ||
rEvent.GetId() == VclEventId::WindowKeyUp)
{
return;
}
SalInstanceWidget::HandleEventListener(rEvent);
}
public: public:
SalInstanceDrawingArea(VclDrawingArea* pDrawingArea, const a11yref& rAlly, SalInstanceDrawingArea(VclDrawingArea* pDrawingArea, const a11yref& rAlly,
FactoryFunction pUITestFactoryFunction, void* pUserData, bool bTakeOwnership) FactoryFunction pUITestFactoryFunction, void* pUserData, bool bTakeOwnership)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment