[Scummvm-git-logs] scummvm master -> ba2013cb464732ed87bdb84aa2adb33e7014c3a4

sev- sev at scummvm.org
Thu Mar 25 22:15:00 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ba2013cb46 GUI: Properly parse the 'rtl' key's value in the themes


Commit: ba2013cb464732ed87bdb84aa2adb33e7014c3a4
    https://github.com/scummvm/scummvm/commit/ba2013cb464732ed87bdb84aa2adb33e7014c3a4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T23:14:10+01:00

Commit Message:
GUI: Properly parse the 'rtl' key's value in the themes

Changed paths:
    gui/ThemeParser.cpp


diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index d2d298956a..31706db854 100644
--- a/gui/ThemeParser.cpp
+++ b/gui/ThemeParser.cpp
@@ -107,6 +107,20 @@ static GUI::ThemeEngine::TextAlignVertical parseTextVAlign(const Common::String
 		return GUI::ThemeEngine::kTextAlignVInvalid;
 }
 
+bool parseBoolean(const Common::String &val) {
+	if (val == "true")
+		return true;
+	else if (val == "yes")
+		return true;
+	else if (val == "false")
+		return false;
+	else if (val == "no")
+		return false;
+	else
+		warning("Incorrect boolean value %s", val.c_str());
+
+	return false;
+}
 
 ThemeParser::ThemeParser(ThemeEngine *parent) : XMLParser() {
 	_defaultStepGlobal = defaultDrawStep();
@@ -752,9 +766,8 @@ bool ThemeParser::parserCallback_widget(ParserNode *node) {
 				return parserError("Invalid value for text alignment.");
 		}
 
-		if (node->values.contains("rtl")) {
-			useRTL = false;
-		}
+		if (node->values.contains("rtl"))
+			useRTL = parseBoolean(node->values["rtl"]);
 
 		_theme->getEvaluator()->addWidget(var, node->values["type"], width, height, alignH, useRTL);
 	}




More information about the Scummvm-git-logs mailing list