summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceValues.h
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2017-06-13 16:03:55 -0700
committerAdam Lesinski <adamlesinski@google.com>2017-06-15 11:14:47 -0700
commit3124e7ca0f582c8d54a9b4cf560c25dfef77ac2a (patch)
treebe1af462cdec9a4808a49901cfb87fbe47b32a24 /tools/aapt2/ResourceValues.h
parent52feccbf41fe58921e66686077cb5ab20b2b0b13 (diff)
AAPT2: Fix issue with enums and integer attributes
When an attribute had the format "enum|integer", and a max or min allowed value set, any value set for this attribute would have its enum symbol's value checked against the valid integer range. This would lead to the following: android:numColumns="autofit" being interpreted as an integer value of -1, which violated the minimum expected value for numColumns, which was 0. Bug: 62358540 Test: make aapt2_tests Change-Id: I3150410448a533d3595a08ac6b2966264db874d8
Diffstat (limited to 'tools/aapt2/ResourceValues.h')
-rw-r--r--tools/aapt2/ResourceValues.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/aapt2/ResourceValues.h b/tools/aapt2/ResourceValues.h
index ac5795fb9774..7e7547fc1b94 100644
--- a/tools/aapt2/ResourceValues.h
+++ b/tools/aapt2/ResourceValues.h
@@ -264,7 +264,7 @@ struct Attribute : public BaseValue<Attribute> {
Attribute* Clone(StringPool* new_pool) const override;
void PrintMask(std::ostream* out) const;
void Print(std::ostream* out) const override;
- bool Matches(const Item* item, DiagMessage* out_msg) const;
+ bool Matches(const Item& item, DiagMessage* out_msg = nullptr) const;
};
struct Style : public BaseValue<Style> {