Kaydet (Commit) 6db92434 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

uitest: add wrapper for special character window

Change-Id: I22acd9da3570e967f427207e242638f2bfd6ffb7
üst c931f3a5
......@@ -74,6 +74,8 @@ public:
virtual void Resize() override;
virtual FactoryFunction GetUITestFactory() const override;
protected:
virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) override;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
......
......@@ -241,6 +241,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/tbxctrls/tbxcolor \
svx/source/tbxctrls/tbxdrctl \
svx/source/tbxctrls/verttexttbxctrl \
svx/source/uitest/uiobject \
svx/source/unodraw/recoveryui \
svx/source/unodraw/unoctabl \
svx/source/unodraw/UnoNamespaceMap \
......
/* -*- 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 <vcl/uitest/uiobject.hxx>
class SvxShowCharSet;
class SvxShowCharSetUIObject : WindowUIObject
{
VclPtr<SvxShowCharSet> mxCharSet;
public:
SvxShowCharSetUIObject(VclPtr<SvxShowCharSet> xCharSet);
virtual StringMap get_state() override;
virtual void execute(const OUString& rAction,
const StringMap& rParameters) override;
static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
protected:
OUString get_name() const override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -33,6 +33,8 @@
#include <svx/svxdlg.hxx>
#include "charmapacc.hxx"
#include "uiobject.hxx"
#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
......@@ -745,6 +747,11 @@ sal_Int32 SvxShowCharSet::getMaxCharCount() const
return mxFontCharMap->GetCharCount();
}
FactoryFunction SvxShowCharSet::GetUITestFactory() const
{
return SvxShowCharSetUIObject::create;
}
// TODO: should be moved into Font Attributes stuff
// we let it mature here though because it is currently the only use
......
/* -*- 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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment