diff options
author | Lei Zhang <thestig@chromium.org> | 2017-11-21 18:07:00 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-21 18:07:00 +0000 |
commit | 135c6601bd9d12bd935371d3122f8e75391de75b (patch) | |
tree | 185227ece2aa6cceb58911d2b25871dab4860251 /xfa | |
parent | f276e78e190e04b25c3f05b35a28ecdd30bdcf21 (diff) | |
download | pdfium-135c6601bd9d12bd935371d3122f8e75391de75b.tar.xz |
Add {Byte/Wide}String::Trim().
So callers no longer have to call str.TrimLeft(); str.TrimRight();
Change-Id: If931eaa8d891f487b9618ebbeee5ee294e807846
Reviewed-on: https://pdfium-review.googlesource.com/18990
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/fxfa/cxfa_textlayout.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_layoutpagemgr.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp index 93c1beebf7..7ff86bafeb 100644 --- a/xfa/fxfa/cxfa_textlayout.cpp +++ b/xfa/fxfa/cxfa_textlayout.cpp @@ -775,7 +775,7 @@ bool CXFA_TextLayout::LoadRichText( if (m_pLoader) { if (wsText.GetLength() > 0 && (m_pLoader->m_dwFlags & XFA_LOADERCNTXTFLG_FILTERSPACE)) { - wsText.TrimLeft(0x20); + wsText.TrimLeft(L" "); } if (CFX_CSSDisplay::Block == eDisplay) { m_pLoader->m_dwFlags |= XFA_LOADERCNTXTFLG_FILTERSPACE; diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp index 2752b35718..c717aff259 100644 --- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp +++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp @@ -142,8 +142,7 @@ CXFA_Node* ResolveBreakTarget(CXFA_Node* pPageSetRoot, if (wsTargetAll.IsEmpty()) return nullptr; - wsTargetAll.TrimLeft(); - wsTargetAll.TrimRight(); + wsTargetAll.Trim(); int32_t iSplitIndex = 0; bool bTargetAllFind = true; while (iSplitIndex != -1) { @@ -383,7 +382,8 @@ bool CXFA_LayoutPageMgr::PrepareFirstPage(CXFA_Node* pRootSubform) { pRootSubform->GetNextSameClassSibling(XFA_Element::Subform); } } - CXFA_Node *pLeader, *pTrailer; + CXFA_Node* pLeader; + CXFA_Node* pTrailer; if (pBreakBeforeNode && ExecuteBreakBeforeOrAfter(pBreakBeforeNode, true, pLeader, pTrailer)) { m_CurrentContainerRecordIter = m_ProposedContainerRecords.begin(); |