Skip to content

Commit

Permalink
For bug #64883
Browse files Browse the repository at this point in the history
Fix selection for the hidden part of complex fields
  • Loading branch information
KirillovIlya committed Feb 8, 2024
1 parent aca0923 commit 9e8c6d1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
20 changes: 20 additions & 0 deletions word/Editor/Paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -19255,6 +19255,26 @@ CParagraphComplexFieldsInfo.prototype.ResetPage = function(Paragraph, CurPage)
else
this.CF = [];
};
CParagraphComplexFieldsInfo.prototype.resetPage = function(paragraph, page)
{
this.ResetPage(paragraph, page);
};
/**
* @param element {AscWord.CRunElementBase}
* @returns {boolean}
*/
CParagraphComplexFieldsInfo.prototype.checkRunElement = function(element)
{
if ((this.IsHiddenFieldContent() || this.IsComplexFieldCode())
&& para_End !== element.Type
&& para_FieldChar !== element.Type)
return false;

if (para_FieldChar === element.Type)
this.ProcessFieldChar(element);

return true;
};
/**
* Находимся ли мы внутри содержимого скрытого поля
* @returns {boolean}
Expand Down
7 changes: 7 additions & 0 deletions word/Editor/Paragraph/draw-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@
this.endInfo = null;

this.anchoredObjects = [];

this.complexFields = new CParagraphComplexFieldsInfo();
}
ParagraphDrawSelectionState.prototype.resetPage = function(page)
{
this.page = page;

this.complexFields.resetPage(this.paragraph, page);
};
ParagraphDrawSelectionState.prototype.resetLine = function(line)
{
Expand Down Expand Up @@ -119,6 +123,9 @@
*/
ParagraphDrawSelectionState.prototype.handleRunElement = function(element, isSelected)
{
if (!this.complexFields.checkRunElement(element))
return;

if (para_Drawing === element.Type && !element.IsInline())
{
if (isSelected)
Expand Down

0 comments on commit 9e8c6d1

Please sign in to comment.