mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-05 15:55:45 +00:00
Fix coverity uninitialized variables
This commit is contained in:
parent
4fbbb67e98
commit
eceed558be
@ -3,10 +3,13 @@
|
||||
|
||||
namespace LuaUi
|
||||
{
|
||||
LuaText::LuaText()
|
||||
: mAutoSized(true)
|
||||
{}
|
||||
|
||||
void LuaText::initialize()
|
||||
{
|
||||
WidgetExtension::initialize();
|
||||
mAutoSized = true;
|
||||
}
|
||||
|
||||
bool LuaText::setPropertyRaw(std::string_view name, sol::object value)
|
||||
|
@ -12,6 +12,7 @@ namespace LuaUi
|
||||
MYGUI_RTTI_DERIVED(LuaText)
|
||||
|
||||
public:
|
||||
LuaText();
|
||||
virtual void initialize() override;
|
||||
|
||||
private:
|
||||
|
@ -11,8 +11,8 @@ namespace LuaUi
|
||||
{
|
||||
MYGUI_RTTI_DERIVED(LuaTextEdit)
|
||||
|
||||
protected:
|
||||
bool setPropertyRaw(std::string_view name, sol::object value) override;
|
||||
protected:
|
||||
bool setPropertyRaw(std::string_view name, sol::object value) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,13 @@
|
||||
|
||||
namespace LuaUi
|
||||
{
|
||||
WidgetExtension::WidgetExtension()
|
||||
: mForcedCoord()
|
||||
, mAbsoluteCoord()
|
||||
, mRelativeCoord()
|
||||
, mAnchor()
|
||||
{}
|
||||
|
||||
void WidgetExtension::triggerEvent(std::string_view name, const sol::object& argument = sol::nil) const
|
||||
{
|
||||
auto it = mCallbacks.find(name);
|
||||
@ -27,11 +34,6 @@ namespace LuaUi
|
||||
|
||||
void WidgetExtension::initialize()
|
||||
{
|
||||
mAbsoluteCoord = MyGUI::IntCoord();
|
||||
mRelativeCoord = MyGUI::FloatCoord();
|
||||
mAnchor = MyGUI::FloatSize();
|
||||
mForcedCoord = MyGUI::IntCoord();
|
||||
|
||||
// \todo might be more efficient to only register these if there are Lua callbacks
|
||||
mWidget->eventKeyButtonPressed += MyGUI::newDelegate(this, &WidgetExtension::keyPress);
|
||||
mWidget->eventKeyButtonReleased += MyGUI::newDelegate(this, &WidgetExtension::keyRelease);
|
||||
|
@ -19,6 +19,7 @@ namespace LuaUi
|
||||
class WidgetExtension
|
||||
{
|
||||
public:
|
||||
WidgetExtension();
|
||||
// must be called after creating the underlying MyGUI::Widget
|
||||
void create(lua_State* lua, MyGUI::Widget* self);
|
||||
// must be called after before destroying the underlying MyGUI::Widget
|
||||
@ -42,7 +43,6 @@ namespace LuaUi
|
||||
void updateCoord();
|
||||
|
||||
protected:
|
||||
~WidgetExtension() {}
|
||||
sol::table makeTable() const;
|
||||
sol::object keyEvent(MyGUI::KeyCode) const;
|
||||
sol::object mouseEvent(int left, int top, MyGUI::MouseButton button) const;
|
||||
|
@ -4,6 +4,12 @@
|
||||
|
||||
namespace LuaUi
|
||||
{
|
||||
LuaWindow::LuaWindow()
|
||||
: mCaption()
|
||||
, mPreviousMouse()
|
||||
, mChangeScale()
|
||||
{}
|
||||
|
||||
void LuaWindow::initialize()
|
||||
{
|
||||
WidgetExtension::initialize();
|
||||
|
@ -13,6 +13,9 @@ namespace LuaUi
|
||||
{
|
||||
MYGUI_RTTI_DERIVED(LuaWindow)
|
||||
|
||||
public:
|
||||
LuaWindow();
|
||||
|
||||
private:
|
||||
// \todo replace with LuaText when skins are properly implemented
|
||||
MyGUI::TextBox* mCaption;
|
||||
|
Loading…
Reference in New Issue
Block a user