Kaydet (Commit) 8bc951da authored tarafından Noel Grandin's avatar Noel Grandin

long->sal_Int32 in tools/gen.hxx

which triggered a lot of changes in sw/

Change-Id: Ia2aa22ea3f76463a85ea077a411246fcfed00bf6
Reviewed-on: https://gerrit.libreoffice.org/48806Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 10eefdfa
......@@ -530,7 +530,7 @@ void MediaWindowImpl::Resize()
if (mpMediaWindowControl)
{
const sal_Int32 nControlHeight = mpMediaWindowControl->GetSizePixel().Height();
const sal_Int32 nControlY = std::max(aCurSize.Height() - nControlHeight - nOffset, 0L);
const sal_Int32 nControlY = std::max<sal_Int32>(aCurSize.Height() - nControlHeight - nOffset, 0);
aPlayerWindowSize.setHeight( nControlY - (nOffset << 1) );
mpMediaWindowControl->SetPosSizePixel(Point(nOffset, nControlY ), Size(aCurSize.Width() - (nOffset << 1), nControlHeight));
......
......@@ -306,7 +306,7 @@ namespace vclcanvas
// paint sprite prio
vcl::Font aVCLFont;
aVCLFont.SetFontHeight( std::min(long(20),aOutputSize.Height()) );
aVCLFont.SetFontHeight( std::min<sal_Int32>(20,aOutputSize.Height()) );
aVCLFont.SetColor( COL_RED );
rTargetSurface.SetTextAlign(ALIGN_TOP);
......
......@@ -2035,10 +2035,10 @@ void ChartController::sendPopupRequest(OUString const & rCID, tools::Rectangle a
sal_Int32 nDimensionIndex = sDimensionIndex.toInt32();
awt::Rectangle xRectangle {
sal_Int32(aRectangle.Left()),
sal_Int32(aRectangle.Top()),
sal_Int32(aRectangle.GetWidth()),
sal_Int32(aRectangle.GetHeight())
aRectangle.Left(),
aRectangle.Top(),
aRectangle.GetWidth(),
aRectangle.GetHeight()
};
uno::Sequence<beans::PropertyValue> aCallbackData = comphelper::InitPropertySequence(
......
......@@ -1564,8 +1564,8 @@ namespace cppcanvas
// least one dimension
// Remark the 1L cannot be replaced, that would cause max to compare long/int
const Size aMtfSizePix( std::max( aMtfSizePixPre.Width(), 1L ),
std::max( aMtfSizePixPre.Height(), 1L ) );
const Size aMtfSizePix( std::max<sal_Int32>( aMtfSizePixPre.Width(), 1 ),
std::max<sal_Int32>( aMtfSizePixPre.Height(), 1 ) );
// Setup local transform, such that the
// metafile renders itself into the given
......@@ -2878,8 +2878,8 @@ namespace cppcanvas
// #i44110# correct null-sized output - there are shapes
// which have zero size in at least one dimension
// Remark the 1L cannot be replaced, that would cause max to compare long/int
const Size aMtfSizePix( std::max( aMtfSizePixPre.Width(), 1L ),
std::max( aMtfSizePixPre.Height(), 1L ) );
const Size aMtfSizePix( std::max<sal_Int32>( aMtfSizePixPre.Width(), 1 ),
std::max<sal_Int32>( aMtfSizePixPre.Height(), 1 ) );
sal_Int32 nCurrActions(0);
ActionFactoryParameters aParms(aStateStack,
......
......@@ -508,7 +508,7 @@ void ColorConfigWindow_Impl::CreateEntries()
ScopedVclPtrInstance< FixedText > aFixedText(this);
aCheckBox->SetText(sSampleText);
aFixedText->SetText(sSampleText);
Size aCheckSize(aCheckBox->CalcMinimumSize(0x7fffffff));
Size aCheckSize(aCheckBox->CalcMinimumSize(RECT_MAX));
Size aFixedSize(aFixedText->CalcMinimumSize());
nCheckBoxLabelOffset = aCheckSize.Width() - aFixedSize.Width();
}
......
......@@ -82,7 +82,7 @@ public:
HeaderBar &rBar = GetTheHeaderBar();
if (rBar.GetItemCount() < 4)
return;
long nCheckWidth = std::max(GetControlColumnWidth() + 12,
long nCheckWidth = std::max<sal_Int32>(GetControlColumnWidth() + 12,
rBar.LogicToPixel(Size(15, 0), MapMode(MapUnit::MapAppFont)).Width());
long nVersionWidth = 12 +
std::max(rBar.GetTextWidth(rBar.GetItemText(3)),
......
......@@ -316,8 +316,8 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
{
BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
Size aTempBitmapSize = aBmpEx.GetSizePixel();
rBitmapSize.setWidth( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
rBitmapSize.setHeight( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
rBitmapSize.setWidth( (OutputDevice::LogicToLogic(aTempBitmapSize.Width(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
rBitmapSize.setHeight( (OutputDevice::LogicToLogic(aTempBitmapSize.Height(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
CalculateBitmapPresetSize();
}
......@@ -531,8 +531,8 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void)
Size aTempBitmapSize = aBmpEx.GetSizePixel();
const double fUIScale = ( (mpView && mpView->GetModel()) ? double(mpView->GetModel()->GetUIScale()) : 1.0);
rBitmapSize.setWidth( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
rBitmapSize.setHeight( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
rBitmapSize.setWidth( (OutputDevice::LogicToLogic(aTempBitmapSize.Width(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
rBitmapSize.setHeight( (OutputDevice::LogicToLogic(aTempBitmapSize.Height(),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
CalculateBitmapPresetSize();
ModifyBitmapStyleHdl( *m_pBitmapStyleLB );
ModifyBitmapPositionHdl( *m_pPositionLB );
......
......@@ -394,10 +394,10 @@ void OJoinController::saveTableWindows( ::comphelper::NamedValueCollection& o_rV
aWindowData.put( "ComposedName", elem->GetComposedName() );
aWindowData.put( "TableName", elem->GetTableName() );
aWindowData.put( "WindowName", elem->GetWinName() );
aWindowData.put( "WindowTop", static_cast<sal_Int32>(elem->GetPosition().Y()) );
aWindowData.put( "WindowLeft", static_cast<sal_Int32>(elem->GetPosition().X()) );
aWindowData.put( "WindowWidth", static_cast<sal_Int32>(elem->GetSize().Width()) );
aWindowData.put( "WindowHeight", static_cast<sal_Int32>(elem->GetSize().Height()) );
aWindowData.put( "WindowTop", elem->GetPosition().Y() );
aWindowData.put( "WindowLeft", elem->GetPosition().X() );
aWindowData.put( "WindowWidth", elem->GetSize().Width() );
aWindowData.put( "WindowHeight", elem->GetSize().Height() );
aWindowData.put( "ShowAll", elem->IsShowAll() );
const OUString sTableName( "Table" + OUString::number( i++ ) );
......
......@@ -212,7 +212,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem)
MapMode aPntMap( MapUnit::MapPoint );
aSz = OutputDevice::LogicToLogic( aSz, aItemMapMode, aPntMap );
aDebStr.append(" Points=");
aDebStr.append(static_cast<sal_Int32>(aSz.Height()));
aDebStr.append(aSz.Height());
}
break;
case EE_CHAR_FONTWIDTH:
......@@ -282,7 +282,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem)
MapMode aPntMap( MapUnit::MapPoint );
aSz = OutputDevice::LogicToLogic( aSz, aItemMapMode, aPntMap );
aDebStr.append(" Points=");
aDebStr.append(static_cast<sal_Int32>(aSz.Height()));
aDebStr.append(aSz.Height());
}
break;
case EE_CHAR_WLM:
......@@ -389,7 +389,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox )
aPortionStr.append(' ');
aPortionStr.append(rPortion.GetLen());
aPortionStr.append('(');
aPortionStr.append(static_cast<sal_Int32>(rPortion.GetSize().Width()));
aPortionStr.append(rPortion.GetSize().Width());
aPortionStr.append(')');
aPortionStr.append('[');
aPortionStr.append(static_cast<sal_Int32>(rPortion.GetKind()));
......@@ -456,9 +456,9 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox )
fprintf( fp, "\n================================================================================" );
fprintf( fp, "\nControl: %x", unsigned( pEE->GetControlWord() ) );
fprintf( fp, "\nRefMapMode: %i", int( pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() ) );
fprintf( fp, "\nPaperSize: %li x %li", pEE->GetPaperSize().Width(), pEE->GetPaperSize().Height() );
fprintf( fp, "\nMaxAutoPaperSize: %li x %li", pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
fprintf( fp, "\nMinAutoPaperSize: %li x %li", pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() );
fprintf( fp, "\nPaperSize: %" SAL_PRIdINT32 " x %" SAL_PRIdINT32, pEE->GetPaperSize().Width(), pEE->GetPaperSize().Height() );
fprintf( fp, "\nMaxAutoPaperSize: %" SAL_PRIdINT32 " x %" SAL_PRIdINT32, pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
fprintf( fp, "\nMinAutoPaperSize: %" SAL_PRIdINT32 " x %" SAL_PRIdINT32, pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() );
fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() );
fprintf( fp, "\nNumber of Views: %" SAL_PRI_SIZET "i", pEE->GetViewCount() );
for ( size_t nView = 0; nView < pEE->GetViewCount(); nView++ )
......@@ -467,9 +467,9 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox )
DBG_ASSERT( pV, "View not found!" );
fprintf( fp, "\nView %zu: Focus=%i", nView, pV->GetWindow()->HasFocus() );
tools::Rectangle aR( pV->GetOutputArea() );
fprintf( fp, "\n OutputArea: nX=%li, nY=%li, dX=%li, dY=%li, MapMode = %i", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() , int( pV->GetWindow()->GetMapMode().GetMapUnit() ) );
fprintf( fp, "\n OutputArea: nX=%" SAL_PRIdINT32 ", nY=%" SAL_PRIdINT32 ", dX=%" SAL_PRIdINT32 ", dY=%" SAL_PRIdINT32 ", MapMode = %i", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() , int( pV->GetWindow()->GetMapMode().GetMapUnit() ) );
aR = pV->GetVisArea();
fprintf( fp, "\n VisArea: nX=%li, nY=%li, dX=%li, dY=%li", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() );
fprintf( fp, "\n VisArea: nX=%" SAL_PRIdINT32 ", nY=%" SAL_PRIdINT32 ", dX=%" SAL_PRIdINT32 ", dY=%" SAL_PRIdINT32, aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() );
ESelection aSel = pV->GetSelection();
fprintf( fp, "\n Selection: Start=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ", End=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32, aSel.nStartPara, aSel.nStartPos, aSel.nEndPara, aSel.nEndPos );
}
......
......@@ -1790,17 +1790,17 @@ SvxFont EditEngine::GetStandardSvxFont( sal_Int32 nPara )
void EditEngine::StripPortions()
{
ScopedVclPtrInstance< VirtualDevice > aTmpDev;
tools::Rectangle aBigRect( Point( 0, 0 ), Size( 0x7FFFFFFF, 0x7FFFFFFF ) );
tools::Rectangle aBigRect( Point( 0, 0 ), Size( RECT_MAX, RECT_MAX ) );
if ( IsVertical() )
{
if( IsTopToBottom() )
{
aBigRect.SetRight( 0 );
aBigRect.SetLeft( -0x7FFFFFFF );
aBigRect.SetLeft( RECT_MIN );
}
else
{
aBigRect.SetTop( -0x7FFFFFFF );
aBigRect.SetTop( RECT_MIN );
aBigRect.SetBottom( 0 );
}
}
......
......@@ -87,9 +87,9 @@ static sal_uInt16 lcl_CalcExtraSpace( const SvxLineSpacingItem& rLSItem )
ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
pSharedVCL(EditDLL::Get().GetSharedVclResources()),
aPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ),
aPaperSize( RECT_MAX, RECT_MAX ),
aMinAutoPaperSize( 0x0, 0x0 ),
aMaxAutoPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ),
aMaxAutoPaperSize( RECT_MAX, RECT_MAX ),
aEditDoc( pItemPool ),
aWordDelimiters(" .,;:-`'?!_=\"{}()[]"),
bKernAsianPunctuation(false),
......@@ -4251,9 +4251,9 @@ void ImpEditEngine::SetValidPaperSize( const Size& rNewSz )
aPaperSize = rNewSz;
long nMinWidth = aStatus.AutoPageWidth() ? aMinAutoPaperSize.Width() : 0;
long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : 0x7FFFFFFF;
long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : RECT_MAX;
long nMinHeight = aStatus.AutoPageHeight() ? aMinAutoPaperSize.Height() : 0;
long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : 0x7FFFFFFF;
long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : RECT_MAX;
// Minimum/Maximum width:
if ( aPaperSize.Width() < nMinWidth )
......
......@@ -404,7 +404,7 @@ void ImpEditEngine::FormatDoc()
if ( aInvalidRect.IsEmpty() )
{
// For Paperwidth 0 (AutoPageSize) it would otherwise be Empty()...
long nWidth = std::max( long(1), ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) );
long nWidth = std::max<sal_Int32>( 1, ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) );
Range aInvRange( GetInvalidYOffsets( pParaPortion ) );
aInvalidRect = tools::Rectangle( Point( 0, nY+aInvRange.Min() ),
Size( nWidth, aInvRange.Len() ) );
......@@ -733,7 +733,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
{
aBulletArea = GetEditEnginePtr()->GetBulletArea( GetParaPortions().GetPos( pParaPortion ) );
if ( aBulletArea.Right() > 0 )
pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( aBulletArea.Right() )) );
pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( long(aBulletArea.Right()) )) );
else
pParaPortion->SetBulletX( 0 ); // if Bullet is set incorrectly
}
......@@ -1711,7 +1711,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion )
{
aBulletArea = GetEditEnginePtr()->GetBulletArea( GetParaPortions().GetPos( pParaPortion ) );
if ( aBulletArea.Right() > 0 )
pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( aBulletArea.Right() )) );
pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( long(aBulletArea.Right()) )) );
else
pParaPortion->SetBulletX( 0 ); // If Bullet set incorrectly.
if ( pParaPortion->GetBulletX() > nStartX )
......@@ -4038,8 +4038,8 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNew
{
// in this case one can redraw directly without invalidating the
// Portions
sal_Int32 nFirstPortion = std::min( static_cast<sal_Int32>(aOldPositions.Min()), nNewPos );
sal_Int32 nLastPortion = std::max( static_cast<sal_Int32>(aOldPositions.Max()), nNewPos );
sal_Int32 nFirstPortion = std::min( aOldPositions.Min(), nNewPos );
sal_Int32 nLastPortion = std::max( aOldPositions.Max(), nNewPos );
ParaPortion* pUpperPortion = GetParaPortions().SafeGetObject( nFirstPortion );
ParaPortion* pLowerPortion = GetParaPortions().SafeGetObject( nLastPortion );
......@@ -4057,7 +4057,7 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNew
else
{
// redraw from the upper invalid position
sal_Int32 nFirstInvPara = std::min( static_cast<sal_Int32>(aOldPositions.Min()), nNewPos );
sal_Int32 nFirstInvPara = std::min( aOldPositions.Min(), nNewPos );
InvalidateFromParagraph( nFirstInvPara );
}
return aSel;
......
......@@ -750,6 +750,9 @@ namespace emfio
case EMR_SETWINDOWEXTEX :
{
mpInputStream->ReadUInt32( nW ).ReadUInt32( nH );
// clamp to valid range
nW = std::max<sal_Int32>(std::min<sal_Int32>(nW, RECT_MAX), RECT_MIN);
nH = std::max<sal_Int32>(std::min<sal_Int32>(nH, RECT_MAX), RECT_MIN);
SetWinExt( Size( nW, nH ), true);
}
break;
......@@ -1926,6 +1929,11 @@ namespace emfio
SetrclFrame(rclFrame);
SetrclBounds(rclBounds);
// clamp to valid range
nPixX = std::max<sal_Int32>(std::min<sal_Int32>(nPixX, RECT_MAX), RECT_MIN);
nPixY = std::max<sal_Int32>(std::min<sal_Int32>(nPixY, RECT_MAX), RECT_MIN);
nMillX = std::max<sal_Int32>(std::min<sal_Int32>(nMillX, RECT_MAX), RECT_MIN);
nMillY = std::max<sal_Int32>(std::min<sal_Int32>(nMillY, RECT_MAX), RECT_MIN);
SetRefPix(Size( nPixX, nPixY ) );
SetRefMill(Size( nMillX, nMillY ) );
......
......@@ -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(( aContainerSize.Height() ), long( 0 ))),
implts_setStatusBarPosSize( ::Point( 0, std::max<sal_Int32>( aContainerSize.Height(), 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(( aContainerClientSize.Height - aStatusBarSize.Height() ), long( 0 ))),
implts_setStatusBarPosSize( ::Point( 0, std::max<sal_Int32>(( aContainerClientSize.Height - aStatusBarSize.Height() ), 0)),
::Size( aContainerClientSize.Width, aStatusBarSize.Height() ));
}
}
......
......@@ -2211,7 +2211,7 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( ui::D
if ( nSpace > 0 )
{
sal_Int32 nMove = std::min( nSpace, static_cast<sal_Int32>(aFrontDockingRect.getWidth()) );
sal_Int32 nMove = std::min( nSpace, 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() ),
sal_Int32( aTrackingRect.getWidth() )));
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() ),
sal_Int32( aTrackingRect.getHeight() )));
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() ),
sal_Int32( aTrackingRect.getWidth() )));
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() ),
sal_Int32( aTrackingRect.getHeight() )));
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( sal_Int32( rTrackingRect.Left()), sal_Int32( 0 )));
sal_Int32 nPosX( std::max( 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( static_cast<sal_Int32>(aDockingAreaRect.getHeight()), sal_Int32( 0 ));
sal_Int32 nDockHeight = std::max<sal_Int32>( aDockingAreaRect.getHeight(), 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, static_cast<sal_Int32>(aTrackingRect.getHeight()) );
sal_Int32 nDockWidth = std::max( static_cast<sal_Int32>(aDockingAreaRect.getWidth()), sal_Int32( 0 ));
sal_Int32 nSize = std::min( nMaxDockingAreaHeight, aTrackingRect.getHeight() );
sal_Int32 nDockWidth = std::max<sal_Int32>( aDockingAreaRect.getWidth(), 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()), sal_Int32( 0 )));
sal_Int32 nPosX( std::max<sal_Int32>( rTrackingRect.Left(), 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, static_cast<sal_Int32>(aTrackingRect.getHeight()) );
sal_Int32 nSize = std::min( nMaxDockingAreaHeight, aTrackingRect.getHeight() );
aTrackingRect.SetPos( ::Point( rRowColumnRect.Left(), nPosY ));
aTrackingRect.setWidth( rRowColumnRect.getWidth() );
......
This diff is collapsed.
......@@ -69,9 +69,9 @@ public:
void setMaxWidthChars(sal_Int32 nWidth);
void setMinWidthChars(sal_Int32 nWidth);
static Size CalcMinimumTextSize(Control const* pControl, long nMaxWidth = 0x7fffffff);
static Size CalcMinimumTextSize(Control const* pControl, long nMaxWidth = RECT_MAX);
static Size getTextDimensions(Control const *pControl, const OUString &rTxt, long nMaxWidth);
Size CalcMinimumSize(long nMaxWidth = 0x7fffffff) const;
Size CalcMinimumSize(long nMaxWidth = RECT_MAX) const;
virtual Size GetOptimalSize() const override;
virtual bool set_property(const OString &rKey, const OUString &rValue) override;
void set_mnemonic_widget(vcl::Window *pWindow);
......
......@@ -356,14 +356,14 @@ private:
long mnOutOffX;
/// Output offset for device output in pixel (pseudo window offset within window system's frames)
long mnOutOffY;
long mnOutWidth;
long mnOutHeight;
sal_Int32 mnOutWidth;
sal_Int32 mnOutHeight;
sal_Int32 mnDPIX;
sal_Int32 mnDPIY;
sal_Int32 mnDPIScalePercentage; ///< For Hi-DPI displays, we want to draw elements for a percentage larger
/// font specific text alignment offsets in pixel units
mutable long mnTextOffX;
mutable long mnTextOffY;
mutable sal_Int32 mnTextOffX;
mutable sal_Int32 mnTextOffY;
mutable long mnEmphasisAscent;
mutable long mnEmphasisDescent;
DrawModeFlags mnDrawMode;
......@@ -1177,13 +1177,13 @@ private:
SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& );
SAL_DLLPRIVATE void ImplDrawTextRect( long nBaseX, long nBaseY, long nX, long nY, long nWidth, long nHeight );
SAL_DLLPRIVATE static void ImplDrawWavePixel( long nOriginX, long nOriginY, long nCurX, long nCurY, short nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev,
SAL_DLLPRIVATE static void ImplDrawWavePixel( long nOriginX, long nOriginY, sal_Int32 nCurX, sal_Int32 nCurY, short nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev,
bool bDrawPixAsRect, long nPixWidth, long nPixHeight );
SAL_DLLPRIVATE void ImplDrawWaveLine( long nBaseX, long nBaseY, long nStartX, long nStartY, long nWidth, long nHeight, long nLineWidth, short nOrientation, const Color& rColor );
SAL_DLLPRIVATE void ImplDrawWaveTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
SAL_DLLPRIVATE void ImplDrawStraightTextLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
SAL_DLLPRIVATE void ImplDrawStrikeoutLine( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
SAL_DLLPRIVATE void ImplDrawStrikeoutChar( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
SAL_DLLPRIVATE void ImplDrawStrikeoutChar( long nBaseX, long nBaseY, sal_Int32 nX, sal_Int32 nY, long nWidth, FontStrikeout eStrikeout, Color aColor );
SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth );
SAL_DLLPRIVATE static bool ImplIsUnderlineAbove( const vcl::Font& );
......
......@@ -327,10 +327,10 @@ public:
struct VCL_DLLPUBLIC BitmapBuffer
{
ScanlineFormat mnFormat;
long mnWidth;
long mnHeight;
long mnScanlineSize;
ScanlineFormat mnFormat;
sal_Int32 mnWidth;
sal_Int32 mnHeight;
sal_Int32 mnScanlineSize;
sal_uInt16 mnBitCount;
ColorMask maColorMask;
BitmapPalette maPalette;
......
......@@ -38,25 +38,25 @@ constexpr ::Color SALCOLOR_NONE ( 0xFF, 0xFF, 0xFF, 0xFF );
// must equal to class Point
struct SalPoint
{
long mnX;
long mnY;
sal_Int32 mnX;
sal_Int32 mnY;
};
typedef const SalPoint* PCONSTSALPOINT;
struct SalTwoRect
{
long mnSrcX;
long mnSrcY;
long mnSrcWidth;
long mnSrcHeight;
long mnDestX;
long mnDestY;
long mnDestWidth;
long mnDestHeight;
sal_Int32 mnSrcX;
sal_Int32 mnSrcY;
sal_Int32 mnSrcWidth;
sal_Int32 mnSrcHeight;
sal_Int32 mnDestX;
sal_Int32 mnDestY;
sal_Int32 mnDestWidth;
sal_Int32 mnDestHeight;
SalTwoRect(long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight,
long nDestX, long nDestY, long nDestWidth, long nDestHeight)
SalTwoRect(sal_Int32 nSrcX, sal_Int32 nSrcY, sal_Int32 nSrcWidth, sal_Int32 nSrcHeight,
sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight)
: mnSrcX(nSrcX), mnSrcY(nSrcY), mnSrcWidth(nSrcWidth), mnSrcHeight(nSrcHeight)
, mnDestX(nDestX), mnDestY(nDestY), mnDestWidth(nDestWidth), mnDestHeight(nDestHeight)
{
......
......@@ -158,13 +158,13 @@ sal_uInt32 VMLExport::EnterGroup( const OUString& rShapeName, const tools::Recta
if ( pRect && ( mnGroupLevel == 1 ) )
{
pAttrList->add( XML_coordorigin,
OStringBuffer( 20 ).append( sal_Int32( pRect->Left() ) )
.append( "," ).append( sal_Int32( pRect->Top() ) )
OStringBuffer( 20 ).append( pRect->Left() )
.append( "," ).append( pRect->Top() )
.makeStringAndClear() );
pAttrList->add( XML_coordsize,
OStringBuffer( 20 ).append( sal_Int32( pRect->Right() ) - sal_Int32( pRect->Left() ) )
.append( "," ).append( sal_Int32( pRect->Bottom() ) - sal_Int32( pRect->Top() ) )
OStringBuffer( 20 ).append( pRect->Right() - pRect->Left() )
.append( "," ).append( pRect->Bottom() - pRect->Top() )
.makeStringAndClear() );
}
......
......@@ -392,7 +392,7 @@ void OObjectBase::SetPropsFromRect(const tools::Rectangle& _rRect)
{
uno::Reference<report::XSection> xSection = pPage->getSection();
assert(_rRect.getHeight() >= 0);
const sal_uInt32 newHeight( ::std::max(0l, _rRect.getHeight()+_rRect.Top()) );
const sal_uInt32 newHeight( ::std::max<sal_Int32>(0, _rRect.getHeight()+_rRect.Top()) );
if ( xSection.is() && ( newHeight > xSection->getHeight() ) )
xSection->setHeight( newHeight );
......
......@@ -163,8 +163,8 @@ void ScFiltersTest::testTdf91979()
Point aPos = aViewData.GetScrPos(MAXCOL - 1, 10000, SC_SPLIT_TOPLEFT, true);
int nColWidth = ScViewData::ToPixel(pDoc->GetColWidth(0, 0), aViewData.GetPPTX());
int nRowHeight = ScViewData::ToPixel(pDoc->GetRowHeight(0, 0), aViewData.GetPPTY());
CPPUNIT_ASSERT_EQUAL(static_cast<long>((MAXCOL - 1) * nColWidth), aPos.getX());
CPPUNIT_ASSERT_EQUAL(static_cast<long>(10000 * nRowHeight), aPos.getY());
CPPUNIT_ASSERT_EQUAL(sal_Int32((MAXCOL - 1) * nColWidth), aPos.getX());
CPPUNIT_ASSERT_EQUAL(sal_Int32(10000 * nRowHeight), aPos.getY());
xComponent->dispose();
}
......
......@@ -445,13 +445,13 @@ void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, tools::Rectangle
SdrObject* pObj = pPage->GetObj(0);
const tools::Rectangle& aSnap = pObj->GetSnapRect();
printf("expected height %ld actual %ld\n", aRect.GetHeight(), aSnap.GetHeight() );
printf("expected height %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.GetHeight(), aSnap.GetHeight() );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.GetHeight(), aSnap.GetHeight(), TOLERANCE ) );
printf("expected width %ld actual %ld\n", aRect.GetWidth(), aSnap.GetWidth() );
printf("expected width %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.GetWidth(), aSnap.GetWidth() );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.GetWidth(), aSnap.GetWidth(), TOLERANCE ) );
printf("expected left %ld actual %ld\n", aRect.Left(), aSnap.Left() );
printf("expected left %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.Left(), aSnap.Left() );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.Left(), aSnap.Left(), TOLERANCE ) );
printf("expected right %ld actual %ld\n", aRect.Top(), aSnap.Top() );
printf("expected right %" SAL_PRIdINT32 " actual %" SAL_PRIdINT32 "\n", aRect.Top(), aSnap.Top() );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.Top(), aSnap.Top(), TOLERANCE ) );
ScDrawObjData* pData = ScDrawLayer::GetObjData( pObj );
......
......@@ -178,11 +178,11 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat)
pPattern = pDoc->GetPattern(0,0,1);
vcl::Font aFont;
pPattern->GetFont(aFont,SC_AUTOCOL_RAW);