Fix manfiest_util parsing localized text nodes 42/36842/3
authorJakub Izydorczyk <j.izydorczyk@samsung.com>
Fri, 13 Mar 2015 13:03:44 +0000 (14:03 +0100)
committerPawel Sikorski <p.sikorski@samsung.com>
Wed, 18 Mar 2015 13:56:47 +0000 (06:56 -0700)
manifest_util was was adding bidi control characters in front and
in the back twice, when dir attribute was specified.

Manifest util test results:
12/12 tests PASS

Change-Id: Ic83a766508f871607849c298d335e813b4484db7

src/widget-manifest-parser/manifest_util.cc

index 15b618e..14928db 100644 (file)
@@ -87,14 +87,15 @@ std::string GetNodeText(xmlNode* root, const std::string& inherit_dir) {
   std::string text;
   for (xmlNode* node = root->children; node; node = node->next) {
     if (node->type == XML_TEXT_NODE || node->type == XML_CDATA_SECTION_NODE) {
-      text = text
-          + common_installer::utils::StripWrappingBidiControlCharactersUTF8(
+      text += common_installer::utils::StripWrappingBidiControlCharactersUTF8(
           std::string(reinterpret_cast<char*>(node->content)));
+      // This is supposed to be done once for each text element
+      text = common_installer::utils::GetDirTextUTF8(text, current_dir);
     } else {
       text = text + GetNodeText(node, current_dir);
     }
   }
-  return common_installer::utils::GetDirTextUTF8(text, current_dir);
+  return text;
 }
 
 // According to widget specification, this two prop need to support dir.