summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-27 16:43:19 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-12-05 15:31:43 +0100
commit72d7376b0f252bb846540f38bacd9454781d29f0 (patch)
treedf86de8f20e100aae2fe691314cbb984fa3fe8be
parent0aaf48842a3ae0b592ee0415f152ff02a62be7ff (diff)
tdf#129043 Correctly deliver combo box events when used with keyboard
Change-Id: I82186f999e74be4aebd59d77666390a7d5e8ad81 Reviewed-on: https://gerrit.libreoffice.org/83923 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 7de9417d5f65d35227c7f80f6d587c2a56bde4e0) Reviewed-on: https://gerrit.libreoffice.org/84405 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--vcl/inc/listbox.hxx1
-rw-r--r--vcl/source/control/combobox.cxx2
-rw-r--r--vcl/source/control/imp_listbox.cxx5
3 files changed, 6 insertions, 2 deletions
diff --git a/vcl/inc/listbox.hxx b/vcl/inc/listbox.hxx
index 1130ad9ef805..e9546e19516e 100644
--- a/vcl/inc/listbox.hxx
+++ b/vcl/inc/listbox.hxx
@@ -213,6 +213,7 @@ private:
bool mbRight : 1; ///< right align Text output
bool mbCenter : 1; ///< center Text output
bool mbEdgeBlending : 1;
+ bool mbIsComboboxDropdown : 1;
Link<ImplListBoxWindow*,void> maScrollHdl;
Link<LinkParamNone*,void> maSelectHdl;
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 4508d34022fc..3ce77bacb950 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -739,7 +739,7 @@ bool ComboBox::EventNotify( NotifyEvent& rNEvt )
case KEY_RETURN:
{
- if ((rNEvt.GetWindow() == m_pImpl->m_pSubEdit) && IsInDropDown())
+ if (rNEvt.GetWindow() == m_pImpl->m_pSubEdit)
{
m_pImpl->m_pImplLB->ProcessKeyInput( aKeyEvt );
bDone = true;
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index b2e002a05ef5..c892692ba036 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -484,6 +484,7 @@ ImplListBoxWindow::ImplListBoxWindow( vcl::Window* pParent, WinBits nWinStyle )
mbCenter = ( nWinStyle & WB_CENTER );
mbSimpleMode = ( nWinStyle & WB_SIMPLEMODE );
mbSort = ( nWinStyle & WB_SORT );
+ mbIsComboboxDropdown = ( nWinStyle & WB_DROPDOWN );
mbEdgeBlending = false;
// pb: #106948# explicit mirroring for calc
@@ -1607,7 +1608,9 @@ bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
mnCurrentPos = nSelect;
if(SelectEntries( nSelect, eLET, bShift, bCtrl, bCurPosChange))
{
- mbTravelSelect = true;
+ // tdf#129043 Correctly deliver events when changing values with arrow keys in combobox
+ if (mbIsComboboxDropdown && IsReallyVisible())
+ mbTravelSelect = true;
mnSelectModifier = rKEvt.GetKeyCode().GetModifier();
ImplCallSelect();
mbTravelSelect = false;