diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2021-04-21 17:44:55 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-04-21 17:44:55 +0000 |
commit | 31031a91f1da3e5acdc493e88d98589b5a6dce2f (patch) | |
tree | 364ecd3aba9f0b0566837153aa7a9148cbe908bb /tools/aapt2/xml/XmlDom.cpp | |
parent | 991791446c1e1a5dea9f4a8e716c4237865dd64e (diff) | |
parent | efcdb95fa7cf2da7d599e0bcda250514ac5ee048 (diff) |
Merge "Aapt2 ValueTransformer" into sc-dev
Diffstat (limited to 'tools/aapt2/xml/XmlDom.cpp')
-rw-r--r-- | tools/aapt2/xml/XmlDom.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/aapt2/xml/XmlDom.cpp b/tools/aapt2/xml/XmlDom.cpp index 005eeb936612..2cdcfe45b50e 100644 --- a/tools/aapt2/xml/XmlDom.cpp +++ b/tools/aapt2/xml/XmlDom.cpp @@ -374,6 +374,7 @@ std::unique_ptr<XmlResource> Inflate(const void* data, size_t len, std::string* std::unique_ptr<XmlResource> XmlResource::Clone() const { std::unique_ptr<XmlResource> cloned = util::make_unique<XmlResource>(file); + CloningValueTransformer cloner(&cloned->string_pool); if (root != nullptr) { cloned->root = root->CloneElement([&](const xml::Element& src, xml::Element* dst) { dst->attributes.reserve(src.attributes.size()); @@ -384,7 +385,7 @@ std::unique_ptr<XmlResource> XmlResource::Clone() const { cloned_attr.value = attr.value; cloned_attr.compiled_attribute = attr.compiled_attribute; if (attr.compiled_value != nullptr) { - cloned_attr.compiled_value.reset(attr.compiled_value->Clone(&cloned->string_pool)); + cloned_attr.compiled_value = attr.compiled_value->Transform(cloner); } dst->attributes.push_back(std::move(cloned_attr)); } |