summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceParser.cpp
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2016-03-10 21:55:04 -0800
committer Adam Lesinski <adamlesinski@google.com> 2016-03-11 00:22:52 -0800
commit7656554f91b40bc93bf94c89afcad4a9a8ced884 (patch)
tree76a275c869513d419dc85ee2b7f946688043e3d9 /tools/aapt2/ResourceParser.cpp
parent5b37ef489a4090da3643041c8d0e6efa282ad8b6 (diff)
AAPT2: Add descriptions of Attributes in Styleables for R.java
Change-Id: I69e7b73cbdfe4baf502348397435c501ae29ff5e
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();