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 /sd | |
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 'sd')
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsFramePainter.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/ViewShellBase.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews3.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/frmview.cxx | 24 |
6 files changed, 28 insertions, 28 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 33c2e47e49f7..39129f2540a3 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -1563,10 +1563,10 @@ void SdImportTest::testTdf103473() SdrTextObj *const pObj = dynamic_cast<SdrTextObj *const>(pPage->GetObj(0)); CPPUNIT_ASSERT(pObj); ::tools::Rectangle aRect = pObj->GetGeoRect(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3629), aRect.Left()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(4431), aRect.Top()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(8353), aRect.Right()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(9155), aRect.Bottom()); + CPPUNIT_ASSERT_EQUAL(3629L, aRect.Left()); + CPPUNIT_ASSERT_EQUAL(4431L, aRect.Top()); + CPPUNIT_ASSERT_EQUAL(8353L, aRect.Right()); + CPPUNIT_ASSERT_EQUAL(9155L, aRect.Bottom()); xDocShRef->DoClose(); } @@ -1905,8 +1905,8 @@ bool SdImportTest::checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeN ReadDIB(aBitmap, aBitmapStream, true); } } - CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBitmap.GetSizePixel().Width()); - CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aBitmap.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL(8L, aBitmap.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL(8L, aBitmap.GetSizePixel().Height()); return checkPatternValues(rExpected, aBitmap); } @@ -2343,7 +2343,7 @@ void SdImportTest::testTdf114913() CPPUNIT_ASSERT_MESSAGE("No text object", pTxtObj != nullptr); const SvxNumBulletItem *pItem = pTxtObj->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET); CPPUNIT_ASSERT(pItem); - CPPUNIT_ASSERT_EQUAL(sal_Int32(691), pItem->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight()); + CPPUNIT_ASSERT_EQUAL(long(691), pItem->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight()); xDocShRef->DoClose(); } diff --git a/sd/source/ui/slidesorter/view/SlsFramePainter.cxx b/sd/source/ui/slidesorter/view/SlsFramePainter.cxx index 6ad0831b7e49..07027c1d1e18 100644 --- a/sd/source/ui/slidesorter/view/SlsFramePainter.cxx +++ b/sd/source/ui/slidesorter/view/SlsFramePainter.cxx @@ -182,7 +182,7 @@ void FramePainter::OffsetBitmap::PaintSide ( { rDevice.DrawBitmapEx( Point(nX,nY), - Size(std::min(aBitmapSize.Width(),nRight-nX+1),aBitmapSize.Height()), + Size(std::min(aBitmapSize.Width(),static_cast<long>(nRight-nX+1)),aBitmapSize.Height()), maBitmap); } } @@ -202,7 +202,7 @@ void FramePainter::OffsetBitmap::PaintSide ( { rDevice.DrawBitmapEx( Point(nX,nY), - Size(aBitmapSize.Width(), std::min(aBitmapSize.Height(), nBottom-nY+1)), + Size(aBitmapSize.Width(), std::min(aBitmapSize.Height(), static_cast<long>(nBottom-nY+1))), maBitmap); } } @@ -223,8 +223,8 @@ void FramePainter::OffsetBitmap::PaintCenter ( rDevice.DrawBitmapEx( Point(nX,nY), Size( - ::std::min<sal_Int32>(aBitmapSize.Width(), rBox.Right()-nX+1), - std::min<sal_Int32>(aBitmapSize.Height(), rBox.Bottom()-nY+1)), + ::std::min(aBitmapSize.Width(), rBox.Right()-nX+1), + std::min(aBitmapSize.Height(), rBox.Bottom()-nY+1)), maBitmap); } diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 7a34f2a80277..e5e48f13d411 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1030,10 +1030,10 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) aAny <<= GetPage()->GetLowerBorder(); break; case WID_PAGE_WIDTH: - aAny <<= GetPage()->GetSize().getWidth(); + aAny <<= static_cast<sal_Int32>( GetPage()->GetSize().getWidth() ); break; case WID_PAGE_HEIGHT: - aAny <<= GetPage()->GetSize().getHeight(); + aAny <<= static_cast<sal_Int32>( GetPage()->GetSize().getHeight() ); break; case WID_PAGE_ORIENT: aAny <<= view::PaperOrientation( diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 67c74771fc16..22dcf4538640 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -478,8 +478,8 @@ void ViewShellBase::InnerResizePixel (const Point& rOrigin, const Size &rSize, b aSize.AdjustHeight( -(aBorder.Top() + aBorder.Bottom()) ); Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel(aObjSize, MapMode(MapUnit::Map100thMM)); SfxViewShell::SetZoomFactor( - Fraction( aSize.Width(), std::max<sal_Int32>( aObjSizePixel.Width(), 1 ) ), - Fraction( aSize.Height(), std::max<sal_Int32>( aObjSizePixel.Height(), 1) ) ); + Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), static_cast<long int>(1) ) ), + Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), static_cast<long int>(1)) ) ); } mpImpl->ResizePixel(rOrigin, rSize, false); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index af0b99c0a7f0..14f4fac32271 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -861,7 +861,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if( mpDrawView->IsTextEdit() ) { Point aPnt1 = GetActiveWindow()->GetWinViewPos(); - ::tools::Rectangle aMinMaxRect = ::tools::Rectangle( aPnt1, Size(RECT_MAX, RECT_MAX) ); + ::tools::Rectangle aMinMaxRect = ::tools::Rectangle( aPnt1, Size(ULONG_MAX, ULONG_MAX) ); rSet.Put( SfxRectangleItem(SID_RULER_LR_MIN_MAX, aMinMaxRect) ); } else diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index b08896abf358..ffaf3d3ab582 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -349,17 +349,17 @@ static OUString createHelpLinesString( const SdrHelpLineList& rHelpLines ) { case SdrHelpLineKind::Point: aLines.append( 'P' ); - aLines.append( rPos.X() ); + aLines.append( static_cast<sal_Int32>(rPos.X()) ); aLines.append( ',' ); - aLines.append( rPos.Y() ); + aLines.append( static_cast<sal_Int32>(rPos.Y()) ); break; case SdrHelpLineKind::Vertical: aLines.append( 'V' ); - aLines.append( rPos.X() ); + aLines.append( static_cast<sal_Int32>(rPos.X()) ); break; case SdrHelpLineKind::Horizontal: aLines.append( 'H' ); - aLines.append( rPos.Y() ); + aLines.append( static_cast<sal_Int32>(rPos.Y()) ); break; default: OSL_FAIL( "Unsupported helpline Kind!" ); @@ -427,16 +427,16 @@ void FrameView::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert { const ::tools::Rectangle aVisArea = GetVisArea(); - aUserData.addValue( sUNO_View_VisibleAreaTop, makeAny( aVisArea.Top() ) ); - aUserData.addValue( sUNO_View_VisibleAreaLeft, makeAny( aVisArea.Left() ) ); - aUserData.addValue( sUNO_View_VisibleAreaWidth, makeAny( aVisArea.GetWidth() ) ); - aUserData.addValue( sUNO_View_VisibleAreaHeight, makeAny( aVisArea.GetHeight() ) ); + aUserData.addValue( sUNO_View_VisibleAreaTop, makeAny( static_cast<sal_Int32>(aVisArea.Top()) ) ); + aUserData.addValue( sUNO_View_VisibleAreaLeft, makeAny( static_cast<sal_Int32>(aVisArea.Left()) ) ); + aUserData.addValue( sUNO_View_VisibleAreaWidth, makeAny( static_cast<sal_Int32>(aVisArea.GetWidth()) ) ); + aUserData.addValue( sUNO_View_VisibleAreaHeight, makeAny( static_cast<sal_Int32>(aVisArea.GetHeight()) ) ); } - aUserData.addValue( sUNO_View_GridCoarseWidth, makeAny( GetGridCoarse().Width() ) ); - aUserData.addValue( sUNO_View_GridCoarseHeight, makeAny( GetGridCoarse().Height() ) ); - aUserData.addValue( sUNO_View_GridFineWidth, makeAny( GetGridFine().Width() ) ); - aUserData.addValue( sUNO_View_GridFineHeight, makeAny( GetGridFine().Height() ) ); + aUserData.addValue( sUNO_View_GridCoarseWidth, makeAny( static_cast<sal_Int32>(GetGridCoarse().Width()) ) ); + aUserData.addValue( sUNO_View_GridCoarseHeight, makeAny( static_cast<sal_Int32>(GetGridCoarse().Height()) ) ); + aUserData.addValue( sUNO_View_GridFineWidth, makeAny( static_cast<sal_Int32>(GetGridFine().Width()) ) ); + aUserData.addValue( sUNO_View_GridFineHeight, makeAny( static_cast<sal_Int32>(GetGridFine().Height()) ) ); aUserData.addValue( sUNO_View_GridSnapWidthXNumerator, makeAny( GetSnapGridWidthX().GetNumerator() ) ); aUserData.addValue( sUNO_View_GridSnapWidthXDenominator, makeAny( GetSnapGridWidthX().GetDenominator() ) ); aUserData.addValue( sUNO_View_GridSnapWidthYNumerator, makeAny( GetSnapGridWidthY().GetNumerator() ) ); |