diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-11-14 00:02:01 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-11-14 09:43:02 +0100 |
commit | e2beb3ee1519ecb790c157853050d3b352d3839c (patch) | |
tree | 36e0826bd4ea3b5c81e1a8f29ce5d0e330ae6bed /starmath | |
parent | dbbfdf3d32760498b746d3d5c5dcbcccf7932225 (diff) |
starmath: use global resource string
In favor of many getters and setters :)
Change-Id: Ibdfe6e2cb70ec2e743def2f898c1b56713af2661
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/ElementsDockingWindow.hrc | 22 | ||||
-rw-r--r-- | starmath/inc/ElementsDockingWindow.hxx | 42 | ||||
-rw-r--r-- | starmath/inc/starmath.hrc | 11 | ||||
-rw-r--r-- | starmath/source/ElementsDockingWindow.cxx | 32 | ||||
-rw-r--r-- | starmath/source/smres.src | 82 |
5 files changed, 60 insertions, 129 deletions
diff --git a/starmath/inc/ElementsDockingWindow.hrc b/starmath/inc/ElementsDockingWindow.hrc deleted file mode 100644 index 6eb65b889f73..000000000000 --- a/starmath/inc/ElementsDockingWindow.hrc +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - */ - -#include <starmath.hrc> - -#define STR_BLACK 1 -#define STR_BLUE 2 -#define STR_GREEN 3 -#define STR_RED 4 -#define STR_CYAN 5 -#define STR_MAGENTA 6 -#define STR_YELLOW 7 -#define STR_HIDE 8 -#define STR_SIZE 9 -#define STR_FONT 10 diff --git a/starmath/inc/ElementsDockingWindow.hxx b/starmath/inc/ElementsDockingWindow.hxx index 66b410c4b124..a3a692e8228d 100644 --- a/starmath/inc/ElementsDockingWindow.hxx +++ b/starmath/inc/ElementsDockingWindow.hxx @@ -115,48 +115,6 @@ public: void setVerticalMode(bool bVertical); void SetSelectHdl(const Link& rLink) { aSelectHdlLink = rLink; } - - void setColorBlack(const OUString color) { maColorBlack = color; } - OUString colorBlack() { return maColorBlack; } - - void setColorBlue(const OUString color) { maColorBlue = color; } - OUString colorBlue() { return maColorBlue; } - - void setColorGreen(const OUString color) { maColorGreen = color; } - OUString colorGreen() { return maColorGreen; } - - void setColorRed(const OUString color) { maColorRed = color; } - OUString colorRed() { return maColorRed; } - - void setColorCyan(const OUString color) { maColorCyan = color; } - OUString colorCyan() { return maColorCyan; } - - void setColorMagenta(const OUString color) { maColorMagenta = color; } - OUString colorMagenta() { return maColorMagenta; } - - void setColorYellow(const OUString color) { maColorYellow = color; } - OUString colorYellow() { return maColorYellow; } - - void setStringHide(const OUString string) { maStringHide = string; } - OUString stringHide() { return maStringHide; } - - void setStringSize(const OUString string) { maStringSize = string; } - OUString stringSize() { return maStringSize; } - - void setStringFont(const OUString string) { maStringFont = string; } - OUString stringFont() { return maStringFont; } - -private: - OUString maColorBlack; - OUString maColorBlue; - OUString maColorGreen; - OUString maColorRed; - OUString maColorCyan; - OUString maColorMagenta; - OUString maColorYellow; - OUString maStringHide; - OUString maStringSize; - OUString maStringFont; }; class SmElementsDockingWindow : public SfxDockingWindow diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index 4d62b993af26..636a5ec88dc0 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -102,7 +102,16 @@ #define STR_STATSTR_READING (RID_APP_START + 823) #define STR_STATSTR_WRITING (RID_APP_START + 824) #define STR_CMDBOXWINDOW (RID_APP_START + 825) - +#define STR_BLACK (RID_APP_START + 826) +#define STR_BLUE (RID_APP_START + 827) +#define STR_GREEN (RID_APP_START + 828) +#define STR_RED (RID_APP_START + 829) +#define STR_CYAN (RID_APP_START + 830) +#define STR_MAGENTA (RID_APP_START + 831) +#define STR_YELLOW (RID_APP_START + 832) +#define STR_HIDE (RID_APP_START + 833) +#define STR_SIZE (RID_APP_START + 834) +#define STR_FONT (RID_APP_START + 835) #define STR_ALIGN_LEFT (RID_APP_START + 836) #define STR_ALIGN_CENTER (RID_APP_START + 837) #define STR_ALIGN_RIGHT (RID_APP_START + 838) diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index e45a1ee78e9c..f02c86f2d857 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -18,7 +18,6 @@ */ #include <ElementsDockingWindow.hxx> -#include <ElementsDockingWindow.hrc> #include <starmath.hrc> #include <smmod.hxx> @@ -460,29 +459,29 @@ void SmElementsControl::addElements(const sal_uInt16 aElementsArray[][2], sal_uI else if (aElementId == RID_BLANK) addElement("\"~\"", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_PHANTOMX) - addElement("\"" + stringHide() +"\"", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); + addElement("\"" + SM_RESSTR(STR_HIDE) +"\"", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_BOLDX) addElement("bold B", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_ITALX) addElement("ital I", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_SIZEXY) - addElement("\"" + stringSize() + "\"", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); + addElement("\"" + SM_RESSTR(STR_SIZE) + "\"", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_FONTXY) - addElement("\"" + stringFont() + "\"", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); + addElement("\"" + SM_RESSTR(STR_FONT) + "\"", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_COLORX_BLACK) - addElement("color black { \"" + colorBlack() + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); + addElement("color black { \"" + SM_RESSTR(STR_BLACK) + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_COLORX_BLUE) - addElement("color blue { \"" + colorBlue() + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); + addElement("color blue { \"" + SM_RESSTR(STR_BLUE) + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_COLORX_GREEN) - addElement("color green { \"" + colorGreen() + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); + addElement("color green { \"" + SM_RESSTR(STR_GREEN) + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_COLORX_RED) - addElement("color red { \"" + colorRed() + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); + addElement("color red { \"" + SM_RESSTR(STR_RED) + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_COLORX_CYAN) - addElement("color cyan { \"" + colorCyan() + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); + addElement("color cyan { \"" + SM_RESSTR(STR_CYAN) + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_COLORX_MAGENTA) - addElement("color magenta { \"" + colorMagenta() + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); + addElement("color magenta { \"" + SM_RESSTR(STR_MAGENTA) + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_COLORX_YELLOW) - addElement("color yellow { \"" + colorYellow() + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); + addElement("color yellow { \"" + SM_RESSTR(STR_YELLOW) + "\" }", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_ALIGNLX) addElement("\"" + SM_RESSTR(STR_ALIGN_LEFT) + "\"", SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp)); else if (aElementId == RID_ALIGNCX) @@ -578,17 +577,6 @@ SmElementsDockingWindow::SmElementsDockingWindow(SfxBindings* pInputBindings, Sf maElementListBox (this, SmResId(1)) { maElementsControl.SetBorderStyle( WINDOW_BORDER_MONO ); - maElementsControl.setColorBlack(SmResId(STR_BLACK)); - maElementsControl.setColorBlue(SmResId(STR_BLUE)); - maElementsControl.setColorGreen(SmResId(STR_GREEN)); - maElementsControl.setColorRed(SmResId(STR_RED)); - maElementsControl.setColorCyan(SmResId(STR_CYAN)); - maElementsControl.setColorMagenta(SmResId(STR_MAGENTA)); - maElementsControl.setColorYellow(SmResId(STR_YELLOW)); - - maElementsControl.setStringHide(SmResId(STR_HIDE)); - maElementsControl.setStringSize(SmResId(STR_SIZE)); - maElementsControl.setStringFont(SmResId(STR_FONT)); maElementListBox.SetDropDownLineCount( 11 ); diff --git a/starmath/source/smres.src b/starmath/source/smres.src index 62c5bd34998c..0907229d4912 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -17,14 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include <sfx2/sfx.hrc> #include <sfx2/tabpage.hrc> #include <svx/globlmn.hrc> #include "starmath.hrc" #include "dialog.hrc" #include "toolbox.hrc" -#include "ElementsDockingWindow.hrc" #include "smcommands.h" #define IMAGE_STDBTN_COLOR Color { Red = 0xff00; Green = 0x0000; Blue = 0xff00; } @@ -394,47 +392,47 @@ DockingWindow RID_ELEMENTSDOCKINGWINDOW }; Text [ en-US ] = "Elements Dock" ; +}; - String STR_BLACK - { - Text [ en-US ] = "black" ; - }; - String STR_BLUE - { - Text [ en-US ] = "blue" ; - }; - String STR_GREEN - { - Text [ en-US ] = "green" ; - }; - String STR_RED - { - Text [ en-US ] = "red" ; - }; - String STR_CYAN - { - Text [ en-US ] = "cyan" ; - }; - String STR_MAGENTA - { - Text [ en-US ] = "magenta" ; - }; - String STR_YELLOW - { - Text [ en-US ] = "yellow" ; - }; - String STR_HIDE - { - Text [ en-US ] = "hide" ; - }; - String STR_SIZE - { - Text [ en-US ] = "size" ; - }; - String STR_FONT - { - Text [ en-US ] = "font" ; - }; +String STR_BLACK +{ + Text [ en-US ] = "black" ; +}; +String STR_BLUE +{ + Text [ en-US ] = "blue" ; +}; +String STR_GREEN +{ + Text [ en-US ] = "green" ; +}; +String STR_RED +{ + Text [ en-US ] = "red" ; +}; +String STR_CYAN +{ + Text [ en-US ] = "cyan" ; +}; +String STR_MAGENTA +{ + Text [ en-US ] = "magenta" ; +}; +String STR_YELLOW +{ + Text [ en-US ] = "yellow" ; +}; +String STR_HIDE +{ + Text [ en-US ] = "hide" ; +}; +String STR_SIZE +{ + Text [ en-US ] = "size" ; +}; +String STR_FONT +{ + Text [ en-US ] = "font" ; }; String STR_ALIGN_LEFT |