This commit is contained in:
Vincent Wei
2019-03-12 09:27:11 +08:00
parent 5a5d5d3bbb
commit 30c6033e8c
2 changed files with 15 additions and 12 deletions
+5 -4
View File
@@ -7977,7 +7977,7 @@ MG_EXPORT void GUIAPI UStrGetJoiningTypes(const Uchar32 *ucs,
BidiJoiningType *joing_types, int len);
/**
* \fn int GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len)
* \fn BidiType GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len)
* \brief get base paragraph direction
*
* This function finds the base direction of a single paragraph,
@@ -7996,13 +7996,13 @@ MG_EXPORT void GUIAPI UStrGetJoiningTypes(const Uchar32 *ucs,
*
* \param bidi_types the pointer to the BidiType array as returned by
* UStrGetBidiTypes().
* \param len The length of bidi_types
* \param len The length of bidi types array.
*
* \return Base pargraph direction. No weak paragraph direction is returned,
* only BIDI_PGDIR_LTR, BIDI_PGDIR_RTL, or BIDI_PGDIR_ON.
*
*/
MG_EXPORT int GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len);
MG_EXPORT BidiType GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len);
/**
* \fn BidiLevel GUIAPI UBidiGetParagraphEmbeddingLevels(
@@ -8032,7 +8032,8 @@ MG_EXPORT int GUIAPI UBidiGetParagraphDir(const BidiType *bidi_types, int len);
* Explicit right to left.
* - BIDI_PGDIR_ON\n
* The base direction will be resolved by applying the
* rules P2 and P3, and returned via this parameter.
* rules P2 and P3, and returned via this parameter (one
* of BIDI_PGDIR_LTR or BIDI_PGDIR_RTL) .
* \param embedding_levels The pointer to a buffer which will restore
* the embedding levels.
*
+10 -8
View File
@@ -149,7 +149,7 @@ static void free_run_list(BidiRun *run_list)
static BidiRun* run_list_encode_bidi_types (const BidiType *bidi_types,
const BidiBracketType *bracket_types, const int len)
const BidiBracketType *bracket_types, int len)
{
BidiRun *list, *last;
register BidiRun *run = NULL;
@@ -524,7 +524,7 @@ static void print_resolved_types(const BidiRun *pp)
_DBG_PRINTF ("\n");
}
static void print_bidi_string(const BidiType *bidi_types, const int len)
static void print_bidi_string(const BidiType *bidi_types, int len)
{
int i;
@@ -644,13 +644,14 @@ static void print_pairing_nodes(BidiPairingNode *nodes)
#define BIDI_EMBEDDING_DIRECTION(link) \
BIDI_LEVEL_TO_DIR(RL_LEVEL(link))
int UBidiGetParagraphDir(const BidiType *bidi_types, const int len)
BidiType UBidiGetParagraphDir(const BidiType *bidi_types, int len)
{
register int i;
for (i = 0; i < len; i++)
for (i = 0; i < len; i++) {
if (BIDI_IS_LETTER(bidi_types[i]))
return BIDI_IS_RTL(bidi_types[i]) ? BIDI_PGDIR_RTL : BIDI_PGDIR_LTR;
}
return BIDI_PGDIR_ON;
}
@@ -739,7 +740,7 @@ static void free_pairing_nodes(BidiPairingNode *nodes)
}
BidiLevel UBidiGetParagraphEmbeddingLevels(const BidiType *bidi_types,
const BidiBracketType *bracket_types, const int len,
const BidiBracketType *bracket_types, int len,
BidiType *paragraph_dir, BidiLevel *embedding_levels)
{
BidiLevel base_level_per_iso_level[BIDI_MAX_EXPLICIT_LEVEL];
@@ -1610,14 +1611,15 @@ BidiLevel UBidiReorderLine(Uint32 flags,
goto out;
}
_DBG_PRINTF ("%s: reset the embedding levels, 4. whitespace at the end of line\n",
__FUNCTION__);
{
register int i;
/* L1. Reset the embedding levels of some chars:
4. any sequence of white space characters at the end of the line. */
_DBG_PRINTF ("%s: L1. Reset the embedding levels of some chars:"
"4. any sequence of white space characters at the end of the line.\n",
__FUNCTION__);
for (i = off + len - 1; i >= off &&
BIDI_IS_EXPLICIT_OR_BN_OR_WS (bidi_types[i]); i--)
embedding_levels[i] = BIDI_DIR_TO_LEVEL (paragraph_dir);