diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-26 13:27:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-27 10:24:14 +0100 |
commit | 8be5a49f377e5451da953aee598fd22f9665fbd6 (patch) | |
tree | d8aad16822c91a6a3115824e3840530e4d59a012 /sc/source/ui/docshell/docsh4.cxx | |
parent | 814e50e6622ea9701094f3ec309a395d175c494f (diff) |
drop old tools/gen.hxx methods in sc
Change-Id: I3652c0a35a6873e80ee22d908a8969d09410776b
Reviewed-on: https://gerrit.libreoffice.org/50361
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/docshell/docsh4.cxx')
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 17f597270876..f9e78ba99034 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2111,10 +2111,11 @@ tools::Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const namespace { -void SnapHor( const ScDocument& rDoc, SCTAB nTab, long& rVal, SCCOL& rStartCol ) +SAL_WARN_UNUSED_RESULT +long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, long nVal, SCCOL& rStartCol ) { SCCOL nCol = 0; - long nTwips = static_cast<long>(rVal / HMM_PER_TWIPS); + long nTwips = static_cast<long>(nVal / HMM_PER_TWIPS); long nSnap = 0; while ( nCol<MAXCOL ) { @@ -2127,14 +2128,16 @@ void SnapHor( const ScDocument& rDoc, SCTAB nTab, long& rVal, SCCOL& rStartCol ) else break; } - rVal = static_cast<long>( nSnap * HMM_PER_TWIPS ); + nVal = static_cast<long>( nSnap * HMM_PER_TWIPS ); rStartCol = nCol; + return nVal; } -void SnapVer( const ScDocument& rDoc, SCTAB nTab, long& rVal, SCROW& rStartRow ) +SAL_WARN_UNUSED_RESULT +long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartRow ) { SCROW nRow = 0; - long nTwips = static_cast<long>(rVal / HMM_PER_TWIPS); + long nTwips = static_cast<long>(nVal / HMM_PER_TWIPS); long nSnap = 0; bool bFound = false; @@ -2163,8 +2166,9 @@ void SnapVer( const ScDocument& rDoc, SCTAB nTab, long& rVal, SCROW& rStartRow ) if (!bFound) nRow = MAXROW; // all hidden down to the bottom - rVal = static_cast<long>( nSnap * HMM_PER_TWIPS ); + nVal = static_cast<long>( nSnap * HMM_PER_TWIPS ); rStartRow = nRow; + return nVal; } } @@ -2177,14 +2181,14 @@ void ScDocShell::SnapVisArea( tools::Rectangle& rRect ) const ScDrawLayer::MirrorRectRTL( rRect ); // calculate with positive (LTR) values SCCOL nCol = 0; - SnapHor( aDocument, nTab, rRect.Left(), nCol ); + rRect.SetLeft( SnapHorizontal( aDocument, nTab, rRect.Left(), nCol ) ); ++nCol; // at least one column - SnapHor( aDocument, nTab, rRect.Right(), nCol ); + rRect.SetRight( SnapHorizontal( aDocument, nTab, rRect.Right(), nCol ) ); SCROW nRow = 0; - SnapVer( aDocument, nTab, rRect.Top(), nRow ); + rRect.SetTop( SnapVertical( aDocument, nTab, rRect.Top(), nRow ) ); ++nRow; // at least one row - SnapVer( aDocument, nTab, rRect.Bottom(), nRow ); + rRect.SetBottom( SnapVertical( aDocument, nTab, rRect.Bottom(), nRow ) ); if ( bNegativePage ) ScDrawLayer::MirrorRectRTL( rRect ); // back to real rectangle |