Bump version to 6.4-15
[LibreOffice.git] / svx / source / uitest / uiobject.cxx
blobc791dc068395729609ac98f0bc191392a0d725cf
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <memory>
11 #include <uiobject.hxx>
12 #include <svx/charmap.hxx>
13 #include <vcl/layout.hxx>
15 SvxShowCharSetUIObject::SvxShowCharSetUIObject(const VclPtr<vcl::Window>& xCharSetWin, SvxShowCharSet* pCharSet):
16 WindowUIObject(xCharSetWin),
17 mpCharSet(pCharSet)
21 void SvxShowCharSetUIObject::execute(const OUString& rAction,
22 const StringMap& rParameters)
24 if (rAction == "SELECT")
26 if (rParameters.find("INDEX") != rParameters.end())
28 OUString aIndexStr = rParameters.find("INDEX")->second;
30 sal_Int32 nIndex = aIndexStr.toInt32();
31 mpCharSet->OutputIndex(nIndex);
33 else if (rParameters.find("COLUMN") != rParameters.end() &&
34 rParameters.find("ROW") != rParameters.end())
36 OUString aColStr = rParameters.find("COLUMN")->second;
37 OUString aRowStr = rParameters.find("ROW")->second;
39 sal_Int32 nColumn = aColStr.toInt32();
40 sal_Int32 nRow = aRowStr.toInt32();
42 sal_Int32 nIndex = nColumn * COLUMN_COUNT + nRow;
43 mpCharSet->OutputIndex(nIndex);
46 else
47 WindowUIObject::execute(rAction, rParameters);
50 std::unique_ptr<UIObject> SvxShowCharSetUIObject::create(vcl::Window* pWindow)
52 VclDrawingArea* pCharSetWin = dynamic_cast<VclDrawingArea*>(pWindow);
53 assert(pCharSetWin);
54 return std::unique_ptr<UIObject>(new SvxShowCharSetUIObject(pCharSetWin, static_cast<SvxShowCharSet*>(pCharSetWin->GetUserData())));
57 OUString SvxShowCharSetUIObject::get_name() const
59 return "SvxShowCharSetUIObject";
62 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */