summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceParser.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2016-03-11 09:16:43 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-03-11 09:16:44 +0000
commit330c57dbd19a064d1f5a4adb3c8ed014711b473f (patch)
tree9a795b0dbeae55273f3f3f35d842574f51102c6d /tools/aapt2/ResourceParser.cpp
parent607c0a0a09e6543609f70eb27cc06ff44857252e (diff)
parent7656554f91b40bc93bf94c89afcad4a9a8ced884 (diff)
Merge "AAPT2: Add descriptions of Attributes in Styleables for R.java" into nyc-dev
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
-rw-r--r--tools/aapt2/ResourceParser.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp
index b100e84f8a46..9704d97029b7 100644
--- a/tools/aapt2/ResourceParser.cpp
+++ b/tools/aapt2/ResourceParser.cpp
@@ -81,6 +81,12 @@ struct ParsedResource {
// Recursively adds resources to the ResourceTable.
static bool addResourcesToTable(ResourceTable* table, IDiagnostics* diag, ParsedResource* res) {
+ StringPiece16 trimmedComment = util::trimWhitespace(res->comment);
+ if (trimmedComment.size() != res->comment.size()) {
+ // Only if there was a change do we re-assign.
+ res->comment = trimmedComment.toString();
+ }
+
if (res->symbolState) {
Symbol symbol;
symbol.state = res->symbolState.value();