summaryrefslogtreecommitdiff
path: root/xfa/src/fxfa/app/xfa_textlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxfa/app/xfa_textlayout.cpp')
-rw-r--r--xfa/src/fxfa/app/xfa_textlayout.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/xfa/src/fxfa/app/xfa_textlayout.cpp b/xfa/src/fxfa/app/xfa_textlayout.cpp
index e8a23b1523..b8a9ec433e 100644
--- a/xfa/src/fxfa/app/xfa_textlayout.cpp
+++ b/xfa/src/fxfa/app/xfa_textlayout.cpp
@@ -1256,7 +1256,7 @@ FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice,
int32_t iPieces = pPieceLine->m_textPieces.GetSize();
int32_t j = 0;
for (j = 0; j < iPieces; j++) {
- const XFA_TEXTPIECE* pPiece = pPieceLine->m_textPieces.GetAt(j);
+ const XFA_TextPiece* pPiece = pPieceLine->m_textPieces.GetAt(j);
int32_t iChars = pPiece->iChars;
if (iCharCount < iChars) {
FX_Free(pCharPos);
@@ -1296,7 +1296,7 @@ void CXFA_TextLayout::UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom) {
CXFA_PieceLine* pPieceLine = m_pieceLines.GetAt(i);
int32_t iPieces = pPieceLine->m_textPieces.GetSize();
for (int32_t j = 0; j < iPieces; j++) {
- XFA_TEXTPIECE* pPiece = pPieceLine->m_textPieces.GetAt(j);
+ XFA_TextPiece* pPiece = pPieceLine->m_textPieces.GetAt(j);
CFX_RectF& rect = pPiece->rtPiece;
rect.top += fHeight;
}
@@ -1651,7 +1651,7 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle,
if (iPieces == 0) {
return;
}
- XFA_TEXTPIECE* pPiece = pPieceLine->m_textPieces.GetAt(iPieces - 1);
+ XFA_TextPiece* pPiece = pPieceLine->m_textPieces.GetAt(iPieces - 1);
int32_t& iTabstopsIndex = m_pTabstopContext->m_iTabIndex;
int32_t iCount = m_textParser.CountTabs(pStyle);
if (iTabstopsIndex > m_pTabstopContext->m_iTabCount - 1) {
@@ -1662,7 +1662,7 @@ void CXFA_TextLayout::DoTabstops(IFDE_CSSComputedStyle* pStyle,
m_pTabstopContext->m_bTabstops = TRUE;
FX_FLOAT fRight = 0;
if (iPieces > 1) {
- XFA_TEXTPIECE* p = pPieceLine->m_textPieces.GetAt(iPieces - 2);
+ XFA_TextPiece* p = pPieceLine->m_textPieces.GetAt(iPieces - 2);
fRight = p->rtPiece.right();
}
m_pTabstopContext->m_fTabWidth =
@@ -1718,8 +1718,7 @@ void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus,
if (pUserData)
pStyle = pUserData->m_pStyle;
FX_FLOAT fVerScale = pPiece->m_iVerticalScale / 100.0f;
- XFA_TEXTPIECE* pTP =
- (XFA_TEXTPIECE*)m_pAllocator->Alloc(sizeof(XFA_TEXTPIECE));
+ XFA_TextPiece* pTP = FXTARGET_NewWith(m_pAllocator) XFA_TextPiece();
pTP->pszText =
(FX_WCHAR*)m_pAllocator->Alloc(pPiece->m_iChars * sizeof(FX_WCHAR));
pTP->pWidths =
@@ -1765,7 +1764,7 @@ void CXFA_TextLayout::AppendTextLine(FX_DWORD dwStatus,
DoTabstops(pStyle, pPieceLine);
}
for (i = 0; i < iPieces; i++) {
- XFA_TEXTPIECE* pTP = pPieceLine->m_textPieces.GetAt(i);
+ XFA_TextPiece* pTP = pPieceLine->m_textPieces.GetAt(i);
FX_FLOAT& fTop = pTP->rtPiece.top;
FX_FLOAT fBaseLineTemp = fTop;
fTop = fLinePos + fLineStep - pTP->rtPiece.height - fBaseLineTemp;
@@ -1847,7 +1846,7 @@ void CXFA_TextLayout::RenderString(IFDE_RenderDevice* pDevice,
int32_t iPiece,
FXTEXT_CHARPOS* pCharPos,
const CFX_Matrix& tmDoc2Device) {
- const XFA_TEXTPIECE* pPiece = pPieceLine->m_textPieces.GetAt(iPiece);
+ const XFA_TextPiece* pPiece = pPieceLine->m_textPieces.GetAt(iPiece);
int32_t iCount = GetDisplayPos(pPiece, pCharPos);
if (iCount > 0) {
pBrush->SetColor(pPiece->dwColor);
@@ -1862,7 +1861,7 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice* pDevice,
int32_t iPiece,
FXTEXT_CHARPOS* pCharPos,
const CFX_Matrix& tmDoc2Device) {
- XFA_TEXTPIECE* pPiece = pPieceLine->m_textPieces.GetAt(iPiece);
+ XFA_TextPiece* pPiece = pPieceLine->m_textPieces.GetAt(iPiece);
FX_BOOL bNoUnderline = pPiece->iUnderline < 1 || pPiece->iUnderline > 2;
FX_BOOL bNoLineThrough = pPiece->iLineThrough < 1 || pPiece->iLineThrough > 2;
if (bNoUnderline && bNoLineThrough) {
@@ -1969,7 +1968,7 @@ void CXFA_TextLayout::RenderPath(IFDE_RenderDevice* pDevice,
XFA_RenderPathRet:
pPath->Release();
}
-int32_t CXFA_TextLayout::GetDisplayPos(const XFA_TEXTPIECE* pPiece,
+int32_t CXFA_TextLayout::GetDisplayPos(const XFA_TextPiece* pPiece,
FXTEXT_CHARPOS* pCharPos,
FX_BOOL bCharCode) {
if (pPiece == NULL) {
@@ -1981,7 +1980,7 @@ int32_t CXFA_TextLayout::GetDisplayPos(const XFA_TEXTPIECE* pPiece,
}
return m_pBreak->GetDisplayPos(&tr, pCharPos, bCharCode);
}
-FX_BOOL CXFA_TextLayout::ToRun(const XFA_TEXTPIECE* pPiece, FX_RTFTEXTOBJ& tr) {
+FX_BOOL CXFA_TextLayout::ToRun(const XFA_TextPiece* pPiece, FX_RTFTEXTOBJ& tr) {
int32_t iLength = pPiece->iChars;
if (iLength < 1) {
return FALSE;