summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas/layout')
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.cpp13
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.h2
-rw-r--r--xfa/fgas/layout/fgas_textbreak.cpp9
-rw-r--r--xfa/fgas/layout/fgas_textbreak.h2
4 files changed, 8 insertions, 18 deletions
diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp
index b44af96c77..aaef7aec61 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.cpp
+++ b/xfa/fgas/layout/fgas_rtfbreak.cpp
@@ -15,7 +15,6 @@
CFX_RTFBreak::CFX_RTFBreak(uint32_t dwPolicies)
: m_dwPolicies(dwPolicies),
- m_pArabicChar(NULL),
m_iBoundaryStart(0),
m_iBoundaryEnd(2000000),
m_dwLayoutStyles(0),
@@ -50,13 +49,11 @@ CFX_RTFBreak::CFX_RTFBreak(uint32_t dwPolicies)
m_pCurLine(NULL),
m_iReady(0),
m_iTolerance(0) {
- m_pArabicChar = new CFX_ArabicChar;
m_pCurLine = &m_RTFLine1;
}
CFX_RTFBreak::~CFX_RTFBreak() {
Reset();
m_PositionedTabs.RemoveAll();
- m_pArabicChar->Release();
if (m_pUserData != NULL) {
m_pUserData->Release();
}
@@ -343,7 +340,7 @@ static const FX_RTFBreak_LPFAppendChar g_FX_RTFBreak_lpfAppendChar[16] = {
&CFX_RTFBreak::AppendChar_Others, &CFX_RTFBreak::AppendChar_Others,
};
uint32_t CFX_RTFBreak::AppendChar(FX_WCHAR wch) {
- ASSERT(m_pFont != NULL && m_pCurLine != NULL && m_pArabicChar != NULL);
+ ASSERT(m_pFont && m_pCurLine);
if (m_bCharCode) {
return AppendChar_CharCode(wch);
}
@@ -520,7 +517,7 @@ uint32_t CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar* pCurChar,
if (pLastChar != NULL) {
iLineWidth -= pLastChar->m_iCharWidth;
CFX_RTFChar* pPrevChar = GetLastChar(2);
- wForm = m_pArabicChar->GetFormChar(pLastChar, pPrevChar, pCurChar);
+ wForm = pdfium::arabic::GetFormChar(pLastChar, pPrevChar, pCurChar);
bAlef = (wForm == 0xFEFF &&
pLastChar->GetCharType() == FX_CHARTYPE_ArabicAlef);
int32_t iLastRotation = pLastChar->m_nRotation + m_iLineRotation;
@@ -544,8 +541,8 @@ uint32_t CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar* pCurChar,
iCharWidth = 0;
}
}
- wForm =
- m_pArabicChar->GetFormChar(pCurChar, (bAlef ? NULL : pLastChar), NULL);
+ wForm = pdfium::arabic::GetFormChar(pCurChar, bAlef ? nullptr : pLastChar,
+ nullptr);
if (m_bVertical != FX_IsOdd(iRotation)) {
iCharWidth = 1000;
} else if (!m_pFont->GetCharWidth(wForm, iCharWidth, m_bCharCode) &&
@@ -1268,7 +1265,7 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText,
} else {
wNext = 0xFEFF;
}
- wForm = m_pArabicChar->GetFormChar(wch, wPrev, wNext);
+ wForm = pdfium::arabic::GetFormChar(wch, wPrev, wNext);
} else if (bRTLPiece || bVerticalChar) {
wForm = FX_GetMirrorChar(wch, dwProps, bRTLPiece, bVerticalChar);
} else if (dwCharType == FX_CHARTYPE_Numeric && bArabicNumber) {
diff --git a/xfa/fgas/layout/fgas_rtfbreak.h b/xfa/fgas/layout/fgas_rtfbreak.h
index 95de85bde6..d595ad38d1 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.h
+++ b/xfa/fgas/layout/fgas_rtfbreak.h
@@ -14,7 +14,6 @@
#include "xfa/fgas/layout/fgas_textbreak.h"
#include "xfa/fgas/layout/fgas_unicode.h"
-class CFX_ArabicChar;
class IFX_Unknown;
class IFX_Font;
@@ -293,7 +292,6 @@ class CFX_RTFBreak {
protected:
uint32_t m_dwPolicies;
- CFX_ArabicChar* m_pArabicChar;
int32_t m_iBoundaryStart;
int32_t m_iBoundaryEnd;
uint32_t m_dwLayoutStyles;
diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp
index 86fecbeef4..4b4ef1fa7b 100644
--- a/xfa/fgas/layout/fgas_textbreak.cpp
+++ b/xfa/fgas/layout/fgas_textbreak.cpp
@@ -16,7 +16,6 @@
CFX_TxtBreak::CFX_TxtBreak(uint32_t dwPolicies)
: m_dwPolicies(dwPolicies),
- m_pArabicChar(NULL),
m_iLineWidth(2000000),
m_dwLayoutStyles(0),
m_bVertical(FALSE),
@@ -51,7 +50,6 @@ CFX_TxtBreak::CFX_TxtBreak(uint32_t dwPolicies)
m_iVerScale(100),
m_iCharSpace(0) {
m_bPagination = (m_dwPolicies & FX_TXTBREAKPOLICY_Pagination) != 0;
- m_pArabicChar = new CFX_ArabicChar;
if (m_bPagination) {
m_pTxtLine1 = new CFX_TxtLine(sizeof(CFX_Char));
m_pTxtLine2 = new CFX_TxtLine(sizeof(CFX_Char));
@@ -66,7 +64,6 @@ CFX_TxtBreak::~CFX_TxtBreak() {
Reset();
delete m_pTxtLine1;
delete m_pTxtLine2;
- m_pArabicChar->Release();
}
void CFX_TxtBreak::SetLineWidth(FX_FLOAT fLineWidth) {
m_iLineWidth = FXSYS_round(fLineWidth * 20000.0f);
@@ -465,7 +462,7 @@ uint32_t CFX_TxtBreak::AppendChar_Arabic(CFX_Char* pCurChar,
iLineWidth -= iCharWidth;
}
CFX_Char* pPrevChar = GetLastChar(2);
- wForm = m_pArabicChar->GetFormChar(pLastChar, pPrevChar, pCurChar);
+ wForm = pdfium::arabic::GetFormChar(pLastChar, pPrevChar, pCurChar);
bAlef = (wForm == 0xFEFF &&
pLastChar->GetCharType() == FX_CHARTYPE_ArabicAlef);
int32_t iLastRotation = pLastChar->m_nRotation + m_iLineRotation;
@@ -488,7 +485,7 @@ uint32_t CFX_TxtBreak::AppendChar_Arabic(CFX_Char* pCurChar,
}
}
m_dwCharType = dwType;
- wForm = m_pArabicChar->GetFormChar(pCurChar, bAlef ? NULL : pLastChar, NULL);
+ wForm = pdfium::arabic::GetFormChar(pCurChar, bAlef ? NULL : pLastChar, NULL);
if (m_bCombText) {
iCharWidth = m_iCombWidth;
} else {
@@ -1268,7 +1265,7 @@ int32_t CFX_TxtBreak::GetDisplayPos(const FX_TXTRUN* pTxtRun,
} else {
wNext = 0xFEFF;
}
- wForm = m_pArabicChar->GetFormChar(wch, wPrev, wNext);
+ wForm = pdfium::arabic::GetFormChar(wch, wPrev, wNext);
bLam = (wPrev == 0x0644 && wch == 0x0644 && wNext == 0x0647);
} else if (dwCharType == FX_CHARTYPE_Combination) {
wForm = wch;
diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h
index 41bd8f4921..6d961f218a 100644
--- a/xfa/fgas/layout/fgas_textbreak.h
+++ b/xfa/fgas/layout/fgas_textbreak.h
@@ -12,7 +12,6 @@
#include "xfa/fgas/crt/fgas_utils.h"
#include "xfa/fgas/layout/fgas_unicode.h"
-class CFX_ArabicChar;
class CFX_Char;
class CFX_TxtChar;
class CFX_TxtPiece;
@@ -270,7 +269,6 @@ class CFX_TxtBreak {
protected:
uint32_t m_dwPolicies;
FX_BOOL m_bPagination;
- CFX_ArabicChar* m_pArabicChar;
int32_t m_iLineWidth;
uint32_t m_dwLayoutStyles;
FX_BOOL m_bVertical;