summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_textout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fde/cfde_textout.cpp')
-rw-r--r--xfa/fde/cfde_textout.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index b8049fbe82..07a0962cf8 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -229,12 +229,12 @@ void CFDE_TextOut::CalcLogicSize(const WideString& str, CFX_RectF* pRect) {
}
dwBreakStatus = m_pTxtBreak->AppendChar(wch);
if (!CFX_BreakTypeNoneOrPiece(dwBreakStatus))
- RetrieveLineWidth(dwBreakStatus, fStartPos, fWidth, fHeight);
+ RetrieveLineWidth(dwBreakStatus, &fStartPos, &fWidth, &fHeight);
}
dwBreakStatus = m_pTxtBreak->EndBreak(CFX_BreakType::Paragraph);
if (!CFX_BreakTypeNoneOrPiece(dwBreakStatus))
- RetrieveLineWidth(dwBreakStatus, fStartPos, fWidth, fHeight);
+ RetrieveLineWidth(dwBreakStatus, &fStartPos, &fWidth, &fHeight);
m_pTxtBreak->Reset();
float fInc = pRect->Height() - fHeight;
@@ -252,9 +252,9 @@ void CFDE_TextOut::CalcLogicSize(const WideString& str, CFX_RectF* pRect) {
}
bool CFDE_TextOut::RetrieveLineWidth(CFX_BreakType dwBreakStatus,
- float& fStartPos,
- float& fWidth,
- float& fHeight) {
+ float* pStartPos,
+ float* pWidth,
+ float* pHeight) {
if (CFX_BreakTypeNoneOrPiece(dwBreakStatus))
return false;
@@ -263,18 +263,18 @@ bool CFDE_TextOut::RetrieveLineWidth(CFX_BreakType dwBreakStatus,
for (int32_t i = 0; i < m_pTxtBreak->CountBreakPieces(); i++) {
const CFX_BreakPiece* pPiece = m_pTxtBreak->GetBreakPieceUnstable(i);
fLineWidth += static_cast<float>(pPiece->m_iWidth) / 20000.0f;
- fStartPos =
- std::min(fStartPos, static_cast<float>(pPiece->m_iStartPos) / 20000.0f);
+ *pStartPos = std::min(*pStartPos,
+ static_cast<float>(pPiece->m_iStartPos) / 20000.0f);
}
m_pTxtBreak->ClearBreakPieces();
if (dwBreakStatus == CFX_BreakType::Paragraph)
m_pTxtBreak->Reset();
if (!m_Styles.line_wrap_ && dwBreakStatus == CFX_BreakType::Line) {
- fWidth += fLineWidth;
+ *pWidth += fLineWidth;
} else {
- fWidth = std::max(fWidth, fLineWidth);
- fHeight += fLineStep;
+ *pWidth = std::max(*pWidth, fLineWidth);
+ *pHeight += fLineStep;
}
++m_iTotalLines;
return true;
@@ -345,7 +345,7 @@ void CFDE_TextOut::LoadText(const WideString& str, const CFX_RectF& rect) {
continue;
bool bEndofLine =
- RetrievePieces(dwBreakStatus, iStartChar, iPieceWidths, false, rect);
+ RetrievePieces(dwBreakStatus, false, rect, &iStartChar, &iPieceWidths);
if (bEndofLine &&
(m_Styles.line_wrap_ || dwBreakStatus == CFX_BreakType::Paragraph ||
dwBreakStatus == CFX_BreakType::Page)) {
@@ -363,17 +363,17 @@ void CFDE_TextOut::LoadText(const WideString& str, const CFX_RectF& rect) {
dwBreakStatus = m_pTxtBreak->EndBreak(CFX_BreakType::Paragraph);
if (!CFX_BreakTypeNoneOrPiece(dwBreakStatus) && !bRet)
- RetrievePieces(dwBreakStatus, iStartChar, iPieceWidths, false, rect);
+ RetrievePieces(dwBreakStatus, false, rect, &iStartChar, &iPieceWidths);
m_pTxtBreak->ClearBreakPieces();
m_pTxtBreak->Reset();
}
bool CFDE_TextOut::RetrievePieces(CFX_BreakType dwBreakStatus,
- int32_t& iStartChar,
- int32_t& iPieceWidths,
bool bReload,
- const CFX_RectF& rect) {
+ const CFX_RectF& rect,
+ int32_t* pStartChar,
+ int32_t* pPieceWidths) {
float fLineStep = (m_fLineSpace > m_fFontSize) ? m_fLineSpace : m_fFontSize;
bool bNeedReload = false;
int32_t iLineWidth = FXSYS_round(rect.Width() * 20000.0f);
@@ -381,14 +381,14 @@ bool CFDE_TextOut::RetrievePieces(CFX_BreakType dwBreakStatus,
for (int32_t i = 0; i < iCount; i++) {
const CFX_BreakPiece* pPiece = m_pTxtBreak->GetBreakPieceUnstable(i);
int32_t iPieceChars = pPiece->GetLength();
- int32_t iChar = iStartChar;
+ int32_t iChar = *pStartChar;
int32_t iWidth = 0;
int32_t j = 0;
for (; j < iPieceChars; j++) {
const CFX_Char* pTC = pPiece->GetChar(j);
int32_t iCurCharWidth = pTC->m_iCharWidth > 0 ? pTC->m_iCharWidth : 0;
if (m_Styles.single_line_ || !m_Styles.line_wrap_) {
- if (iLineWidth - iPieceWidths - iWidth < iCurCharWidth) {
+ if (iLineWidth - *pPieceWidths - iWidth < iCurCharWidth) {
bNeedReload = true;
break;
}
@@ -401,7 +401,7 @@ bool CFDE_TextOut::RetrievePieces(CFX_BreakType dwBreakStatus,
m_ttoLines[m_iCurLine].SetNewReload(true);
} else if (j > 0) {
FDE_TTOPIECE ttoPiece;
- ttoPiece.iStartChar = iStartChar;
+ ttoPiece.iStartChar = *pStartChar;
ttoPiece.iChars = j;
ttoPiece.dwCharStyles = pPiece->m_dwCharStyles;
ttoPiece.rtPiece = CFX_RectF(
@@ -413,8 +413,8 @@ bool CFDE_TextOut::RetrievePieces(CFX_BreakType dwBreakStatus,
AppendPiece(ttoPiece, bNeedReload, (bReload && i == iCount - 1));
}
- iStartChar += iPieceChars;
- iPieceWidths += iWidth;
+ *pStartChar += iPieceChars;
+ *pPieceWidths += iWidth;
}
m_pTxtBreak->ClearBreakPieces();
@@ -475,7 +475,7 @@ void CFDE_TextOut::ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect) {
while (iStar < iEnd) {
dwBreakStatus = m_pTxtBreak->AppendChar(*(pwsStr + iStar));
if (!CFX_BreakTypeNoneOrPiece(dwBreakStatus))
- RetrievePieces(dwBreakStatus, iStartChar, iPieceWidths, true, rect);
+ RetrievePieces(dwBreakStatus, true, rect, &iStartChar, &iPieceWidths);
++iStar;
}
@@ -485,7 +485,7 @@ void CFDE_TextOut::ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect) {
dwBreakStatus = m_pTxtBreak->EndBreak(CFX_BreakType::Paragraph);
if (!CFX_BreakTypeNoneOrPiece(dwBreakStatus))
- RetrievePieces(dwBreakStatus, iStartChar, iPieceWidths, true, rect);
+ RetrievePieces(dwBreakStatus, true, rect, &iStartChar, &iPieceWidths);
m_pTxtBreak->Reset();
}