summaryrefslogtreecommitdiffstats
path: root/tools/aapt
diff options
context:
space:
mode:
authorBen Gruver <bgruv@google.com>2012-03-07 21:19:16 -0800
committerBen Gruver <bgruv@google.com>2012-03-07 21:19:16 -0800
commitdb6e67d8ec081f43bcf14155741e268a38915719 (patch)
tree143c9d8b2324d6d7d662dbbd31c5f83bcdb6dbae /tools/aapt
parent42f23b3cfe2c4fa45c7c9ca4b60a6724aea31621 (diff)
downloadframeworks_base-db6e67d8ec081f43bcf14155741e268a38915719.zip
frameworks_base-db6e67d8ec081f43bcf14155741e268a38915719.tar.gz
frameworks_base-db6e67d8ec081f43bcf14155741e268a38915719.tar.bz2
Fix an issue where a non-styled string could be made into a styled string
If a styled version of an otherwise identical string is encountered before a non-styled version, aapt merges the two, effectively making the non-styled string have a spurious style. Change-Id: I424a61c0c83c59e0b9c8939e457402efd06a7a4f
Diffstat (limited to 'tools/aapt')
-rw-r--r--tools/aapt/StringPool.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp
index fe88e37..7f137ce 100644
--- a/tools/aapt/StringPool.cpp
+++ b/tools/aapt/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);