@@ -637,6 +637,11 @@ export class BaseHistoryInfo {
637
637
this . endPosition = undefined ;
638
638
// Use this property to skip deletion if already selected content deleted case.
639
639
let isRemoveContent : boolean = false ;
640
+ // Use this property to delete table or cell based on history action.
641
+ let isDeletecell : boolean = false ;
642
+ if ( this . action === 'DeleteCells' ) {
643
+ isDeletecell = true ;
644
+ }
640
645
if ( this . endRevisionLogicalIndex && deletedNodes . length > 0 ) {
641
646
let currentPosition : TextPosition = sel . getTextPosBasedOnLogicalIndex ( this . endRevisionLogicalIndex ) ;
642
647
if ( this . editorHistory . isUndoing || ( this . editorHistory . isRedoing && insertTextPosition . isAtSamePosition ( endTextPosition ) ) ) {
@@ -648,7 +653,7 @@ export class BaseHistoryInfo {
648
653
this . endIndex += this . paraInclude ( currentPosition ) ;
649
654
}
650
655
if ( this . editorHistory . isUndoing || ( this . editorHistory . isRedoing && ! this . owner . selectionModule . isEmpty && deletedNodes . length > 0 ) ) {
651
- this . owner . editorModule . deleteSelectedContents ( sel , true ) ;
656
+ this . owner . editorModule . deleteSelectedContents ( sel , true , isDeletecell ) ;
652
657
isRemoveContent = true ;
653
658
}
654
659
}
@@ -710,11 +715,6 @@ export class BaseHistoryInfo {
710
715
let isRedoAction : boolean = ( this . editorHistory . isRedoing && ! isRemoveContent ) ;
711
716
isRemoveContent = this . lastElementRevision ? false : isRemoveContent ;
712
717
this . revertModifiedNodes ( deletedNodes , isRedoAction , isForwardSelection ? start : end , start === end , isForwardSelection ? end : start ) ;
713
- // Use this property to delete table or cell based on history action.
714
- let isDeletecell : boolean = false ;
715
- if ( this . action === 'DeleteCells' ) {
716
- isDeletecell = true ;
717
- }
718
718
if ( isRemoveContent ) {
719
719
this . removeContent ( insertTextPosition , endTextPosition , isDeletecell ) ;
720
720
}
@@ -725,7 +725,7 @@ export class BaseHistoryInfo {
725
725
if ( ! isNullOrUndefined ( this . editorHistory . currentHistoryInfo ) && ( this . editorHistory . currentHistoryInfo . action === 'Reject All' || this . editorHistory . currentHistoryInfo . action === 'Accept All' || this . editorHistory . currentHistoryInfo . action === 'Paste' ) ) {
726
726
updateSelection = true ;
727
727
}
728
- if ( ! this . owner . trackChangesPane . isTrackingPageBreak && ( ( this . editorHistory . isUndoing || this . endRevisionLogicalIndex || this . action === 'RemoveRowTrack' || updateSelection ) && isNullOrUndefined ( this . editorHistory . currentHistoryInfo ) || updateSelection ) ||
728
+ if ( this . action !== 'TrackingPageBreak' && ( ( this . editorHistory . isUndoing || this . endRevisionLogicalIndex || this . action === 'RemoveRowTrack' || updateSelection ) && isNullOrUndefined ( this . editorHistory . currentHistoryInfo ) || updateSelection ) ||
729
729
( ( this . action === 'InsertRowAbove' || this . action === 'Borders' || this . action === 'InsertRowBelow' || this . action === 'InsertColumnLeft' || this . action === 'InsertColumnRight' || this . action === 'Accept Change' || this . action === 'PasteColumn' || this . action === 'PasteRow' || this . action === 'PasteOverwrite' || this . action === 'PasteNested' ) && ( this . editorHistory . isRedoing
730
730
|| this . editorHistory . currentHistoryInfo . action === 'Paste' ) ) ) {
731
731
if ( this . action === 'RemoveRowTrack' && this . editorHistory . isRedoing ) {
@@ -1190,7 +1190,14 @@ export class BaseHistoryInfo {
1190
1190
if ( this . editorHistory . isUndoing ) {
1191
1191
while ( currentPara !== endPara ) {
1192
1192
isSplittedWidget = false ;
1193
- this . owner . editorModule . applyRevisionForCurrentPara ( currentPara , startoffset , currentPara . getLength ( ) , id , true ) ;
1193
+ let endOffset = 0 ;
1194
+ if ( ! isNullOrUndefined ( currentPara . previousSplitWidget ) ) {
1195
+ startoffset = ( currentPara . previousSplitWidget as ParagraphWidget ) . getLength ( ) + 1 ;
1196
+ endOffset = ( currentPara . previousSplitWidget as ParagraphWidget ) . getLength ( ) + currentPara . getLength ( ) ;
1197
+ } else {
1198
+ endOffset = currentPara . getLength ( ) ;
1199
+ }
1200
+ this . owner . editorModule . applyRevisionForCurrentPara ( currentPara , startoffset , endOffset , id , true ) ;
1194
1201
//Correct the condition to get next widget instead of next widget of next splitted widget
1195
1202
currentPara = this . documentHelper . selection . getNextParagraphBlock ( currentPara as BlockWidget ) ;
1196
1203
if ( ! isNullOrUndefined ( currentPara ) && ! isNullOrUndefined ( currentPara . previousRenderedWidget ) && currentPara . previousRenderedWidget instanceof ParagraphWidget && currentPara . previousRenderedWidget . nextSplitWidget && currentPara === endPara ) {
0 commit comments