Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Unified Diff: core/src/fxcrt/fx_arabic.cpp

Issue 1423103002: XFA: Manual merge of Clean up IFX_BidiChar (Closed) Base URL: https://pdfium.googlesource.com/pdfium@xfa
Patch Set: missing files Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fxcrt/fx_arabic.cpp
diff --git a/core/src/fxcrt/fx_arabic.cpp b/core/src/fxcrt/fx_arabic.cpp
index 139e9f1f48fae163e906f949b4bffd0659693c24..f086bcf464348e8fdd0f74851e85683eb50c5c40 100644
--- a/core/src/fxcrt/fx_arabic.cpp
+++ b/core/src/fxcrt/fx_arabic.cpp
@@ -1053,77 +1053,3 @@ void FX_BidiLine(CFX_RTFCharArray& chars, int32_t iCount, int32_t iBaseLevel) {
CFX_BidiLineTemplate<CFX_RTFChar> blt;
blt.FX_BidiLine(chars, iCount, iBaseLevel);
}
-IFX_BidiChar* IFX_BidiChar::Create() {
- return new CFX_BidiChar;
-}
-CFX_BidiChar::CFX_BidiChar()
- : m_bSeparateNeutral(TRUE),
- m_iCurStart(0),
- m_iCurCount(0),
- m_iCurBidi(0),
- m_iLastBidi(0),
- m_iLastStart(0),
- m_iLastCount(0) {}
-void CFX_BidiChar::SetPolicy(FX_BOOL bSeparateNeutral) {
- m_bSeparateNeutral = bSeparateNeutral;
-}
-
-FX_BOOL CFX_BidiChar::AppendChar(FX_WCHAR wch) {
- FX_DWORD dwProps = kTextLayoutCodeProperties[(FX_WORD)wch];
- int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
- int32_t iContext = 0;
- switch (iBidiCls) {
- case FX_BIDICLASS_L:
- case FX_BIDICLASS_AN:
- case FX_BIDICLASS_EN:
- iContext = 1;
- break;
- case FX_BIDICLASS_R:
- case FX_BIDICLASS_AL:
- iContext = 2;
- break;
- }
- FX_BOOL bRet = FALSE;
- if (iContext != m_iCurBidi) {
- if (m_bSeparateNeutral) {
- bRet = TRUE;
- } else {
- if (m_iCurBidi == 0) {
- bRet = (m_iCurCount > 0);
- } else {
- bRet = (iContext != 0);
- }
- }
- if (bRet) {
- m_iLastBidi = m_iCurBidi;
- m_iLastStart = m_iCurStart;
- m_iCurStart = m_iCurCount;
- m_iLastCount = m_iCurCount - m_iLastStart;
- }
- if (m_bSeparateNeutral || iContext != 0) {
- m_iCurBidi = iContext;
- }
- }
- m_iCurCount++;
- return bRet;
-}
-FX_BOOL CFX_BidiChar::EndChar() {
- m_iLastBidi = m_iCurBidi;
- m_iLastStart = m_iCurStart;
- m_iCurStart = m_iCurCount;
- m_iLastCount = m_iCurCount - m_iLastStart;
- return m_iLastCount > 0;
-}
-int32_t CFX_BidiChar::GetBidiInfo(int32_t& iStart, int32_t& iCount) {
- iStart = m_iLastStart;
- iCount = m_iLastCount;
- return m_iLastBidi;
-}
-void CFX_BidiChar::Reset() {
- m_iCurStart = 0;
- m_iCurCount = 0;
- m_iCurBidi = 0;
- m_iLastBidi = 0;
- m_iLastStart = 0;
- m_iLastCount = 0;
-}

Powered by Google App Engine
This is Rietveld 408576698