diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-04-07 11:45:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-04-07 14:13:18 +0200 |
commit | d36f7c5bd2115fcdd26ba8ff7b6a0446dea70bd4 (patch) | |
tree | 5ae4b15f3302a538ac55d714ba0529ca4c1de87a /svx | |
parent | 61d57bcebd1a246603cbcd9ad5e0a7df1a8d66cd (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 'svx')
-rw-r--r-- | svx/source/dialog/pagectrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/swframeexample.cxx | 4 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridcl.cxx | 4 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridif.cxx | 2 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws2.cxx | 4 | ||||
-rw-r--r-- | svx/source/sidebar/PanelLayout.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextpathdecomposition.cxx | 2 |
7 files changed, 11 insertions, 11 deletions
diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index e141a664f48f..eb2fc6ef92fd 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -91,7 +91,7 @@ VCL_BUILDER_FACTORY(SvxPageWindow) void SvxPageWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { Fraction aXScale(aWinSize.Width(), std::max(long(aSize.Width() * 2 + aSize.Width() / 8), 1L)); - Fraction aYScale(aWinSize.Height(), std::max<sal_Int32>(aSize.Height(), 1)); + Fraction aYScale(aWinSize.Height(), std::max(aSize.Height(), 1L)); MapMode aMapMode(rRenderContext.GetMapMode()); if(aYScale < aXScale) diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index e7e3e157a5bb..ceacc555d0e6 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -216,8 +216,8 @@ void SvxSwFrameExample::InitAllRects_Impl(vcl::RenderContext& rRenderContext) aFrmSize = Size(nLBorder - 3, (aTextLine.GetHeight() + 2) * 3); break; } - aFrmSize.setWidth( std::max<sal_Int32>(5, aFrmSize.Width()) ); - aFrmSize.setHeight( std::max<sal_Int32>(5, aFrmSize.Height()) ); + aFrmSize.setWidth( std::max(5L, aFrmSize.Width()) ); + aFrmSize.setHeight( std::max(5L, aFrmSize.Height()) ); } else { diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index b36fa382badb..83e507a54eb2 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -1494,7 +1494,7 @@ void FmGridControl::RowHeightChanged() try { sal_Int32 nUnzoomedPixelHeight = CalcReverseZoom( GetDataRowHeight() ); - Any aProperty = makeAny( PixelToLogic( Point(0, nUnzoomedPixelHeight), MapMode(MapUnit::Map10thMM)).Y() ); + Any aProperty = makeAny( static_cast<sal_Int32>(PixelToLogic( Point(0, nUnzoomedPixelHeight), MapMode(MapUnit::Map10thMM)).Y()) ); xModel->setPropertyValue( FM_PROP_ROWHEIGHT, aProperty ); } catch( const Exception& ) @@ -1517,7 +1517,7 @@ void FmGridControl::ColumnResized(sal_uInt16 nId) sal_Int32 nColumnWidth = GetColumnWidth(nId); nColumnWidth = CalcReverseZoom(nColumnWidth); // convert to 10THMM - aWidth <<= PixelToLogic(Point(nColumnWidth, 0), MapMode(MapUnit::Map10thMM)).X(); + aWidth <<= static_cast<sal_Int32>(PixelToLogic(Point(nColumnWidth, 0), MapMode(MapUnit::Map10thMM)).X()); xColModel->setPropertyValue(FM_PROP_WIDTH, aWidth); } } diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 5611196b2000..32bdc76ab2c9 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -2049,7 +2049,7 @@ Any FmXGridPeer::getProperty( const OUString& _rPropertyName ) sal_Int32 nPixelHeight = pGrid->GetDataRowHeight(); // take the zoom factor into account nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight); - aProp <<= pGrid->PixelToLogic(Point(0, nPixelHeight), MapMode(MapUnit::Map10thMM)).Y(); + aProp <<= static_cast<sal_Int32>(pGrid->PixelToLogic(Point(0, nPixelHeight), MapMode(MapUnit::Map10thMM)).Y()); } else if ( _rPropertyName == FM_PROP_HASNAVIGATION ) { diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 8ff45be133d5..32fee03bee82 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -959,8 +959,8 @@ sal_uInt32 GalleryBrowser2::ImplGetSelectedItemId( const Point* pSelPos, Point& } } - rSelPos.setX( std::max<sal_Int32>( std::min<sal_Int32>( rSelPos.X(), aOutputSizePixel.Width() - 1 ), 0 ) ); - rSelPos.setY( std::max<sal_Int32>( std::min<sal_Int32>( rSelPos.Y(), aOutputSizePixel.Height() - 1 ), 0 ) ); + rSelPos.setX( std::max( std::min( rSelPos.X(), aOutputSizePixel.Width() - 1 ), 0L ) ); + rSelPos.setY( std::max( std::min( rSelPos.Y(), aOutputSizePixel.Height() - 1 ), 0L ) ); if( nRet && ( !mpCurTheme || ( nRet > mpCurTheme->GetObjectCount() ) ) ) { diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx index 91d5e588e805..90bbd328da8b 100644 --- a/svx/source/sidebar/PanelLayout.cxx +++ b/svx/source/sidebar/PanelLayout.cxx @@ -94,9 +94,9 @@ void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, P Size aSize(GetOptimalSize()); if (!bCanHandleSmallerWidth) - nWidth = std::max<sal_Int32>(nWidth,aSize.Width()); + nWidth = std::max(nWidth,aSize.Width()); if (!bCanHandleSmallerHeight) - nHeight = std::max<sal_Int32>(nHeight,aSize.Height()); + nHeight = std::max(nHeight,aSize.Height()); Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags); diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index 18fb1e52544e..45e01138f885 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -677,7 +677,7 @@ void SdrTextObj::impDecomposePathTextPrimitive( SdrOutliner& rOutliner = ImpGetDrawOutliner(); rOutliner.SetUpdateMode(true); rOutliner.Clear(); - rOutliner.SetPaperSize(Size(RECT_MAX,RECT_MAX)); + rOutliner.SetPaperSize(Size(LONG_MAX,LONG_MAX)); rOutliner.SetText(rSdrPathTextPrimitive.getOutlinerParaObject()); // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition |