From 3b460497e8ae53d07289b2351298ef7cc1c1baad Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 9 Jan 2019 17:02:21 -0800 Subject: [PATCH 1/2] Avoid using std::string Eliminates a using std::string directive that conflicts with a Google-internal using directive in base libs. --- third_party/txt/src/minikin/Layout.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/third_party/txt/src/minikin/Layout.cpp b/third_party/txt/src/minikin/Layout.cpp index 436c59b9f9df3..0d4c573a7d9cc 100644 --- a/third_party/txt/src/minikin/Layout.cpp +++ b/third_party/txt/src/minikin/Layout.cpp @@ -41,9 +41,6 @@ #include "LayoutUtils.h" #include "MinikinInternal.h" -using std::string; -using std::vector; - namespace minikin { const int kDirection_Mask = 0x1; @@ -745,7 +742,7 @@ float Layout::doLayoutWord(const uint16_t* buf, return advance; } -static void addFeatures(const string& str, vector* features) { +static void addFeatures(const std::string& str, std::vector* features) { if (!str.size()) return; @@ -925,10 +922,10 @@ void Layout::doLayoutRun(const uint16_t* buf, LayoutContext* ctx, const std::shared_ptr& collection) { hb_buffer_t* buffer = LayoutEngine::getInstance().hbBuffer; - vector items; + std::vector items; collection->itemize(buf + start, count, ctx->style, &items); - vector features; + std::vector features; // Disable default-on non-required ligature features if letter-spacing // See http://dev.w3.org/csswg/css-text-3/#letter-spacing-property // "When the effective spacing between two characters is not zero (due to From d29cc32648696137753ad0d63179664d0b9e3763 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 9 Jan 2019 17:13:38 -0800 Subject: [PATCH 2/2] Apply clang-format --- third_party/txt/src/minikin/Layout.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/third_party/txt/src/minikin/Layout.cpp b/third_party/txt/src/minikin/Layout.cpp index 0d4c573a7d9cc..fa30e1ab50a53 100644 --- a/third_party/txt/src/minikin/Layout.cpp +++ b/third_party/txt/src/minikin/Layout.cpp @@ -742,7 +742,8 @@ float Layout::doLayoutWord(const uint16_t* buf, return advance; } -static void addFeatures(const std::string& str, std::vector* features) { +static void addFeatures(const std::string& str, + std::vector* features) { if (!str.size()) return;