jenkins-bot has submitted this change and it was merged.

Change subject: Store intended table selection before expansion and use when 
translating
......................................................................


Store intended table selection before expansion and use when translating

This makes cursoring through merged cells more logical without
breaking the expectation that selections always cover merged cells.

Change-Id: I28dccfde5e02d44871f1828154faccd33d8332cb
---
M src/dm/ve.dm.TableSelection.js
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/dm/ve.dm.TableSelection.js b/src/dm/ve.dm.TableSelection.js
index 0b9ed63..e3805db 100644
--- a/src/dm/ve.dm.TableSelection.js
+++ b/src/dm/ve.dm.TableSelection.js
@@ -31,6 +31,10 @@
        this.startRow = fromRow < toRow ? fromRow : toRow;
        this.endCol = fromCol < toCol ? toCol : fromCol;
        this.endRow = fromRow < toRow ? toRow : fromRow;
+       this.intendedFromCol = this.fromCol;
+       this.intendedFromRow = this.fromRow;
+       this.intendedToCol = this.toCol;
+       this.intendedToRow = this.toRow;
 
        if ( expand ) {
                this.expand();
@@ -302,7 +306,7 @@
                return cell;
        }
 
-       fromCell = matrix.getCell( this.fromRow, this.fromCol );
+       fromCell = matrix.getCell( this.intendedFromRow, this.intendedFromCol );
        if ( fromColOffset ) {
                fromCell = adjust( 'col', fromCell, fromColOffset );
        }
@@ -310,7 +314,7 @@
                fromCell = adjust( 'row', fromCell, fromRowOffset );
        }
 
-       toCell = matrix.getCell( this.toRow, this.toCol );
+       toCell = matrix.getCell( this.intendedToRow, this.intendedToCol );
        if ( toColOffset ) {
                toCell = adjust( 'col', toCell, toColOffset );
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/170027
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I28dccfde5e02d44871f1828154faccd33d8332cb
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Trevor Parscal <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to