X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/406a85e3379b4ecdd668cb39a386864db2d59e0e..f31a875568a6a1049af3566d7f5ae440d29c9e4a:/XMLNode.cpp diff --git a/XMLNode.cpp b/XMLNode.cpp index 6daa0d2..4c59288 100644 --- a/XMLNode.cpp +++ b/XMLNode.cpp @@ -219,7 +219,12 @@ moveon: } spanStack.pop(); - if (empty) { + /* + * This warning seems to be just an irritation to most people, + * since it is typically introduced by translators who then never + * see the warning. + */ + if (0 && empty) { fprintf(stderr, "%s:%d: warning: empty '%s' span found in text '%s'\n", fileName, inXml->getLineNumber(), String8(spanTag).string(), String8(*outString).string()); @@ -473,6 +478,7 @@ XMLNode::XMLNode(const String8& filename, const String16& s1, const String16& s2 , mFilename(filename) , mStartLineNumber(0) , mEndLineNumber(0) + , mUTF8(false) { if (isNamespace) { mNamespacePrefix = s1; @@ -549,6 +555,19 @@ const XMLNode::attribute_entry* XMLNode::getAttribute(const String16& ns, return NULL; } +XMLNode::attribute_entry* XMLNode::editAttribute(const String16& ns, + const String16& name) +{ + for (size_t i=0; ins == ns && ae->name == name) { + return ae; + } + } + + return NULL; +} + const String16& XMLNode::getCData() const { return mChars; @@ -832,7 +851,7 @@ status_t XMLNode::assignResourceIds(const sp& assets, status_t XMLNode::flatten(const sp& dest, bool stripComments, bool stripRawValues) const { - StringPool strings; + StringPool strings = StringPool(false, mUTF8); Vector resids; // First collect just the strings for attribute names that have a