summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/cfx_txtbreak.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas/layout/cfx_txtbreak.cpp')
-rw-r--r--xfa/fgas/layout/cfx_txtbreak.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/xfa/fgas/layout/cfx_txtbreak.cpp b/xfa/fgas/layout/cfx_txtbreak.cpp
index 67140c4711..526fd64c96 100644
--- a/xfa/fgas/layout/cfx_txtbreak.cpp
+++ b/xfa/fgas/layout/cfx_txtbreak.cpp
@@ -305,7 +305,7 @@ bool CFX_TxtBreak::EndBreak_SplitLine(CFX_BreakLine* pNextLine,
CFX_BreakPiece tp;
if (bAllChars && !bDone) {
int32_t iEndPos = m_pCurLine->m_iWidth;
- GetBreakPos(m_pCurLine->m_LineChars, iEndPos, bAllChars, true);
+ GetBreakPos(m_pCurLine->m_LineChars, bAllChars, true, &iEndPos);
}
return false;
}
@@ -533,9 +533,9 @@ CFX_BreakType CFX_TxtBreak::EndBreak(CFX_BreakType dwStatus) {
}
int32_t CFX_TxtBreak::GetBreakPos(std::vector<CFX_Char>& ca,
- int32_t& iEndPos,
bool bAllChars,
- bool bOnlyBrk) {
+ bool bOnlyBrk,
+ int32_t* pEndPos) {
int32_t iLength = pdfium::CollectionSize<int32_t>(ca) - 1;
if (iLength < 1)
return iLength;
@@ -546,12 +546,12 @@ int32_t CFX_TxtBreak::GetBreakPos(std::vector<CFX_Char>& ca,
int32_t iIndirectPos = -1;
int32_t iLast = -1;
int32_t iLastPos = -1;
- if (m_bSingleLine || iEndPos <= m_iLineWidth) {
+ if (m_bSingleLine || *pEndPos <= m_iLineWidth) {
if (!bAllChars)
return iLength;
iBreak = iLength;
- iBreakPos = iEndPos;
+ iBreakPos = *pEndPos;
}
FX_LINEBREAKTYPE eType;
@@ -566,7 +566,7 @@ int32_t CFX_TxtBreak::GetBreakPos(std::vector<CFX_Char>& ca,
nNext = nCodeProp & 0x003F;
int32_t iCharWidth = pCur->m_iCharWidth;
if (iCharWidth > 0)
- iEndPos -= iCharWidth;
+ *pEndPos -= iCharWidth;
while (iLength >= 0) {
pCur = &ca[iLength];
@@ -579,25 +579,25 @@ int32_t CFX_TxtBreak::GetBreakPos(std::vector<CFX_Char>& ca,
if (bAllChars)
pCur->m_nBreakType = static_cast<uint8_t>(eType);
if (!bOnlyBrk) {
- if (m_bSingleLine || iEndPos <= m_iLineWidth ||
+ if (m_bSingleLine || *pEndPos <= m_iLineWidth ||
nCur == kBreakPropertySpace) {
if (eType == FX_LBT_DIRECT_BRK && iBreak < 0) {
iBreak = iLength;
- iBreakPos = iEndPos;
+ iBreakPos = *pEndPos;
if (!bAllChars)
return iLength;
} else if (eType == FX_LBT_INDIRECT_BRK && iIndirect < 0) {
iIndirect = iLength;
- iIndirectPos = iEndPos;
+ iIndirectPos = *pEndPos;
}
if (iLast < 0) {
iLast = iLength;
- iLastPos = iEndPos;
+ iLastPos = *pEndPos;
}
}
iCharWidth = pCur->m_iCharWidth;
if (iCharWidth > 0)
- iEndPos -= iCharWidth;
+ *pEndPos -= iCharWidth;
}
nNext = nCodeProp & 0x003F;
iLength--;
@@ -605,15 +605,15 @@ int32_t CFX_TxtBreak::GetBreakPos(std::vector<CFX_Char>& ca,
if (bOnlyBrk)
return 0;
if (iBreak > -1) {
- iEndPos = iBreakPos;
+ *pEndPos = iBreakPos;
return iBreak;
}
if (iIndirect > -1) {
- iEndPos = iIndirectPos;
+ *pEndPos = iIndirectPos;
return iIndirect;
}
if (iLast > -1) {
- iEndPos = iLastPos;
+ *pEndPos = iLastPos;
return iLast;
}
return 0;
@@ -629,7 +629,7 @@ void CFX_TxtBreak::SplitTextLine(CFX_BreakLine* pCurLine,
int32_t iEndPos = pCurLine->m_iWidth;
std::vector<CFX_Char>& curChars = pCurLine->m_LineChars;
- int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, false);
+ int32_t iCharPos = GetBreakPos(curChars, bAllChars, false, &iEndPos);
if (iCharPos < 0)
iCharPos = 0;