diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-05-16 12:43:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-16 14:33:40 +0100 |
commit | 859f28865c9761a3ea8608ef919fce1ff4037ac4 (patch) | |
tree | 07f15df6d5fbed5a4c8091ae06edda7e4e80300e | |
parent | 545e810da6758f78de45a00374877bd091dc051f (diff) |
make nospace edit not allow space in numbers only mode
Change-Id: Ie20dacb14b89d872045e58c84d4bf7804f4bee35
-rw-r--r-- | cui/source/options/optinet2.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 261058eaf2f3..b48986c1ef0e 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -106,22 +106,20 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxNoSpaceEdit(Window *pPar void SvxNoSpaceEdit::KeyInput( const KeyEvent& rKEvent ) { - if ( bOnlyNumeric ) + bool bValid = rKEvent.GetKeyCode().GetCode() != KEY_SPACE; + if (bValid && bOnlyNumeric) { const KeyCode& rKeyCode = rKEvent.GetKeyCode(); sal_uInt16 nGroup = rKeyCode.GetGroup(); sal_uInt16 nKey = rKeyCode.GetCode(); - sal_Bool bValid = ( KEYGROUP_NUM == nGroup || KEYGROUP_CURSOR == nGroup || - ( KEYGROUP_MISC == nGroup && ( nKey < KEY_ADD || nKey > KEY_EQUAL ) ) ); + bValid = ( KEYGROUP_NUM == nGroup || KEYGROUP_CURSOR == nGroup || + ( KEYGROUP_MISC == nGroup && ( nKey < KEY_ADD || nKey > KEY_EQUAL ) ) ); if ( !bValid && ( rKeyCode.IsMod1() && ( KEY_A == nKey || KEY_C == nKey || KEY_V == nKey || KEY_X == nKey || KEY_Z == nKey ) ) ) // Erase, Copy, Paste, Select All und Undo soll funktionieren bValid = sal_True; - - if ( bValid ) - Edit::KeyInput(rKEvent); } - else if( rKEvent.GetKeyCode().GetCode() != KEY_SPACE ) + if (bValid) Edit::KeyInput(rKEvent); } |