summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2015-10-01 19:31:17 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-10-02 10:44:54 +0000
commit7dd8483362cf0ef102363204dd2235246400d96a (patch)
treef0122e5b16ded53675fc16ccf3913a84a069bdda /fpicker
parent1d49c4a54995b6c96a32a092f78b38b36a5748d5 (diff)
tdf#57370 : Open place after pressing 'Enter'
Change-Id: Iabcf17b71b3fe06a25bb7b0e7f3aa65ad0663e69 Reviewed-on: https://gerrit.libreoffice.org/19083 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/office/PlacesListBox.cxx17
-rw-r--r--fpicker/source/office/PlacesListBox.hxx2
2 files changed, 19 insertions, 0 deletions
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index 5b6d33416f85..66c885135e89 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -167,6 +167,23 @@ void PlacesListBox::SetSizePixel( const Size& rNewSize )
mpDelBtn->SetPosPixel( Point( 6 + 24, nBtnY ) );
}
+bool PlacesListBox::Notify( NotifyEvent& rNEvt )
+{
+ if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
+ {
+ const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
+ const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
+
+ if( rCode.GetCode() == KEY_RETURN )
+ {
+ mbSelectionChanged = true;
+ updateView();
+ return true;
+ }
+ }
+ return Control::Notify( rNEvt );
+}
+
Image PlacesListBox::getEntryIcon( PlacePtr pPlace )
{
Image theImage = mpDlg->GetButtonImage( IMG_FILEDLG_PLACE_LOCAL );
diff --git a/fpicker/source/office/PlacesListBox.hxx b/fpicker/source/office/PlacesListBox.hxx
index e2e0ab138bcd..3149d7972e39 100644
--- a/fpicker/source/office/PlacesListBox.hxx
+++ b/fpicker/source/office/PlacesListBox.hxx
@@ -70,6 +70,8 @@ class PlacesListBox : public Control
VclPtr<PushButton> GetDeleteButton() const { return mpDelBtn; }
VclPtr<PlacesListBox_Impl> GetPlacesListBox() const { return mpImpl; }
+ virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
+
private:
Image getEntryIcon( PlacePtr pPlace );