Kaydet (Commit) 0b25b7a8 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

Make definition state attribute default to "any"

...and remove all the "any" from definition.xml

Change-Id: I8a91129c89255c83c1c2f975bf9acb710b664efc
Reviewed-on: https://gerrit.libreoffice.org/68828
Tested-by: Jenkins
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 208a6896
...@@ -55,6 +55,13 @@ bool readColor(OString const& rString, Color& rColor) ...@@ -55,6 +55,13 @@ bool readColor(OString const& rString, Color& rColor)
return true; return true;
} }
OString getValueOrAny(OString const& rInputString)
{
if (rInputString.isEmpty())
return "any";
return rInputString;
}
ControlPart xmlStringToControlPart(OString const& sPart) ControlPart xmlStringToControlPart(OString const& sPart)
{ {
if (sPart.equalsIgnoreAsciiCase("NONE")) if (sPart.equalsIgnoreAsciiCase("NONE"))
...@@ -308,16 +315,14 @@ void WidgetDefinitionReader::readPart(tools::XmlWalker& rWalker, ...@@ -308,16 +315,14 @@ void WidgetDefinitionReader::readPart(tools::XmlWalker& rWalker,
{ {
if (rWalker.name() == "state") if (rWalker.name() == "state")
{ {
OString sEnabled = rWalker.attribute("enabled"); OString sEnabled = getValueOrAny(rWalker.attribute("enabled"));
OString sFocused = rWalker.attribute("focused"); OString sFocused = getValueOrAny(rWalker.attribute("focused"));
OString sPressed = rWalker.attribute("pressed"); OString sPressed = getValueOrAny(rWalker.attribute("pressed"));
OString sRollover = rWalker.attribute("rollover"); OString sRollover = getValueOrAny(rWalker.attribute("rollover"));
OString sDefault = rWalker.attribute("default"); OString sDefault = getValueOrAny(rWalker.attribute("default"));
OString sSelected = rWalker.attribute("selected"); OString sSelected = getValueOrAny(rWalker.attribute("selected"));
OString sButtonValue = rWalker.attribute("button-value"); OString sButtonValue = getValueOrAny(rWalker.attribute("button-value"));
OString sExtra = rWalker.attribute("extra"); OString sExtra = getValueOrAny(rWalker.attribute("extra"));
if (sExtra.isEmpty())
sExtra = "any";
std::shared_ptr<WidgetDefinitionState> pState = std::make_shared<WidgetDefinitionState>( std::shared_ptr<WidgetDefinitionState> pState = std::make_shared<WidgetDefinitionState>(
sEnabled, sFocused, sPressed, sRollover, sDefault, sSelected, sButtonValue, sExtra); sEnabled, sFocused, sPressed, sRollover, sDefault, sSelected, sButtonValue, sExtra);
......
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