未验证 提交 24eeb0e9 编写于 作者: O openharmony_ci 提交者: Gitee

回退 'Pull Request !738 : ICU升级69.1'

上级 9ba691c8
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "font/ui_line_break.h" #include "font/ui_line_break.h"
#include "rbbidata.h" #include "rbbidata.h"
#include "ucmndata.h" #include "ucmndata.h"
#include "utrie2.h"
using namespace U_ICU_NAMESPACE; using namespace U_ICU_NAMESPACE;
namespace OHOS { namespace OHOS {
...@@ -56,8 +55,8 @@ uint16_t UILineBreakEngine::GetNextBreakPos(UILineBreakProxy& record) ...@@ -56,8 +55,8 @@ uint16_t UILineBreakEngine::GetNextBreakPos(UILineBreakProxy& record)
} }
int32_t state = LINE_BREAK_STATE_START; int32_t state = LINE_BREAK_STATE_START;
const RBBIStateTable* rbbStateTable = reinterpret_cast<const RBBIStateTable*>(stateTbl_); const RBBIStateTable* rbbStateTable = reinterpret_cast<const RBBIStateTable*>(stateTbl_);
const RBBIStateTableRow16* row = const RBBIStateTableRow* row =
reinterpret_cast<const RBBIStateTableRow16*>(rbbStateTable->fTableData + rbbStateTable->fRowLen * state); reinterpret_cast<const RBBIStateTableRow*>(rbbStateTable->fTableData + rbbStateTable->fRowLen * state);
UTrie2* trie2 = reinterpret_cast<UTrie2*>(lineBreakTrie_); UTrie2* trie2 = reinterpret_cast<UTrie2*>(lineBreakTrie_);
for (uint16_t index = 0; index < record.GetStrLen(); ++index) { for (uint16_t index = 0; index < record.GetStrLen(); ++index) {
uint16_t category = UTRIE2_GET16(trie2, static_cast<uint32_t>(str[index])); uint16_t category = UTRIE2_GET16(trie2, static_cast<uint32_t>(str[index]));
...@@ -67,7 +66,7 @@ uint16_t UILineBreakEngine::GetNextBreakPos(UILineBreakProxy& record) ...@@ -67,7 +66,7 @@ uint16_t UILineBreakEngine::GetNextBreakPos(UILineBreakProxy& record)
category &= ~0x4000; category &= ~0x4000;
} }
state = row->fNextState[category]; state = row->fNextState[category];
row = reinterpret_cast<const RBBIStateTableRow16*>(rbbStateTable->fTableData + rbbStateTable->fRowLen * state); row = reinterpret_cast<const RBBIStateTableRow*>(rbbStateTable->fTableData + rbbStateTable->fRowLen * state);
int16_t completedRule = row->fAccepting; int16_t completedRule = row->fAccepting;
if ((completedRule > 0) || (state == LINE_BREAK_STATE_STOP)) { if ((completedRule > 0) || (state == LINE_BREAK_STATE_STOP)) {
return index; return index;
...@@ -196,8 +195,8 @@ bool UILineBreakEngine::IsBreakPos(uint32_t unicode, uint8_t fontId, uint8_t fon ...@@ -196,8 +195,8 @@ bool UILineBreakEngine::IsBreakPos(uint32_t unicode, uint8_t fontId, uint8_t fon
return true; return true;
} }
const RBBIStateTable* rbbStateTable = reinterpret_cast<const RBBIStateTable*>(stateTbl_); const RBBIStateTable* rbbStateTable = reinterpret_cast<const RBBIStateTable*>(stateTbl_);
const RBBIStateTableRow16* row = const RBBIStateTableRow* row =
reinterpret_cast<const RBBIStateTableRow16*>(rbbStateTable->fTableData + rbbStateTable->fRowLen * state); reinterpret_cast<const RBBIStateTableRow*>(rbbStateTable->fTableData + rbbStateTable->fRowLen * state);
uint16_t utf16 = 0; uint16_t utf16 = 0;
if (unicode <= TypedText::MAX_UINT16_LOW_SCOPE) { if (unicode <= TypedText::MAX_UINT16_LOW_SCOPE) {
utf16 = (unicode & TypedText::MAX_UINT16_LOW_SCOPE); utf16 = (unicode & TypedText::MAX_UINT16_LOW_SCOPE);
...@@ -210,7 +209,7 @@ bool UILineBreakEngine::IsBreakPos(uint32_t unicode, uint8_t fontId, uint8_t fon ...@@ -210,7 +209,7 @@ bool UILineBreakEngine::IsBreakPos(uint32_t unicode, uint8_t fontId, uint8_t fon
category &= ~0x4000; category &= ~0x4000;
} }
state = row->fNextState[category]; state = row->fNextState[category];
row = reinterpret_cast<const RBBIStateTableRow16*>(rbbStateTable->fTableData + rbbStateTable->fRowLen * state); row = reinterpret_cast<const RBBIStateTableRow*>(rbbStateTable->fTableData + rbbStateTable->fRowLen * state);
utf16 = static_cast<uint16_t>(TypedText::UTF16_HIGH_PARAM1 + (unicode >> TypedText::UTF16_HIGH_SHIFT) - utf16 = static_cast<uint16_t>(TypedText::UTF16_HIGH_PARAM1 + (unicode >> TypedText::UTF16_HIGH_SHIFT) -
TypedText::UTF16_HIGH_PARAM2); // high TypedText::UTF16_HIGH_PARAM2); // high
} }
...@@ -221,7 +220,7 @@ bool UILineBreakEngine::IsBreakPos(uint32_t unicode, uint8_t fontId, uint8_t fon ...@@ -221,7 +220,7 @@ bool UILineBreakEngine::IsBreakPos(uint32_t unicode, uint8_t fontId, uint8_t fon
category &= ~0x4000; category &= ~0x4000;
} }
state = row->fNextState[category]; state = row->fNextState[category];
row = reinterpret_cast<const RBBIStateTableRow16*>(rbbStateTable->fTableData + rbbStateTable->fRowLen * state); row = reinterpret_cast<const RBBIStateTableRow*>(rbbStateTable->fTableData + rbbStateTable->fRowLen * state);
return (row->fAccepting > 0 || state == LINE_BREAK_STATE_STOP); return (row->fAccepting > 0 || state == LINE_BREAK_STATE_STOP);
} }
} // namespace OHOS } // namespace OHOS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册