Spreadsheet: fix range checking (#6997)

* App: add option to normalize a Range

- To make sure the range starts from top left and ends with bottom right
corner.
- Default is to not normalize on construction for backward compatibility.
-  fix range checking in range binding
This commit is contained in:
Zheng Lei
2022-06-09 18:20:08 +08:00
committed by GitHub
parent 9cd7500d65
commit fb457594fd
4 changed files with 37 additions and 19 deletions

View File

@@ -188,8 +188,8 @@ void DlgBindSheet::accept()
else {
checkAddress(toEnd, toCellEnd, true);
if (toCellStart.isValid()) {
App::Range fromRange(fromCellStart, fromCellEnd);
App::Range toRange(toCellStart, toCellEnd);
App::Range fromRange(fromCellStart, fromCellEnd, true);
App::Range toRange(toCellStart, toCellEnd, true);
if (fromRange.size() != toRange.size()) {
auto res = QMessageBox::warning(this, tr("Bind cells"),
tr("Source and target cell count mismatch. Partial binding may still work.\n\n"