Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1403)

Unified Diff: third_party/WebKit/Source/platform/text/TextRun.h

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Rebase after reopen Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/text/TextRun.h
diff --git a/third_party/WebKit/Source/platform/text/TextRun.h b/third_party/WebKit/Source/platform/text/TextRun.h
index 65bf6dcbef05971a490883f71e49b5b888de0a48..1cec2196b84abecf9b9b4c0d5f6f7f0ab6913fd3 100644
--- a/third_party/WebKit/Source/platform/text/TextRun.h
+++ b/third_party/WebKit/Source/platform/text/TextRun.h
@@ -69,7 +69,7 @@ class PLATFORM_EXPORT TextRun final {
float expansion = 0,
ExpansionBehavior expansionBehavior = AllowTrailingExpansion |
ForbidLeadingExpansion,
- TextDirection direction = LTR,
+ TextDirection direction = TextDirection::Ltr,
bool directionalOverride = false)
: m_charactersLength(len),
m_len(len),
@@ -79,7 +79,7 @@ class PLATFORM_EXPORT TextRun final {
m_expansionBehavior(expansionBehavior),
m_is8Bit(true),
m_allowTabs(false),
- m_direction(direction),
+ m_direction(static_cast<unsigned>(direction)),
m_directionalOverride(directionalOverride),
m_disableSpacing(false),
m_textJustify(TextJustifyAuto),
@@ -94,7 +94,7 @@ class PLATFORM_EXPORT TextRun final {
float expansion = 0,
ExpansionBehavior expansionBehavior = AllowTrailingExpansion |
ForbidLeadingExpansion,
- TextDirection direction = LTR,
+ TextDirection direction = TextDirection::Ltr,
bool directionalOverride = false)
: m_charactersLength(len),
m_len(len),
@@ -104,7 +104,7 @@ class PLATFORM_EXPORT TextRun final {
m_expansionBehavior(expansionBehavior),
m_is8Bit(false),
m_allowTabs(false),
- m_direction(direction),
+ m_direction(static_cast<unsigned>(direction)),
m_directionalOverride(directionalOverride),
m_disableSpacing(false),
m_textJustify(TextJustifyAuto),
@@ -118,7 +118,7 @@ class PLATFORM_EXPORT TextRun final {
float expansion = 0,
ExpansionBehavior expansionBehavior = AllowTrailingExpansion |
ForbidLeadingExpansion,
- TextDirection direction = LTR,
+ TextDirection direction = TextDirection::Ltr,
bool directionalOverride = false)
: m_charactersLength(string.length()),
m_len(string.length()),
@@ -127,7 +127,7 @@ class PLATFORM_EXPORT TextRun final {
m_expansion(expansion),
m_expansionBehavior(expansionBehavior),
m_allowTabs(false),
- m_direction(direction),
+ m_direction(static_cast<unsigned>(direction)),
m_directionalOverride(directionalOverride),
m_disableSpacing(false),
m_textJustify(TextJustifyAuto),
@@ -240,13 +240,15 @@ class PLATFORM_EXPORT TextRun final {
TextDirection direction() const {
return static_cast<TextDirection>(m_direction);
}
- bool rtl() const { return m_direction == RTL; }
- bool ltr() const { return m_direction == LTR; }
+ bool rtl() const { return direction() == TextDirection::Rtl; }
+ bool ltr() const { return direction() == TextDirection::Ltr; }
bool directionalOverride() const { return m_directionalOverride; }
bool spacingDisabled() const { return m_disableSpacing; }
void disableSpacing() { m_disableSpacing = true; }
- void setDirection(TextDirection direction) { m_direction = direction; }
+ void setDirection(TextDirection direction) {
+ m_direction = static_cast<unsigned>(direction);
+ }
void setDirectionalOverride(bool override) {
m_directionalOverride = override;
}
« no previous file with comments | « third_party/WebKit/Source/platform/text/TextDirection.h ('k') | third_party/WebKit/Source/web/ExternalPopupMenu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698