[Libreoffice-commits] core.git: sc/source
tushar (via logerrit)
logerrit at kemper.freedesktop.org
Thu May 27 13:48:18 UTC 2021
sc/source/ui/miscdlgs/datatableview.cxx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 0643e5a3accc01e0ee7a2359ec283ced8d0cf0ab
Author: tushar <tusharrai282 at gmail.com>
AuthorDate: Sat May 15 12:04:13 2021 +0530
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu May 27 15:47:39 2021 +0200
tdf#135332 Return MAXROW/MAXCOL for rows/columns out of range.
*Also change the number of rows to MAXROW in Row Header Control.
Change-Id: Ie34361442a0944f62abbc9bb273a9efe72773c57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115642
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sc/source/ui/miscdlgs/datatableview.cxx b/sc/source/ui/miscdlgs/datatableview.cxx
index 2541688a6677..3c88ac65b290 100644
--- a/sc/source/ui/miscdlgs/datatableview.cxx
+++ b/sc/source/ui/miscdlgs/datatableview.cxx
@@ -90,7 +90,7 @@ void ScDataTableColView::HideEntries(SCCOLROW nPos, SCCOLROW nEndPos)
ScDataTableRowView::ScDataTableRowView(vcl::Window* pParent, SelectionEngine* pSelectionEngine):
- ScHeaderControl(pParent, pSelectionEngine, 1024, true, nullptr),
+ ScHeaderControl(pParent, pSelectionEngine, 1048576, true, nullptr),
mpDoc(nullptr),
mnRow(0)
{
@@ -218,7 +218,7 @@ SCCOL findColFromPos(sal_uInt16 nPixelPos, const ScDocument* pDoc, SCCOL nStartC
}
SAL_WARN("sc", "Could not find the corresponding column");
- return -1;
+ return MAXCOL;
}
SCROW findRowFromPos(sal_uInt16 nPixelPos, const ScDocument* pDoc, SCROW nStartRow = 0)
@@ -238,7 +238,7 @@ SCROW findRowFromPos(sal_uInt16 nPixelPos, const ScDocument* pDoc, SCROW nStartR
}
SAL_WARN("sc", "Could not find the corresponding row");
- return -1;
+ return MAXROW;
}
}
@@ -321,13 +321,13 @@ IMPL_LINK(ScDataTableView, ScrollHdl, ScrollBar*, pScrollBar, void)
if (pScrollBar == mpVScroll.get())
{
mnFirstVisibleRow = pScrollBar->GetThumbPos();
- pScrollBar->SetRangeMax(mnFirstVisibleRow + 100);
+ pScrollBar->SetRangeMax(std::min( MAXROW,static_cast<SCROW>(mnFirstVisibleRow + 100 )));
mpRowView->SetPos(mnFirstVisibleRow);
}
else
{
mnFirstVisibleCol = pScrollBar->GetThumbPos();
- pScrollBar->SetRangeMax(mnFirstVisibleCol + 50);
+ pScrollBar->SetRangeMax(std::min( MAXCOL,static_cast<SCCOL>(mnFirstVisibleCol + 50 )));
mpColView->SetPos(mnFirstVisibleCol);
}
Invalidate();
More information about the Libreoffice-commits
mailing list