From 25453b90f25eff970ec666f194dacf772e8cf56e Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 4 Jul 2008 10:10:37 +0000 Subject: [PATCH] --- .../application/juce_PropertiesFile.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/juce_appframework/application/juce_PropertiesFile.cpp b/src/juce_appframework/application/juce_PropertiesFile.cpp index 36ee769f24..73b5087e23 100644 --- a/src/juce_appframework/application/juce_PropertiesFile.cpp +++ b/src/juce_appframework/application/juce_PropertiesFile.cpp @@ -117,7 +117,12 @@ PropertiesFile::PropertiesFile (const File& f, const String name (e->getStringAttribute (T("name"))); if (name.isNotEmpty()) - getAllProperties().set (name, e->getStringAttribute (T("val"))); + { + getAllProperties().set (name, + e->getFirstChildElement() != 0 + ? e->getFirstChildElement()->createDocument (String::empty, true) + : e->getStringAttribute (T("val"))); + } } } else @@ -171,7 +176,16 @@ bool PropertiesFile::save() { XmlElement* const e = new XmlElement (propertyTagName); e->setAttribute (T("name"), getAllProperties().getAllKeys() [i]); - e->setAttribute (T("val"), getAllProperties().getAllValues() [i]); + + // if the value seems to contain xml, store it as such.. + XmlDocument xmlContent (getAllProperties().getAllValues() [i]); + XmlElement* const childElement = xmlContent.getDocumentElement(); + + if (childElement != 0) + e->addChildElement (childElement); + else + e->setAttribute (T("val"), getAllProperties().getAllValues() [i]); + doc->addChildElement (e); }