From: Ben Gruver Date: Thu, 8 Mar 2012 22:52:09 +0000 (-0800) Subject: Merge "Fix an issue where a non-styled string could be made into a styled string" X-Git-Url: https://git.saurik.com/android/aapt.git/commitdiff_plain/9c823478da49d3291645ee3235ce55110bcf8835?hp=ff618d5a3ab8c4854727be2b49cee98bf4c9da3c Merge "Fix an issue where a non-styled string could be made into a styled string" --- diff --git a/StringPool.cpp b/StringPool.cpp index fe88e37..7f137ce 100644 --- a/StringPool.cpp +++ b/StringPool.cpp @@ -174,7 +174,9 @@ ssize_t StringPool::add(const String16& ident, const String16& value, } const bool first = vidx < 0; - if (first || !mergeDuplicates) { + const bool styled = (pos >= 0 && (size_t)pos < mEntryStyleArray.size()) ? + mEntryStyleArray[pos].spans.size() : 0; + if (first || styled || !mergeDuplicates) { pos = mEntryArray.add(eidx); if (first) { vidx = mValues.add(value, pos);