summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/view/tabview.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 5862d87a8fa0..523044c7531a 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1330,15 +1330,15 @@ namespace
SCROW lcl_LastVisible( const ScViewData& rViewData )
{
- // If many rows are hidden at end of the document (what kind of idiot does that?),
+ // If many rows are hidden at end of the document,
// then there should not be a switch to wide row headers because of this
- //! as a member to the document???
ScDocument& rDoc = rViewData.GetDocument();
SCTAB nTab = rViewData.GetTabNo();
SCROW nVis = rDoc.MaxRow();
- while ( nVis > 0 && rDoc.GetRowHeight( nVis, nTab ) == 0 )
- --nVis;
+ SCROW startRow;
+ while ( nVis > 0 && rDoc.GetRowHeight( nVis, nTab, &startRow, nullptr ) == 0 )
+ nVis = std::max<SCROW>( startRow - 1, 0 );
return nVis;
}