summaryrefslogtreecommitdiff
path: root/editeng
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 /editeng
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 'editeng')
-rw-r--r--editeng/source/editeng/editdoc.cxx4
-rw-r--r--editeng/source/editeng/impedit.cxx12
-rw-r--r--editeng/source/editeng/impedit2.cxx4
-rw-r--r--editeng/source/editeng/impedit3.cxx14
-rw-r--r--editeng/source/editeng/impedit4.cxx2
-rw-r--r--editeng/source/items/svxfont.cxx2
-rw-r--r--editeng/source/items/textitem.cxx2
-rw-r--r--editeng/source/outliner/outliner.cxx6
8 files changed, 23 insertions, 23 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index c1899492bb7d..06afc77352a9 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -577,7 +577,7 @@ void ParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff )
{
// nInvalidPosEnd = pNode->Len();
DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" );
- nInvalidPosStart = Min( nInvalidPosStart, (sal_uInt16) ( nDiff < 0 ? nStart+nDiff : nDiff ) );
+ nInvalidPosStart = std::min( nInvalidPosStart, (sal_uInt16) ( nDiff < 0 ? nStart+nDiff : nDiff ) );
nInvalidDiff = 0;
bSimple = sal_False;
}
@@ -596,7 +596,7 @@ void ParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /* nEnd */
}
else
{
- nInvalidPosStart = Min( nInvalidPosStart, nStart );
+ nInvalidPosStart = std::min( nInvalidPosStart, nStart );
// nInvalidPosEnd = pNode->Len();
}
nInvalidDiff = 0;
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 1cfc48c8b494..7525db99b9ee 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -257,8 +257,8 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion, OutputD
long nX1 = pEditEngine->GetXPos(pTmpPortion, pLine, nTmpStartIndex, true);
long nX2 = pEditEngine->GetXPos(pTmpPortion, pLine, nTmpEndIndex);
- Point aPt1( Min( nX1, nX2 ), aTopLeft.Y() );
- Point aPt2( Max( nX1, nX2 ), aBottomRight.Y() );
+ Point aPt1( std::min( nX1, nX2 ), aTopLeft.Y() );
+ Point aPt2( std::max( nX1, nX2 ), aBottomRight.Y() );
ImplDrawHighlightRect( pTarget, aPt1, aPt2, pPolyPoly );
@@ -765,10 +765,10 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sa
long nDiffY = !IsVertical() ? nDocDiffY : nDocDiffX;
// Negative: Back to the top or left edge
- if ( ( Abs( nDiffY ) > pEditEngine->GetOnePixelInRef() ) && DoBigScroll() )
+ if ( ( std::abs( nDiffY ) > pEditEngine->GetOnePixelInRef() ) && DoBigScroll() )
{
long nH = aOutArea.GetHeight() / 4;
- if ( ( nH > aEditCursor.GetHeight() ) && ( Abs( nDiffY ) < nH ) )
+ if ( ( nH > aEditCursor.GetHeight() ) && ( std::abs( nDiffY ) < nH ) )
{
if ( nDiffY < 0 )
nDiffY -= nH;
@@ -777,10 +777,10 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sa
}
}
- if ( ( Abs( nDiffX ) > pEditEngine->GetOnePixelInRef() ) && DoBigScroll() )
+ if ( ( std::abs( nDiffX ) > pEditEngine->GetOnePixelInRef() ) && DoBigScroll() )
{
long nW = aOutArea.GetWidth() / 4;
- if ( Abs( nDiffX ) < nW )
+ if ( std::abs( nDiffX ) < nW )
{
if ( nDiffY < 0 )
nDiffY -= nW;
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 75169ca3e593..e75a7f9c314f 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3709,7 +3709,7 @@ sal_uInt16 ImpEditEngine::GetChar(
pParaPortion->GetNode()->GetString(), nRight, aLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount );
if ( ( nLeft != nChar ) && ( nRight != nChar ) )
{
- nChar = ( Abs( nRight - nChar ) < Abs( nLeft - nChar ) ) ? nRight : nLeft;
+ nChar = ( std::abs( nRight - nChar ) < std::abs( nLeft - nChar ) ) ? nRight : nLeft;
}
}
}
@@ -4145,7 +4145,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_uInt16 nIndex
if ( nFlags & GETCRSR_TXTONLY )
aEditCursor.Top() = aEditCursor.Bottom() - pLine->GetTxtHeight() + 1;
else
- aEditCursor.Top() = aEditCursor.Bottom() - Min( pLine->GetTxtHeight(), pLine->GetHeight() ) + 1;
+ aEditCursor.Top() = aEditCursor.Bottom() - std::min( pLine->GetTxtHeight(), pLine->GetHeight() ) + 1;
return aEditCursor;
}
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index da52915fa92b..b682fdc5897c 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -415,7 +415,7 @@ void ImpEditEngine::FormatDoc()
if ( aInvalidRect.IsEmpty() )
{
// For Paperwidth 0 (AutoPageSize) it would otherwise be Empty()...
- long nWidth = Max( (long)1, ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) );
+ long nWidth = std::max( (long)1, ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) );
Range aInvRange( GetInvalidYOffsets( pParaPortion ) );
aInvalidRect = Rectangle( Point( 0, nY+aInvRange.Min() ),
Size( nWidth, aInvRange.Len() ) );
@@ -442,7 +442,7 @@ void ImpEditEngine::FormatDoc()
aStatus.GetStatusWord() |= !IsVertical() ? EE_STAT_TEXTHEIGHTCHANGED : EE_STAT_TEXTWIDTHCHANGED;
if ( nNewHeight < nCurTextHeight )
{
- aInvalidRect.Bottom() = (long)Max( nNewHeight, nCurTextHeight );
+ aInvalidRect.Bottom() = (long)std::max( nNewHeight, nCurTextHeight );
if ( aInvalidRect.IsEmpty() )
{
aInvalidRect.Top() = 0;
@@ -632,7 +632,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY )
const short nInvalidDiff = pParaPortion->GetInvalidDiff();
const sal_uInt16 nInvalidStart = pParaPortion->GetInvalidPosStart();
- const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff );
+ const sal_uInt16 nInvalidEnd = nInvalidStart + std::abs( nInvalidDiff );
sal_Bool bQuickFormat = sal_False;
if ( !bEmptyNodeWithPolygon && !HasScriptType( nPara, i18n::ScriptType::COMPLEX ) )
@@ -864,7 +864,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY )
{
// Try further down in the polygon.
// Below the polygon use the Paper Width.
- nTextExtraYOffset += Max( (long)(nTextLineHeight / 10), (long)1 );
+ nTextExtraYOffset += std::max( (long)(nTextLineHeight / 10), (long)1 );
if ( ( nTextY + nTextExtraYOffset ) > GetTextRanger()->GetBoundRect().Bottom() )
{
nXWidth = !IsVertical() ? GetPaperSize().Width() : GetPaperSize().Height();
@@ -3956,8 +3956,8 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNe
{
// in this case one can redraw directly without invalidating the
// Portions
- sal_uInt16 nFirstPortion = Min( (sal_uInt16)aOldPositions.Min(), nNewPos );
- sal_uInt16 nLastPortion = Max( (sal_uInt16)aOldPositions.Max(), nNewPos );
+ sal_uInt16 nFirstPortion = std::min( (sal_uInt16)aOldPositions.Min(), nNewPos );
+ sal_uInt16 nLastPortion = std::max( (sal_uInt16)aOldPositions.Max(), nNewPos );
ParaPortion* pUpperPortion = GetParaPortions().SafeGetObject( nFirstPortion );
ParaPortion* pLowerPortion = GetParaPortions().SafeGetObject( nLastPortion );
@@ -3973,7 +3973,7 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNe
else
{
// redraw from the upper invalid position
- sal_uInt16 nFirstInvPara = Min( (sal_uInt16)aOldPositions.Min(), nNewPos );
+ sal_uInt16 nFirstInvPara = std::min( (sal_uInt16)aOldPositions.Min(), nNewPos );
InvalidateFromParagraph( nFirstInvPara );
}
return aSel;
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 34ef278174f2..08aed29dbd6a 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -988,7 +988,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
rOutput << "{\\*\\updnprop" << OString::valueOf(
static_cast<sal_Int32>(nProp100)).getStr() << '}';
}
- long nUpDown = nFontHeight * Abs( nEsc ) / 100;
+ long nUpDown = nFontHeight * std::abs( nEsc ) / 100;
OString aUpDown = OString::valueOf(
static_cast<sal_Int32>(nUpDown));
if ( nEsc < 0 )
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index 837c0325fba2..0c6648dbce77 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -209,7 +209,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
const xub_StrLen nLen = STRING_LEN == nPartLen ? rDo.GetLen() : nPartLen;
const XubString aTxt( CalcCaseMap( rTxt ) );
- const sal_uInt16 nTxtLen = Min( rTxt.Len(), nLen );
+ const sal_uInt16 nTxtLen = std::min( rTxt.Len(), nLen );
sal_uInt16 nPos = 0;
sal_uInt16 nOldPos = nPos;
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 31d316bd82bf..66f5fa3c539f 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -2491,7 +2491,7 @@ bool SvxEscapementItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
case MID_ESC:
{
sal_Int16 nVal = sal_Int16();
- if( (rVal >>= nVal) && (Abs(nVal) <= 101))
+ if( (rVal >>= nVal) && (std::abs(nVal) <= 101))
nEsc = nVal;
else
return sal_False;
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index d9adae804867..7a53b0e524a0 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -240,7 +240,7 @@ void Outliner::SetMaxDepth( sal_Int16 nDepth, sal_Bool bCheckParagraphs )
{
if( nMaxDepth != nDepth )
{
- nMaxDepth = Min( nDepth, (sal_Int16)(SVX_MAX_NUM-1) );
+ nMaxDepth = std::min( nDepth, (sal_Int16)(SVX_MAX_NUM-1) );
if( bCheckParagraphs )
{
@@ -1580,7 +1580,7 @@ Rectangle Outliner::ImpCalcBulletArea( sal_uInt16 nPara, sal_Bool bAdjust, sal_B
const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&) pEditEngine->GetParaAttrib( nPara, bOutlineMode ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE );
aTopLeft.X() = rLR.GetTxtLeft() + rLR.GetTxtFirstLineOfst() + nSpaceBefore;
- long nBulletWidth = Max( (long) -rLR.GetTxtFirstLineOfst(), (long) ((-pFmt->GetFirstLineOffset()) + pFmt->GetCharTextDistance()) );
+ long nBulletWidth = std::max( (long) -rLR.GetTxtFirstLineOfst(), (long) ((-pFmt->GetFirstLineOffset()) + pFmt->GetCharTextDistance()) );
if ( nBulletWidth < aBulletSize.Width() ) // The Bullet creates its space
nBulletWidth = aBulletSize.Width();
@@ -1839,7 +1839,7 @@ IMPL_LINK( Outliner, EndMovingParagraphsHdl, MoveParagraphsInfo*, pInfos )
DBG_CHKTHIS(Outliner,0);
pParaList->MoveParagraphs( pInfos->nStartPara, pInfos->nDestPara, pInfos->nEndPara - pInfos->nStartPara + 1 );
- sal_uInt16 nChangesStart = Min( pInfos->nStartPara, pInfos->nDestPara );
+ sal_uInt16 nChangesStart = std::min( pInfos->nStartPara, pInfos->nDestPara );
sal_uInt16 nParas = (sal_uInt16)pParaList->GetParagraphCount();
for ( sal_uInt16 n = nChangesStart; n < nParas; n++ )
ImplCalcBulletText( n, sal_False, sal_False );