diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-08-14 10:26:59 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-14 14:50:00 +0000 |
commit | dff02cee2d2410d81a55c59345fb38b5aac8a457 (patch) | |
tree | d09dfb18aeb7ae4af4ec96ab0034c6aafbcee883 /xfa/fwl/cfwl_widget.cpp | |
parent | aeac95192c106b41c058c8372aa2ec8d0092f60b (diff) | |
download | pdfium-dff02cee2d2410d81a55c59345fb38b5aac8a457.tar.xz |
Cleanup FDE_TTO{STYLE|ALIGNMENT} defines.
This CL replaceds FDE_TTOSTYLE defines with a FDE_TextStyle struct which
is used to set the needed flags. The FDE_TTOALIGNMENT defines are
replaced with an enum class and unused members have been removed.
Change-Id: Ib0e2818a82e7f1961de57f8d15703477f8235a03
Reviewed-on: https://pdfium-review.googlesource.com/10530
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_widget.cpp')
-rw-r--r-- | xfa/fwl/cfwl_widget.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp index a2c270c332..8b8bf5d3cd 100644 --- a/xfa/fwl/cfwl_widget.cpp +++ b/xfa/fwl/cfwl_widget.cpp @@ -324,9 +324,12 @@ CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString& wsText, CFWL_ThemeText calPart; calPart.m_pWidget = this; calPart.m_wsText = wsText; - calPart.m_dwTTOStyles = - bMultiLine ? FDE_TTOSTYLE_LineWrap : FDE_TTOSTYLE_SingleLine; - calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; + if (bMultiLine) + calPart.m_dwTTOStyles.line_wrap_ = true; + else + calPart.m_dwTTOStyles.single_line_ = true; + + calPart.m_iTTOAlign = FDE_TextAlignment::kTopLeft; float fWidth = bMultiLine ? FWL_WGT_CalcMultiLineDefWidth : FWL_WGT_CalcWidth; CFX_RectF rect(0, 0, fWidth, FWL_WGT_CalcHeight); pTheme->CalcTextRect(&calPart, rect); @@ -335,8 +338,8 @@ CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString& wsText, void CFWL_Widget::CalcTextRect(const CFX_WideString& wsText, IFWL_ThemeProvider* pTheme, - uint32_t dwTTOStyles, - int32_t iTTOAlign, + const FDE_TextStyle& dwTTOStyles, + FDE_TextAlignment iTTOAlign, CFX_RectF& rect) { CFWL_ThemeText calPart; calPart.m_pWidget = this; |