Skip to content

Commit

Permalink
[de] Fix passing through a complex field with arrows left/right
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillovIlya committed Feb 2, 2025
1 parent 804f320 commit 0d64677
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions word/Editor/Run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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())))
Expand All @@ -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();

Expand All @@ -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()))
Expand All @@ -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)
Expand All @@ -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();

Expand All @@ -6929,15 +6929,15 @@ 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();
}

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--;

Expand Down Expand Up @@ -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() ) )
Expand All @@ -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();

Expand All @@ -7032,17 +7032,17 @@ 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();
}

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)
{
Expand Down Expand Up @@ -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() ) ) )
Expand Down

0 comments on commit 0d64677

Please sign in to comment.