summaryrefslogtreecommitdiff
path: root/svx/source/uitest/uiobject.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-25 00:16:45 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-25 00:18:49 +0200
commit6db92434c664116eb1ec6cb127f2cd957a03bb65 (patch)
tree4afc3b187cdb4df9acdbde677db489905df094c3 /svx/source/uitest/uiobject.cxx
parentc931f3a5184928bc333796362a5616a93c6ed6d7 (diff)
uitest: add wrapper for special character window
Change-Id: I22acd9da3570e967f427207e242638f2bfd6ffb7
Diffstat (limited to 'svx/source/uitest/uiobject.cxx')
-rw-r--r--svx/source/uitest/uiobject.cxx68
1 files changed, 68 insertions, 0 deletions
diff --git a/svx/source/uitest/uiobject.cxx b/svx/source/uitest/uiobject.cxx
new file mode 100644
index 000000000000..dc5db9e72ab9
--- /dev/null
+++ b/svx/source/uitest/uiobject.cxx
@@ -0,0 +1,68 @@
+/* -*- 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 "uiobject.hxx"
+
+#include <svx/charmap.hxx>
+
+SvxShowCharSetUIObject::SvxShowCharSetUIObject(VclPtr<SvxShowCharSet> xCharSet):
+ WindowUIObject(xCharSet),
+ mxCharSet(xCharSet)
+{
+}
+
+StringMap SvxShowCharSetUIObject::get_state()
+{
+ StringMap aMap = WindowUIObject::get_state();
+
+ return aMap;
+}
+
+void SvxShowCharSetUIObject::execute(const OUString& rAction,
+ const StringMap& rParameters)
+{
+ if (rAction == "SELECT")
+ {
+ if (rParameters.find("INDEX") != rParameters.end())
+ {
+ OUString aIndexStr = rParameters.find("INDEX")->second;
+
+ sal_Int32 nIndex = aIndexStr.toInt32();
+ mxCharSet->OutputIndex(nIndex);
+ }
+ else if (rParameters.find("COLUMN") != rParameters.end() &&
+ rParameters.find("ROW") != rParameters.end())
+ {
+ OUString aColStr = rParameters.find("COLUMN")->second;
+ OUString aRowStr = rParameters.find("ROW")->second;
+
+ sal_Int32 nColumn = aColStr.toInt32();
+ sal_Int32 nRow = aRowStr.toInt32();
+
+ sal_Int32 nIndex = nColumn * COLUMN_COUNT + nRow;
+ mxCharSet->OutputIndex(nIndex);
+ }
+ }
+ else
+ WindowUIObject::execute(rAction, rParameters);
+}
+
+std::unique_ptr<UIObject> SvxShowCharSetUIObject::create(vcl::Window* pWindow)
+{
+ SvxShowCharSet* pCharSet = dynamic_cast<SvxShowCharSet*>(pWindow);
+ assert(pCharSet);
+ return std::unique_ptr<UIObject>(new SvxShowCharSetUIObject(pCharSet));
+}
+
+OUString SvxShowCharSetUIObject::get_name() const
+{
+ return OUString("SvxShowCharSetUIObject");
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */