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 /sw/source/core/layout/calcmove.cxx | |
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 'sw/source/core/layout/calcmove.cxx')
-rw-r--r-- | sw/source/core/layout/calcmove.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index c9a275d989d5..87142b7f0e6f 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -157,7 +157,7 @@ bool SwContentFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool, bool & ) ( pNewUpper->IsColBodyFrame() && !pNewUpper->GetUpper()->GetPrev() && !pNewUpper->GetUpper()->GetNext() ) ) ) ) - nSpace += pNewUpper->Grow( SAL_MAX_INT32, true ); + nSpace += pNewUpper->Grow( LONG_MAX, true ); if ( nMoveAnyway < 3 ) { @@ -644,15 +644,15 @@ void SwFrame::MakePos() } // #i28701# - new type <SwSortedObjs> -static void lcl_CheckObjects(SwSortedObjs& rSortedObjs, const SwFrame* pFrame, sal_Int32& rBot) +static void lcl_CheckObjects(SwSortedObjs& rSortedObjs, const SwFrame* pFrame, long& rBot) { // And then there can be paragraph anchored frames that sit below their paragraph. - sal_Int32 nMax = 0; + long nMax = 0; for (SwAnchoredObject* pObj : rSortedObjs) { // #i28701# - consider changed type of <SwSortedObjs> // entries. - sal_Int32 nTmp = 0; + long nTmp = 0; if ( dynamic_cast<const SwFlyFrame*>( pObj) != nullptr ) { SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pObj); @@ -679,11 +679,11 @@ size_t SwPageFrame::GetContentHeight(const long nTop, const long nBottom) const "SwPageFrame::GetContentHeight(): No support for columns."); // In pages without columns, the content defines the size. - sal_Int32 nBot = getFrameArea().Top() + nTop; + long nBot = getFrameArea().Top() + nTop; const SwFrame *pFrame = Lower(); while (pFrame) { - sal_Int32 nTmp = 0; + long nTmp = 0; const SwFrame *pCnt = static_cast<const SwLayoutFrame*>(pFrame)->ContainsAny(); while (pCnt && (pCnt->GetUpper() == pFrame || static_cast<const SwLayoutFrame*>(pFrame)->IsAnLower(pCnt))) @@ -812,7 +812,7 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext) else { // In pages without columns, the content defines the size. - sal_Int32 nBot = GetContentHeight(nTop, nBottom); + long nBot = GetContentHeight(nTop, nBottom); // #i35143# - If second page frame // exists, the first page doesn't have to fulfill the @@ -823,7 +823,7 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext) } // #i35143# - Assure, that the page // doesn't exceed the defined browse height. - aFrm.Height( std::min<sal_Int32>( nBot, BROWSE_HEIGHT ) ); + aFrm.Height( std::min( nBot, BROWSE_HEIGHT ) ); } } @@ -1053,7 +1053,7 @@ void SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) // Do not protrude the edge of the visible area. The page may be // wider, because there may be objects with excess width // (RootFrame::ImplCalcBrowseWidth()) - sal_Int32 nMinWidth = 0; + long nMinWidth = 0; for (size_t i = 0; GetDrawObjs() && i < GetDrawObjs()->size(); ++i) { @@ -1070,14 +1070,14 @@ void SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) if ( RndStdIds::FLY_AS_CHAR == rFormat.GetAnchor().GetAnchorId() ) { - nMinWidth = std::max<sal_Int32>( nMinWidth, + nMinWidth = std::max( nMinWidth, bFly ? rFormat.GetFrameSize().GetWidth() : pObj->GetObjRect().Width() ); } } const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() ); - sal_Int32 nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() ); + long nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() ); nWidth -= aRectFnSet.GetLeft(getFramePrintArea()); nWidth -= rAttrs.CalcRightLine(); nWidth = std::max( nMinWidth, nWidth ); @@ -1091,7 +1091,7 @@ void SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) // The PrtArea should already be at least MINLAY wide, matching the // minimal values of the UI SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this); - aRectFnSet.SetWidth( aPrt, std::min<sal_Int32>( MINLAY, aRectFnSet.GetWidth(getFrameArea()) ) ); + aRectFnSet.SetWidth( aPrt, std::min( long(MINLAY), aRectFnSet.GetWidth(getFrameArea()) ) ); SwTwips nTmp = aRectFnSet.GetWidth(getFrameArea()) - aRectFnSet.GetWidth(aPrt); if( aRectFnSet.GetLeft(aPrt) > nTmp ) |