1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
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
),
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
);
47 WindowUIObject::execute(rAction
, rParameters
);
50 std::unique_ptr
<UIObject
> SvxShowCharSetUIObject::create(vcl::Window
* pWindow
)
52 VclDrawingArea
* pCharSetWin
= dynamic_cast<VclDrawingArea
*>(pWindow
);
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: */