summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-27 16:43:19 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-28 11:20:23 +0100
commit7de9417d5f65d35227c7f80f6d587c2a56bde4e0 (patch)
tree4ccdc3d281964fc616c54e8aefbfbe2ce3168f60
parent255ee67072aefdd31265df1cc462821797ef76e5 (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>
-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 1ee124423fc1..8faed20374e8 100644
--- a/vcl/inc/listbox.hxx
+++ b/vcl/inc/listbox.hxx
@@ -220,6 +220,7 @@ private:
bool mbCenter : 1; ///< center Text output
bool mbRight : 1; ///< right align 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 c96591bc2714..af661ee3a34a 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -749,7 +749,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 9d9de05b93cd..3f053f466a0b 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -483,6 +483,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
@@ -1637,7 +1638,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;