summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh4.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-07 11:45:13 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-04-07 14:13:18 +0200
commitd36f7c5bd2115fcdd26ba8ff7b6a0446dea70bd4 (patch)
tree5ae4b15f3302a538ac55d714ba0529ca4c1de87a /sc/source/ui/docshell/docsh4.cxx
parent61d57bcebd1a246603cbcd9ad5e0a7df1a8d66cd (diff)
Revert "long->sal_Int32 in tools/gen.hxx"
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0. As discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html> "long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with signed integer overflow, and the original plan was to redo it to consistently use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/> "sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed miserably on Windows, causing odd failures like not writing out Pictures/*.svm streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best approach is to just revert the original commit, at least for now. Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix Library_vclplug_qt5". Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae Reviewed-on: https://gerrit.libreoffice.org/52532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/source/ui/docshell/docsh4.cxx')
-rw-r--r--sc/source/ui/docshell/docsh4.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index a0b2cf8b8678..c5d96d47b00b 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2120,14 +2120,14 @@ tools::Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
namespace {
SAL_WARN_UNUSED_RESULT
-sal_Int32 SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SCCOL& rStartCol )
+long SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, long nVal, SCCOL& rStartCol )
{
SCCOL nCol = 0;
- sal_Int32 nTwips = static_cast<long>(nVal / HMM_PER_TWIPS);
- sal_Int32 nSnap = 0;
+ long nTwips = static_cast<long>(nVal / HMM_PER_TWIPS);
+ long nSnap = 0;
while ( nCol<MAXCOL )
{
- sal_Int32 nAdd = rDoc.GetColWidth(nCol, nTab);
+ long nAdd = rDoc.GetColWidth(nCol, nTab);
if ( nSnap + nAdd/2 < nTwips || nCol < rStartCol )
{
nSnap += nAdd;
@@ -2136,17 +2136,17 @@ sal_Int32 SnapHorizontal( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SC
else
break;
}
- nVal = nSnap * HMM_PER_TWIPS;
+ nVal = static_cast<long>( nSnap * HMM_PER_TWIPS );
rStartCol = nCol;
return nVal;
}
SAL_WARN_UNUSED_RESULT
-sal_Int32 SnapVertical( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SCROW& rStartRow )
+long SnapVertical( const ScDocument& rDoc, SCTAB nTab, long nVal, SCROW& rStartRow )
{
SCROW nRow = 0;
- sal_Int32 nTwips = static_cast<sal_Int32>(nVal / HMM_PER_TWIPS);
- sal_Int32 nSnap = 0;
+ long nTwips = static_cast<long>(nVal / HMM_PER_TWIPS);
+ long nSnap = 0;
bool bFound = false;
for (SCROW i = nRow; i <= MAXROW; ++i)
@@ -2159,7 +2159,7 @@ sal_Int32 SnapVertical( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SCRO
}
nRow = i;
- sal_Int32 nAdd = rDoc.GetRowHeight(i, nTab);
+ long nAdd = rDoc.GetRowHeight(i, nTab);
if ( nSnap + nAdd/2 < nTwips || nRow < rStartRow )
{
nSnap += nAdd;
@@ -2174,7 +2174,7 @@ sal_Int32 SnapVertical( const ScDocument& rDoc, SCTAB nTab, sal_Int32 nVal, SCRO
if (!bFound)
nRow = MAXROW; // all hidden down to the bottom
- nVal = nSnap * HMM_PER_TWIPS;
+ nVal = static_cast<long>( nSnap * HMM_PER_TWIPS );
rStartRow = nRow;
return nVal;
}