diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-09 16:58:12 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-13 13:43:05 +0000 |
commit | c36fe07a4d800cab2bfbec95e8580ea2b0e406d2 (patch) | |
tree | 7d3cce091856f50d08aaf646022f464b4ab186a0 /xfa/fde/cfde_txtedtpage.cpp | |
parent | e472622d33bdca2316a22ff5ff8d77ac975c2eb2 (diff) | |
download | pdfium-c36fe07a4d800cab2bfbec95e8580ea2b0e406d2.tar.xz |
Cleanup FX_TXTBREAK
This Cl removes the FX_TXTBREAK defines and unifies the type with the
CFX_RTFBreakType which is renamed to CFX_BreakType.
Change-Id: I890ae5e08a65f922d714aaaa9ab0f9f8a882cb3c
Reviewed-on: https://pdfium-review.googlesource.com/2939
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_txtedtpage.cpp')
-rw-r--r-- | xfa/fde/cfde_txtedtpage.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fde/cfde_txtedtpage.cpp b/xfa/fde/cfde_txtedtpage.cpp index 8b58b2b443..12333c608d 100644 --- a/xfa/fde/cfde_txtedtpage.cpp +++ b/xfa/fde/cfde_txtedtpage.cpp @@ -246,7 +246,7 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox, m_pIter.reset(new CFDE_TxtEdtBuf::Iterator(static_cast<CFDE_TxtEdtBuf*>(pBuf), wcAlias)); CFX_TxtBreak* pBreak = m_pEditEngine->GetTextBreak(); - pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); + pBreak->EndBreak(CFX_BreakType::Paragraph); pBreak->ClearBreakPieces(); int32_t nPageLineCount = m_pEditEngine->GetPageLineCount(); int32_t nStartLine = nPageLineCount * m_nPageIndex; @@ -274,11 +274,11 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox, m_pTextSet = pdfium::MakeUnique<CFDE_TxtEdtTextSet>(this); m_Pieces.clear(); - uint32_t dwBreakStatus = FX_TXTBREAK_None; + CFX_BreakType dwBreakStatus = CFX_BreakType::None; int32_t nPieceStart = 0; m_CharWidths.resize(nPageEnd - nPageStart + 1, 0); - pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); + pBreak->EndBreak(CFX_BreakType::Paragraph); pBreak->ClearBreakPieces(); m_nPageStart = nPageStart; m_nCharCount = nPageEnd - nPageStart + 1; @@ -290,15 +290,15 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox, bool bFirstPiece = true; do { if (bReload) { - dwBreakStatus = pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); + dwBreakStatus = pBreak->EndBreak(CFX_BreakType::Paragraph); } else { FX_WCHAR wAppend = pIter->GetChar(); dwBreakStatus = pBreak->AppendChar(wAppend); } - if (pIter->GetAt() == nPageEnd && dwBreakStatus < FX_TXTBREAK_LineBreak) { - dwBreakStatus = pBreak->EndBreak(FX_TXTBREAK_ParagraphBreak); - } - if (dwBreakStatus > FX_TXTBREAK_PieceBreak) { + if (pIter->GetAt() == nPageEnd && CFX_BreakTypeNoneOrPiece(dwBreakStatus)) + dwBreakStatus = pBreak->EndBreak(CFX_BreakType::Paragraph); + + if (!CFX_BreakTypeNoneOrPiece(dwBreakStatus)) { int32_t nPieceCount = pBreak->CountBreakPieces(); for (int32_t j = 0; j < nPieceCount; j++) { const CFX_TxtPiece* pPiece = pBreak->GetBreakPiece(j); @@ -312,7 +312,7 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox, TxtEdtPiece.dwCharStyles |= FX_TXTCHARSTYLE_OddBidiLevel; } FX_FLOAT fParaBreakWidth = 0.0f; - if (pPiece->m_dwStatus > FX_TXTBREAK_PieceBreak) { + if (!CFX_BreakTypeNoneOrPiece(pPiece->m_dwStatus)) { FX_WCHAR wRtChar = pParams->wLineBreakChar; if (TxtEdtPiece.nCount >= 2) { FX_WCHAR wChar = pBuf->GetCharByIndex( @@ -356,7 +356,7 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox, fLinePos += fLineStep; pBreak->ClearBreakPieces(); } - if (pIter->GetAt() == nPageEnd && dwBreakStatus == FX_TXTBREAK_LineBreak) { + if (pIter->GetAt() == nPageEnd && dwBreakStatus == CFX_BreakType::Line) { bReload = true; pIter->Next(true); } |