diff options
author | Lei Zhang <thestig@chromium.org> | 2018-08-20 17:14:26 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-20 17:14:26 +0000 |
commit | f01e4a5ec03c6b232d41dc878a3640924150f2a7 (patch) | |
tree | 6ad558d5e5688d87f3495413ad21a2c08003e795 /xfa/fgas/layout/cfx_rtfbreak.cpp | |
parent | 5b10a4c713fbc831cc7bed16936b44ff65fd68b1 (diff) | |
download | pdfium-f01e4a5ec03c6b232d41dc878a3640924150f2a7.tar.xz |
Use more consts in CFX_Break.
Change-Id: I57cd74581849a8f434f64c4ec3c4ad3ce1f92546
Reviewed-on: https://pdfium-review.googlesource.com/40630
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fgas/layout/cfx_rtfbreak.cpp')
-rw-r--r-- | xfa/fgas/layout/cfx_rtfbreak.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xfa/fgas/layout/cfx_rtfbreak.cpp b/xfa/fgas/layout/cfx_rtfbreak.cpp index 4dfe8989d1..a50bade98a 100644 --- a/xfa/fgas/layout/cfx_rtfbreak.cpp +++ b/xfa/fgas/layout/cfx_rtfbreak.cpp @@ -27,15 +27,15 @@ CFX_RTFBreak::CFX_RTFBreak(uint32_t dwLayoutStyles) CFX_RTFBreak::~CFX_RTFBreak() {} void CFX_RTFBreak::SetLineStartPos(float fLinePos) { - int32_t iLinePos = FXSYS_round(fLinePos * 20000.0f); + int32_t iLinePos = FXSYS_round(fLinePos * kConversionFactor); iLinePos = std::min(iLinePos, m_iLineWidth); iLinePos = std::max(iLinePos, m_iLineStart); m_pCurLine->m_iStart = iLinePos; } void CFX_RTFBreak::AddPositionedTab(float fTabPos) { - int32_t iTabPos = - std::min(FXSYS_round(fTabPos * 20000.0f) + m_iLineStart, m_iLineWidth); + int32_t iTabPos = std::min( + FXSYS_round(fTabPos * kConversionFactor) + m_iLineStart, m_iLineWidth); auto it = std::lower_bound(m_PositionedTabs.begin(), m_PositionedTabs.end(), iTabPos); if (it != m_PositionedTabs.end() && *it == iTabPos) @@ -158,7 +158,7 @@ void CFX_RTFBreak::AppendChar_Tab(CFX_Char* pCurChar) { iSafeCharWidth = iCharWidth; } else { // Tab width is >= 160000, so this part does not need to be checked. - ASSERT(m_iTabWidth >= 160000); + ASSERT(m_iTabWidth >= kMinimumTabWidth); iSafeCharWidth = iLineWidth / m_iTabWidth + 1; iSafeCharWidth *= m_iTabWidth; } |