summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_rtfbreak.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-01 09:38:14 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-03-01 15:34:33 +0000
commitd1aee7ce47383377888a3b88bfffc340330190da (patch)
tree97caf152e1ea5800c564898115b35cc9540120d6 /xfa/fgas/layout/fgas_rtfbreak.cpp
parent17f31183d59ee5371c1fafdb4a72390e863320ae (diff)
downloadpdfium-d1aee7ce47383377888a3b88bfffc340330190da.tar.xz
More RTFBreak unused code and default params
This Cl removes more unused methods from the RTFBreak code along with removing all default params. Change-Id: I31d2880acde590ca9239440239ac56f5bb370f56 Reviewed-on: https://pdfium-review.googlesource.com/2881 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fgas/layout/fgas_rtfbreak.cpp')
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.cpp51
1 files changed, 4 insertions, 47 deletions
diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp
index e2cfaaaec3..dd3f34c739 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.cpp
+++ b/xfa/fgas/layout/fgas_rtfbreak.cpp
@@ -863,38 +863,6 @@ const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(int32_t index) const {
return pRTFPieces->GetPtrAt(index);
}
-void CFX_RTFBreak::GetLineRect(CFX_RectF& rect) const {
- rect.top = 0;
- const CFX_RTFLine* pRTFLine = GetRTFLine();
- if (!pRTFLine) {
- rect.left = ((FX_FLOAT)m_iBoundaryStart) / 20000.0f;
- rect.width = rect.height = 0;
- return;
- }
-
- rect.left = static_cast<FX_FLOAT>(pRTFLine->m_iStart) / 20000.0f;
- rect.width = static_cast<FX_FLOAT>(pRTFLine->m_iWidth) / 20000.0f;
- const CFX_RTFPieceArray& rtfPieces = pRTFLine->m_LinePieces;
- int32_t iCount = rtfPieces.GetSize();
- if (iCount < 1) {
- rect.width = 0;
- return;
- }
-
- CFX_RTFPiece* pBreakPiece;
- int32_t iLineHeight = 0;
- int32_t iMax;
- for (int32_t i = 0; i < iCount; i++) {
- pBreakPiece = rtfPieces.GetPtrAt(i);
- int32_t iFontHeight = FXSYS_round(pBreakPiece->m_iFontHeight *
- pBreakPiece->m_iVerticalScale / 100.0f);
- iMax = std::max(pBreakPiece->m_iFontSize, iFontHeight);
- if (i == 0 || iLineHeight < iMax)
- iLineHeight = iMax;
- }
- rect.height = static_cast<FX_FLOAT>(iLineHeight) / 20.0f;
-}
-
void CFX_RTFBreak::ClearBreakPieces() {
const CFX_RTFLine* pRTFLine = GetRTFLine();
if (pRTFLine)
@@ -910,9 +878,7 @@ void CFX_RTFBreak::Reset() {
int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
FXTEXT_CHARPOS* pCharPos,
- bool bCharCode,
- CFX_WideString* pWSForms,
- FX_AdjustCharDisplayPos pAdjustPos) const {
+ bool bCharCode) const {
if (!pText || pText->iLength < 1)
return 0;
@@ -1001,8 +967,6 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
pCharPos->m_ExtGID = pCharPos->m_GlyphIndex;
#endif
pCharPos->m_FontCharWidth = iCharWidth;
- if (pWSForms)
- *pWSForms += wForm;
}
iCharHeight = 1000;
@@ -1011,15 +975,8 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
if (bRTLPiece && dwCharType != FX_CHARTYPE_Combination)
fX -= fCharWidth;
- if (!bEmptyChar) {
- CFX_PointF ptOffset;
- bool bAdjusted = false;
- if (pAdjustPos) {
- bAdjusted =
- pAdjustPos(wForm, false, pFont, fFontSize, false, ptOffset);
- }
- pCharPos->m_Origin = CFX_PointF(fX + ptOffset.x, fY - ptOffset.y);
- }
+ if (!bEmptyChar)
+ pCharPos->m_Origin = CFX_PointF(fX, fY);
if (!bRTLPiece && dwCharType != FX_CHARTYPE_Combination)
fX += fCharWidth;
@@ -1079,7 +1036,7 @@ CFX_RTFLine::CFX_RTFLine()
m_iMBCSChars(0) {}
CFX_RTFLine::~CFX_RTFLine() {
- RemoveAll();
+ RemoveAll(false);
}
FX_RTFTEXTOBJ::FX_RTFTEXTOBJ()