Commit c13e7606 authored by Miyoung Shin's avatar Miyoung Shin Committed by Commit Bot

Refactor: unsigned short/unsigned -> uint16_t in third_party/blink/renderer/platform/text

- unsigned short / unsigned -> uint16_t.
- USHRT_MAX -> std::numeric_limits<uint16_t>::max()
- Reference: https://google.github.io/styleguide/cppguide.html#Integer_Types

Bug: 929986
Change-Id: If80935d74042f4f8e50275d0ec17832e19ae7046
Reviewed-on: https://chromium-review.googlesource.com/c/1490367
Commit-Queue: Miyoung Shin <myid.shin@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636641}
parent ed541124
...@@ -315,7 +315,7 @@ void InlineTextBox::AttachLine() { ...@@ -315,7 +315,7 @@ void InlineTextBox::AttachLine() {
GetLineLayoutItem().AttachTextBox(this); GetLineLayoutItem().AttachTextBox(this);
} }
void InlineTextBox::SetTruncation(unsigned truncation) { void InlineTextBox::SetTruncation(uint16_t truncation) {
if (truncation == truncation_) if (truncation == truncation_)
return; return;
......
...@@ -176,7 +176,7 @@ class CORE_EXPORT InlineTextBox : public InlineBox { ...@@ -176,7 +176,7 @@ class CORE_EXPORT InlineTextBox : public InlineBox {
private: private:
bool IsBoxEndIncludedInSelection() const; bool IsBoxEndIncludedInSelection() const;
void SetTruncation(unsigned); void SetTruncation(uint16_t);
void ClearTruncation() final; void ClearTruncation() final;
LayoutUnit PlaceEllipsisBox(bool flow_is_ltr, LayoutUnit PlaceEllipsisBox(bool flow_is_ltr,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_TRUNCATION_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_TRUNCATION_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_TRUNCATION_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_TRUNCATION_H_
#include <climits> #include <limits>
namespace blink { namespace blink {
...@@ -17,10 +17,11 @@ namespace blink { ...@@ -17,10 +17,11 @@ namespace blink {
// representing the characters that are not truncated. // representing the characters that are not truncated.
// //
// Thus the maximum possible length of the text displayed before an ellipsis in // Thus the maximum possible length of the text displayed before an ellipsis in
// a single NGTextFragment or InlineTextBox is |USHRT_MAX - 2| to allow for the // a single NGTextFragment or InlineTextBox is
// no-truncation and full-truncation states. // |std::numeric_limits<uint16_t>::max() - 2| to allow for the no-truncation and
const unsigned short kCNoTruncation = USHRT_MAX; // full-truncation states.
const unsigned short kCFullTruncation = USHRT_MAX - 1; constexpr uint16_t kCNoTruncation = std::numeric_limits<uint16_t>::max();
constexpr uint16_t kCFullTruncation = std::numeric_limits<uint16_t>::max() - 1;
} // namespace blink } // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment