diff options
author | Daisuke Nishino <niboshi000@gmail.com> | 2011-11-15 19:42:35 +0900 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2011-11-16 14:54:21 +0000 |
commit | 20dde3737f250ab48b80a28c9c03d348e486dd8b (patch) | |
tree | 03324ac0aac8af25f8b98019d45415698c28979d /starmath/source/view.cxx | |
parent | 1b6d2c7f465cb1249e33d9e873f11756be634a3a (diff) |
Move cursor to the right of brace when the closing brace is typed.
Diffstat (limited to 'starmath/source/view.cxx')
-rw-r--r-- | starmath/source/view.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 0dec05a7bf38..a77a32a92e77 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -504,6 +504,8 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt) default: { sal_Unicode code = rKEvt.GetCharCode(); + SmBraceNode* pBraceNode = NULL; + if(code == ' ') { rCursor.InsertElement(BlankElement); }else if(code == 'c' && rKEvt.GetKeyCode().IsMod1()) { @@ -524,6 +526,12 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt) rCursor.InsertElement(FactorialElement); }else if(code == '%') { rCursor.InsertElement(PercentElement); + }else if(code == ')' && rCursor.IsAtTailOfBracket(RoundBrackets, &pBraceNode)) { + rCursor.MoveAfterBracket(pBraceNode); + }else if(code == ']' && rCursor.IsAtTailOfBracket(SquareBrackets, &pBraceNode)) { + rCursor.MoveAfterBracket(pBraceNode); + }else if(code == '}' && rCursor.IsAtTailOfBracket(CurlyBrackets, &pBraceNode)) { + rCursor.MoveAfterBracket(pBraceNode); }else{ if(code != 0){ rCursor.InsertText(code); |