summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2013-03-08 10:39:56 +0100
committerZolnai Tamás <zolnaitamas2000@gmail.com>2013-03-09 08:20:51 +0100
commit33933867b0e4488423ad35068d5a1ad673e9b4a3 (patch)
tree5a392a204fce09f77217f938919734281c77c880 /dbaccess
parent85429fbe773a1c7c2edc144abba5d6ce40b20bdf (diff)
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
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/inc/LimitBox.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/LimitBox.cxx20
-rw-r--r--dbaccess/source/ui/querydesign/limitboxcontroller.cxx21
3 files changed, 20 insertions, 23 deletions
diff --git a/dbaccess/source/ui/inc/LimitBox.hxx b/dbaccess/source/ui/inc/LimitBox.hxx
index 52084a0ce33a..3958402417ad 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 a6908269b96b..36fb191ad6bc 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 7697894e9b8c..e49dfbcf2bb8 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 );
}