summaryrefslogtreecommitdiff
path: root/framework/source
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 /framework/source
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 'framework/source')
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx4
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx22
2 files changed, 13 insertions, 13 deletions
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 1c3cf233d12e..3eed6268f3f0 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -2343,7 +2343,7 @@ bool LayoutManager::implts_doLayout( bool bForceRequestBorderSpace, bool bOuterR
// Position the status bar
if ( aStatusBarSize.Height() > 0 )
{
- implts_setStatusBarPosSize( ::Point( 0, std::max<sal_Int32>( aContainerSize.Height(), 0 )),
+ implts_setStatusBarPosSize( ::Point( 0, std::max(( aContainerSize.Height() ), long( 0 ))),
::Size( aContainerSize.Width(),aStatusBarSize.Height() ));
}
@@ -2466,7 +2466,7 @@ void LayoutManager::implts_setDockingAreaWindowSizes()
// Position the status bar
if ( aStatusBarSize.Height() > 0 )
{
- implts_setStatusBarPosSize( ::Point( 0, std::max<sal_Int32>(( aContainerClientSize.Height - aStatusBarSize.Height() ), 0)),
+ implts_setStatusBarPosSize( ::Point( 0, std::max(( aContainerClientSize.Height - aStatusBarSize.Height() ), long( 0 ))),
::Size( aContainerClientSize.Width, aStatusBarSize.Height() ));
}
}
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 2048f9a9b3ae..e8925e9de098 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -2211,7 +2211,7 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( ui::D
if ( nSpace > 0 )
{
- sal_Int32 nMove = std::min( nSpace, aFrontDockingRect.getWidth() );
+ sal_Int32 nMove = std::min( nSpace, static_cast<sal_Int32>(aFrontDockingRect.getWidth()) );
if ( bHorzDockArea )
aFrontDockingRect.Move( -nMove, 0 );
else
@@ -2700,7 +2700,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
if ( bHorizontalDockArea )
{
sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32( aContainerWinSize.Width() - aWindowRect.Left() ),
- aTrackingRect.getWidth() ));
+ sal_Int32( aTrackingRect.getWidth() )));
if ( nSize == 0 )
nSize = aWindowRect.getWidth();
@@ -2715,7 +2715,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
{
sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32(
nTopDockingAreaSize + nMaxLeftRightDockAreaSize - aWindowRect.Top() ),
- aTrackingRect.getHeight() ));
+ sal_Int32( aTrackingRect.getHeight() )));
if ( nSize == 0 )
nSize = aWindowRect.getHeight();
@@ -2737,7 +2737,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
if ( bHorizontalDockArea )
{
sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32(( aContainerWinSize.Width() ) - aWindowRect.Right() ),
- aTrackingRect.getWidth() ));
+ sal_Int32( aTrackingRect.getWidth() )));
if ( nSize == 0 )
{
aUIElementRect.SetPos( ::Point( aContainerWinSize.Width() - aTrackingRect.getWidth(), aWindowRect.Top() ));
@@ -2758,7 +2758,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
else
{
sal_Int32 nSize = ::std::max( sal_Int32( 0 ), std::min( sal_Int32( nTopDockingAreaSize + nMaxLeftRightDockAreaSize - aWindowRect.Bottom() ),
- aTrackingRect.getHeight() ));
+ sal_Int32( aTrackingRect.getHeight() )));
aUIElementRect.SetPos( ::Point( aWindowRect.Left(), aWindowRect.Bottom() ));
aUIElementRect.SetSize( ::Size( aWindowRect.getWidth(), nSize ));
@@ -2852,14 +2852,14 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
if ( bHorizontalDockArea )
{
- sal_Int32 nPosX( std::max( rTrackingRect.Left(), sal_Int32( 0 )));
+ sal_Int32 nPosX( std::max( sal_Int32( rTrackingRect.Left()), sal_Int32( 0 )));
if (( nPosX + rTrackingRect.getWidth()) > aContainerWinSize.Width() )
nPosX = std::min( nPosX,
std::max( sal_Int32( aContainerWinSize.Width() - rTrackingRect.getWidth() ),
sal_Int32( 0 )));
sal_Int32 nSize = std::min( aContainerWinSize.Width(), rTrackingRect.getWidth() );
- sal_Int32 nDockHeight = std::max<sal_Int32>( aDockingAreaRect.getHeight(), 0 );
+ sal_Int32 nDockHeight = std::max( static_cast<sal_Int32>(aDockingAreaRect.getHeight()), sal_Int32( 0 ));
if ( nDockHeight == 0 )
{
sal_Int32 nPosY( std::max( aDockingAreaRect.Top(), aDockingAreaRect.Bottom() ));
@@ -2904,8 +2904,8 @@ void ToolbarLayoutManager::implts_calcDockingPosSize(
std::max<sal_Int32>( nTopDockingAreaSize + ( nMaxDockingAreaHeight - aTrackingRect.getHeight() ),
nTopDockingAreaSize ));
- sal_Int32 nSize = std::min( nMaxDockingAreaHeight, aTrackingRect.getHeight() );
- sal_Int32 nDockWidth = std::max<sal_Int32>( aDockingAreaRect.getWidth(), 0 );
+ sal_Int32 nSize = std::min( nMaxDockingAreaHeight, static_cast<sal_Int32>(aTrackingRect.getHeight()) );
+ sal_Int32 nDockWidth = std::max( static_cast<sal_Int32>(aDockingAreaRect.getWidth()), sal_Int32( 0 ));
if ( nDockWidth == 0 )
{
sal_Int32 nPosX( std::max( aDockingAreaRect.Left(), aDockingAreaRect.Right() ));
@@ -3009,7 +3009,7 @@ framework::ToolbarLayoutManager::DockingOperation ToolbarLayoutManager::implts_d
::tools::Rectangle aTrackingRect( rTrackingRect );
if ( bHorizontalDockArea )
{
- sal_Int32 nPosX( std::max<sal_Int32>( rTrackingRect.Left(), 0 ));
+ sal_Int32 nPosX( std::max( sal_Int32( rTrackingRect.Left()), sal_Int32( 0 )));
if (( nPosX + rTrackingRect.getWidth()) > rContainerWinSize.Width() )
nPosX = std::min( nPosX,
std::max( sal_Int32( rContainerWinSize.Width() - rTrackingRect.getWidth() ),
@@ -3035,7 +3035,7 @@ framework::ToolbarLayoutManager::DockingOperation ToolbarLayoutManager::implts_d
std::max<sal_Int32>( nTopDockingAreaSize + ( nMaxDockingAreaHeight - aTrackingRect.getHeight() ),
nTopDockingAreaSize ));
- sal_Int32 nSize = std::min( nMaxDockingAreaHeight, aTrackingRect.getHeight() );
+ sal_Int32 nSize = std::min( nMaxDockingAreaHeight, static_cast<sal_Int32>(aTrackingRect.getHeight()) );
aTrackingRect.SetPos( ::Point( rRowColumnRect.Left(), nPosY ));
aTrackingRect.setWidth( rRowColumnRect.getWidth() );