From 7656554f91b40bc93bf94c89afcad4a9a8ced884 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Thu, 10 Mar 2016 21:55:04 -0800 Subject: AAPT2: Add descriptions of Attributes in Styleables for R.java Change-Id: I69e7b73cbdfe4baf502348397435c501ae29ff5e --- tools/aapt2/ResourceParser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/aapt2/ResourceParser.cpp') 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(); -- cgit v1.2.3-59-g8ed1b