| Index: core/src/fpdftext/fpdf_text_int.cpp
|
| diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
|
| index 6755939ca2a8f7877d1038a3776434e238c3abb0..149d9bf2e2fe0fb216ccb4fb76c62b1baa7b4b98 100644
|
| --- a/core/src/fpdftext/fpdf_text_int.cpp
|
| +++ b/core/src/fpdftext/fpdf_text_int.cpp
|
| @@ -1143,8 +1143,8 @@ int CPDF_TextPage::GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const
|
| void CPDF_TextPage::OnPiece(IFX_BidiChar* pBidi, CFX_WideString& str)
|
| {
|
| int32_t start, count;
|
| - int32_t ret = pBidi->GetBidiInfo(start, count);
|
| - if(ret == 2) {
|
| + IFX_BidiChar::Direction ret = pBidi->GetBidiInfo(&start, &count);
|
| + if (ret == IFX_BidiChar::RIGHT) {
|
| for(int i = start + count - 1; i >= start; i--) {
|
| m_TextBuf.AppendChar(str.GetAt(i));
|
| m_charList.Add(*(PAGECHAR_INFO*)m_TempCharList.GetAt(i));
|
| @@ -1251,28 +1251,29 @@ void CPDF_TextPage::CloseTempLine()
|
| bPrevSpace = FALSE;
|
| }
|
| if(pBidiChar->AppendChar(str.GetAt(i))) {
|
| - int32_t ret = pBidiChar->GetBidiInfo(start, count);
|
| + IFX_BidiChar::Direction ret =
|
| + pBidiChar->GetBidiInfo(&start, &count);
|
| order.Add(start);
|
| order.Add(count);
|
| order.Add(ret);
|
| if(!bR2L) {
|
| - if(ret == 2) {
|
| + if (ret == IFX_BidiChar::RIGHT) {
|
| nR2L++;
|
| - } else if (ret == 1) {
|
| + } else if (ret == IFX_BidiChar::LEFT) {
|
| nL2R++;
|
| }
|
| }
|
| }
|
| }
|
| if(pBidiChar->EndChar()) {
|
| - int32_t ret = pBidiChar->GetBidiInfo(start, count);
|
| + IFX_BidiChar::Direction ret = pBidiChar->GetBidiInfo(&start, &count);
|
| order.Add(start);
|
| order.Add(count);
|
| order.Add(ret);
|
| if(!bR2L) {
|
| - if(ret == 2) {
|
| + if (ret == IFX_BidiChar::RIGHT) {
|
| nR2L++;
|
| - } else if(ret == 1) {
|
| + } else if (ret == IFX_BidiChar::LEFT) {
|
| nL2R++;
|
| }
|
| }
|
| @@ -1857,7 +1858,6 @@ FX_BOOL CPDF_TextPage::IsRightToLeft(const CPDF_TextObject* pTextObj,
|
| nonstd::unique_ptr<IFX_BidiChar> pBidiChar(IFX_BidiChar::Create());
|
| int32_t nR2L = 0;
|
| int32_t nL2R = 0;
|
| - int32_t start = 0, count = 0;
|
| CPDF_TextObjectItem item;
|
| for (int32_t i = 0; i < nItems; i++) {
|
| pTextObj->GetItemInfo(i, &item);
|
| @@ -1873,21 +1873,20 @@ FX_BOOL CPDF_TextPage::IsRightToLeft(const CPDF_TextObject* pTextObj,
|
| continue;
|
| }
|
| if (pBidiChar->AppendChar(wChar)) {
|
| - int32_t ret = pBidiChar->GetBidiInfo(start, count);
|
| - if (ret == 2) {
|
| + IFX_BidiChar::Direction ret =
|
| + pBidiChar->GetBidiInfo(nullptr, nullptr);
|
| + if (ret == IFX_BidiChar::RIGHT) {
|
| nR2L++;
|
| - }
|
| - else if (ret == 1) {
|
| + } else if (ret == IFX_BidiChar::LEFT) {
|
| nL2R++;
|
| }
|
| }
|
| }
|
| if (pBidiChar->EndChar()) {
|
| - int32_t ret = pBidiChar->GetBidiInfo(start, count);
|
| - if (ret == 2) {
|
| + IFX_BidiChar::Direction ret = pBidiChar->GetBidiInfo(nullptr, nullptr);
|
| + if (ret == IFX_BidiChar::RIGHT) {
|
| nR2L++;
|
| - }
|
| - else if (ret == 1) {
|
| + } else if (ret == IFX_BidiChar::LEFT) {
|
| nL2R++;
|
| }
|
| }
|
|
|