summaryrefslogtreecommitdiffstats
path: root/starmath
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2011-12-04 15:05:46 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2011-12-04 19:24:58 +0400
commit558b5ea32a99654dcb63526f107726f7aec4747f (patch)
tree750e6a42194a989dd330191b20f69fa3d9e57353 /starmath
parentvisual formula editor: place cursor on numerator when creating empty fraction (diff)
downloadcore-558b5ea32a99654dcb63526f107726f7aec4747f.tar.gz
core-558b5ea32a99654dcb63526f107726f7aec4747f.zip
visual formula editor: copy/cut/paste for any keyboard layout
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/view.cxx27
1 files changed, 11 insertions, 16 deletions
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 66626a089062..c9a0ffdf75d9 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -421,8 +421,17 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt)
ScrollableWindow::KeyInput(rKEvt);
return;
}
- sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
+
SmCursor& rCursor = pViewShell->GetDoc()->GetCursor();
+ KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
+ if (eFunc == KEYFUNC_COPY)
+ rCursor.Copy();
+ else if (eFunc == KEYFUNC_CUT)
+ rCursor.Cut();
+ else if (eFunc == KEYFUNC_PASTE)
+ rCursor.Paste();
+ else {
+ sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
switch(nCode)
{
case KEY_LEFT:
@@ -491,15 +500,6 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt)
case KEY_EQUAL:
rCursor.InsertElement(EqualElement);
break;
- case KEY_COPY:
- rCursor.Copy();
- break;
- case KEY_CUT:
- rCursor.Cut();
- break;
- case KEY_PASTE:
- rCursor.Paste();
- break;
default:
{
sal_Unicode code = rKEvt.GetCharCode();
@@ -507,12 +507,6 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt)
if(code == ' ') {
rCursor.InsertElement(BlankElement);
- }else if(code == 'c' && rKEvt.GetKeyCode().IsMod1()) {
- rCursor.Copy();
- }else if(code == 'x' && rKEvt.GetKeyCode().IsMod1()) {
- rCursor.Cut();
- }else if(code == 'v' && rKEvt.GetKeyCode().IsMod1()) {
- rCursor.Paste();
}else if(code == '^') {
rCursor.InsertSubSup(RSUP);
}else if(code == '(') {
@@ -539,6 +533,7 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt)
}
}
}
+ }
CaretBlinkStop();
CaretBlinkStart();
SetIsCursorVisible(true);