Translate some words in Math Elements Dock

Change-Id: I7d5075b0c9ac481b954c6a843b35e46355b5348e
Reviewed-on: https://gerrit.libreoffice.org/5519
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/starmath/inc/ElementsDockingWindow.hrc b/starmath/inc/ElementsDockingWindow.hrc
new file mode 100644
index 0000000..6eb65b8
--- /dev/null
+++ b/starmath/inc/ElementsDockingWindow.hrc
@@ -0,0 +1,22 @@
/* -*- 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 9b58be7..ab739bb 100644
--- a/starmath/inc/ElementsDockingWindow.hxx
+++ b/starmath/inc/ElementsDockingWindow.hxx
@@ -107,6 +107,48 @@ 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 maColorGreen; }

    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/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 111a818..2d01c2d 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -18,6 +18,7 @@
 */

#include <ElementsDockingWindow.hxx>
#include <ElementsDockingWindow.hrc>

#include <starmath.hrc>
#include <smmod.hxx>
@@ -393,29 +394,29 @@ void SmElementsControl::addElements(const sal_uInt16 aElementsArray[], sal_uInt1
            else if (aElementId == RID_BLANK)
                addElement(OUString("\"~\""), SmResId(aElementId));
            else if (aElementId == RID_PHANTOMX)
                addElement(OUString("\"hide\""), SmResId(aElementId));
                addElement(OUString("\"" + stringHide() +"\""), SmResId(aElementId));
            else if (aElementId == RID_BOLDX)
                addElement(OUString("bold B"), SmResId(aElementId));
            else if (aElementId == RID_ITALX)
                addElement(OUString("ital I"), SmResId(aElementId));
            else if (aElementId == RID_SIZEXY)
                addElement(OUString("\"size\""), SmResId(aElementId));
                addElement(OUString("\"" + stringSize() + "\""), SmResId(aElementId));
            else if (aElementId == RID_FONTXY)
                addElement(OUString("\"font\""), SmResId(aElementId));
                addElement(OUString("\"" + stringFont() + "\""), SmResId(aElementId));
            else if (aElementId == RID_COLORX_BLACK)
                addElement(OUString("color black { \"black\" }"), SmResId(aElementId));
                addElement(OUString("color black { \"" + colorBlack() + "\" }"), SmResId(aElementId));
            else if (aElementId == RID_COLORX_BLUE)
                addElement(OUString("color blue { \"blue\" }"), SmResId(aElementId));
                addElement(OUString("color blue { \"" + colorBlue() + "\" }"), SmResId(aElementId));
            else if (aElementId == RID_COLORX_GREEN)
                addElement(OUString("color green { \"green\" }"), SmResId(aElementId));
                addElement(OUString("color green { \"" + colorGreen() + "\" }"), SmResId(aElementId));
            else if (aElementId == RID_COLORX_RED)
                addElement(OUString("color red { \"red\" }"), SmResId(aElementId));
                addElement(OUString("color red { \"" + colorRed() + "\" }"), SmResId(aElementId));
            else if (aElementId == RID_COLORX_CYAN)
                addElement(OUString("color cyan { \"cyan\" }"), SmResId(aElementId));
                addElement(OUString("color cyan { \"" + colorCyan() + "\" }"), SmResId(aElementId));
            else if (aElementId == RID_COLORX_MAGENTA)
                addElement(OUString("color magenta { \"magenta\" }"), SmResId(aElementId));
                addElement(OUString("color magenta { \"" + colorMagenta() + "\" }"), SmResId(aElementId));
            else if (aElementId == RID_COLORX_YELLOW)
                addElement(OUString("color yellow { \"yellow\" }"), SmResId(aElementId));
                addElement(OUString("color yellow { \"" + colorYellow() + "\" }"), SmResId(aElementId));
            else
                addElement(SmResId(aElementId), SmResId(aElementId));
        }
@@ -492,6 +493,17 @@ 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( 10 );

diff --git a/starmath/source/smres.src b/starmath/source/smres.src
index b9979ce..d03c15b 100644
--- a/starmath/source/smres.src
+++ b/starmath/source/smres.src
@@ -24,6 +24,7 @@
#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; }
@@ -470,6 +471,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" ;
    };
};