diff --git a/word/Editor/Run.js b/word/Editor/Run.js index 9f06e6637b..8de8a23332 100644 --- a/word/Editor/Run.js +++ b/word/Editor/Run.js @@ -6798,7 +6798,7 @@ ParaRun.prototype.Get_LeftPos = function(SearchPos, ContentPos, Depth, UseConten { var CurPos = true === UseContentPos ? ContentPos.Get(Depth) : this.Content.length; - var isFieldCode = SearchPos.isComplexFieldCode(); + var isHiddenPart = SearchPos.isHiddenComplexFieldPart(); var isFieldValue = SearchPos.isComplexFieldValue(); var isHiddenCF = SearchPos.isHiddenComplexField(); @@ -6811,12 +6811,12 @@ ParaRun.prototype.Get_LeftPos = function(SearchPos, ContentPos, Depth, UseConten if (CurPos >= 0 && para_FieldChar === Item.Type) { SearchPos.ProcessComplexFieldChar(-1, Item); - isFieldCode = SearchPos.isComplexFieldCode(); + isHiddenPart = SearchPos.isComplexFieldCode(); isFieldValue = SearchPos.isComplexFieldValue(); isHiddenCF = SearchPos.isHiddenComplexField(); } - if (CurPos >= 0 && (isFieldCode || isHiddenCF)) + if (CurPos >= 0 && (isHiddenPart || isHiddenCF)) continue; if (CurPos < 0 || (!(para_Drawing === Item.Type && false === Item.Is_Inline() && false === SearchPos.IsCheckAnchors()) && !((para_FootnoteReference === Item.Type || para_EndnoteReference === Item.Type) && true === Item.IsCustomMarkFollows()))) @@ -6833,8 +6833,8 @@ ParaRun.prototype.Get_LeftPos = function(SearchPos, ContentPos, Depth, UseConten ParaRun.prototype.Get_RightPos = function(SearchPos, ContentPos, Depth, UseContentPos, StepEnd) { var CurPos = ( true === UseContentPos ? ContentPos.Get(Depth) : 0 ); - - var isFieldCode = SearchPos.isComplexFieldCode(); + + var isHiddenPart = SearchPos.isHiddenComplexFieldPart(); var isFieldValue = SearchPos.isComplexFieldValue(); var isHiddenCF = SearchPos.isHiddenComplexField(); @@ -6857,12 +6857,12 @@ ParaRun.prototype.Get_RightPos = function(SearchPos, ContentPos, Depth, UseConte if (para_FieldChar === PrevItem.Type) { SearchPos.ProcessComplexFieldChar(1, PrevItem); - isFieldCode = SearchPos.isComplexFieldCode(); + isHiddenPart = SearchPos.isHiddenComplexFieldPart(); isFieldValue = SearchPos.isComplexFieldValue(); isHiddenCF = SearchPos.isHiddenComplexField(); } - if (isFieldCode || isHiddenCF) + if (isHiddenPart || isHiddenCF) return; if ((true !== StepEnd && para_End === PrevItemType) || (para_Drawing === PrevItemType && false === PrevItem.Is_Inline() && false === SearchPos.IsCheckAnchors()) || ((para_FootnoteReference === PrevItemType || para_EndnoteReference === PrevItemType) && true === PrevItem.IsCustomMarkFollows())) @@ -6881,12 +6881,12 @@ ParaRun.prototype.Get_RightPos = function(SearchPos, ContentPos, Depth, UseConte if (para_FieldChar === Item.Type) { SearchPos.ProcessComplexFieldChar(1, Item); - isFieldCode = SearchPos.isComplexFieldCode(); + isHiddenPart = SearchPos.isHiddenComplexFieldPart(); isFieldValue = SearchPos.isComplexFieldValue(); isHiddenCF = SearchPos.isHiddenComplexField(); } - if (isFieldCode || isHiddenCF) + if (isHiddenPart || isHiddenCF) continue; if (!(true !== StepEnd && para_End === ItemType) @@ -6912,7 +6912,7 @@ ParaRun.prototype.Get_WordStartPos = function(SearchPos, ContentPos, Depth, UseC SearchPos.Shift = true; - var isFieldCode = SearchPos.isComplexFieldCode(); + var isHiddenPart = SearchPos.isHiddenComplexFieldPart(); var isFieldValue = SearchPos.isComplexFieldValue(); var isHiddenCF = SearchPos.isHiddenComplexField(); @@ -6929,7 +6929,7 @@ ParaRun.prototype.Get_WordStartPos = function(SearchPos, ContentPos, Depth, UseC if (para_FieldChar === Type) { SearchPos.ProcessComplexFieldChar(-1, Item); - isFieldCode = SearchPos.isComplexFieldCode(); + isHiddenPart = SearchPos.isHiddenComplexFieldPart(); isFieldValue = SearchPos.isComplexFieldValue(); isHiddenCF = SearchPos.isHiddenComplexField(); } @@ -6937,7 +6937,7 @@ ParaRun.prototype.Get_WordStartPos = function(SearchPos, ContentPos, Depth, UseC if ( para_Space === Type || para_Tab === Type || ( para_Text === Type && true === Item.IsNBSP() ) || ( para_Drawing === Type && true !== Item.Is_Inline() ) ) bSpace = true; - if (true === bSpace || isFieldCode || isHiddenCF) + if (true === bSpace || isHiddenPart || isHiddenCF) { CurPos--; @@ -6985,12 +6985,12 @@ ParaRun.prototype.Get_WordStartPos = function(SearchPos, ContentPos, Depth, UseC if (para_FieldChar === Item.Type) { SearchPos.ProcessComplexFieldChar(-1, Item); - isFieldCode = SearchPos.isComplexFieldCode(); + isHiddenPart = SearchPos.isHiddenComplexFieldPart(); isFieldValue = SearchPos.isComplexFieldValue(); isHiddenCF = SearchPos.isHiddenComplexField(); } - if (isFieldCode || isHiddenCF) + if (isHiddenPart || isHiddenCF) continue; if ( (para_Text !== TempType && para_Math_Text !== TempType) || true === Item.IsNBSP() || ( true === SearchPos.Punctuation && true !== Item.IsPunctuation() ) || ( false === SearchPos.Punctuation && false !== Item.IsPunctuation() ) ) @@ -7015,8 +7015,8 @@ ParaRun.prototype.Get_WordEndPos = function(SearchPos, ContentPos, Depth, UseCon var ContentLen = this.Content.length; if (CurPos >= ContentLen || ContentLen <= 0) return; - - var isFieldCode = SearchPos.isComplexFieldCode(); + + var isHiddenPart = SearchPos.isHiddenComplexFieldPart(); var isFieldValue = SearchPos.isComplexFieldValue(); var isHiddenCF = SearchPos.isHiddenComplexField(); @@ -7032,7 +7032,7 @@ ParaRun.prototype.Get_WordEndPos = function(SearchPos, ContentPos, Depth, UseCon if (para_FieldChar === Type) { SearchPos.ProcessComplexFieldChar(1, Item); - isFieldCode = SearchPos.isComplexFieldCode(); + isHiddenPart = SearchPos.isHiddenComplexFieldPart(); isFieldValue = SearchPos.isComplexFieldValue(); isHiddenCF = SearchPos.isHiddenComplexField(); } @@ -7040,9 +7040,9 @@ ParaRun.prototype.Get_WordEndPos = function(SearchPos, ContentPos, Depth, UseCon if ( (para_Text === Type || para_Math_Text === Type) && true != Item.IsNBSP() && ( true === SearchPos.First || ( SearchPos.Punctuation === Item.IsPunctuation() ) ) ) bText = true; - if (true === bText || isFieldCode || isHiddenCF) + if (true === bText || isHiddenPart || isHiddenCF) { - if (!isFieldCode && !isHiddenCF) + if (!isHiddenPart && !isHiddenCF) { if (true === SearchPos.First) { @@ -7130,12 +7130,12 @@ ParaRun.prototype.Get_WordEndPos = function(SearchPos, ContentPos, Depth, UseCon if (para_FieldChar === Item.Type) { SearchPos.ProcessComplexFieldChar(1, Item); - isFieldCode = SearchPos.isComplexFieldCode(); + isHiddenPart = SearchPos.isHiddenComplexFieldPart(); isFieldValue = SearchPos.isComplexFieldValue(); isHiddenCF = SearchPos.isHiddenComplexField(); } - if (isFieldCode || isHiddenCF) + if (isHiddenPart || isHiddenCF) continue; if ( (true !== StepEnd && para_End === TempType) || !( para_Space === TempType || ( para_Text === TempType && true === Item.IsNBSP() ) ) )