From bc9164115e8aeefcc06f5bf08684a4733b25e085 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 19 May 2016 10:51:56 -0700 Subject: Cleanup unused fgas/ code. Purely code removal. Review-Url: https://codereview.chromium.org/1991143003 --- xfa/fgas/layout/fgas_linebreak.cpp | 52 ----------------------------- xfa/fgas/layout/fgas_linebreak.h | 7 ---- xfa/fgas/layout/fgas_unicode.cpp | 68 -------------------------------------- xfa/fgas/layout/fgas_unicode.h | 19 ----------- 4 files changed, 146 deletions(-) (limited to 'xfa/fgas/layout') diff --git a/xfa/fgas/layout/fgas_linebreak.cpp b/xfa/fgas/layout/fgas_linebreak.cpp index 72f5d70323..519ccc590a 100644 --- a/xfa/fgas/layout/fgas_linebreak.cpp +++ b/xfa/fgas/layout/fgas_linebreak.cpp @@ -266,55 +266,3 @@ const FX_LINEBREAKTYPE gs_FX_LineBreak_PairTable[64][32] = { FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN}, }; - -void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, - FX_LINEBREAKTYPE* pBrkType, - int32_t iLength) { - if (iLength < 2) { - return; - } - uint32_t dwCur, dwNext; - FX_WCHAR wch; - wch = *pwsText++; - dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; - iLength--; - for (int32_t i = 0; i < iLength; i++) { - wch = *pwsText++; - dwNext = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; - if (dwNext == FX_CBP_SP) { - pBrkType[i] = FX_LBT_PROHIBITED_BRK; - } else { - pBrkType[i] = *((const FX_LINEBREAKTYPE*)gs_FX_LineBreak_PairTable + - (dwCur << 5) + dwNext); - } - dwCur = dwNext; - } - pBrkType[iLength] = FX_LBT_INDIRECT_BRK; -} -void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, - int32_t iLength, - CFX_Int32MassArray& bp) { - if (iLength < 2) { - return; - } - FX_LINEBREAKTYPE eType; - uint32_t dwCur, dwNext; - FX_WCHAR wch; - wch = *pwsText++; - dwCur = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; - iLength--; - for (int32_t i = 0; i < iLength; i++) { - wch = *pwsText++; - dwNext = kTextLayoutCodeProperties[(uint16_t)wch] & 0x003F; - if (dwNext == FX_CBP_SP) { - eType = FX_LBT_PROHIBITED_BRK; - } else { - eType = *((const FX_LINEBREAKTYPE*)gs_FX_LineBreak_PairTable + - (dwCur << 5) + dwNext); - } - if (eType == FX_LBT_DIRECT_BRK) { - bp.Add(i); - } - dwCur = dwNext; - } -} diff --git a/xfa/fgas/layout/fgas_linebreak.h b/xfa/fgas/layout/fgas_linebreak.h index 1333937db1..a96841ef7e 100644 --- a/xfa/fgas/layout/fgas_linebreak.h +++ b/xfa/fgas/layout/fgas_linebreak.h @@ -30,11 +30,4 @@ enum FX_LINEBREAKTYPE : uint8_t { extern const FX_LINEBREAKTYPE gs_FX_LineBreak_PairTable[64][32]; -void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, - FX_LINEBREAKTYPE* pBrkType, - int32_t iLength); -void FX_GetLineBreakPositions(const FX_WCHAR* pwsText, - int32_t iLength, - CFX_Int32MassArray& bp); - #endif // XFA_FGAS_LAYOUT_FGAS_LINEBREAK_H_ diff --git a/xfa/fgas/layout/fgas_unicode.cpp b/xfa/fgas/layout/fgas_unicode.cpp index 94f06253ac..10fdbf0810 100644 --- a/xfa/fgas/layout/fgas_unicode.cpp +++ b/xfa/fgas/layout/fgas_unicode.cpp @@ -47,71 +47,3 @@ void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray& tpos, int32_t iStart, int32_t iEnd) { FX_TEXTLAYOUT_PieceSort(tpos, j, iEnd); } } -static const FX_JAPCHARPROPERTYEX gs_FX_JapCharPropertysEx[] = { - {0x3001, 0x13}, {0x3002, 0x13}, {0x3041, 0x23}, {0x3043, 0x23}, - {0x3045, 0x23}, {0x3047, 0x23}, {0x3049, 0x23}, {0x3063, 0x23}, - {0x3083, 0x23}, {0x3085, 0x23}, {0x3087, 0x23}, {0x308E, 0x23}, - {0x3095, 0x23}, {0x3096, 0x23}, {0x30A1, 0x23}, {0x30A3, 0x23}, - {0x30A5, 0x23}, {0x30A7, 0x23}, {0x30A9, 0x23}, {0x30C3, 0x23}, - {0x30E3, 0x23}, {0x30E5, 0x23}, {0x30E7, 0x23}, {0x30EE, 0x23}, - {0x30F5, 0x23}, {0x30F6, 0x23}, {0x30FB, 0x22}, {0x31F0, 0x23}, - {0x31F1, 0x23}, {0x31F2, 0x23}, {0x31F3, 0x23}, {0x31F4, 0x23}, - {0x31F5, 0x23}, {0x31F6, 0x23}, {0x31F7, 0x23}, {0x31F8, 0x23}, - {0x31F9, 0x23}, {0x31FA, 0x23}, {0x31FB, 0x23}, {0x31FC, 0x23}, - {0x31FD, 0x23}, {0x31FE, 0x23}, {0x31FF, 0x23}, -}; -const FX_JAPCHARPROPERTYEX* FX_GetJapCharPropertyEx(FX_WCHAR wch) { - int32_t iStart = 0; - int32_t iEnd = - sizeof(gs_FX_JapCharPropertysEx) / sizeof(FX_JAPCHARPROPERTYEX); - while (iStart <= iEnd) { - int32_t iMid = (iStart + iEnd) / 2; - FX_WCHAR wJapChar = gs_FX_JapCharPropertysEx[iMid].wChar; - if (wch == wJapChar) { - return gs_FX_JapCharPropertysEx + iMid; - } else if (wch < wJapChar) { - iEnd = iMid - 1; - } else { - iStart = iMid + 1; - } - } - return NULL; -} -FX_BOOL FX_AdjustJapCharDisplayPos(FX_WCHAR wch, - FX_BOOL bMBCSCode, - IFX_Font* pFont, - FX_FLOAT fFontSize, - FX_BOOL bVertical, - CFX_PointF& ptOffset) { - if (pFont == NULL || !bVertical) { - return FALSE; - } - if (wch < 0x3001 || wch > 0x31FF) { - return FALSE; - } - const FX_JAPCHARPROPERTYEX* pJapChar = FX_GetJapCharPropertyEx(wch); - if (pJapChar == NULL) { - return FALSE; - } - CFX_Rect rtBBox; - rtBBox.Reset(); - if (pFont->GetCharBBox(wch, rtBBox, bMBCSCode)) { - switch (pJapChar->uAlign & 0xF0) { - case FX_JAPCHARPROPERTYEX_Top: - ptOffset.y = fFontSize * (1000 - rtBBox.height) / 1200.0f; - break; - case FX_JAPCHARPROPERTYEX_Middle: - ptOffset.y = fFontSize * (1000 - rtBBox.height) / 6000.0f; - break; - } - switch (pJapChar->uAlign & 0x0F) { - case FX_JAPCHARPROPERTYEX_Center: - ptOffset.x = fFontSize * (600 - rtBBox.right()) / 1000.0f; - break; - case FX_JAPCHARPROPERTYEX_Right: - ptOffset.x = fFontSize * (950 - rtBBox.right()) / 1000.0f; - break; - } - } - return TRUE; -} diff --git a/xfa/fgas/layout/fgas_unicode.h b/xfa/fgas/layout/fgas_unicode.h index dd574026c9..139547468c 100644 --- a/xfa/fgas/layout/fgas_unicode.h +++ b/xfa/fgas/layout/fgas_unicode.h @@ -10,13 +10,6 @@ #include "xfa/fgas/crt/fgas_utils.h" #include "xfa/fgas/font/fgas_font.h" -#define FX_JAPCHARPROPERTYEX_Left 0x01 -#define FX_JAPCHARPROPERTYEX_Center 0x02 -#define FX_JAPCHARPROPERTYEX_Right 0x03 -#define FX_JAPCHARPROPERTYEX_Top 0x10 -#define FX_JAPCHARPROPERTYEX_Middle 0x20 -#define FX_JAPCHARPROPERTYEX_Bottom 0x30 - struct FX_TPO { int32_t index; int32_t pos; @@ -25,23 +18,11 @@ typedef CFX_MassArrayTemplate CFX_TPOArray; void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray& tpos, int32_t iStart, int32_t iEnd); -struct FX_JAPCHARPROPERTYEX { - uint16_t wChar; - uint8_t uAlign; -}; - -const FX_JAPCHARPROPERTYEX* FX_GetJapCharPropertyEx(FX_WCHAR wch); typedef FX_BOOL (*FX_AdjustCharDisplayPos)(FX_WCHAR wch, FX_BOOL bMBCSCode, IFX_Font* pFont, FX_FLOAT fFontSize, FX_BOOL bVertical, CFX_PointF& ptOffset); -FX_BOOL FX_AdjustJapCharDisplayPos(FX_WCHAR wch, - FX_BOOL bMBCSCode, - IFX_Font* pFont, - FX_FLOAT fFontSize, - FX_BOOL bVertical, - CFX_PointF& ptOffset); #endif // XFA_FGAS_LAYOUT_FGAS_UNICODE_H_ -- cgit v1.2.3