dbaccess/source/ui/inc/LimitBox.hxx | 2 - dbaccess/source/ui/querydesign/LimitBox.cxx | 20 ----------------- dbaccess/source/ui/querydesign/limitboxcontroller.cxx | 21 +++++++++++++++++- 3 files changed, 20 insertions(+), 23 deletions(-)
New commits: commit 33933867b0e4488423ad35068d5a1ad673e9b4a3 Author: Zolnai Tamás <zolnaitamas2...@gmail.com> Date: Fri Mar 8 10:39:56 2013 +0100 fdo#61797 ESCape abort changes and grab focus Handling of hitting enter or escape are only usefull for toolbar element. In a dialog these keys have other meanings (close the dialog with/without saving) Change-Id: Ifbe5d36daab9c0702b888a58403dc170082fc32d diff --git a/dbaccess/source/ui/inc/LimitBox.hxx b/dbaccess/source/ui/inc/LimitBox.hxx index 52084a0..39584024 100644 --- a/dbaccess/source/ui/inc/LimitBox.hxx +++ b/dbaccess/source/ui/inc/LimitBox.hxx @@ -26,8 +26,6 @@ class LimitBox: public NumericBox LimitBox( Window* pParent, WinBits nStyle ); virtual ~LimitBox(); - virtual long Notify( NotifyEvent& rNEvt ); - virtual OUString CreateFieldText( sal_Int64 nValue ) const; virtual void Reformat(); diff --git a/dbaccess/source/ui/querydesign/LimitBox.cxx b/dbaccess/source/ui/querydesign/LimitBox.cxx index a690826..36fb191 100644 --- a/dbaccess/source/ui/querydesign/LimitBox.cxx +++ b/dbaccess/source/ui/querydesign/LimitBox.cxx @@ -55,26 +55,6 @@ LimitBox::~LimitBox() { } -long LimitBox::Notify( NotifyEvent& rNEvt ) -{ - long nHandled = 0; - - switch ( rNEvt.GetType() ) - { - case EVENT_KEYINPUT: - { - const sal_uInt16 nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode(); - if( nCode == KEY_RETURN ) - { - GrabFocusToDocument(); - nHandled = 1; - } - break; - } - } - return nHandled ? nHandled : NumericBox::Notify( rNEvt ); -} - OUString LimitBox::CreateFieldText( sal_Int64 nValue ) const { if( nValue == ALL_INT ) diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx index 7697894..e49dfbc 100644 --- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx +++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx @@ -51,6 +51,7 @@ LimitBoxImpl::~LimitBoxImpl() long LimitBoxImpl::Notify( NotifyEvent& rNEvt ) { + long nHandled = 0; switch ( rNEvt.GetType() ) { case EVENT_LOSEFOCUS: @@ -61,8 +62,26 @@ long LimitBoxImpl::Notify( NotifyEvent& rNEvt ) m_pControl->dispatchCommand( aArgs ); break; } + case EVENT_KEYINPUT: + { + const sal_uInt16 nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode(); + switch ( nCode ) + { + case KEY_ESCAPE: + { + Undo(); + } + case KEY_RETURN: + { + GrabFocusToDocument(); + nHandled = 1; + break; + } + } + break; + } } - return LimitBox::Notify( rNEvt ); + return nHandled ? nHandled : LimitBox::Notify( rNEvt ); }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits