From 27081872bc44a768c8db6266be47857b079d2dd9 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Sun, 2 Feb 2025 03:11:13 +0300 Subject: [PATCH 1/4] [de] Add ability to show the field code instead of the field value --- word/Editor/Paragraph.js | 19 ++++++++++++++++++- word/Editor/Paragraph/ComplexField.js | 6 ++++++ word/Editor/Paragraph/complex-field-stack.js | 14 +++++++++++++- .../Paragraph/draw/highlight-draw-state.js | 2 +- word/Editor/Paragraph_Recalculate.js | 12 ++++++++++++ word/Editor/Run.js | 17 ++++++++++------- 6 files changed, 60 insertions(+), 10 deletions(-) diff --git a/word/Editor/Paragraph.js b/word/Editor/Paragraph.js index 2a083f4550..4ff08a5da2 100644 --- a/word/Editor/Paragraph.js +++ b/word/Editor/Paragraph.js @@ -19519,6 +19519,11 @@ CComplexFieldStatePos.prototype.IsEqual = function(oState) && oState.ComplexField && this.ComplexField.GetBeginChar() === oState.ComplexField.GetBeginChar()); }; +CComplexFieldStatePos.prototype.IsShowFieldCode = function() +{ + let beginChar = this.ComplexField ? this.ComplexField.GetBeginChar() : null; + return beginChar ? beginChar.IsShowFieldCode() : null; +}; //---------------------------------------------------------------------------------------------------------------------- // Классы для работы с курсором @@ -19638,7 +19643,7 @@ CParagraphSearchPos.prototype.InitComplexFields = function(arrComplexFields) }; CParagraphSearchPos.prototype.isComplexField = function() { - return (this.ComplexFields.length > 0 ? true : false); + return (this.ComplexFields.length > 0); }; CParagraphSearchPos.prototype.isComplexFieldCode = function() { @@ -19653,6 +19658,18 @@ CParagraphSearchPos.prototype.isComplexFieldCode = function() return false; }; +CParagraphSearchPos.prototype.isHiddenComplexFieldPart = function() +{ + for (let fieldIndex = 0, fieldCount = this.ComplexFields.length; fieldIndex < fieldCount; ++ fieldIndex) + { + let isFieldCode = this.ComplexFields[fieldIndex].IsFieldCode(); + let isShowCode = this.ComplexFields[fieldIndex].IsShowFieldCode(); + if (isFieldCode !== isShowCode) + return true; + } + + return false; +}; CParagraphSearchPos.prototype.isComplexFieldValue = function() { if (!this.isComplexField() || this.isComplexFieldCode()) diff --git a/word/Editor/Paragraph/ComplexField.js b/word/Editor/Paragraph/ComplexField.js index c61b04e35a..4f4880e032 100644 --- a/word/Editor/Paragraph/ComplexField.js +++ b/word/Editor/Paragraph/ComplexField.js @@ -50,6 +50,8 @@ function ParaFieldChar(Type, LogicDocument) this.X = 0; this.Y = 0; this.PageAbs = 0; + + this.showFieldCode = false; this.numText = null; this.textPr = null; @@ -446,6 +448,10 @@ ParaFieldChar.prototype.FindNextFillingForm = function(isNext, isCurrent, isStar else return (this.IsEnd() && (!isCurrent || isNext) ? this.ComplexField : null); }; +ParaFieldChar.prototype.IsShowFieldCode = function() +{ + return this.showFieldCode; +}; /** * @constructor diff --git a/word/Editor/Paragraph/complex-field-stack.js b/word/Editor/Paragraph/complex-field-stack.js index 9d5086d9ab..5943862d54 100644 --- a/word/Editor/Paragraph/complex-field-stack.js +++ b/word/Editor/Paragraph/complex-field-stack.js @@ -90,7 +90,7 @@ */ ParagraphComplexFieldStack.prototype.checkRunElement = function(element) { - if ((this.isHiddenFieldContent() || this.isComplexFieldCode()) + if ((this.isHiddenFieldContent() || this.isHiddenComplexFieldPart()) && para_End !== element.Type && para_FieldChar !== element.Type) return false; @@ -218,6 +218,18 @@ return false; }; + ParagraphComplexFieldStack.prototype.isHiddenComplexFieldPart = function() + { + for (let fieldIndex = 0, fieldCount = this.CF.length; fieldIndex < fieldCount; ++ fieldIndex) + { + let isFieldCode = this.CF[fieldIndex].IsFieldCode(); + let isShowCode = this.CF[fieldIndex].IsShowFieldCode(); + if (isFieldCode !== isShowCode) + return true; + } + + return false; + }; ParagraphComplexFieldStack.prototype.isCurrentComplexField = function() { for (let index = 0, count = this.CF.length; index < count; ++index) diff --git a/word/Editor/Paragraph/draw/highlight-draw-state.js b/word/Editor/Paragraph/draw/highlight-draw-state.js index 6aaabaacf4..77e9a6f2b9 100644 --- a/word/Editor/Paragraph/draw/highlight-draw-state.js +++ b/word/Editor/Paragraph/draw/highlight-draw-state.js @@ -494,7 +494,7 @@ ParagraphHighlightDrawState.prototype.isComplexFieldHighlight = function() { return (this.complexFields.isComplexField() - && !this.complexFields.isComplexFieldCode() + && !this.complexFields.isHiddenComplexFieldPart() && this.complexFields.isCurrentComplexField() && !this.complexFields.isHyperlinkField()); }; diff --git a/word/Editor/Paragraph_Recalculate.js b/word/Editor/Paragraph_Recalculate.js index 2873a96d81..e06262c50e 100644 --- a/word/Editor/Paragraph_Recalculate.js +++ b/word/Editor/Paragraph_Recalculate.js @@ -4473,6 +4473,18 @@ CParagraphRecalculateStateInfo.prototype.isComplexFieldCode = function() return false; }; +CParagraphRecalculateStateInfo.prototype.isHiddenComplexFieldPart = function() +{ + for (let fieldIndex = 0, fieldCount = this.ComplexFields.length; fieldIndex < fieldCount; ++ fieldIndex) + { + let isFieldCode = this.ComplexFields[fieldIndex].IsFieldCode(); + let isShowCode = this.ComplexFields[fieldIndex].IsShowFieldCode(); + if (isFieldCode !== isShowCode) + return true; + } + + return false; +}; CParagraphRecalculateStateInfo.prototype.processFieldCharAndCollectComplexField = function(oChar) { if (oChar.IsBegin()) diff --git a/word/Editor/Run.js b/word/Editor/Run.js index 2af71cff99..9f06e6637b 100644 --- a/word/Editor/Run.js +++ b/word/Editor/Run.js @@ -3694,7 +3694,7 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) let isSkipFillRange = false; // TODO: Сделать возможность показывать инструкцию - var isHiddenCFPart = PRS.ComplexFields.isComplexFieldCode(); + var isHiddenCFPart = PRS.ComplexFields.isHiddenComplexFieldPart(); PRS.CheckUpdateLBP(Pos, Depth); @@ -3726,7 +3726,7 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) else { var oInstrText = Item; - if (!PRS.ComplexFields.isComplexFieldCode()) + if (!isHiddenCFPart) { if (AscCommon.IsSpace(Item.Value)) { @@ -4701,7 +4701,7 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) Item.SetRun(this); PRS.ComplexFields.processFieldChar(Item); - isHiddenCFPart = PRS.ComplexFields.isComplexFieldCode(); + isHiddenCFPart = PRS.ComplexFields.isHiddenComplexFieldPart(); if (Item.IsSeparate()) { @@ -5168,7 +5168,7 @@ ParaRun.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange) let textPr = this.Get_CompiledPr(false); // TODO: Сделать возможность показывать инструкцию - var isHiddenCFPart = PRSC.ComplexFields.isComplexFieldCode(); + var isHiddenCFPart = PRSC.ComplexFields.isHiddenComplexFieldPart(); for ( var Pos = StartPos; Pos < EndPos; Pos++ ) { var Item = this.private_CheckInstrText(this.Content[Pos]); @@ -5179,6 +5179,9 @@ ParaRun.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange) if (isHiddenCFPart && para_End !== ItemType && para_FieldChar !== ItemType && para_InstrText !== ItemType) continue; + + if (!isHiddenCFPart && para_InstrText === ItemType) + ItemType = para_Text; switch( ItemType ) { @@ -5332,7 +5335,7 @@ ParaRun.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange) else PRSC.ComplexFields.processFieldCharAndCollectComplexField(Item); - isHiddenCFPart = PRSC.ComplexFields.isComplexFieldCode(); + isHiddenCFPart = PRSC.ComplexFields.isHiddenComplexFieldPart(); if (Item.IsVisual()) { @@ -5375,7 +5378,7 @@ ParaRun.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _CurRange, var EndPos = this.protected_GetRangeEndPos(CurLine, CurRange); // TODO: Сделать возможность показывать инструкцию - var isHiddenCFPart = PRSA.ComplexFields.isComplexFieldCode(); + var isHiddenCFPart = PRSA.ComplexFields.isHiddenComplexFieldPart(); for ( var Pos = StartPos; Pos < EndPos; Pos++ ) { var Item = this.private_CheckInstrText(this.Content[Pos]); @@ -5755,7 +5758,7 @@ ParaRun.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _CurRange, case para_FieldChar: { PRSA.ComplexFields.processFieldChar(Item); - isHiddenCFPart = PRSA.ComplexFields.isComplexFieldCode(); + isHiddenCFPart = PRSA.ComplexFields.isHiddenComplexFieldPart(); if (Item.IsVisual()) { From d99707faf86924c0f9fb36d2e042d390c41d663c Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Sun, 2 Feb 2025 13:55:22 +0300 Subject: [PATCH 2/4] [de] Add method to switch between displaying the field value and the field code --- word/Editor/Document.js | 17 +++++++++ word/Editor/Paragraph/ComplexField.js | 55 +++++++++++++++++++++++++++ word/api.js | 6 +++ 3 files changed, 78 insertions(+) diff --git a/word/Editor/Document.js b/word/Editor/Document.js index 2bea46cad3..ca82525ade 100644 --- a/word/Editor/Document.js +++ b/word/Editor/Document.js @@ -23689,6 +23689,23 @@ CDocument.prototype.GetCurrentComplexFields = function() return oParagraph.GetCurrentComplexFields(); }; +CDocument.prototype.ToggleComplexFieldCodes = function() +{ + let fields = this.GetCurrentComplexFields(); + if (fields.length <= 0) + return; + + for (let i = 0; i < fields.length; ++i) + { + if (!fields[i].IsShowFieldCode()) + { + fields[i].ToggleFieldCodes(); + return; + } + } + + fields[fields.length - 1].ToggleFieldCodes(); +}; CDocument.prototype.IsFastCollaborationBeforeViewModeInReview = function() { return this.ViewModeInReview.isFastCollaboration; diff --git a/word/Editor/Paragraph/ComplexField.js b/word/Editor/Paragraph/ComplexField.js index 4f4880e032..3fbd5cff05 100644 --- a/word/Editor/Paragraph/ComplexField.js +++ b/word/Editor/Paragraph/ComplexField.js @@ -452,6 +452,28 @@ ParaFieldChar.prototype.IsShowFieldCode = function() { return this.showFieldCode; }; +ParaFieldChar.prototype.SetShowFieldCode = function(isShow) +{ + this.showFieldCode = isShow; +}; +ParaFieldChar.prototype.MoveCursorToChar = function(isBefore) +{ + let run = this.GetRun(); + if (!run) + return; + let inRunPos = run.GetElementPosition(this); + if (-1 === inRunPos) + return; + + if (this.LogicDocument) + this.LogicDocument.RemoveSelection(); + + if (false === isBefore) + inRunPos += 1 + + run.Make_ThisElementCurrent(false); + run.SetCursorPosition(inRunPos); +}; /** * @constructor @@ -2123,6 +2145,39 @@ CComplexField.prototype.GetRelatedParagraphs = function() return result; }; +CComplexField.prototype.IsShowFieldCode = function() +{ + if (!this.IsValid()) + return false; + + return this.BeginChar.IsShowFieldCode(); +}; +CComplexField.prototype.ToggleFieldCodes = function() +{ + let isShowFieldCode = !this.BeginChar.IsShowFieldCode(); + + this.BeginChar.SetShowFieldCode(isShowFieldCode); + + let logicDocument = this.LogicDocument; + if (!logicDocument) + return; + + let history = logicDocument.GetHistory(); + let recalcData = history.getRecalcDataByElements([this.BeginChar.GetParagraph()]); + logicDocument.RecalculateWithParams(recalcData); + + if (isShowFieldCode) + { + this.BeginChar.MoveCursorToChar(false); + } + else + { + if (this.SeparateChar) + this.SeparateChar.MoveCursorToChar(false); + else + this.EndChar.MoveCursorToChar(true); + } +}; function getRefInstruction(sBookmarkName, nType, bHyperlink, bAboveBelow, sSeparator) { diff --git a/word/api.js b/word/api.js index a49fbd56e3..d6dd477248 100644 --- a/word/api.js +++ b/word/api.js @@ -12067,6 +12067,11 @@ background-repeat: no-repeat;\ return logicDocument.UpdateFields(isInSelection); }; + asc_docs_api.prototype.asc_ToggleComplexFieldCodes = function() + { + let logicDocument = this.private_GetLogicDocument(); + logicDocument && logicDocument.ToggleComplexFieldCodes() + }; asc_docs_api.prototype.asc_ParseTableFormulaInstrLine = function(sInstrLine) { @@ -14860,6 +14865,7 @@ background-repeat: no-repeat;\ asc_docs_api.prototype['asc_CreateInstructionLine'] = asc_docs_api.prototype.asc_CreateInstructionLine; asc_docs_api.prototype['asc_HaveFields'] = asc_docs_api.prototype.asc_HaveFields; asc_docs_api.prototype['asc_UpdateFields'] = asc_docs_api.prototype.asc_UpdateFields; + asc_docs_api.prototype['asc_ToggleComplexFieldCodes'] = asc_docs_api.prototype.asc_ToggleComplexFieldCodes; asc_docs_api.prototype["asc_addDateTime"] = asc_docs_api.prototype.asc_addDateTime; From 804f3209cc12f07e4d084d81b75cd95ecace77d6 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Mon, 3 Feb 2025 01:48:08 +0300 Subject: [PATCH 3/4] [de] Handle changing instruction in the context of the canvas editor --- word/Editor/Paragraph.js | 16 +++++++++++++++- word/Editor/Paragraph/ComplexField.js | 8 ++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/word/Editor/Paragraph.js b/word/Editor/Paragraph.js index 4ff08a5da2..46e85f0b1a 100644 --- a/word/Editor/Paragraph.js +++ b/word/Editor/Paragraph.js @@ -4702,11 +4702,16 @@ Paragraph.prototype.Add = function(Item) if (Item.SetParagraph) Item.SetParagraph(this); - + + let itemType = Item.GetType(); + if ((para_Text === itemType || para_Space === itemType) && this.IsCurrentPosInComplexFieldCode()) + Item = new ParaInstrText(Item.GetCodePoint()); + switch (Item.Get_Type()) { case para_Text: case para_Space: + case para_InstrText: case para_PageNum: case para_Tab: case para_Drawing: @@ -4719,6 +4724,7 @@ Paragraph.prototype.Add = function(Item) case para_ContinuationSeparator: default: { + // Элементы данного типа добавляем во внутренний элемент this.Content[this.CurPos.ContentPos].Add(Item); @@ -16817,6 +16823,14 @@ Paragraph.prototype.GetPermRangesByPos = function(paraPos) this.LoadSelectionState(state); return permRanges; }; +Paragraph.prototype.IsCurrentPosInComplexFieldCode = function() +{ + let cfStatePos = this.GetCurrentComplexFields(true); + if (!cfStatePos.length) + return false; + + return cfStatePos[cfStatePos.length - 1].IsFieldCode(); +}; Paragraph.prototype.GetCurrentComplexFields = function(bReturnFieldPos) { var arrComplexFields = []; diff --git a/word/Editor/Paragraph/ComplexField.js b/word/Editor/Paragraph/ComplexField.js index 3fbd5cff05..cfeab6572d 100644 --- a/word/Editor/Paragraph/ComplexField.js +++ b/word/Editor/Paragraph/ComplexField.js @@ -550,6 +550,14 @@ ParaInstrText.prototype.GetValue = function() { return String.fromCharCode(this.Value); }; +ParaInstrText.prototype.GetCodePoint = function() +{ + return this.Value; +}; +ParaInstrText.prototype.GetCharCode = function() +{ + return this.Value; +}; ParaInstrText.prototype.SetCharCode = function(CharCode) { this.Value = CharCode; From 0d6467783c1b16cea46c2b7f98c80694a963e49d Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Mon, 3 Feb 2025 01:53:12 +0300 Subject: [PATCH 4/4] [de] Fix passing through a complex field with arrows left/right --- word/Editor/Run.js | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) 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() ) ) )