X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/804c194eac94d50849367090c96d6cc2d62d2760..2f6d4c72f931dc1840b9d0924e279a14b0701287:/StringPool.cpp 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);