summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh4.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-08-11 17:36:12 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-12 09:44:10 +0100
commit00d74a5e0291a40e532b2a0f51fdd5a3e1f487ed (patch)
treec34ba7a271768d14bd6f5535069ac203228fa476 /sc/source/ui/docshell/docsh4.cxx
parent9871789e0f9256ac27ea7bc4590ba910d6e4c373 (diff)
Use more o3tl::convert in sc
Change-Id: I624b6c570eff8b6cdc83ffcb2d0dbadf848715b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120330 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/ui/docshell/docsh4.cxx')
-rw-r--r--sc/source/ui/docshell/docsh4.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 1c32a670baf1..289c66f756d9 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1692,7 +1692,7 @@ bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
tools::Long nBlkTwipsX = 0;
if (bHeaders)
- nBlkTwipsX += tools::Long(PRINT_HEADER_WIDTH);
+ nBlkTwipsX += PRINT_HEADER_WIDTH;
SCCOL nStartCol = rRange.aStart.Col();
SCCOL nEndCol = rRange.aEnd.Col();
if ( pRepeatCol && nStartCol >= pRepeatCol->aStart.Col() )
@@ -1710,7 +1710,7 @@ bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )
tools::Long nBlkTwipsY = 0;
if (bHeaders)
- nBlkTwipsY += tools::Long(PRINT_HEADER_HEIGHT);
+ nBlkTwipsY += PRINT_HEADER_HEIGHT;
SCROW nStartRow = rRange.aStart.Row();
SCROW nEndRow = rRange.aEnd.Row();
if ( pRepeatRow && nStartRow >= pRepeatRow->aStart.Row() )
@@ -2259,7 +2259,7 @@ namespace {
tools::Long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, tools::Long nVal, SCCOL& rStartCol )
{
SCCOL nCol = 0;
- tools::Long nTwips = static_cast<tools::Long>(nVal / HMM_PER_TWIPS);
+ tools::Long nTwips = o3tl::convert(nVal, o3tl::Length::mm100, o3tl::Length::twip);
tools::Long nSnap = 0;
while ( nCol<rDoc.MaxCol() )
{
@@ -2272,7 +2272,7 @@ tools::Long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, tools::Long nVal
else
break;
}
- nVal = static_cast<tools::Long>( nSnap * HMM_PER_TWIPS );
+ nVal = o3tl::convert(nSnap, o3tl::Length::twip, o3tl::Length::mm100);
rStartCol = nCol;
return nVal;
}
@@ -2281,7 +2281,7 @@ tools::Long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, tools::Long nVal
tools::Long SnapVertical( const ScDocument& rDoc, SCTAB nTab, tools::Long nVal, SCROW& rStartRow )
{
SCROW nRow = 0;
- tools::Long nTwips = static_cast<tools::Long>(nVal / HMM_PER_TWIPS);
+ tools::Long nTwips = o3tl::convert(nVal, o3tl::Length::mm100, o3tl::Length::twip);
tools::Long nSnap = 0;
bool bFound = false;
@@ -2310,7 +2310,7 @@ tools::Long SnapVertical( const ScDocument& rDoc, SCTAB nTab, tools::Long nVal,
if (!bFound)
nRow = rDoc.MaxRow(); // all hidden down to the bottom
- nVal = static_cast<tools::Long>( nSnap * HMM_PER_TWIPS );
+ nVal = o3tl::convert(nSnap, o3tl::Length::twip, o3tl::Length::mm100);
rStartRow = nRow;
return nVal;
}