[Scummvm-cvs-logs] SF.net SVN: scummvm: [21133] scummvm/trunk/gui/theme-config.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Mar 7 11:24:03 CET 2006


Revision: 21133
Author:   sev
Date:     2006-03-07 11:23:38 -0800 (Tue, 07 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21133&view=rev

Log Message:
-----------
Fix implementation of UseWithPrefix keyword

Modified Paths:
--------------
    scummvm/trunk/gui/theme-config.cpp
Modified: scummvm/trunk/gui/theme-config.cpp
===================================================================
--- scummvm/trunk/gui/theme-config.cpp	2006-03-07 19:19:37 UTC (rev 21132)
+++ scummvm/trunk/gui/theme-config.cpp	2006-03-07 19:23:38 UTC (rev 21133)
@@ -149,11 +149,21 @@
 			continue;
 		}
 		if (iterk->key == "useWithPrefix") {
-			if (iterk->value == name)
-				error("Theme section [%s]: cannot use itself", name.c_str());
-			if (!config.hasSection(name))
-				error("Undefined use of section [%s]", name.c_str());
-			processResSection(config, iterk->value, true, iterk->value + "_");
+			const char *temp = iterk->value.c_str();
+            const char *pos = strrchr(temp, ' ');
+			String n, pref;
+
+			if (pos == NULL)
+				error("2 arguments required for useWithPrefix keyword");
+
+			n = String(temp, strchr(temp, ' ') - temp);
+			pref = String(pos + 1);
+
+			if (n == name)
+				error("Theme section [%s]: cannot use itself", n.c_str());
+			if (!config.hasSection(n))
+				error("Undefined use of section [%s]", n.c_str());
+			processResSection(config, n, true, pref);
 			continue;
 		}
 		processSingleLine(name, prefix + iterk->key, iterk->value);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list