summaryrefslogtreecommitdiff
path: root/starmath/source
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-08-14 10:18:44 -0300
committerThorsten Behrens <tbehrens@suse.com>2013-08-16 13:52:42 +0000
commitc66062aacb521037eb5af9c32c94c33df9cd69a7 (patch)
tree0a27eba9f7aee6a633c6c7e7b4038d1e3972bd52 /starmath/source
parentd626fa2e5892a8a166b5aec49e9cb5bfc2cf18c5 (diff)
Math: New feature about color selection
Now we can choose colors to equations in Elements Dock, in the Attributes section. All colors there can be choosed by clicking in the name of color. Change-Id: I5545b292955072f9f45f31262a511cee3d70c953 Reviewed-on: https://gerrit.libreoffice.org/5414 Reviewed-by: Thorsten Behrens <tbehrens@suse.com> Tested-by: Thorsten Behrens <tbehrens@suse.com>
Diffstat (limited to 'starmath/source')
-rw-r--r--starmath/source/ElementsDockingWindow.cxx23
-rw-r--r--starmath/source/commands.src7
2 files changed, 25 insertions, 5 deletions
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 893c2a09289f..111a81826861 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -48,8 +48,6 @@ SmElementSeparator::SmElementSeparator() :
SmElement(SmNodePointer(), OUString())
{}
-//////////////////////////////////
-
const sal_uInt16 SmElementsControl::aUnaryBinaryOperatorsList[] =
{
RID_PLUSX, RID_MINUSX, RID_PLUSMINUSX, RID_MINUSPLUSX,
@@ -130,7 +128,10 @@ const sal_uInt16 SmElementsControl::aAttributes[] =
RID_WIDEVECX, RID_WIDETILDEX, RID_WIDEHATX, RID_OVERLINEX,
RID_UNDERLINEX, RID_OVERSTRIKEX,
0xFFFF,
- RID_PHANTOMX, RID_BOLDX, RID_ITALX, RID_SIZEXY, RID_FONTXY
+ RID_PHANTOMX, RID_BOLDX, RID_ITALX, RID_SIZEXY, RID_FONTXY,
+ 0xFFFF,
+ RID_COLORX_BLACK, RID_COLORX_BLUE, RID_COLORX_GREEN,
+ RID_COLORX_RED, RID_COLORX_CYAN, RID_COLORX_MAGENTA, RID_COLORX_YELLOW
};
const sal_uInt16 SmElementsControl::aBrackets[] =
@@ -401,6 +402,20 @@ void SmElementsControl::addElements(const sal_uInt16 aElementsArray[], sal_uInt1
addElement(OUString("\"size\""), SmResId(aElementId));
else if (aElementId == RID_FONTXY)
addElement(OUString("\"font\""), SmResId(aElementId));
+ else if (aElementId == RID_COLORX_BLACK)
+ addElement(OUString("color black { \"black\" }"), SmResId(aElementId));
+ else if (aElementId == RID_COLORX_BLUE)
+ addElement(OUString("color blue { \"blue\" }"), SmResId(aElementId));
+ else if (aElementId == RID_COLORX_GREEN)
+ addElement(OUString("color green { \"green\" }"), SmResId(aElementId));
+ else if (aElementId == RID_COLORX_RED)
+ addElement(OUString("color red { \"red\" }"), SmResId(aElementId));
+ else if (aElementId == RID_COLORX_CYAN)
+ addElement(OUString("color cyan { \"cyan\" }"), SmResId(aElementId));
+ else if (aElementId == RID_COLORX_MAGENTA)
+ addElement(OUString("color magenta { \"magenta\" }"), SmResId(aElementId));
+ else if (aElementId == RID_COLORX_YELLOW)
+ addElement(OUString("color yellow { \"yellow\" }"), SmResId(aElementId));
else
addElement(SmResId(aElementId), SmResId(aElementId));
}
@@ -458,8 +473,6 @@ void SmElementsControl::build()
Invalidate();
}
-//*******************
-
const sal_uInt16 SmElementsDockingWindow::aCategories[] = {
RID_CATEGORY_UNARY_BINARY_OPERATORS,
RID_CATEGORY_RELATIONS,
diff --git a/starmath/source/commands.src b/starmath/source/commands.src
index e30e3e078988..a39d1510c58a 100644
--- a/starmath/source/commands.src
+++ b/starmath/source/commands.src
@@ -173,6 +173,13 @@ String RID_ITALX { Text = "ital <?> " ; };
String RID_SIZEXY { Text = "size <?> {<?>} " ; };
String RID_FONTXY { Text = "font <?> {<?>} " ; };
String RID_COLORX { Text = "color <?> {<?>} " ; };
+String RID_COLORX_BLACK { Text = "color black {<?>} " ; };
+String RID_COLORX_BLUE { Text = "color blue {<?>} " ; };
+String RID_COLORX_GREEN { Text = "color green {<?>} " ; };
+String RID_COLORX_RED { Text = "color red {<?>} " ; };
+String RID_COLORX_CYAN { Text = "color cyan {<?>} " ; };
+String RID_COLORX_MAGENTA { Text = "color magenta {<?>} " ; };
+String RID_COLORX_YELLOW { Text = "color yellow {<?>} " ; };
String RID_LRGROUPX { Text = "{<?>} " ; };
String RID_LRPARENTX { Text = "(<?>) " ; };
String RID_LRBRACKETX { Text = "[<?>] " ; };