Skip to content

Commit

Permalink
Add sectPr type diff for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Coolcooo authored and SergeyLuzyanin committed Jan 28, 2025
1 parent b530d14 commit 131976a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion word/Editor/Comparison.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,19 @@
};
CNode.prototype.getDiff = function (oAnotherNode, oComparison) {
if (this.equals(oAnotherNode, oComparison)) {
return this.wordCounter.diff(oAnotherNode.wordCounter);
let nWordDiff = this.wordCounter.diff(oAnotherNode.wordCounter);
if (this.element instanceof AscWord.Paragraph) {
let startType;
let endType;
if (this.element.SectPr) {
startType = this.element.SectPr.Type;
}
if (oAnotherNode.element.SectPr) {
endType = oAnotherNode.element.SectPr.Type;
}
nWordDiff += endType !== startType ? 1 : 0;
}
return nWordDiff;
}
return this.wordCounter.count + oAnotherNode.wordCounter.count + 2;
};
Expand Down

0 comments on commit 131976a

Please sign in to comment.