diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-13 15:32:07 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-14 14:13:24 +0000 |
commit | 893822aa5b6254591f8e80fbffcbb4fa6ad849aa (patch) | |
tree | 74e20ab6378d515c12a1ec9b9fc70d8e309b361b /core/fxcrt/fx_arabic.cpp | |
parent | 80e370c7d8b6541f59d98b6cbfbaae51f7e139da (diff) | |
download | pdfium-893822aa5b6254591f8e80fbffcbb4fa6ad849aa.tar.xz |
Merge text breaking helper classes.
This Cl merges the CFX_TxtPiece and CFX_RTFPiece classes into
CFX_BreakPiece. CFX_TxtLine and CFX_RTFLine into CFX_BreakLine and
CFX_TxtChar and CFX_RTFChar into CFX_Char.
Change-Id: I95421bdf4cafd5e394db9238dea3603ccb8349c3
Reviewed-on: https://pdfium-review.googlesource.com/2966
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_arabic.cpp')
-rw-r--r-- | core/fxcrt/fx_arabic.cpp | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/core/fxcrt/fx_arabic.cpp b/core/fxcrt/fx_arabic.cpp index 29e6e437e8..11743e41ad 100644 --- a/core/fxcrt/fx_arabic.cpp +++ b/core/fxcrt/fx_arabic.cpp @@ -410,10 +410,9 @@ void FX_BidiReorder(int32_t iBaseLevel, } } -template <class baseType> class CFX_BidiLineTemplate { public: - void FX_BidiReverseString(std::vector<baseType>& chars, + void FX_BidiReverseString(std::vector<CFX_Char>& chars, int32_t iStart, int32_t iCount) { ASSERT(iStart >= 0 && iStart < pdfium::CollectionSize<int32_t>(chars)); @@ -422,7 +421,7 @@ class CFX_BidiLineTemplate { std::reverse(chars.begin() + iStart, chars.begin() + iStart + iCount); } - void FX_BidiSetDeferredRun(std::vector<baseType>& chars, + void FX_BidiSetDeferredRun(std::vector<CFX_Char>& chars, bool bClass, int32_t iStart, int32_t iCount, @@ -439,7 +438,7 @@ class CFX_BidiLineTemplate { } } - void FX_BidiClassify(std::vector<baseType>& chars, int32_t iCount, bool bWS) { + void FX_BidiClassify(std::vector<CFX_Char>& chars, int32_t iCount, bool bWS) { ASSERT(iCount >= 0 && iCount <= pdfium::CollectionSize<int32_t>(chars)); if (bWS) { for (int32_t i = 0; i < iCount; i++) { @@ -456,7 +455,7 @@ class CFX_BidiLineTemplate { } } - void FX_BidiResolveExplicit(std::vector<baseType>& chars, + void FX_BidiResolveExplicit(std::vector<CFX_Char>& chars, int32_t iCount, int32_t iBaseLevel) { ASSERT(iCount >= 0 && iCount <= pdfium::CollectionSize<int32_t>(chars)); @@ -465,7 +464,7 @@ class CFX_BidiLineTemplate { chars[i].m_iBidiLevel = static_cast<int16_t>(iBaseLevel); } - void FX_BidiResolveWeak(std::vector<baseType>& chars, + void FX_BidiResolveWeak(std::vector<CFX_Char>& chars, int32_t iCount, int32_t iBaseLevel) { ASSERT(iCount >= 0 && iCount <= pdfium::CollectionSize<int32_t>(chars)); @@ -473,7 +472,7 @@ class CFX_BidiLineTemplate { if (iCount < 1) { return; } - baseType *pTC, *pTCNext; + CFX_Char *pTC, *pTCNext; int32_t iLevelCur = iBaseLevel; int32_t iState = FX_IsOdd(iBaseLevel) ? FX_BWSxr : FX_BWSxl; int32_t i = 0, iNum = 0, iClsCur, iClsRun, iClsNew, iAction; @@ -537,7 +536,7 @@ class CFX_BidiLineTemplate { } } - void FX_BidiResolveNeutrals(std::vector<baseType>& chars, + void FX_BidiResolveNeutrals(std::vector<CFX_Char>& chars, int32_t iCount, int32_t iBaseLevel) { ASSERT(iCount >= 0 && iCount <= pdfium::CollectionSize<int32_t>(chars)); @@ -546,7 +545,7 @@ class CFX_BidiLineTemplate { if (iCount < 1) { return; } - baseType* pTC; + CFX_Char* pTC; int32_t iLevel = iBaseLevel; int32_t iState = FX_IsOdd(iBaseLevel) ? FX_BNSr : FX_BNSl; int32_t i = 0, iNum = 0, iClsCur, iClsRun, iClsNew, iAction; @@ -586,7 +585,7 @@ class CFX_BidiLineTemplate { } } - void FX_BidiResolveImplicit(std::vector<baseType>& chars, int32_t iCount) { + void FX_BidiResolveImplicit(std::vector<CFX_Char>& chars, int32_t iCount) { ASSERT(iCount >= 0 && iCount <= pdfium::CollectionSize<int32_t>(chars)); for (int32_t i = 0; i < iCount; i++) { int32_t iCls = chars[i].m_iBidiClass; @@ -600,7 +599,7 @@ class CFX_BidiLineTemplate { } } - void FX_BidiResolveWhitespace(std::vector<baseType>& chars, + void FX_BidiResolveWhitespace(std::vector<CFX_Char>& chars, int32_t iCount, int32_t iBaseLevel) { ASSERT(iCount >= 0 && iCount <= pdfium::CollectionSize<int32_t>(chars)); @@ -644,7 +643,7 @@ class CFX_BidiLineTemplate { } } - int32_t FX_BidiReorderLevel(std::vector<baseType>& chars, + int32_t FX_BidiReorderLevel(std::vector<CFX_Char>& chars, int32_t iCount, int32_t iBaseLevel, int32_t iStart, @@ -672,7 +671,7 @@ class CFX_BidiLineTemplate { return iNum; } - void FX_BidiReorder(std::vector<baseType>& chars, + void FX_BidiReorder(std::vector<CFX_Char>& chars, int32_t iCount, int32_t iBaseLevel) { ASSERT(iCount >= 0 && iCount <= pdfium::CollectionSize<int32_t>(chars)); @@ -683,13 +682,13 @@ class CFX_BidiLineTemplate { } } - void FX_BidiPosition(std::vector<baseType>& chars, int32_t iCount) { + void FX_BidiPosition(std::vector<CFX_Char>& chars, int32_t iCount) { ASSERT(iCount >= 0 && iCount <= pdfium::CollectionSize<int32_t>(chars)); for (int32_t i = 0; i < iCount; ++i) chars[chars[i].m_iBidiPos].m_iBidiOrder = i; } - void FX_BidiLine(std::vector<baseType>& chars, + void FX_BidiLine(std::vector<CFX_Char>& chars, int32_t iCount, int32_t iBaseLevel) { ASSERT(iCount >= 0 && iCount <= pdfium::CollectionSize<int32_t>(chars)); @@ -708,15 +707,9 @@ class CFX_BidiLineTemplate { } }; -void FX_BidiLine(std::vector<CFX_TxtChar>& chars, +void FX_BidiLine(std::vector<CFX_Char>& chars, int32_t iCount, int32_t iBaseLevel) { - CFX_BidiLineTemplate<CFX_TxtChar> blt; - blt.FX_BidiLine(chars, iCount, iBaseLevel); -} -void FX_BidiLine(std::vector<CFX_RTFChar>& chars, - int32_t iCount, - int32_t iBaseLevel) { - CFX_BidiLineTemplate<CFX_RTFChar> blt; + CFX_BidiLineTemplate blt; blt.FX_BidiLine(chars, iCount, iBaseLevel); } |