summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabview5.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-10-10 21:46:59 +0100
committerMichael Meeks <michael.meeks@collabora.com>2019-10-11 20:20:50 +0200
commit5782dc181fe32c4b38dc8595adf7ac99bea2bce8 (patch)
treeb8bc34d0f74bc3c6df137c2b3ef1ea1064f786bf /sc/source/ui/view/tabview5.cxx
parent945c713d60fdca62905eb6aba48408ba5a7dca7a (diff)
sc: rowcol: migrate some viewdata.
The ScViewData is able to not have a document for a time, curious to allow a model-free view, but there it is. Change-Id: I402fa5f814f3cc674b733353c5d3fa2de1970e23 Reviewed-on: https://gerrit.libreoffice.org/80631 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc/source/ui/view/tabview5.cxx')
-rw-r--r--sc/source/ui/view/tabview5.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 9d611736f1bb..22afcdb908cd 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -106,10 +106,10 @@ void ScTabView::Init()
explicitly because the parent frame window is already RTL disabled. */
pTabControl->EnableRTL( AllSettings::GetLayoutRTL() );
- InitScrollBar( *aHScrollLeft, MAXCOL+1 );
- InitScrollBar( *aHScrollRight, MAXCOL+1 );
- InitScrollBar( *aVScrollTop, MAXROW+1 );
- InitScrollBar( *aVScrollBottom, MAXROW+1 );
+ InitScrollBar( *aHScrollLeft, aViewData.GetDocument()->MaxCol()+1 );
+ InitScrollBar( *aHScrollRight, aViewData.GetDocument()->MaxCol()+1 );
+ InitScrollBar( *aVScrollTop, aViewData.GetDocument()->MaxRow()+1 );
+ InitScrollBar( *aVScrollBottom, aViewData.GetDocument()->MaxRow()+1 );
/* #i97900# scrollbars remain in correct RTL mode, needed mirroring etc.
is now handled correctly at the respective places. */
@@ -320,7 +320,7 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
ScDocShell* pDocSh = GetViewData().GetDocShell();
ScModelObj* pModelObj = pDocSh ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocSh->GetModel()) : nullptr;
- if (pModelObj)
+ if (pModelObj && GetViewData().GetDocument())
{
Size aDocSize = pModelObj->getDocumentSize();
std::stringstream ss;
@@ -585,7 +585,7 @@ void ScTabView::MakeVisible( const tools::Rectangle& rHMMRect )
long nLinesX=0, nLinesY=0; // columns/rows - scroll at least nScrollX/Y
if (nScrollX > 0)
- while (nScrollX > 0 && nPosX < MAXCOL)
+ while (nScrollX > 0 && nPosX < pDoc->MaxCol())
{
nScrollX -= static_cast<long>( pDoc->GetColWidth(nPosX, nTab) * nPPTX );
++nPosX;
@@ -600,7 +600,7 @@ void ScTabView::MakeVisible( const tools::Rectangle& rHMMRect )
}
if (nScrollY > 0)
- while (nScrollY > 0 && nPosY < MAXROW)
+ while (nScrollY > 0 && nPosY < pDoc->MaxRow())
{
nScrollY -= static_cast<long>( pDoc->GetRowHeight(nPosY, nTab) * nPPTY );
++nPosY;