summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-04-11 00:21:40 -0300
committerDavid Tardon <dtardon@redhat.com>2013-04-20 11:09:54 +0000
commit0f200cc30ea75fdce59f7bb6ae87ebc85729e2a4 (patch)
tree2e2c28f9500f81825cdadcbabd131da767ddbb49 /svtools
parent5414a3eecdb09be928313477792acfe1d3534645 (diff)
fdo#63154: Change Min/Max/Abs for std::min/max/abs
Now all these usages were removed from LO. Change-Id: I8a7233db20abdcdbb18428ad4004c78cc516a0e6 Reviewed-on: https://gerrit.libreoffice.org/3326 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/brwbox/brwbox1.cxx16
-rw-r--r--svtools/source/brwbox/brwbox2.cxx14
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx2
-rw-r--r--svtools/source/config/printoptions.cxx2
-rw-r--r--svtools/source/contnr/imivctl1.cxx4
-rw-r--r--svtools/source/contnr/svimpbox.cxx2
-rw-r--r--svtools/source/contnr/treelistbox.cxx2
-rw-r--r--svtools/source/control/ruler.cxx4
-rw-r--r--svtools/source/control/scriptedtext.cxx6
-rw-r--r--svtools/source/control/scrwin.cxx4
-rw-r--r--svtools/source/control/toolbarmenu.cxx2
-rw-r--r--svtools/source/graphic/grfcache.cxx2
-rw-r--r--svtools/source/misc/imap2.cxx2
13 files changed, 31 insertions, 31 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 5d59ff2cdc2f..0fbca4c5d3b8 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -1070,9 +1070,9 @@ long BrowseBox::ScrollRows( long nRows )
return 0;
// compute new top row
- long nTmpMin = Min( (long)(nTopRow + nRows), (long)(nRowCount - 1) );
+ long nTmpMin = std::min( (long)(nTopRow + nRows), (long)(nRowCount - 1) );
- long nNewTopRow = Max( (long)nTmpMin, (long)0 );
+ long nNewTopRow = std::max( (long)nTmpMin, (long)0 );
if ( nNewTopRow == nTopRow )
return 0;
@@ -1083,9 +1083,9 @@ long BrowseBox::ScrollRows( long nRows )
VisibleRowsChanged(nNewTopRow, nVisibleRows);
// compute new top row again (nTopRow might have changed!)
- nTmpMin = Min( (long)(nTopRow + nRows), (long)(nRowCount - 1) );
+ nTmpMin = std::min( (long)(nTopRow + nRows), (long)(nRowCount - 1) );
- nNewTopRow = Max( (long)nTmpMin, (long)0 );
+ nNewTopRow = std::max( (long)nTmpMin, (long)0 );
StartScroll();
@@ -1100,8 +1100,8 @@ long BrowseBox::ScrollRows( long nRows )
pVScroll->SetThumbPos( nTopRow );
if( pDataWin->GetBackground().IsScrollable() &&
- Abs( nDeltaY ) > 0 &&
- Abs( nDeltaY ) < pDataWin->GetSizePixel().Height() )
+ std::abs( nDeltaY ) > 0 &&
+ std::abs( nDeltaY ) < pDataWin->GetSizePixel().Height() )
{
pDataWin->Scroll( 0, (short)-nDeltaY, SCROLL_FLAGS );
}
@@ -1348,7 +1348,7 @@ void BrowseBox::RowRemoved( long nRow, long nNumRows, sal_Bool bDoPaint )
nCurRow = BROWSER_ENDOFSELECTION;
else if ( nRow < nCurRow )
{
- nCurRow -= Min( nCurRow - nRow, nNumRows );
+ nCurRow -= std::min( nCurRow - nRow, nNumRows );
// with the above nCurRow points a) to the first row after the removed block or b) to the same line
// as before, but moved up nNumRows
// case a) needs an additional correction if the last n lines were deleted, as 'the first row after the
@@ -1723,7 +1723,7 @@ void BrowseBox::SelectAll()
Rectangle aHighlightRect;
sal_uInt16 nVisibleRows =
(sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
- for ( long nRow = Max( nTopRow, uRow.pSel->FirstSelected() );
+ for ( long nRow = std::max( nTopRow, uRow.pSel->FirstSelected() );
nRow != BROWSER_ENDOFSELECTION && nRow < nTopRow + nVisibleRows;
nRow = uRow.pSel->NextSelected() )
aHighlightRect.Union( Rectangle(
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index fd027fc0e1fa..a93d65bf12e0 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -1240,7 +1240,7 @@ void BrowseBox::UpdateScrollbars()
? (short)( pCols->size() - nFirstCol )
: (short)( nLastCol - nFirstCol );
- short nRange = Max( nScrollCols, (short)0 );
+ short nRange = std::max( nScrollCols, (short)0 );
aHScroll.SetVisibleSize( nVisibleHSize );
aHScroll.SetRange( Range( 0, nRange ));
if ( bNeedsHScroll && !aHScroll.IsVisible() )
@@ -1257,7 +1257,7 @@ void BrowseBox::UpdateScrollbars()
if ( pVScroll->GetThumbPos() != nTopRow )
pVScroll->SetThumbPos( nTopRow );
- long nVisibleSize = Min( Min( nRowCount, nMaxRows ), long(nRowCount-nTopRow) );
+ long nVisibleSize = std::min( std::min( nRowCount, nMaxRows ), long(nRowCount-nTopRow) );
pVScroll->SetVisibleSize( nVisibleSize ? nVisibleSize : 1 );
pVScroll->SetRange( Range( 0, nRowCount ) );
pVScroll->SetPosSizePixel(
@@ -1473,7 +1473,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt )
long nR = nX + pCol->Width() - 1;
// at the end of a column (and not handle column)?
- if ( pCol->GetId() && Abs( nR - rEvtPos.X() ) < 2 )
+ if ( pCol->GetId() && std::abs( nR - rEvtPos.X() ) < 2 )
{
// start resizing the column
bResizing = sal_True;
@@ -1527,7 +1527,7 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt )
// show resize-pointer?
if ( bResizing || ( pCol->GetId() &&
- Abs( ((long) nR ) - rEvt.GetPosPixel().X() ) < MIN_COLUMNWIDTH ) )
+ std::abs( ((long) nR ) - rEvt.GetPosPixel().X() ) < MIN_COLUMNWIDTH ) )
{
aNewPointer = Pointer( POINTER_HSPLIT );
if ( bResizing )
@@ -1536,7 +1536,7 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt )
pDataWin->HideTracking() ;
// check allowed width and new delta
- nDragX = Max( rEvt.GetPosPixel().X(), nMinResizeX );
+ nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX );
long nDeltaX = nDragX - nResizeX;
sal_uInt16 nId = GetColumnId(nResizeCol);
sal_uLong nOldWidth = GetColumnWidth(nId);
@@ -1570,12 +1570,12 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
pDataWin->HideTracking();
// width changed?
- nDragX = Max( rEvt.GetPosPixel().X(), nMinResizeX );
+ nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX );
if ( (nDragX - nResizeX) != (long)(*pCols)[ nResizeCol ]->Width() )
{
// resize column
long nMaxX = pDataWin->GetSizePixel().Width();
- nDragX = Min( nDragX, nMaxX );
+ nDragX = std::min( nDragX, nMaxX );
long nDeltaX = nDragX - nResizeX;
sal_uInt16 nId = GetColumnId(nResizeCol);
SetColumnWidth( GetColumnId(nResizeCol), GetColumnWidth(nId) + nDeltaX );
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index 36930e7a6f4b..9e0ab710991a 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -1248,7 +1248,7 @@ namespace svt
sal_uInt32 nCurColWidth = GetColumnWidth(nColId);
sal_uInt32 nMinColWidth = CalcZoom(20); // minimum
sal_uInt32 nNewColWidth = nMinColWidth;
- long nMaxRows = Min(long(GetVisibleRows()), GetRowCount());
+ long nMaxRows = std::min(long(GetVisibleRows()), GetRowCount());
long nLastVisRow = GetTopRow() + nMaxRows - 1;
if (GetTopRow() <= nLastVisRow) // calc the column with using the cell contents
diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx
index ffae299aafc9..f75866f38cc5 100644
--- a/svtools/source/config/printoptions.cxx
+++ b/svtools/source/config/printoptions.cxx
@@ -674,7 +674,7 @@ void SvtBasePrintOptions::GetPrinterOptions( PrinterOptions& rOptions ) const
rOptions.SetReducedGradientStepCount( GetReducedGradientStepCount() );
rOptions.SetReduceBitmaps( IsReduceBitmaps() );
rOptions.SetReducedBitmapMode( (PrinterBitmapMode) GetReducedBitmapMode() );
- rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) GetReducedBitmapResolution(), (sal_uInt16)( DPI_COUNT - 1 ) ) ] );
+ rOptions.SetReducedBitmapResolution( aDPIArray[ std::min( (sal_uInt16) GetReducedBitmapResolution(), (sal_uInt16)( DPI_COUNT - 1 ) ) ] );
rOptions.SetReducedBitmapIncludesTransparency( IsReducedBitmapIncludesTransparency() );
rOptions.SetConvertToGreyscales( IsConvertToGreyscales() );
rOptions.SetPDFAsStandardPrintJobFormat( IsPDFAsStandardPrintJobFormat() );
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 0c9e425de2e0..805ce6fb45c6 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2105,7 +2105,7 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingWidth( SvxIconChoiceCtrlEntry* pEntry )
switch( nWinBits & (VIEWMODE_MASK) )
{
case WB_ICON:
- nWidth = Max( nStringWidth, aImageSize.Width() );
+ nWidth = std::max( nStringWidth, aImageSize.Width() );
break;
case WB_SMALLICON:
@@ -2133,7 +2133,7 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingHeight( SvxIconChoiceCtrlEntry* pEntry
case WB_SMALLICON:
case WB_DETAILS:
- nHeight = Max( aImageSize.Height(), nStringHeight );
+ nHeight = std::max( aImageSize.Height(), nStringHeight );
break;
}
if( nHeight > nMaxBoundHeight )
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 3e10acb130b8..0099dd22a9c0 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -185,7 +185,7 @@ void SvImpLBox::UpdateContextBmpWidthVectorFromMovedEntry( SvTreeListEntry* pEnt
SvLBoxContextBmp* pBmpItem = static_cast< SvLBoxContextBmp* >( pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP ) );
short nExpWidth = (short)pBmpItem->GetBitmap1().GetSizePixel().Width();
short nColWidth = (short)pBmpItem->GetBitmap2().GetSizePixel().Width();
- short nMax = Max(nExpWidth, nColWidth);
+ short nMax = std::max(nExpWidth, nColWidth);
UpdateContextBmpWidthVector( pEntry, nMax );
if( pEntry->HasChildren() ) // recursive call, whether expanded or not
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 5fa6021abce0..a418330ba887 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3676,7 +3676,7 @@ void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvTreeListEntry* pE
break;
const Image& rBitmap1( pBmpItem->GetBitmap1() );
const Image& rBitmap2( pBmpItem->GetBitmap2() );
- short nMaxWidth = short( Max( rBitmap1.GetSizePixel().Width(), rBitmap2.GetSizePixel().Width() ) );
+ short nMaxWidth = short( std::max( rBitmap1.GetSizePixel().Width(), rBitmap2.GetSizePixel().Width() ) );
nMaxWidth = pImp->UpdateContextBmpWidthVector( pEntry, nMaxWidth );
if( nMaxWidth > nContextBmpWidthMax )
{
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index ab7e320c03fe..bd999746c007 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -1004,7 +1004,7 @@ void Ruler::ImplCalc()
mnWinWidth = mnWidth - mnVirOff;
if ( mpData->bAutoPageWidth )
mpData->nPageWidth = mnWinWidth;
- mpData->nRulWidth = Min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth );
+ mpData->nRulWidth = std::min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth );
if ( nRulWinOff+mpData->nRulWidth > mnWidth )
mpData->nRulWidth = mnWidth-nRulWinOff;
}
@@ -1014,7 +1014,7 @@ void Ruler::ImplCalc()
mnWinWidth = mnHeight - mnVirOff;
if ( mpData->bAutoPageWidth )
mpData->nPageWidth = mnWinWidth;
- mpData->nRulWidth = Min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth );
+ mpData->nRulWidth = std::min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth );
if ( nRulWinOff+mpData->nRulWidth > mnHeight )
mpData->nRulWidth = mnHeight-nRulWinOff;
}
diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx
index 146ceeb37c7b..46f40fc1a1b9 100644
--- a/svtools/source/control/scriptedtext.cxx
+++ b/svtools/source/control/scriptedtext.cxx
@@ -170,11 +170,11 @@ void SvtScriptedTextHelper_Impl::CalculateSizes()
// calculate maximum font height
SetOutDevFont( i18n::ScriptType::LATIN );
- maTextSize.Height() = Max( maTextSize.Height(), mrOutDevice.GetTextHeight() );
+ maTextSize.Height() = std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() );
SetOutDevFont( i18n::ScriptType::ASIAN );
- maTextSize.Height() = Max( maTextSize.Height(), mrOutDevice.GetTextHeight() );
+ maTextSize.Height() = std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() );
SetOutDevFont( i18n::ScriptType::COMPLEX );
- maTextSize.Height() = Max( maTextSize.Height(), mrOutDevice.GetTextHeight() );
+ maTextSize.Height() = std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() );
mrOutDevice.SetFont( maDefltFont );
}
diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx
index b20343f04ff9..c66a31eba5f6 100644
--- a/svtools/source/control/scrwin.cxx
+++ b/svtools/source/control/scrwin.cxx
@@ -358,8 +358,8 @@ void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 )
Update();
// does the new area overlap the old one?
- if ( Abs( (int)aDeltaPix.Height() ) < aOutPixSz.Height() ||
- Abs( (int)aDeltaPix.Width() ) < aOutPixSz.Width() )
+ if ( std::abs( (int)aDeltaPix.Height() ) < aOutPixSz.Height() ||
+ std::abs( (int)aDeltaPix.Width() ) < aOutPixSz.Width() )
{
// scroll the overlapping area
SetMapMode( aMap );
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index d8d9b396f2ab..3405dac90448 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -621,7 +621,7 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo
)
{
rRadioHeight = aNativeBounds.GetHeight();
- rMaxWidth = Max (rMaxWidth, aNativeContent.GetWidth());
+ rMaxWidth = std::max (rMaxWidth, aNativeContent.GetWidth());
}
}
return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight;
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 372ecf96f1e0..f0d462967ca5 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -1035,7 +1035,7 @@ void GraphicCache::SetMaxObjDisplayCacheSize( sal_uLong nNewMaxObjSize, sal_Bool
{
const sal_Bool bDestroy = ( bDestroyGreaterCached && ( nNewMaxObjSize < mnMaxObjDisplaySize ) );
- mnMaxObjDisplaySize = Min( nNewMaxObjSize, mnMaxDisplaySize );
+ mnMaxObjDisplaySize = std::min( nNewMaxObjSize, mnMaxDisplaySize );
if( bDestroy )
{
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index 456db307cead..bec3886d0db1 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -132,7 +132,7 @@ void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) co
void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
{
OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("poly "));
- const sal_uInt16 nCount = Min( aPoly.GetSize(), (sal_uInt16) 100 );
+ const sal_uInt16 nCount = std::min( aPoly.GetSize(), (sal_uInt16) 100 );
AppendNCSAURL(aStrBuf, rBaseURL);