diff options
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/fxfa/cxfa_loadercontext.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_textlayout.cpp | 19 |
2 files changed, 9 insertions, 12 deletions
diff --git a/xfa/fxfa/cxfa_loadercontext.h b/xfa/fxfa/cxfa_loadercontext.h index 87a795be9c..91ffee64f9 100644 --- a/xfa/fxfa/cxfa_loadercontext.h +++ b/xfa/fxfa/cxfa_loadercontext.h @@ -22,13 +22,13 @@ struct CXFA_LoaderContext { ~CXFA_LoaderContext(); bool bSaveLineHeight = false; + bool bFilterSpace = false; float fWidth = 0; float fHeight = 0; float fLastPos = 0; float fStartLineOffset = 0; int32_t iChar = 0; int32_t iTotalLines = -1; - uint32_t dwFlags = 0; UnownedPtr<const CFX_XMLNode> pXMLNode; UnownedPtr<CXFA_Node> pNode; RetainPtr<CFX_CSSComputedStyle> pParentStyle; diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp index ec36bcb7a3..44a7c64fc0 100644 --- a/xfa/fxfa/cxfa_textlayout.cpp +++ b/xfa/fxfa/cxfa_textlayout.cpp @@ -34,8 +34,6 @@ #include "xfa/fxfa/parser/cxfa_node.h" #include "xfa/fxfa/parser/cxfa_para.h" -#define XFA_LOADERCNTXTFLG_FILTERSPACE 0x001 - namespace { void ProcessText(WideString* pText) { @@ -807,20 +805,19 @@ bool CXFA_TextLayout::LoadRichText( ProcessText(&wsText); if (m_pLoader) { - if (wsText.GetLength() > 0 && - (m_pLoader->dwFlags & XFA_LOADERCNTXTFLG_FILTERSPACE)) { + if (wsText.GetLength() > 0 && m_pLoader->bFilterSpace) { wsText.TrimLeft(L" "); } if (CFX_CSSDisplay::Block == eDisplay) { - m_pLoader->dwFlags |= XFA_LOADERCNTXTFLG_FILTERSPACE; + m_pLoader->bFilterSpace = true; } else if (CFX_CSSDisplay::Inline == eDisplay && - (m_pLoader->dwFlags & XFA_LOADERCNTXTFLG_FILTERSPACE)) { - m_pLoader->dwFlags &= ~XFA_LOADERCNTXTFLG_FILTERSPACE; + m_pLoader->bFilterSpace) { + m_pLoader->bFilterSpace = false; } else if (wsText.GetLength() > 0 && (0x20 == wsText[wsText.GetLength() - 1])) { - m_pLoader->dwFlags |= XFA_LOADERCNTXTFLG_FILTERSPACE; + m_pLoader->bFilterSpace = true; } else if (wsText.GetLength() != 0) { - m_pLoader->dwFlags &= ~XFA_LOADERCNTXTFLG_FILTERSPACE; + m_pLoader->bFilterSpace = false; } } @@ -833,7 +830,7 @@ bool CXFA_TextLayout::LoadRichText( if (AppendChar(wsText, pLinePos, 0, bSavePieces)) { if (m_pLoader) - m_pLoader->dwFlags &= ~XFA_LOADERCNTXTFLG_FILTERSPACE; + m_pLoader->bFilterSpace = false; if (IsEnd(bSavePieces)) { if (m_pLoader && m_pLoader->iTotalLines > -1) { m_pLoader->pXMLNode = pXMLNode; @@ -860,7 +857,7 @@ bool CXFA_TextLayout::LoadRichText( if (m_pLoader) { if (CFX_CSSDisplay::Block == eDisplay) - m_pLoader->dwFlags |= XFA_LOADERCNTXTFLG_FILTERSPACE; + m_pLoader->bFilterSpace = true; } if (bCurLi) EndBreak(CFX_BreakType::Line, pLinePos, bSavePieces); |