summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 );
}