summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_rtfbreak.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-28 14:51:28 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-28 20:40:34 +0000
commite3409535a6ecad8006d872df680ae7eda8120c1c (patch)
tree241dbd6b4db21b022a5cc5e3c4733d12129b747b /xfa/fgas/layout/fgas_rtfbreak.cpp
parent70719432f41eedeb405f3851ad88960c74e506be (diff)
downloadpdfium-e3409535a6ecad8006d872df680ae7eda8120c1c.tar.xz
Remove always true method paramschromium/3027
Cleanup a couple methods in RTFBreak and TextBreak which always recieve true as their parameter. Change-Id: I4704cdb6200b85e0a1a2990d16158ea58699a110 Reviewed-on: https://pdfium-review.googlesource.com/2879 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fgas/layout/fgas_rtfbreak.cpp')
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp
index 9791a5f20f..a3bf58c27b 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.cpp
+++ b/xfa/fgas/layout/fgas_rtfbreak.cpp
@@ -187,23 +187,20 @@ CFX_RTFChar* CFX_RTFBreak::GetLastChar(int32_t index) const {
}
return nullptr;
}
-CFX_RTFLine* CFX_RTFBreak::GetRTFLine(bool bReady) const {
- if (bReady) {
- if (m_iReady == 1) {
- return (CFX_RTFLine*)&m_RTFLine1;
- } else if (m_iReady == 2) {
- return (CFX_RTFLine*)&m_RTFLine2;
- } else {
- return nullptr;
- }
- }
- ASSERT(m_pCurLine);
- return m_pCurLine;
+
+CFX_RTFLine* CFX_RTFBreak::GetRTFLine() const {
+ if (m_iReady == 1)
+ return (CFX_RTFLine*)&m_RTFLine1;
+ if (m_iReady == 2)
+ return (CFX_RTFLine*)&m_RTFLine2;
+ return nullptr;
}
-CFX_RTFPieceArray* CFX_RTFBreak::GetRTFPieces(bool bReady) const {
- CFX_RTFLine* pRTFLine = GetRTFLine(bReady);
+
+CFX_RTFPieceArray* CFX_RTFBreak::GetRTFPieces() const {
+ CFX_RTFLine* pRTFLine = GetRTFLine();
return pRTFLine ? &pRTFLine->m_LinePieces : nullptr;
}
+
inline FX_CHARTYPE CFX_RTFBreak::GetUnifiedCharType(
FX_CHARTYPE chartype) const {
return chartype >= FX_CHARTYPE_ArabicAlef ? FX_CHARTYPE_Arabic : chartype;
@@ -423,7 +420,7 @@ CFX_RTFBreakType CFX_RTFBreak::EndBreak(CFX_RTFBreakType dwStatus) {
return dwStatus;
}
- CFX_RTFLine* pLastLine = GetRTFLine(true);
+ CFX_RTFLine* pLastLine = GetRTFLine();
if (pLastLine) {
pCurPieces = &pLastLine->m_LinePieces;
iCount = pCurPieces->GetSize();
@@ -856,12 +853,12 @@ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine* pCurLine,
}
int32_t CFX_RTFBreak::CountBreakPieces() const {
- CFX_RTFPieceArray* pRTFPieces = GetRTFPieces(true);
+ CFX_RTFPieceArray* pRTFPieces = GetRTFPieces();
return pRTFPieces ? pRTFPieces->GetSize() : 0;
}
const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(int32_t index) const {
- CFX_RTFPieceArray* pRTFPieces = GetRTFPieces(true);
+ CFX_RTFPieceArray* pRTFPieces = GetRTFPieces();
if (!pRTFPieces)
return nullptr;
@@ -873,7 +870,7 @@ const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(int32_t index) const {
void CFX_RTFBreak::GetLineRect(CFX_RectF& rect) const {
rect.top = 0;
- CFX_RTFLine* pRTFLine = GetRTFLine(true);
+ CFX_RTFLine* pRTFLine = GetRTFLine();
if (!pRTFLine) {
rect.left = ((FX_FLOAT)m_iBoundaryStart) / 20000.0f;
rect.width = rect.height = 0;
@@ -903,7 +900,7 @@ void CFX_RTFBreak::GetLineRect(CFX_RectF& rect) const {
rect.height = ((FX_FLOAT)iLineHeight) / 20.0f;
}
void CFX_RTFBreak::ClearBreakPieces() {
- CFX_RTFLine* pRTFLine = GetRTFLine(true);
+ CFX_RTFLine* pRTFLine = GetRTFLine();
if (pRTFLine) {
pRTFLine->RemoveAll(true);
}