Kaydet (Commit) 72ea9568 authored tarafından Luke Dixon's avatar Luke Dixon Kaydeden (comit) Jonas Finnemann Jensen

Add the percent sign as a symbol that is inserted when % is pressed

üst 11af030d
......@@ -52,7 +52,8 @@ enum SmFormulaElement{
CDotElement,
EqualElement,
LessThanElement,
GreaterThanElement
GreaterThanElement,
PercentElement
};
/** Bracket types that can be inserted */
......
......@@ -198,7 +198,9 @@ enum MathSymbol
MS_SETZ = (sal_Unicode) 0x2124,
MS_SETQ = (sal_Unicode) 0x211A,
MS_SETR = (sal_Unicode) 0x211D,
MS_SETC = (sal_Unicode) 0x2102
MS_SETC = (sal_Unicode) 0x2102,
MS_PERCENT = (sal_Unicode) 0x0025
};
#endif
......
......@@ -1058,6 +1058,15 @@ void SmCursor::InsertElement(SmFormulaElement element){
token.aText.AssignAscii(">");
pNewNode = new SmMathSymbolNode(token);
}break;
case PercentElement:
{
SmToken token;
token.eType = TTEXT;
token.cMathChar = MS_PERCENT;
token.nGroup = 0;
token.aText.AssignAscii("\"%\"");
pNewNode = new SmMathSymbolNode(token);
}break;
default:
j_assert(false, "Element unknown!");
}
......
......@@ -513,6 +513,8 @@ void SmGraphicWindow::KeyInput(const KeyEvent& rKEvt)
rCursor.InsertBrackets(CurlyBrackets);
}else if(code == '!') {
rCursor.InsertElement(FactorialElement);
}else if(code == '%') {
rCursor.InsertElement(PercentElement);
}else{
if(code != 0){
rCursor.InsertText(code);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment