summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_textbreak.cpp
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2017-03-13 12:08:31 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-13 16:28:00 +0000
commit8da79203b32d1a0df05a23da83044bdaf71c320d (patch)
tree8cbb0484f9e44a406c74e9b937c10b2afd248b76 /xfa/fgas/layout/fgas_textbreak.cpp
parent575898e6251c1dbb8de0d40a5b6ce90762aa2af2 (diff)
downloadpdfium-8da79203b32d1a0df05a23da83044bdaf71c320d.tar.xz
Simplify the CFX_TxtPiece class
This Cl removes unused methods and makes GetString return a CFX_WideString instead of taking an out parameter. Change-Id: I3d2fcbdf51e7619f4fa42e46a0c83fbfa1132a84 Reviewed-on: https://pdfium-review.googlesource.com/2950 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fgas/layout/fgas_textbreak.cpp')
-rw-r--r--xfa/fgas/layout/fgas_textbreak.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp
index 68930db919..a6473842f0 100644
--- a/xfa/fgas/layout/fgas_textbreak.cpp
+++ b/xfa/fgas/layout/fgas_textbreak.cpp
@@ -563,7 +563,6 @@ void CFX_TxtBreak::EndBreak_Alignment(const std::deque<FX_TPO>& tpos,
int32_t iCount = pCurPieces->GetSize();
bool bFind = false;
FX_TPO tpo;
- CFX_TxtChar* pTC;
FX_CHARTYPE chartype;
for (i = iCount - 1; i > -1; i--) {
tpo = tpos[i];
@@ -574,14 +573,14 @@ void CFX_TxtBreak::EndBreak_Alignment(const std::deque<FX_TPO>& tpos,
bool bArabic = FX_IsOdd(ttp.m_iBidiLevel);
j = bArabic ? 0 : ttp.m_iChars - 1;
while (j > -1 && j < ttp.m_iChars) {
- pTC = ttp.GetCharPtr(j);
- if (pTC->m_nBreakType == FX_LBT_DIRECT_BRK)
+ const CFX_TxtChar& pTC = ttp.GetChar(j);
+ if (pTC.m_nBreakType == FX_LBT_DIRECT_BRK)
iGapChars++;
if (!bFind || !bAllChars) {
- chartype = pTC->GetCharType();
+ chartype = pTC.GetCharType();
if (chartype == FX_CHARTYPE_Space || chartype == FX_CHARTYPE_Control) {
if (!bFind) {
- iCharWidth = pTC->m_iCharWidth;
+ iCharWidth = pTC.m_iCharWidth;
if (bAllChars && iCharWidth > 0)
iNetWidth -= iCharWidth;
}
@@ -610,12 +609,12 @@ void CFX_TxtBreak::EndBreak_Alignment(const std::deque<FX_TPO>& tpos,
ttp.m_iStartPos = iStart;
for (j = 0; j < ttp.m_iChars; j++) {
- pTC = ttp.GetCharPtr(j);
- if (pTC->m_nBreakType != FX_LBT_DIRECT_BRK || pTC->m_iCharWidth < 0)
+ CFX_TxtChar& pTC = ttp.GetChar(j);
+ if (pTC.m_nBreakType != FX_LBT_DIRECT_BRK || pTC.m_iCharWidth < 0)
continue;
int32_t k = iOffset / iGapChars;
- pTC->m_iCharWidth += k;
+ pTC.m_iCharWidth += k;
ttp.m_iWidth += k;
iOffset -= k;
iGapChars--;