summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/cfx_break.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas/layout/cfx_break.cpp')
-rw-r--r--xfa/fgas/layout/cfx_break.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/xfa/fgas/layout/cfx_break.cpp b/xfa/fgas/layout/cfx_break.cpp
index 43ef9a3833..35c637a51f 100644
--- a/xfa/fgas/layout/cfx_break.cpp
+++ b/xfa/fgas/layout/cfx_break.cpp
@@ -12,11 +12,8 @@
#include "third_party/base/stl_util.h"
#include "xfa/fgas/font/cfgas_gefont.h"
-namespace {
-
-const int kMinimumTabWidth = 160000;
-
-} // namespace
+const float CFX_Break::kConversionFactor = 20000.0f;
+const int CFX_Break::kMinimumTabWidth = 160000;
CFX_Break::CFX_Break(uint32_t dwLayoutStyles)
: m_dwLayoutStyles(dwLayoutStyles) {
@@ -102,7 +99,8 @@ void CFX_Break::SetTabWidth(float fTabWidth) {
// Note, the use of max here was only done in the TxtBreak code. Leaving this
// in for the RTFBreak code for consistency. If we see issues with tab widths
// we may need to fix this.
- m_iTabWidth = std::max(FXSYS_round(fTabWidth * 20000.0f), kMinimumTabWidth);
+ m_iTabWidth =
+ std::max(FXSYS_round(fTabWidth * kConversionFactor), kMinimumTabWidth);
}
void CFX_Break::SetDefaultChar(wchar_t wch) {
@@ -125,19 +123,19 @@ void CFX_Break::SetParagraphBreakChar(wchar_t wch) {
}
void CFX_Break::SetLineBreakTolerance(float fTolerance) {
- m_iTolerance = FXSYS_round(fTolerance * 20000.0f);
+ m_iTolerance = FXSYS_round(fTolerance * kConversionFactor);
}
void CFX_Break::SetCharSpace(float fCharSpace) {
- m_iCharSpace = FXSYS_round(fCharSpace * 20000.0f);
+ m_iCharSpace = FXSYS_round(fCharSpace * kConversionFactor);
}
void CFX_Break::SetLineBoundary(float fLineStart, float fLineEnd) {
if (fLineStart > fLineEnd)
return;
- m_iLineStart = FXSYS_round(fLineStart * 20000.0f);
- m_iLineWidth = FXSYS_round(fLineEnd * 20000.0f);
+ m_iLineStart = FXSYS_round(fLineStart * kConversionFactor);
+ m_iLineWidth = FXSYS_round(fLineEnd * kConversionFactor);
m_pCurLine->m_iStart = std::min(m_pCurLine->m_iStart, m_iLineWidth);
m_pCurLine->m_iStart = std::max(m_pCurLine->m_iStart, m_iLineStart);
}