diff options
Diffstat (limited to 'sw')
94 files changed, 411 insertions, 411 deletions
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index b33f75417d39..29a7fd1158c5 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -176,7 +176,7 @@ public: void SetTableModel( sal_Bool bNew ){ bNewModel = bNew; } sal_Bool IsNewModel() const { return bNewModel; } - sal_uInt16 GetRowsToRepeat() const { return Min( (sal_uInt16)GetTabLines().size(), nRowsToRepeat ); } + sal_uInt16 GetRowsToRepeat() const { return std::min( (sal_uInt16)GetTabLines().size(), nRowsToRepeat ); } sal_uInt16 _GetRowsToRepeat() const { return nRowsToRepeat; } void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { nRowsToRepeat = nNumOfRows; } diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 8ebcd45d7622..c21e6bc76562 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -535,7 +535,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, if( (bSrchForward || pSttNd != &rNdIdx.GetNode()) && Move( fnMoveForward, fnGoCntnt ) && (!bSrchForward || pSttNd != &GetPoint()->nNode.GetNode()) && - 1 == Abs( (int)( GetPoint()->nNode.GetIndex() - + 1 == std::abs( (int)( GetPoint()->nNode.GetIndex() - GetMark()->nNode.GetIndex()) ) ) { // if backward search, switch point and mark diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index e6fb6e431519..54715ed1ed7b 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1732,7 +1732,7 @@ void SwCursor::DoSetBidiLevelUpDown() if ( nCurrLevel % 2 != nPrevLevel % 2 ) { // set cursor level to the lower of the two levels - SetCrsrBidiLevel( Min( nCurrLevel, nPrevLevel ) ); + SetCrsrBidiLevel( std::min( nCurrLevel, nPrevLevel ) ); } else SetCrsrBidiLevel( nCurrLevel ); diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 858782edb65b..ab8319998cfd 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1647,7 +1647,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr, MarkBase* pMark = dynamic_cast<MarkBase*>(pMarkAccess->getMarksBegin()[aSave.GetCount()].get()); SwPosition aNewPos(pMark->GetMarkPos()); aNewPos.nNode = rNd; - aNewPos.nContent.Assign(pCNd, Min(aSave.GetContent(), nLen)); + aNewPos.nContent.Assign(pCNd, std::min(aSave.GetContent(), nLen)); pMark->SetMarkPos(aNewPos); } break; @@ -1656,7 +1656,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr, MarkBase* pMark = dynamic_cast<MarkBase*>(pMarkAccess->getMarksBegin()[aSave.GetCount()].get()); SwPosition aNewPos(pMark->GetOtherMarkPos()); aNewPos.nNode = rNd; - aNewPos.nContent.Assign(pCNd, Min(aSave.GetContent(), nLen)); + aNewPos.nContent.Assign(pCNd, std::min(aSave.GetContent(), nLen)); pMark->SetOtherMarkPos(aNewPos); } break; @@ -1678,7 +1678,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr, aNewPos.nNode = rNd; if ( FLY_AT_CHAR == rFlyAnchor.GetAnchorId() ) { - aNewPos.nContent.Assign( pCNd, Min( + aNewPos.nContent.Assign( pCNd, std::min( aSave.GetContent(), nLen ) ); } else @@ -1776,7 +1776,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr, if( pPos ) { pPos->nNode = rNd; - pPos->nContent.Assign( pCNd, Min( aSave.GetContent(), nLen ) ); + pPos->nContent.Assign( pCNd, std::min( aSave.GetContent(), nLen ) ); } n -= 2; rSaveArr.erase( rSaveArr.begin() + n, rSaveArr.begin() + n + 2); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 13be89d9dec9..038f01eea263 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -559,7 +559,7 @@ bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset ) // If a Position inside the special nodes array sections was calculated, // set it to document start instead. // Sections or Tables at the document start will be pushed backwards. - nNewPos = Max( nNewPos, GetNodes().GetEndOfExtras().GetIndex() + 2 ); + nNewPos = std::max( nNewPos, GetNodes().GetEndOfExtras().GetIndex() + 2 ); long nOffs = nNewPos - ( 0 < nOffset ? aEndRg.GetIndex() : aSttRg.GetIndex()); SwPaM aPam( aSttRg, aEndRg, 0, -1 ); diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 306736366ff9..ab89350ab04d 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -858,7 +858,7 @@ sal_uInt16 FlatFndBox::GetRowCount(const _FndBox& rBox) for(sal_uInt16 j=0; j < rBoxes.size(); ++j) if (rBoxes[j].GetLines().size()) // Iterate recursively over the Lines - nLn = Max(GetRowCount(rBoxes[j]), nLn); + nLn = std::max(GetRowCount(rBoxes[j]), nLn); nLines = nLines + nLn; } diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 53be8e01a11d..d1a784b1beae 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -1556,7 +1556,7 @@ static void lcl_ResizeLine( const SwTableLine* pLine, sal_uInt16 *pWidth ) BOOST_FOREACH( const SwTableBox* pBox, pLine->GetTabBoxes() ) lcl_ResizeBox(pBox, pWidth ); - SAL_WARN_IF( nOldWidth && Abs(*pWidth-nOldWidth) >= COLFUZZY, "sw.core", + SAL_WARN_IF( nOldWidth && std::abs(*pWidth-nOldWidth) >= COLFUZZY, "sw.core", "A box's rows have all a different length" ); } @@ -1626,7 +1626,7 @@ void SwHTMLTableLayout::SetWidths( sal_Bool bCallPass2, sal_uInt16 nAbsAvail, sal_uInt16 nCalcTabWidth = 0; BOOST_FOREACH( const SwTableLine *pLine, pSwTable->GetTabLines() ) lcl_ResizeLine( pLine, &nCalcTabWidth ); - SAL_WARN_IF( Abs( nRelTabWidth-nCalcTabWidth ) >= COLFUZZY, "sw.core", + SAL_WARN_IF( std::abs( nRelTabWidth-nCalcTabWidth ) >= COLFUZZY, "sw.core", "Table width is not equal to the row width" ); // Lock the table format when altering it, or else the box formats diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index bf9c7e880561..06b6ee389b13 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -358,7 +358,7 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect, } else { - nLeftCrop = Max( aOrigSz.Width() - + nLeftCrop = std::max( aOrigSz.Width() - (rCrop.GetRight() + rCrop.GetLeft()), long(1) ); const double nScale = double(Prt().Width()) / double(nLeftCrop); nLeftCrop = long(nScale * -rCrop.GetLeft() ); @@ -381,7 +381,7 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect, } else { - nTopCrop = Max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), long(1) ); + nTopCrop = std::max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), long(1) ); const double nScale = double(Prt().Height()) / double(nTopCrop); nTopCrop = long(nScale * -rCrop.GetTop() ); nBottomCrop= long(nScale * -rCrop.GetBottom() ); @@ -480,7 +480,7 @@ void SwNoTxtFrm::Format( const SwBorderAttrs * ) if( nChgHght > 0) Grow( nChgHght ); else if( nChgHght < 0) - Shrink( Min(Prt().Height(), -nChgHght) ); + Shrink( std::min(Prt().Height(), -nChgHght) ); } sal_Bool SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos, diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 988b6101cfb9..0de8a736d641 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -873,8 +873,8 @@ lcl_FndNxtPrvDelBox( const SwTableLines& rTblLns, pFndBox = rLowLns.back()->GetTabBoxes().front(); } - if( Abs( nFndWidth ) > COLFUZZY || - Abs( nBoxWidth - nFndBoxWidth ) > COLFUZZY ) + if( std::abs( nFndWidth ) > COLFUZZY || + std::abs( nBoxWidth - nFndBoxWidth ) > COLFUZZY ) pFndBox = 0; else if( pAllDelBoxes ) { @@ -2456,7 +2456,7 @@ static bool lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam, // Collect all "ContentBoxes" if( ( 0 != ( bGreaterBox = TBLFIX_CHGABS != rParam.nMode && ( nDist + ( rParam.bLeft ? 0 : nWidth ) ) >= rParam.nSide)) || - ( !rParam.bBigger && ( Abs( nDist + (( rParam.nMode && rParam.bLeft ) ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY ) ) ) + ( !rParam.bBigger && ( std::abs( nDist + (( rParam.nMode && rParam.bLeft ) ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY ) ) ) { rParam.bAnyBoxFnd = true; SwTwips nLowerDiff; @@ -2492,7 +2492,7 @@ static bool lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam, if( nLowerDiff || ( 0 != ( bGreaterBox = !nOldLower && TBLFIX_CHGABS != rParam.nMode && ( nDist + ( rParam.bLeft ? 0 : nWidth ) ) >= rParam.nSide)) || - ( Abs( nDist + ( (rParam.nMode && rParam.bLeft) ? 0 : nWidth ) + ( std::abs( nDist + ( (rParam.nMode && rParam.bLeft) ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY )) { // This column contains the Cursor - so decrease/increase @@ -2555,7 +2555,7 @@ static bool lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam, return false; if( rParam.bBigger && ( TBLFIX_CHGABS == rParam.nMode - ? Abs( nDist - rParam.nSide ) < COLFUZZY + ? std::abs( nDist - rParam.nSide ) < COLFUZZY : ( rParam.bLeft ? nDist < rParam.nSide - COLFUZZY : nDist >= rParam.nSide - COLFUZZY )) ) { @@ -2591,7 +2591,7 @@ static bool lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam, if( nLowerDiff || ( TBLFIX_CHGABS == rParam.nMode - ? Abs( nDist - rParam.nSide ) < COLFUZZY + ? std::abs( nDist - rParam.nSide ) < COLFUZZY : ( rParam.bLeft ? nDist < rParam.nSide - COLFUZZY : nDist >= rParam.nSide - COLFUZZY) ) ) @@ -2650,7 +2650,7 @@ static bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam, return false; // Collect all "ContentBoxes" - if( Abs( nDist + ( rParam.bLeft ? 0 : nWidth ) + if( std::abs( nDist + ( rParam.bLeft ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY ) nCmp = 1; else if( nDist + ( rParam.bLeft ? 0 : nWidth/2 ) > rParam.nSide ) @@ -2692,7 +2692,7 @@ static bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam, if( nLowerDiff ) nCmp = 1; - else if( Abs( nDist + ( rParam.bLeft ? 0 : nWidth ) + else if( std::abs( nDist + ( rParam.bLeft ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY ) nCmp = 2; else if( nDist + nWidth / 2 > rParam.nSide ) @@ -2943,8 +2943,8 @@ SwComparePosition _CheckBoxInRange( sal_uInt16 nStt, sal_uInt16 nEnd, { if( nEnd + COLFUZZY >= nBoxEnd ) { - if( COLFUZZY > Abs( long(nEnd) - long(nBoxEnd) ) && - COLFUZZY > Abs( long(nStt) - long(nBoxStt) ) ) + if( COLFUZZY > std::abs( long(nEnd) - long(nBoxEnd) ) && + COLFUZZY > std::abs( long(nStt) - long(nBoxStt) ) ) nRet = POS_EQUAL; else nRet = POS_INSIDE; @@ -2969,7 +2969,7 @@ static void lcl_DelSelBox_CorrLowers( SwTableLine& rLine, CR_SetBoxWidth& rParam for( n = rBoxes.size(); n; ) nBoxWidth += rBoxes[ --n ]->GetFrmFmt()->GetFrmSize().GetWidth(); - if( COLFUZZY < Abs( nWidth - nBoxWidth )) + if( COLFUZZY < std::abs( nWidth - nBoxWidth )) { // Thus, they need to be adjusted for( n = rBoxes.size(); n; ) @@ -3027,7 +3027,7 @@ static void lcl_ChgBoxSize( SwTableBox& rBox, CR_SetBoxWidth& rParam, break; case TBLVAR_CHGABS: // Variable table, change all neighbors - if( COLFUZZY < Abs( rParam.nBoxWidth - + if( COLFUZZY < std::abs( rParam.nBoxWidth - ( rDelWidth + rParam.nLowerDiff ))) { nDiff = rDelWidth + rParam.nLowerDiff - rParam.nBoxWidth; @@ -3207,7 +3207,7 @@ static bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam, // if it's as large as the change in the Table. if( (( TBLVAR_CHGABS != rParam.nMode || nDelWidth != rParam.nBoxWidth ) && - COLFUZZY > Abs( rParam.bLeft + COLFUZZY > std::abs( rParam.bLeft ? nWidth - nDist : (nDist + nWidth - rParam.nTblWidth ))) || !::lcl_DeleteBox_Rekursiv( rParam, *pBox, bCheck ) ) @@ -3247,7 +3247,7 @@ static bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam, pLine == pBox->GetTabLines()[ i ] ) { if( !bFirst && !bCorrLowers && - COLFUZZY < Abs( nLowerDiff - rParam.nLowerDiff ) ) + COLFUZZY < std::abs( nLowerDiff - rParam.nLowerDiff ) ) bCorrLowers = true; // The largest deletion width counts, but only if we don't @@ -3400,7 +3400,7 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize ) _CheckBoxWidth( *pBox->GetTabLines()[ j ], nBoxW ); } - if (sal::static_int_cast< unsigned long >(Abs(nAktSize - nSize)) > + if (sal::static_int_cast< unsigned long >(std::abs(nAktSize - nSize)) > (COLFUZZY * rBoxes.size())) { OSL_FAIL( "Line's Boxes are too small or too large" ); @@ -3680,7 +3680,7 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType, } } else if( bInsDel || - ( bLeft ? nDist : Abs( rSz.GetWidth() - nDist ) > COLFUZZY ) ) + ( bLeft ? nDist : std::abs( rSz.GetWidth() - nDist ) > COLFUZZY ) ) { bRet = true; if( bLeft && TBLFIX_CHGABS == eTblChgMode && !bInsDel ) diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 5cad0d70ea8e..f8b224fdd977 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -2639,7 +2639,7 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , else { nLowerBorder = (*aIter).first; - long nNewLowerBorderUpperBoundary = Max( (*aIter).second.first, nUpperBorder ); + long nNewLowerBorderUpperBoundary = std::max( (*aIter).second.first, nUpperBorder ); aPair.first = nNewLowerBorderUpperBoundary; aPair.second = LONG_MAX; } aBoundaries[ nLowerBorder ] = aPair; diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 3eb533b8da22..95e2163b993c 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -58,7 +58,7 @@ extern void ClearFEShellTabCols(); // See swtable.cxx too #define COLFUZZY 20L -inline bool IsSame( long nA, long nB ) { return Abs(nA-nB) <= COLFUZZY; } +inline bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; } class SwTblFmtCmp { @@ -329,7 +329,7 @@ void SwDoc::SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew ) } std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( Max( 255, (int)aRowArr.size() ) ); + aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for( sal_uInt16 i = 0; i < aRowArr.size(); ++i ) ::lcl_ProcessRowAttr( aFmtCmp, aRowArr[i], rNew ); @@ -381,7 +381,7 @@ void SwDoc::SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew ) } std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( Max( 255, (int)aRowArr.size() ) ); + aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for ( sal_uInt16 i = 0; i < aRowArr.size(); ++i ) ::lcl_ProcessRowSize( aFmtCmp, aRowArr[i], rNew ); SwTblFmtCmp::Delete( aFmtCmp ); @@ -438,7 +438,7 @@ sal_Bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly ) SwFrm* pFrm = aIter.First(); while ( pFrm ) { - nHeight = Max( nHeight, pFrm->Frm().Height() ); + nHeight = std::max( nHeight, pFrm->Frm().Height() ); pFrm = aIter.Next(); } } @@ -451,7 +451,7 @@ sal_Bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly ) } std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( Max( 255, (int)aRowArr.size() ) ); + aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for( i = 0; i < aRowArr.size(); ++i ) ::lcl_ProcessRowSize( aFmtCmp, (SwTableLine*)aRowArr[i], aNew ); SwTblFmtCmp::Delete( aFmtCmp ); @@ -480,7 +480,7 @@ void SwDoc::SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew } std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( Max( 255, (int)aRowArr.size() ) ); + aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for( sal_uInt16 i = 0; i < aRowArr.size(); ++i ) ::lcl_ProcessRowAttr( aFmtCmp, aRowArr[i], rNew ); @@ -1286,7 +1286,7 @@ static sal_uInt16 lcl_CalcCellFit( const SwLayoutFrm *pCell ) ((SwTxtFrm*)pFrm)->CalcFitToContent() : (pFrm->Prt().*fnRect->fnGetWidth)(); - nRet = Max( nRet, nCalcFitToContent + nAdd ); + nRet = std::max( nRet, nCalcFitToContent + nAdd ); pFrm = pFrm->GetNext(); } // Surrounding border as well as left and Right Border also need to be respected @@ -1296,7 +1296,7 @@ static sal_uInt16 lcl_CalcCellFit( const SwLayoutFrm *pCell ) // To compensate for the accuracy of calculation later on in SwTable::SetTabCols // we keep adding up a little. nRet += COLFUZZY; - return (sal_uInt16)Max( long(MINLAY), nRet ); + return (sal_uInt16)std::max( long(MINLAY), nRet ); } /** diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 0047c409ad9a..eb996809be97 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -789,7 +789,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, } nMin -= MINFLY; } - aSz.Width() = Max( aSz.Width(), nMin ); + aSz.Width() = std::max( aSz.Width(), nMin ); } SwFrmFmt *pFmt = GetFmt(); diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 5cb58fd7df5b..b2ebf5ec8d2d 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1525,7 +1525,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) else { bChgBullet = true; - SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_BUL_LEVEL1 + ( Min( nLvl, cnNumBullColls ) * 4 )) ); + SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_BUL_LEVEL1 + ( std::min( nLvl, cnNumBullColls ) * 4 )) ); } } else @@ -1545,7 +1545,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) // Ebene 0 und Einrueckung dann wird die Ebene durch den linken // Einzug und der default NumEinrueckung bestimmt. if( !nDigitLevel && nLeftTxtPos ) - nLvl = Min( sal_uInt16( nLeftTxtPos / lNumIndent ), + nLvl = std::min( sal_uInt16( nLeftTxtPos / lNumIndent ), sal_uInt16( MAXLEVEL - 1 ) ); else nLvl = nDigitLevel; @@ -1622,7 +1622,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) } } else if( !aFlags.bAFmtByInput ) - SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_NUM_LEVEL1 + ( Min( nLvl, cnNumBullColls ) * 4 ) )); + SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_NUM_LEVEL1 + ( std::min( nLvl, cnNumBullColls ) * 4 ) )); else bChgEnum = false; } @@ -1791,7 +1791,7 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) SwTxtFrmInfo aFInfo( pAktTxtFrm ); const SwTxtNode* pNxtNd = GetNextNode(); while( CanJoin( pNxtNd ) && - 20 < Abs( (long)(nSpaces - aFInfo.SetFrm( + 20 < std::abs( (long)(nSpaces - aFInfo.SetFrm( GetFrm( *pNxtNd ) ).GetLineStart() )) ) { diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index c3c63381b527..017ce7152aa9 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -734,7 +734,7 @@ void SwDBNumSetField::Evaluate(SwDoc* pDoc) if( bCondValid && pMgr && pMgr->IsInMerge() && pMgr->IsDataSourceOpen(aTmpData.sDataSource, aTmpData.sCommand, sal_True)) { // Bedingug OK -> aktuellen Set einstellen - pMgr->ToRecordId(Max((sal_uInt16)aPar2.ToInt32(), sal_uInt16(1))-1); + pMgr->ToRecordId(std::max((sal_uInt16)aPar2.ToInt32(), sal_uInt16(1))-1); } } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index eee6211c0328..7f0f2e953a26 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -2308,7 +2308,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld, ? (sal_uInt32)SVX_NUM_ARABIC : pPgFrm->GetPageDesc()->GetNumType().GetNumberingType() ) : pGetFld->GetFormat(); - short nPageNum = static_cast<short>(Max(0, pSetFld->GetOffset() + (short)nDiff)); + short nPageNum = static_cast<short>(std::max(0, pSetFld->GetOffset() + (short)nDiff)); pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) ); } } @@ -2395,7 +2395,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm, sal_uInt32 nTmpFmt = SVX_NUM_PAGEDESC == pGetFld->GetFormat() ? pPgFrm->GetPageDesc()->GetNumType().GetNumberingType() : pGetFld->GetFormat(); - short nPageNum = static_cast<short>(Max(0, pSetFld->GetOffset() + (short)nDiff )); + short nPageNum = static_cast<short>(std::max(0, pSetFld->GetOffset() + (short)nDiff )); pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) ); } } diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 2819819160b5..ed33b5c79460 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -1404,7 +1404,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < { aNewSz.Height() += pChgFly->Frm().Height() - pFly->Prt().Height(); - if( Abs( aNewSz.Height() - pChgFly->Frm().Height()) > 1 ) + if( std::abs( aNewSz.Height() - pChgFly->Frm().Height()) > 1 ) aFrmSz.SetHeight( aNewSz.Height() ); } // via Doc for the Undo! @@ -1861,8 +1861,8 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam const long nWidth = rBound.Right() - rBound.Left(); const long nHeight= rBound.Bottom() - rBound.Top(); aFrmSet.Put( SwFmtFrmSize( ATT_MIN_SIZE, - Max( nWidth, long(MINFLY) ), - Max( nHeight, long(MINFLY) ))); + std::max( nWidth, long(MINFLY) ), + std::max( nHeight, long(MINFLY) ))); if( SFX_ITEM_SET != aFrmSet.GetItemState( RES_HORI_ORIENT )) aFrmSet.Put( SwFmtHoriOrient( aRelPos.X(), text::HoriOrientation::NONE, text::RelOrientation::FRAME )); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 4982e4377148..4c979791352d 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1774,8 +1774,8 @@ sal_Bool SwFEShell::ImpEndCreate() // For OBJ_NONE a fly is inserted. const long nWidth = rBound.Right() - rBound.Left(); const long nHeight= rBound.Bottom() - rBound.Top(); - aSet.Put( SwFmtFrmSize( ATT_MIN_SIZE, Max( nWidth, long(MINFLY) ), - Max( nHeight, long(MINFLY) ))); + aSet.Put( SwFmtFrmSize( ATT_MIN_SIZE, std::max( nWidth, long(MINFLY) ), + std::max( nHeight, long(MINFLY) ))); SwFmtHoriOrient aHori( nXOffset, text::HoriOrientation::NONE, text::RelOrientation::FRAME ); SwFmtVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME ); diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 72a0a8920478..bbf751670506 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -66,7 +66,7 @@ using namespace ::com::sun::star; // also see swtable.cxx #define COLFUZZY 20L -inline bool IsSame( long nA, long nB ) { return Abs(nA-nB) <= COLFUZZY; } +inline bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; } // table column cache SwTabCols *pLastCols = 0; @@ -1147,7 +1147,7 @@ sal_uInt16 SwFEShell::GetRowSelectionFromTop() const if ( ( nPtLine == 0 && nMkLine != USHRT_MAX ) || ( nMkLine == 0 && nPtLine != USHRT_MAX ) ) { - nRet = Max( nPtLine, nMkLine ) + 1; + nRet = std::max( nPtLine, nMkLine ) + 1; } } @@ -1727,7 +1727,7 @@ static double lcl_DistancePoint2Segment( const Point& rA, const Point& rB, const } } - return Abs(nRet); + return std::abs(nRet); } /* Helper function*/ diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 358a383f2dd1..f0687c88e75e 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -1815,7 +1815,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart, const long nStSz = pStart->GetFmt()->GetFrmSize().GetWidth(); const long nEdSz = pEnd->GetFmt()->GetFrmSize().GetWidth(); - const long nWish = Max( 1L, pTable->GetFmt()->GetFrmSize().GetWidth() ); + const long nWish = std::max( 1L, pTable->GetFmt()->GetFrmSize().GetWidth() ); while ( pTable ) { SWRECTFN( pTable ) diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 5b52817bc967..0c15ce703c5a 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -1150,7 +1150,7 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA, const sal_uInt16 nTrans = rSet.GetTransparencyGrf().GetValue(); rGA.SetTransparency( (sal_uInt8) FRound( - Min( nTrans, (sal_uInt16) 100 ) * 2.55 ) ); + std::min( nTrans, (sal_uInt16) 100 ) * 2.55 ) ); return rGA; } diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx index 478a4a78bb68..ab4a193a5673 100644 --- a/sw/source/core/layout/anchoredobject.cxx +++ b/sw/source/core/layout/anchoredobject.cxx @@ -669,8 +669,8 @@ const SwRect& SwAnchoredObject::GetObjRectWithSpaces() const const SvxULSpaceItem& rUL = rFmt.GetULSpace(); const SvxLRSpaceItem& rLR = rFmt.GetLRSpace(); { - maObjRectWithSpaces.Top ( Max( maObjRectWithSpaces.Top() - long(rUL.GetUpper()), 0L )); - maObjRectWithSpaces.Left( Max( maObjRectWithSpaces.Left()- long(rLR.GetLeft()), 0L )); + maObjRectWithSpaces.Top ( std::max( maObjRectWithSpaces.Top() - long(rUL.GetUpper()), 0L )); + maObjRectWithSpaces.Left( std::max( maObjRectWithSpaces.Left()- long(rLR.GetLeft()), 0L )); maObjRectWithSpaces.SSize().Height() += rUL.GetLower(); maObjRectWithSpaces.SSize().Width() += rLR.GetRight(); } diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 447f55d4b44a..5bd0c2d487e5 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1067,7 +1067,7 @@ bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) const text::TextColumn* pArray = aSetColumns.getConstArray(); aColumns.clear(); //max count is 64k here - this is something the array can't do - sal_uInt16 nCount = Min( (sal_uInt16)aSetColumns.getLength(), + sal_uInt16 nCount = std::min( (sal_uInt16)aSetColumns.getLength(), (sal_uInt16) 0x3fff ); sal_uInt16 nWidthSum = 0; // #101224# one column is no column diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 44059617882d..884bfbad4226 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -113,7 +113,7 @@ sal_Bool SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool } SWRECTFN( this ) SWRECTFNX( pNewUpper ) - if( Abs( (pNewUpper->Prt().*fnRectX->fnGetWidth)() - + if( std::abs( (pNewUpper->Prt().*fnRectX->fnGetWidth)() - (GetUpper()->Prt().*fnRect->fnGetWidth)() ) > 1 ) { // In this case, only a _WouldFit with test move is possible nMoveAnyway = 2; @@ -671,10 +671,10 @@ static void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* pFrm, long& rBot } else nTmp = pObj->GetObjRect().Bottom(); - nMax = Max( nTmp, nMax ); + nMax = std::max( nTmp, nMax ); } ++nMax; // Lower edge vs. height! - rBot = Max( rBot, nMax ); + rBot = std::max( rBot, nMax ); } void SwPageFrm::MakeAll() @@ -722,7 +722,7 @@ void SwPageFrm::MakeAll() nWidth = pSh->GetBrowseWidth(); nWidth += + 2 * aBorder.Width(); - nWidth = Max( nWidth, 2L * aBorder.Width() + 4L*MM50 ); + nWidth = std::max( nWidth, 2L * aBorder.Width() + 4L*MM50 ); Frm().Width( nWidth ); SwLayoutFrm *pBody = FindBodyCont(); @@ -760,7 +760,7 @@ void SwPageFrm::MakeAll() ( pFrm->Frm().Height() < pFrm->Prt().Height() ) ) { - nTmp = Min( nTmp, pFrm->Frm().Height() ); + nTmp = std::min( nTmp, pFrm->Frm().Height() ); } else { @@ -770,7 +770,7 @@ void SwPageFrm::MakeAll() nTmp += pFrm->Frm().Height() - pFrm->Prt().Height(); } if ( !pFrm->IsBodyFrm() ) - nTmp = Min( nTmp, pFrm->Frm().Height() ); + nTmp = std::min( nTmp, pFrm->Frm().Height() ); nBot += nTmp; // Here we check whether paragraph anchored objects // protrude outside the Body/FtnCont. @@ -789,11 +789,11 @@ void SwPageFrm::MakeAll() // visible area. if ( !GetPrev() && !GetNext() ) { - nBot = Max( nBot, pSh->VisArea().Height() ); + nBot = std::max( nBot, pSh->VisArea().Height() ); } // #i35143# - Assure, that the page // doesn't exceed the defined browse height. - Frm().Height( Min( nBot, BROWSE_HEIGHT ) ); + Frm().Height( std::min( nBot, BROWSE_HEIGHT ) ); } Prt().Left ( pAttrs->CalcLeftLine() + aBorder.Width() ); Prt().Top ( nTop ); @@ -1007,7 +1007,7 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) if ( FLY_AS_CHAR == rFmt.GetAnchor().GetAnchorId() ) { - nMinWidth = Max( nMinWidth, + nMinWidth = std::max( nMinWidth, bFly ? rFmt.GetFrmSize().GetWidth() : pObj->GetObjRect().Width() ); } @@ -1017,8 +1017,8 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) long nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() ); nWidth -= (Prt().*fnRect->fnGetLeft)(); nWidth -= rAttrs.CalcRightLine(); - nWidth = Max( nMinWidth, nWidth ); - (Prt().*fnRect->fnSetWidth)( Min( nWidth, + nWidth = std::max( nMinWidth, nWidth ); + (Prt().*fnRect->fnSetWidth)( std::min( nWidth, (Prt().*fnRect->fnGetWidth)() ) ); } @@ -1026,7 +1026,7 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) { // The PrtArea should already be at least MINLAY wide, matching the // minimal values of the UI - (Prt().*fnRect->fnSetWidth)( Min( long(MINLAY), + (Prt().*fnRect->fnSetWidth)( std::min( long(MINLAY), (Frm().*fnRect->fnGetWidth)() ) ); SwTwips nTmp = (Frm().*fnRect->fnGetWidth)() - (Prt().*fnRect->fnGetWidth)(); diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index 2e0f2226cdfc..a73a8b425973 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -274,7 +274,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew, bAdjustAttributes = sal_True; else { - sal_uInt16 nCount = Min( rNew.GetColumns().size(), rOld.GetColumns().size() ); + sal_uInt16 nCount = std::min( rNew.GetColumns().size(), rOld.GetColumns().size() ); for ( sal_uInt16 i = 0; i < nCount; ++i ) if ( !(rOld.GetColumns()[i] == rNew.GetColumns()[i]) ) { @@ -393,16 +393,16 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttribut { if ( i == 0 ) { - aLR.SetRight( Max( nRight, nMin ) ); + aLR.SetRight( std::max( nRight, nMin ) ); } else if ( i == pAttr->GetNumCols() - 1 ) { - aLR.SetLeft ( Max( nLeft, nMin ) ); + aLR.SetLeft ( std::max( nLeft, nMin ) ); } else { - aLR.SetLeft ( Max( nLeft, nMin ) ); - aLR.SetRight( Max( nRight, nMin ) ); + aLR.SetLeft ( std::max( nLeft, nMin ) ); + aLR.SetRight( std::max( nRight, nMin ) ); } } diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index a8bc8fe7b33e..14bfc39b80f6 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1511,7 +1511,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, // former consideration if ( pOwn->IsTxtFrm() ) { - nAdd = Max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace() ); + nAdd = std::max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace() ); } nUpper += nAdd; } @@ -1537,7 +1537,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, } else { - nAdd = Max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) ); + nAdd = std::max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) ); } } nUpper += nAdd; @@ -1545,7 +1545,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, } else { - nUpper = Max( static_cast<long>(nPrevLowerSpace), + nUpper = std::max( static_cast<long>(nPrevLowerSpace), static_cast<long>(pAttrs->GetULSpace().GetUpper()) ); // OD 07.01.2004 #i11859# - consideration of the line spacing // for the upper spacing of a text frame @@ -1553,10 +1553,10 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, { // former consideration if ( pOwn->IsTxtFrm() ) - nUpper = Max( nUpper, ((SwTxtFrm*)pOwn)->GetLineSpace() ); + nUpper = std::max( nUpper, ((SwTxtFrm*)pOwn)->GetLineSpace() ); if ( nPrevLineSpacing != 0 ) { - nUpper = Max( nUpper, nPrevLineSpacing ); + nUpper = std::max( nUpper, nPrevLineSpacing ); } } else @@ -1583,7 +1583,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, } else { - nAdd = Max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) ); + nAdd = std::max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) ); } } nUpper += nAdd; @@ -1709,7 +1709,7 @@ SwTwips SwFlowFrm::_GetUpperSpaceAmountConsideredForPrevFrm() const } else { - nUpperSpaceAmountOfPrevFrm = Max( nPrevLowerSpace, nPrevLineSpacing ); + nUpperSpaceAmountOfPrevFrm = std::max( nPrevLowerSpace, nPrevLineSpacing ); } } } diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 42890b9d051b..f72a1eeb4e4c 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -909,10 +909,10 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, SwRect aNew( GetObjRectWithSpaces() ); SwRect aOld( maFrm ); const SvxULSpaceItem &rUL = ((SwFmtChg*)pOld)->pChangedFmt->GetULSpace(); - aOld.Top( Max( aOld.Top() - long(rUL.GetUpper()), 0L ) ); + aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) ); aOld.SSize().Height()+= rUL.GetLower(); const SvxLRSpaceItem &rLR = ((SwFmtChg*)pOld)->pChangedFmt->GetLRSpace(); - aOld.Left ( Max( aOld.Left() - long(rLR.GetLeft()), 0L ) ); + aOld.Left ( std::max( aOld.Left() - long(rLR.GetLeft()), 0L ) ); aOld.SSize().Width() += rLR.GetRight(); aNew.Union( aOld ); NotifyBackground( FindPageFrm(), aNew, PREP_CLEAR ); @@ -1001,13 +1001,13 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, if ( RES_UL_SPACE == nWhich ) { const SvxULSpaceItem &rUL = *(SvxULSpaceItem*)pNew; - aOld.Top( Max( aOld.Top() - long(rUL.GetUpper()), 0L ) ); + aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) ); aOld.SSize().Height()+= rUL.GetLower(); } else { const SvxLRSpaceItem &rLR = *(SvxLRSpaceItem*)pNew; - aOld.Left ( Max( aOld.Left() - long(rLR.GetLeft()), 0L ) ); + aOld.Left ( std::max( aOld.Left() - long(rLR.GetLeft()), 0L ) ); aOld.SSize().Width() += rLR.GetRight(); } aNew.Union( aOld ); @@ -1459,7 +1459,7 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs ) if ( nAutoWidth ) { if( ATT_MIN_SIZE == rFrmSz.GetWidthSizeType() ) - nNewSize = Max( nNewSize - nLR, nAutoWidth ); + nNewSize = std::max( nNewSize - nLR, nAutoWidth ); else nNewSize = nAutoWidth; } @@ -1949,7 +1949,7 @@ SwTwips SwFlyFrm::_Shrink( SwTwips nDist, sal_Bool bTst ) const SwFmtFrmSize& rFmtSize = GetFmt()->GetFrmSize(); SwTwips nFmtHeight = bVert ? rFmtSize.GetWidth() : rFmtSize.GetHeight(); - nVal = Min( nDist, nHeight - nFmtHeight ); + nVal = std::min( nDist, nHeight - nFmtHeight ); } if ( nVal <= 0L ) @@ -2501,15 +2501,15 @@ Size SwFlyFrm::CalcRel( const SwFmtFrmSize &rSz ) const if ( nDiff > 0 ) nRelHeight -= nDiff; } - nRelWidth = Min( nRelWidth, pRel->Prt().Width() ); - nRelHeight = Min( nRelHeight, pRel->Prt().Height() ); + nRelWidth = std::min( nRelWidth, pRel->Prt().Width() ); + nRelHeight = std::min( nRelHeight, pRel->Prt().Height() ); if( !pRel->IsPageFrm() ) { const SwPageFrm* pPage = FindPageFrm(); if( pPage ) { - nRelWidth = Min( nRelWidth, pPage->Prt().Width() ); - nRelHeight = Min( nRelHeight, pPage->Prt().Height() ); + nRelWidth = std::min( nRelWidth, pPage->Prt().Width() ); + nRelHeight = std::min( nRelHeight, pPage->Prt().Height() ); } } diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index d1bcb832c9b9..41057cdf31d2 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -917,10 +917,10 @@ static sal_uLong lcl_FindCntDiff( const Point &rPt, const SwLayoutFrm *pLay, { //Calculate the distance between those two points. //'delta' X^2 + 'delta' Y^2 = 'distance'^2 - sal_uInt32 dX = Max( pCnt->Frm().Left(), rPt.X() ) - - Min( pCnt->Frm().Left(), rPt.X() ), - dY = Max( pCnt->Frm().Top(), rPt.Y() ) - - Min( pCnt->Frm().Top(), rPt.Y() ); + sal_uInt32 dX = std::max( pCnt->Frm().Left(), rPt.X() ) - + std::min( pCnt->Frm().Left(), rPt.X() ), + dY = std::max( pCnt->Frm().Top(), rPt.Y() ) - + std::min( pCnt->Frm().Top(), rPt.Y() ); BigInt dX1( dX ), dY1( dY ); dX1 *= dX1; dY1 *= dY1; const sal_uLong nDiff = ::SqRt( dX1 + dY1 ); diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index e9522c1de9cd..fece11426d71 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -317,7 +317,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz ) if ( !pHeader || !pHeader->IsHeaderFrm() ) { const long nOld = Frm().Top(); - Frm().Pos().Y() = Max( aClip.Top(), nClipBot - Frm().Height() ); + Frm().Pos().Y() = std::max( aClip.Top(), nClipBot - Frm().Height() ); if ( Frm().Top() != nOld ) bAgain = true; bHeightClipped = sal_True; @@ -326,7 +326,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz ) if ( bRig ) { const long nOld = Frm().Left(); - Frm().Pos().X() = Max( aClip.Left(), nClipRig - Frm().Width() ); + Frm().Pos().X() = std::max( aClip.Left(), nClipRig - Frm().Width() ); if ( Frm().Left() != nOld ) { const SwFmtHoriOrient &rH = GetFmt()->GetHoriOrient(); @@ -441,7 +441,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz ) const long nPrtWidthDiff = Frm().Width() - Prt().Width(); maUnclippedFrm = SwRect( Frm() ); Frm().Height( aFrmRect.Height() ); - Frm().Width ( Max( long(MINLAY), aFrmRect.Width() ) ); + Frm().Width ( std::max( long(MINLAY), aFrmRect.Width() ) ); if ( Lower() && Lower()->IsColumnFrm() ) { ColLock(); //lock grow/shrink diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 51ab0afe3b6e..6fcef9bfeb1d 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2873,8 +2873,8 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld, { SwRect aTmp( rOld ); aTmp.Union( aFrm ); - aTmp.Left( Min(aFrm.Left(), rOld.Left()) ); - aTmp.Right( Max(aFrm.Left(), rOld.Left()) ); + aTmp.Left( std::min(aFrm.Left(), rOld.Left()) ); + aTmp.Right( std::max(aFrm.Left(), rOld.Left()) ); pFly->NotifyBackground( pOld, aTmp, PREP_FLY_CHGD ); } SwTwips nOld = rOld.Right(); @@ -2883,16 +2883,16 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld, { SwRect aTmp( rOld ); aTmp.Union( aFrm ); - aTmp.Left( Min(nNew, nOld) ); - aTmp.Right( Max(nNew, nOld) ); + aTmp.Left( std::min(nNew, nOld) ); + aTmp.Right( std::max(nNew, nOld) ); pFly->NotifyBackground( pOld, aTmp, PREP_FLY_CHGD ); } if ( rOld.Top() != aFrm.Top() ) { SwRect aTmp( rOld ); aTmp.Union( aFrm ); - aTmp.Top( Min(aFrm.Top(), rOld.Top()) ); - aTmp.Bottom( Max(aFrm.Top(), rOld.Top()) ); + aTmp.Top( std::min(aFrm.Top(), rOld.Top()) ); + aTmp.Bottom( std::max(aFrm.Top(), rOld.Top()) ); pFly->NotifyBackground( pOld, aTmp, PREP_FLY_CHGD ); } nOld = rOld.Bottom(); @@ -2901,8 +2901,8 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld, { SwRect aTmp( rOld ); aTmp.Union( aFrm ); - aTmp.Top( Min(nNew, nOld) ); - aTmp.Bottom( Max(nNew, nOld) ); + aTmp.Top( std::min(nNew, nOld) ); + aTmp.Bottom( std::max(nNew, nOld) ); pFly->NotifyBackground( pOld, aTmp, PREP_FLY_CHGD ); } } @@ -3282,8 +3282,8 @@ static SwTwips lcl_CalcCellRstHeight( SwLayoutFrm *pCell ) nLow += ((SwTxtFrm*)pLow)->GetParHeight()-pLow->Prt().Height(); else if( pLow->IsSctFrm() && ((SwSectionFrm*)pLow)->IsUndersized() ) nLow += ((SwSectionFrm*)pLow)->Undersize(); - nFlyAdd = Max( 0L, nFlyAdd - nLow ); - nFlyAdd = Max( nFlyAdd, ::CalcHeightWidthFlys( pLow ) ); + nFlyAdd = std::max( 0L, nFlyAdd - nLow ); + nFlyAdd = std::max( nFlyAdd, ::CalcHeightWidthFlys( pLow ) ); nHeight += nLow; pLow = pLow->GetNext(); } while ( pLow ); @@ -3319,7 +3319,7 @@ SwTwips CalcRowRstHeight( SwLayoutFrm *pRow ) SwLayoutFrm *pLow = (SwLayoutFrm*)pRow->Lower(); while ( pLow ) { - nRstHeight = Min( nRstHeight, ::lcl_CalcCellRstHeight( pLow ) ); + nRstHeight = std::min( nRstHeight, ::lcl_CalcCellRstHeight( pLow ) ); pLow = (SwLayoutFrm*)pLow->GetNext(); } return nRstHeight; diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 673f31046949..ff798b5a2818 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -288,7 +288,7 @@ void SwFtnContFrm::Format( const SwBorderAttrs * ) SwTwips nPrtHeight = (Prt().*fnRect->fnGetHeight)(); if( nPrtHeight < 0 ) { - const SwTwips nTmpDiff = Max( (Prt().*fnRect->fnGetTop)(), + const SwTwips nTmpDiff = std::max( (Prt().*fnRect->fnGetTop)(), -nPrtHeight ); (Prt().*fnRect->fnSubTop)( nTmpDiff ); } @@ -344,7 +344,7 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool ) { if ( pBoss->GetMaxFtnHeight() != LONG_MAX ) { - nDist = Min( nDist, pBoss->GetMaxFtnHeight() + nDist = std::min( nDist, pBoss->GetMaxFtnHeight() - (Frm().*fnRect->fnGetHeight)() ); if ( nDist <= 0 ) return 0L; diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 807a40b14c67..1753d8544e50 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -570,10 +570,10 @@ sal_uLong SwLayHelper::CalcPageCount() nMaxParaPerPage = nNdCount / nPgCount; else { - nMaxParaPerPage = Max( sal_uLong(20), + nMaxParaPerPage = std::max( sal_uLong(20), sal_uLong(20 + nNdCount / 1000 * 3) ); const sal_uLong nMax = 53; - nMaxParaPerPage = Min( nMaxParaPerPage, nMax ); + nMaxParaPerPage = std::min( nMaxParaPerPage, nMax ); nPgCount = nNdCount / nMaxParaPerPage; } if ( nNdCount < 1000 ) @@ -716,7 +716,7 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex ) ++nCnt; pTmp = pTmp->GetNext(); } while( pTmp ); - nMaxRowPerPage = Max( sal_uLong(2), nMaxParaPerPage / nCnt ); + nMaxRowPerPage = std::max( sal_uLong(2), nMaxParaPerPage / nCnt ); } bLongTab = true; } diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 8c5429ab7743..5421332650bb 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -658,8 +658,8 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, ((SwFmtChg*)pNew)->pChangedFmt->GetFrmSize() : (const SwFmtFrmSize&)*pNew; - Frm().Height( Max( rSz.GetHeight(), long(MINLAY) ) ); - Frm().Width ( Max( rSz.GetWidth(), long(MINLAY) ) ); + Frm().Height( std::max( rSz.GetHeight(), long(MINLAY) ) ); + Frm().Width ( std::max( rSz.GetWidth(), long(MINLAY) ) ); if ( GetUpper() ) static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 ); @@ -1769,7 +1769,7 @@ void SwRootFrm::ImplCalcBrowseWidth() ((const SwTabFrm *)pFrm)->GetTable() ->GetHTMLTableLayout(); if ( pLayoutInfo ) - nWidth = Min( nWidth, pLayoutInfo->GetBrowseWidthMin() ); + nWidth = std::min( nWidth, pLayoutInfo->GetBrowseWidthMin() ); switch ( rHori.GetHoriOrient() ) { @@ -1784,7 +1784,7 @@ void SwRootFrm::ImplCalcBrowseWidth() break; } - nBrowseWidth = Max( nBrowseWidth, nWidth ); + nBrowseWidth = std::max( nBrowseWidth, nWidth ); } } else if ( pFrm->GetDrawObjs() ) @@ -1843,7 +1843,7 @@ void SwRootFrm::ImplCalcBrowseWidth() break; default: /* do nothing */; } - nBrowseWidth = Max( nBrowseWidth, nWidth ); + nBrowseWidth = std::max( nBrowseWidth, nWidth ); } } pFrm = pFrm->FindNextCnt(); @@ -2193,7 +2193,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi nWidthRemain = nWidthRemain - nPageWidth; nCurrentRowWidth = nCurrentRowWidth + nPageWidth; - nCurrentRowHeight = Max( nCurrentRowHeight, nPageHeight ); + nCurrentRowHeight = std::max( nCurrentRowHeight, nPageHeight ); pPageFrm = static_cast<SwPageFrm*>(pPageFrm->GetNext()); @@ -2307,8 +2307,8 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi const bool bLastColumn = pPageToAdjust->GetNext() == pEndOfRow; const bool bLastRow = !pEndOfRow; - nMinPageLeft = Min( nMinPageLeft, aNewPagePos.X() ); - nMaxPageRight = Max( nMaxPageRight, aNewPagePos.X() + nCurrentPageWidth); + nMinPageLeft = std::min( nMinPageLeft, aNewPagePos.X() ); + nMaxPageRight = std::max( nMaxPageRight, aNewPagePos.X() + nCurrentPageWidth); // border of nGapBetweenPages around the current page: SwRect aPageRectWithBorders( aNewPagePos.X() - nGapBetweenPages, diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 3e5f308c0a02..45b0fd41214d 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -551,8 +551,8 @@ bool SwLineRect::MakeUnion( const SwRect &rRect ) if ( Bottom() + nAdd >= rRect.Top() && Top() - nAdd <= rRect.Bottom() ) { - Bottom( Max( Bottom(), rRect.Bottom() ) ); - Top ( Min( Top(), rRect.Top() ) ); + Bottom( std::max( Bottom(), rRect.Bottom() ) ); + Top ( std::min( Top(), rRect.Top() ) ); return true; } } @@ -566,8 +566,8 @@ bool SwLineRect::MakeUnion( const SwRect &rRect ) if ( Right() + nAdd >= rRect.Left() && Left() - nAdd <= rRect.Right() ) { - Right( Max( Right(), rRect.Right() ) ); - Left ( Min( Left(), rRect.Left() ) ); + Right( std::max( Right(), rRect.Right() ) ); + Left ( std::min( Left(), rRect.Left() ) ); return true; } } @@ -951,7 +951,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut ) if ( rLRect.IsLocked() ) { - nMinCount = Min( nMinCount, i ); + nMinCount = std::min( nMinCount, i ); continue; } @@ -1015,7 +1015,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut ) if ( rLRect.IsLocked() ) { - nMinCount = Min( nMinCount, i ); + nMinCount = std::min( nMinCount, i ); continue; } @@ -1312,7 +1312,7 @@ static long lcl_AlignWidth( const long nWidth ) const long nW = nWidth % nPixelSzW; if ( !nW || nW > nHalfPixelSzW ) - return Max(1L, nWidth - nHalfPixelSzW); + return std::max(1L, nWidth - nHalfPixelSzW); } return nWidth; } @@ -1324,7 +1324,7 @@ static long lcl_AlignHeight( const long nHeight ) const long nH = nHeight % nPixelSzH; if ( !nH || nH > nHalfPixelSzH ) - return Max(1L, nHeight - nHalfPixelSzH); + return std::max(1L, nHeight - nHalfPixelSzH); } return nHeight; } @@ -1333,7 +1333,7 @@ static long lcl_MinHeightDist( const long nDist ) { if ( aScaleX < aMinDistScale || aScaleY < aMinDistScale ) return nDist; - return ::lcl_AlignHeight( Max( nDist, nMinDistPixelH )); + return ::lcl_AlignHeight( std::max( nDist, nMinDistPixelH )); } //Calculate PrtArea plus surrounding plus shadow. @@ -2374,8 +2374,8 @@ void SwTabFrmPainter::PaintLines( OutputDevice& rDev, const SwRect& rRect ) cons // The following stuff if necessary to have the new table borders fit // into a ::SwAlignRect adjusted world. - const SwTwips nTwipXCorr = bVert ? 0 : Max( 0L, nHalfPixelSzW - 2 ); // 1 < 2 < 3 ;-) - const SwTwips nTwipYCorr = !bVert ? 0 : Max( 0L, nHalfPixelSzW - 2 ); // 1 < 2 < 3 ;-) + const SwTwips nTwipXCorr = bVert ? 0 : std::max( 0L, nHalfPixelSzW - 2 ); // 1 < 2 < 3 ;-) + const SwTwips nTwipYCorr = !bVert ? 0 : std::max( 0L, nHalfPixelSzW - 2 ); // 1 < 2 < 3 ;-) const SwFrm* pUpper = mrTabFrm.GetUpper(); SwRect aUpper( pUpper->Prt() ); aUpper.Pos() += pUpper->Frm().Pos(); @@ -2457,11 +2457,11 @@ void SwTabFrmPainter::PaintLines( OutputDevice& rDev, const SwRect& rRect ) cons sal_uInt16 nSecn = aStyles[ i ].Secn(); if ( nPrim > 0 ) - nPrim = (sal_uInt16)( Max( 1L, nPixelSzH * ( nPrim / nPixelSzH ) ) ); + nPrim = (sal_uInt16)( std::max( 1L, nPixelSzH * ( nPrim / nPixelSzH ) ) ); if ( nDist > 0 ) - nDist = (sal_uInt16)( Max( 1L, nPixelSzH * ( nDist / nPixelSzH ) ) ); + nDist = (sal_uInt16)( std::max( 1L, nPixelSzH * ( nDist / nPixelSzH ) ) ); if ( nSecn > 0 ) - nSecn = (sal_uInt16)( Max( 1L, nPixelSzH * ( nSecn / nPixelSzH ) ) ); + nSecn = (sal_uInt16)( std::max( 1L, nPixelSzH * ( nSecn / nPixelSzH ) ) ); aStyles[ i ].Set( nPrim, nDist, nSecn ); } @@ -5289,8 +5289,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const if( bGrid ) { nY -= nGrid; - SwTwips nPosY = Max( aInter.Left(), nY ); - SwTwips nHeight = Min(nRight, aTmp.Pos().X())-nPosY; + SwTwips nPosY = std::max( aInter.Left(), nY ); + SwTwips nHeight = std::min(nRight, aTmp.Pos().X())-nPosY; if( nHeight > 0 ) { if( bCell ) @@ -5322,8 +5322,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const nY -= nRuby; if( bBorder ) { - SwTwips nPos = Max( aInter.Left(), nY ); - SwTwips nW = Min(nRight, aTmp.Pos().X()) - nPos; + SwTwips nPos = std::max( aInter.Left(), nY ); + SwTwips nW = std::min(nRight, aTmp.Pos().X()) - nPos; SwRect aVert( Point( nPos, aGrid.Top() ), Size( nW, 1 ) ); if( nW > 0 ) @@ -5348,7 +5348,7 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const { nY -= nGrid; SwTwips nHeight = aTmp.Pos().X() - - Max(aInter.Left(), nY ); + - std::max(aInter.Left(), nY ); if( nHeight > 0 ) { if( bCell ) @@ -5380,8 +5380,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const nY -= nRuby; if( bBorder ) { - SwTwips nPos = Max( aInter.Left(), nY ); - SwTwips nW = Min(nRight, aTmp.Pos().X()) - nPos; + SwTwips nPos = std::max( aInter.Left(), nY ); + SwTwips nW = std::min(nRight, aTmp.Pos().X()) - nPos; SwRect aVert( Point( nPos, aGrid.Top() ), Size( nW, 1 ) ); if( nW > 0 ) @@ -5420,8 +5420,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const if( bGrid ) { nY += nGrid; - SwTwips nPosY = Max( aInter.Top(), aTmp.Pos().Y() ); - SwTwips nHeight = Min(nBottom, nY ) - nPosY; + SwTwips nPosY = std::max( aInter.Top(), aTmp.Pos().Y() ); + SwTwips nHeight = std::min(nBottom, nY ) - nPosY; if( nHeight ) { if( bCell ) @@ -5453,8 +5453,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const nY += nRuby; if( bBorder ) { - SwTwips nPos = Max(aInter.Top(),aTmp.Pos().Y()); - SwTwips nH = Min( nBottom, nY ) - nPos; + SwTwips nPos = std::max(aInter.Top(),aTmp.Pos().Y()); + SwTwips nH = std::min( nBottom, nY ) - nPos; SwRect aVert( Point( aGrid.Left(), nPos ), Size( 1, nH ) ); if( nH > 0 ) @@ -5478,7 +5478,7 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const if( bGrid ) { nY += nGrid; - SwTwips nHeight = Min(nBottom, nY) - aTmp.Pos().Y(); + SwTwips nHeight = std::min(nBottom, nY) - aTmp.Pos().Y(); if( nHeight ) { if( bCell ) @@ -5510,8 +5510,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const nY += nRuby; if( bBorder ) { - SwTwips nPos = Max(aInter.Top(),aTmp.Pos().Y()); - SwTwips nH = Min( nBottom, nY ) - nPos; + SwTwips nPos = std::max(aInter.Top(),aTmp.Pos().Y()); + SwTwips nH = std::min( nBottom, nY ) - nPos; SwRect aVert( Point( aGrid.Left(), nPos ), Size( 1, nH ) ); if( nH > 0 ) diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 12d831bc34d4..dde50560d6d5 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -563,13 +563,13 @@ static void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine, SwBorderAttrAccess aAccess( SwFrm::GetCache(), pCell ); const SwBorderAttrs &rAttrs = *aAccess.Get(); - nMinHeight = Max( nMinHeight, lcl_CalcTopAndBottomMargin( *(SwLayoutFrm*)pCell, rAttrs ) ); + nMinHeight = std::max( nMinHeight, lcl_CalcTopAndBottomMargin( *(SwLayoutFrm*)pCell, rAttrs ) ); pCell = pCell->GetNext(); } const SwFmtFrmSize &rSz = pTmpLastLineRow->GetFmt()->GetFrmSize(); if ( rSz.GetHeightSizeType() == ATT_MIN_SIZE ) - nMinHeight = Max( nMinHeight, rSz.GetHeight() ); + nMinHeight = std::max( nMinHeight, rSz.GetHeight() ); } // @@ -2741,7 +2741,7 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper, const long nWidth = (*fnRect->fnXDiff)( (aFlyRect.*fnRect->fnGetRight)(), (pFly->GetAnchorFrm()->Frm().*fnRect->fnGetLeft)() ); - rLeftOffset = Max( rLeftOffset, nWidth ); + rLeftOffset = std::max( rLeftOffset, nWidth ); bInvalidatePrtArea = sal_True; } if ( (SURROUND_LEFT == rSur.GetSurround() || @@ -2751,7 +2751,7 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper, const long nWidth = (*fnRect->fnXDiff)( (pFly->GetAnchorFrm()->Frm().*fnRect->fnGetRight)(), (aFlyRect.*fnRect->fnGetLeft)() ); - rRightOffset = Max( rRightOffset, nWidth ); + rRightOffset = std::max( rRightOffset, nWidth ); bInvalidatePrtArea = sal_True; } } @@ -2798,7 +2798,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) nLeftOffset = 0; if( CalcFlyOffsets( nUpper, nLeftOffset, nTmpRight ) ) mbValidPrtArea = sal_False; - long nRightOffset = Max( 0L, nTmpRight ); + long nRightOffset = std::max( 0L, nTmpRight ); SwTwips nLower = pAttrs->CalcBottomLine(); // #i29550# @@ -2853,7 +2853,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) // surrounding fly frames on the right // -> right indent is maximun of given right offset // and wished right offset. - nRightSpacing = nRightLine + Max( nRightOffset, nWishRight ); + nRightSpacing = nRightLine + std::max( nRightOffset, nWishRight ); } else { @@ -2865,7 +2865,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) nRightSpacing = nRightLine + ( ( (nWishRight+nLeftOffset) < 0 ) ? (nWishRight+nLeftOffset) : - Max( 0L, nWishRight ) ); + std::max( 0L, nWishRight ) ); } } break; @@ -2884,7 +2884,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) // surrounding fly frames on the left // -> right indent is maximun of given left offset // and wished left offset. - nLeftSpacing = nLeftLine + Max( nLeftOffset, nWishLeft ); + nLeftSpacing = nLeftLine + std::max( nLeftOffset, nWishLeft ); } else { @@ -2896,7 +2896,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) nLeftSpacing = nLeftLine + ( ( (nWishLeft+nRightOffset) < 0 ) ? (nWishLeft+nRightOffset) : - Max( 0L, nWishLeft ) ); + std::max( 0L, nWishLeft ) ); } } break; @@ -2907,11 +2907,11 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) const SwTwips nCenterSpacing = ( nMax - nWishedTableWidth ) / 2; nLeftSpacing = nLeftLine + ( (nLeftOffset > 0) ? - Max( nCenterSpacing, nLeftOffset ) : + std::max( nCenterSpacing, nLeftOffset ) : nCenterSpacing ); nRightSpacing = nRightLine + ( (nRightOffset > 0) ? - Max( nCenterSpacing, nRightOffset ) : + std::max( nCenterSpacing, nRightOffset ) : nCenterSpacing ); } break; @@ -2934,7 +2934,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) // they overlap with the table. // Thus, take maximun of left spacing and left offset. // OD 10.03.2003 #i9040# - consider left line attribute. - nLeftSpacing = Max( nLeftSpacing, ( nLeftOffset + nLeftLine ) ); + nLeftSpacing = std::max( nLeftSpacing, ( nLeftOffset + nLeftLine ) ); } // OD 23.01.2003 #106895# - add 1st param to <SwBorderAttrs::CalcRight(..)> nRightSpacing = pAttrs->CalcRight( this ); @@ -2944,7 +2944,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) // they overlap with the table. // Thus, take maximun of right spacing and right offset. // OD 10.03.2003 #i9040# - consider right line attribute. - nRightSpacing = Max( nRightSpacing, ( nRightOffset + nRightLine ) ); + nRightSpacing = std::max( nRightSpacing, ( nRightOffset + nRightLine ) ); } } break; @@ -2960,14 +2960,14 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) // they overlap with the table. // Thus, take maximun of right spacing and right offset. // OD 10.03.2003 #i9040# - consider left line attribute. - nLeftSpacing = Max( nLeftSpacing, ( pAttrs->CalcLeftLine() + nLeftOffset ) ); + nLeftSpacing = std::max( nLeftSpacing, ( pAttrs->CalcLeftLine() + nLeftOffset ) ); } // OD 10.03.2003 #i9040# - consider right and left line attribute. const SwTwips nWishRight = nMax - (nLeftSpacing-pAttrs->CalcLeftLine()) - nWishedTableWidth; nRightSpacing = nRightLine + ( (nRightOffset > 0) ? - Max( nWishRight, nRightOffset ) : + std::max( nWishRight, nRightOffset ) : nWishRight ); } break; @@ -3000,7 +3000,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) long nWidth = pSh->GetBrowseWidth(); nWidth -= Prt().Left(); nWidth -= pAttrs->CalcRightLine(); - Prt().Width( Min( nWidth, Prt().Width() ) ); + Prt().Width( std::min( nWidth, Prt().Width() ) ); } if ( nOldHeight != (Prt().*fnRect->fnGetHeight)() ) @@ -3067,7 +3067,7 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) if ( IsRestrictTableGrowth() ) { - nTmp = Min( nDist, nReal + nTmp ); + nTmp = std::min( nDist, nReal + nTmp ); nDist = nTmp < 0 ? 0 : nTmp; } } @@ -3415,7 +3415,7 @@ sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &r long nOldWidth = (GetUpper()->Prt().*fnRect->fnGetWidth)(); SWRECTFNX( pNewUpper ); long nNewWidth = (pNewUpper->Prt().*fnRectX->fnGetWidth)(); - if( Abs( nNewWidth - nOldWidth ) < 2 ) + if( std::abs( nNewWidth - nOldWidth ) < 2 ) { if( !( bMoveAnyway = (BwdMoveNecessary( pOldPage, Frm() ) > 1) ) ) { @@ -3835,7 +3835,7 @@ long CalcHeightWidthFlys( const SwFrm *pFrm ) (pTmp->Frm().*fnRect->fnGetTop)(), (pFrm->Frm().*fnRect->fnGetTop)() ); - nHeight = Max( nHeight, nDistOfFlyBottomToAnchorTop + nFrmDiff - + nHeight = std::max( nHeight, nDistOfFlyBottomToAnchorTop + nFrmDiff - (pFrm->Frm().*fnRect->fnGetHeight)() ); // #i56115# The first height calculation @@ -3849,7 +3849,7 @@ long CalcHeightWidthFlys( const SwFrm *pFrm ) (pAnchoredObj->GetObjRect().*fnRect->fnGetBottom)(), (pFrm->Frm().*fnRect->fnGetBottom)() ); - nHeight = Max( nHeight, nDistOfFlyBottomToAnchorTop2 ); + nHeight = std::max( nHeight, nDistOfFlyBottomToAnchorTop2 ); } } } @@ -3925,8 +3925,8 @@ static SwTwips lcl_CalcMinCellHeight( const SwLayoutFrm *_pCell, // #i26945# if ( _bConsiderObjs ) { - nFlyAdd = Max( 0L, nFlyAdd - nLowHeight ); - nFlyAdd = Max( nFlyAdd, ::CalcHeightWidthFlys( pLow ) ); + nFlyAdd = std::max( 0L, nFlyAdd - nLowHeight ); + nFlyAdd = std::max( nFlyAdd, ::CalcHeightWidthFlys( pLow ) ); } } @@ -4006,7 +4006,7 @@ static SwTwips lcl_CalcMinRowHeight( const SwRowFrm* _pRow, pLow = static_cast<const SwCellFrm*>(pLow->GetNext()); } if ( rSz.GetHeightSizeType() == ATT_MIN_SIZE && !_pRow->IsRowSpanLine() ) - nHeight = Max( nHeight, rSz.GetHeight() ); + nHeight = std::max( nHeight, rSz.GetHeight() ); return nHeight; } @@ -4028,7 +4028,7 @@ static sal_uInt16 lcl_GetTopSpace( const SwRowFrm& rRow ) const SvxBoxItem& rBoxItem = rSet.GetBox(); nTmpTopSpace = rBoxItem.CalcLineSpace( BOX_LINE_TOP, sal_True ); } - nTopSpace = Max( nTopSpace, nTmpTopSpace ); + nTopSpace = std::max( nTopSpace, nTmpTopSpace ); } return nTopSpace; } @@ -4049,7 +4049,7 @@ static sal_uInt16 lcl_GetTopLineDist( const SwRowFrm& rRow ) const SvxBoxItem& rBoxItem = rSet.GetBox(); nTmpTopLineDist = rBoxItem.GetDistance( BOX_LINE_TOP ); } - nTopLineDist = Max( nTopLineDist, nTmpTopLineDist ); + nTopLineDist = std::max( nTopLineDist, nTmpTopLineDist ); } return nTopLineDist; } @@ -4074,7 +4074,7 @@ static sal_uInt16 lcl_GetBottomLineSize( const SwRowFrm& rRow ) nTmpBottomLineSize = rBoxItem.CalcLineSpace( BOX_LINE_BOTTOM, sal_True ) - rBoxItem.GetDistance( BOX_LINE_BOTTOM ); } - nBottomLineSize = Max( nBottomLineSize, nTmpBottomLineSize ); + nBottomLineSize = std::max( nBottomLineSize, nTmpBottomLineSize ); } return nBottomLineSize; } @@ -4098,7 +4098,7 @@ static sal_uInt16 lcl_GetBottomLineDist( const SwRowFrm& rRow ) const SvxBoxItem& rBoxItem = rSet.GetBox(); nTmpBottomLineDist = rBoxItem.GetDistance( BOX_LINE_BOTTOM ); } - nBottomLineDist = Max( nBottomLineDist, nTmpBottomLineDist ); + nBottomLineDist = std::max( nBottomLineDist, nTmpBottomLineDist ); } return nBottomLineDist; } @@ -4447,7 +4447,7 @@ SwTwips SwRowFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) (Frm().*fnRect->fnBottomDist)( (GetUpper()->GetUpper()->*fnRect->fnGetPrtBottom)() ); if ( bRestrictTableGrowth && nAdditionalSpace > 0 ) { - nReal = Min( nAdditionalSpace, nDist ); + nReal = std::min( nAdditionalSpace, nDist ); nDist -= nReal; if ( !bTst ) (Frm().*fnRect->fnAddBottom)( nReal ); @@ -5589,7 +5589,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const if ( 1 == pLower2->GetTabBox()->getRowSpan() ) { const SwTwips nCellHeight = lcl_CalcMinCellHeight( pLower2, sal_True ); - nMaxHeight = Max( nCellHeight, nMaxHeight ); + nMaxHeight = std::max( nCellHeight, nMaxHeight ); } pLower2 = static_cast<const SwCellFrm*>(pLower2->GetNext()); } @@ -5616,7 +5616,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const const SwTwips nMinRowHeight = rSz.GetHeightSizeType() == ATT_MIN_SIZE ? rSz.GetHeight() : 0; - nTmpHeight += Max( nHeightOfFirstContentLine, nMinRowHeight ); + nTmpHeight += std::max( nHeightOfFirstContentLine, nMinRowHeight ); if ( !bOldJoinLock ) ((SwTabFrm*)this)->UnlockJoin(); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 8f4f0bef6a7e..eee460fa5041 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -204,10 +204,10 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, // check, if we have to adjust the point if ( !Frm().IsInside( aPoint ) ) { - aPoint.X() = Max( aPoint.X(), Frm().Left() ); - aPoint.X() = Min( aPoint.X(), Frm().Right() ); - aPoint.Y() = Max( aPoint.Y(), Frm().Top() ); - aPoint.Y() = Min( aPoint.Y(), Frm().Bottom() ); + aPoint.X() = std::max( aPoint.X(), Frm().Left() ); + aPoint.X() = std::min( aPoint.X(), Frm().Right() ); + aPoint.Y() = std::max( aPoint.Y(), Frm().Top() ); + aPoint.Y() = std::min( aPoint.Y(), Frm().Bottom() ); } sal_Bool bTextRet, bBackRet = sal_False; @@ -1197,10 +1197,10 @@ sal_uLong CalcDiff( const Point &rPt1, const Point &rPt2 ) { //Jetzt die Entfernung zwischen den beiden Punkten berechnen. //'Delta' X^2 + 'Delta'Y^2 = 'Entfernung'^2 - sal_uInt32 dX = Max( rPt1.X(), rPt2.X() ) - - Min( rPt1.X(), rPt2.X() ), - dY = Max( rPt1.Y(), rPt2.Y() ) - - Min( rPt1.Y(), rPt2.Y() ); + sal_uInt32 dX = std::max( rPt1.X(), rPt2.X() ) - + std::min( rPt1.X(), rPt2.X() ), + dY = std::max( rPt1.Y(), rPt2.Y() ) - + std::min( rPt1.Y(), rPt2.Y() ); BigInt dX1( dX ), dY1( dY ); dX1 *= dX1; dY1 *= dY1; return ::SqRt( dX1 + dY1 ); diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 8c65279a6921..de45f50dad6e 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -1384,7 +1384,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst ) if ( nDiff > 0 ) { nChg = BROWSE_HEIGHT - pUp->Frm().Height(); - nChg = Min( nDiff, nChg ); + nChg = std::min( nDiff, nChg ); if ( !IsBodyFrm() ) { @@ -1396,7 +1396,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst ) const long nTmp = nChg - pBody->Prt().Height(); if ( !bTst ) { - pBody->Frm().Height(Max( 0L, pBody->Frm().Height() - nChg )); + pBody->Frm().Height(std::max( 0L, pBody->Frm().Height() - nChg )); pBody->_InvalidatePrt(); pBody->_InvalidateSize(); if ( pBody->GetNext() ) @@ -3136,7 +3136,7 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs ) pFrm = pFrm->GetNext(); } nRemaining += nBorder; - nRemaining = Max( nRemaining, nMinHeight ); + nRemaining = std::max( nRemaining, nMinHeight ); const SwTwips nDiff = nRemaining-(Frm().*fnRect->fnGetHeight)(); const long nOldLeft = (Frm().*fnRect->fnGetLeft)(); const long nOldTop = (Frm().*fnRect->fnGetTop)(); @@ -3267,7 +3267,7 @@ long SwLayoutFrm::CalcRel( const SwFmtFrmSize &rSz, sal_Bool ) const if ( nDiff > 0 ) nRel -= nDiff; } - nRel = Min( nRel, pRel->Prt().Width() ); + nRel = std::min( nRel, pRel->Prt().Width() ); nRet = nRel * nPercent / 100; } return nRet; @@ -3294,7 +3294,7 @@ static long lcl_CalcMinColDiff( SwLayoutFrm *pLayFrm ) if ( pCol == pLayFrm->Lower() ) nFirstDiff = nTmp; else - nDiff = nDiff ? Min( nDiff, nTmp ) : nTmp; + nDiff = nDiff ? std::min( nDiff, nTmp ) : nTmp; } } //Skip empty columns! @@ -3565,7 +3565,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs, nDiff = nMinDiff; // If we should grow more than by nMinDiff we split it over // the columns - if ( Abs(nDiff - nMinDiff) > nNumCols && nDiff > (long)nNumCols ) + if ( std::abs(nDiff - nMinDiff) > nNumCols && nDiff > (long)nNumCols ) nDiff /= nNumCols; if ( bMinDiff ) @@ -3576,7 +3576,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs, // nMinDiff afterwards. long nFrmHeight = (Frm().*fnRect->fnGetHeight)(); if ( nFrmHeight > nMinHeight || nPrtHeight >= nMinDiff ) - nDiff = Max( nDiff, nMinDiff ); + nDiff = std::max( nDiff, nMinDiff ); else if( nDiff < nMinDiff ) nDiff = nMinDiff - nPrtHeight + 1; } diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 0b54d93c9198..c0ef98a7e8cf 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -433,7 +433,7 @@ static void lcl_RefreshHidden( SwTabCols &rToFill, sal_uInt16 nPos ) { for ( sal_uInt16 i = 0; i < rToFill.Count(); ++i ) { - if ( Abs((long)(nPos - rToFill[i])) <= COLFUZZY ) + if ( std::abs((long)(nPos - rToFill[i])) <= COLFUZZY ) { rToFill.SetHidden( i, sal_False ); break; diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 46a064e970b3..940c9406a4cf 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -209,8 +209,8 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, // nMaxY is an absolute value //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin SwTwips nMaxY = bVert ? - ( bVertL2R ? Min( nFrmMaxY, nUpperMaxY ) : Max( nFrmMaxY, nUpperMaxY ) ) : - Min( nFrmMaxY, nUpperMaxY ); + ( bVertL2R ? std::min( nFrmMaxY, nUpperMaxY ) : std::max( nFrmMaxY, nUpperMaxY ) ) : + std::min( nFrmMaxY, nUpperMaxY ); sal_Bool bRet = sal_False; @@ -384,8 +384,8 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const // nMaxY is in absolute value //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin SwTwips nMaxY = bVert ? - ( bVertL2R ? Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) : Max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) ) : - Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ); + ( bVertL2R ? std::min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) : std::max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) ) : + std::min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ); if ( pFrm->IsEmpty() || ! (pFrm->Prt().*fnRect->fnGetHeight)() ) { @@ -1283,7 +1283,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, { if( nFormat <= GetOfst() ) { - nFormat = Min( xub_StrLen( GetOfst() + MIN_OFFSET_STEP ), + nFormat = std::min( xub_StrLen( GetOfst() + MIN_OFFSET_STEP ), static_cast<xub_StrLen>(nTmpLen) ); if( nFormat <= GetOfst() ) break; @@ -1444,7 +1444,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const if( nLineHeight ) { const SvxULSpaceItem &rUL = pSet->GetULSpace(); - SwTwips nDist = Max( rUL.GetLower(), rUL.GetUpper() ); + SwTwips nDist = std::max( rUL.GetLower(), rUL.GetUpper() ); if( rFill.Fill().nColumnCnt ) { rFill.aFrm.Height( nLineHeight ); @@ -1455,7 +1455,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const nFirst = nFirst - (sal_uInt16)nDist; else nFirst = 0; - nDist = Max( nDist, long( GetLineSpace() ) ); + nDist = std::max( nDist, long( GetLineSpace() ) ); nDist += nLineHeight; nDiff -= nFirst; @@ -1681,8 +1681,8 @@ static sal_Char const sDoubleSpace[] = " "; rFill.SetSpace( nSpaceCnt ); if( bFill ) { - if( Abs( rFill.X() - nCenter ) <= - Abs( rFill.X() - rRect.Left() ) ) + if( std::abs( rFill.X() - nCenter ) <= + std::abs( rFill.X() - rRect.Left() ) ) { rFill.SetOrient( text::HoriOrientation::CENTER ); rFill.SetTab( 0 ); diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 1b1081651c05..4bd5c03da780 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -483,7 +483,7 @@ void SwTxtFrm::AdjustFrm( const SwTwips nChgHght, sal_Bool bHasToFit ) ( IsInSct() && !FindSctFrm()->MoveAllowed(this) ) ) { SetUndersized( sal_True ); - Shrink( Min( ( nFrmHeight - nRstHeight), nPrtHeight ) ); + Shrink( std::min( ( nFrmHeight - nRstHeight), nPrtHeight ) ); } else SetUndersized( sal_False ); @@ -1182,14 +1182,14 @@ sal_Bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const sal_Bool bPrev ) rLine.SetUnclipped( sal_False ); } } - SwTwips nRght = Max( nOldWidth, pNew->Width() + + SwTwips nRght = std::max( nOldWidth, pNew->Width() + pNew->GetHangingMargin() ); ViewShell *pSh = getRootFrm()->GetCurrShell(); const SwViewOption *pOpt = pSh ? pSh->GetViewOptions() : 0; if( pOpt && (pOpt->IsParagraph() || pOpt->IsLineBreak()) ) - nRght += ( Max( nOldAscent, pNew->GetAscent() ) ); + nRght += ( std::max( nOldAscent, pNew->GetAscent() ) ); else - nRght += ( Max( nOldAscent, pNew->GetAscent() ) / 4); + nRght += ( std::max( nOldAscent, pNew->GetAscent() ) / 4); nRght += rLine.GetLeftMargin(); if( rRepaint.GetOfst() || rRepaint.GetRightOfst() < nRght ) rRepaint.SetRightOfst( nRght ); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 489ef87d7caa..5adc1c5a1cda 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -197,7 +197,7 @@ void ChkOutDev( const SwTxtSizeInfo &rInf ) inline sal_Int32 GetMinLen( const SwTxtSizeInfo &rInf ) { const sal_Int32 nInfLen = rInf.GetIdx() + rInf.GetLen(); - return Min( rInf.GetTxt().getLength(), nInfLen ); + return std::min( rInf.GetTxt().getLength(), nInfLen ); } @@ -1263,7 +1263,7 @@ sal_Bool SwTxtFormatInfo::InitHyph( const sal_Bool bAutoHyphen ) nHyphStart = nHyphWrdStart = STRING_LEN; nHyphWrdLen = 0; - const sal_Int16 nMinimalLeading = Max(rAttr.GetMinLead(), sal_uInt8(2)); + const sal_Int16 nMinimalLeading = std::max(rAttr.GetMinLead(), sal_uInt8(2)); const sal_Int16 nMinimalTrailing = rAttr.GetMinTrail(); lcl_InitHyphValues( aHyphVals, nMinimalLeading, nMinimalTrailing); } diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index cd011028cf6f..d95ee5500f49 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -922,7 +922,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd if ( cChar == CH_BREAK ) { - nWidth = Max( nWidth, nProWidth ); + nWidth = std::max( nWidth, nProWidth ); nProWidth = 0; nIdx++; } @@ -973,7 +973,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd } // end of while } - nWidth = Max( nWidth, nProWidth ); + nWidth = std::max( nWidth, nProWidth ); // search for a text frame this node belongs to SwIterator<SwTxtFrm,SwTxtNode> aFrmIter( *this ); diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index e13bb5595bb3..b68b5ce3ea21 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -219,7 +219,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) else { nLeft = pFrm->Frm().Left() + - Max( long( rSpace.GetTxtLeft() + nLMWithNum ), + std::max( long( rSpace.GetTxtLeft() + nLMWithNum ), pFrm->Prt().Left() ); } } @@ -308,7 +308,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) else { nFirst = pFrm->Frm().Left() + - Max( rSpace.GetTxtLeft() + nLMWithNum+ nFirstLineOfs, + std::max( rSpace.GetTxtLeft() + nLMWithNum+ nFirstLineOfs, pFrm->Prt().Left() ); } diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index ff8332c71cb9..56dcbefea2f8 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -674,7 +674,7 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf ) ( nSumWidth - 1 ) / nGridWidth + 1 : 0; const SwTwips nTmpWidth = i * nGridWidth; - const SwTwips nKernWidth = Min( (SwTwips)(nTmpWidth - nSumWidth), + const SwTwips nKernWidth = std::min( (SwTwips)(nTmpWidth - nSumWidth), nRestWidth ); const sal_uInt16 nKernWidth_1 = (sal_uInt16)(nKernWidth / 2); @@ -916,15 +916,15 @@ SwTxtPortion *SwTxtFormatter::NewTxtPortion( SwTxtFormatInfo &rInf ) // until next attribute change: const sal_Int32 nNextAttr = GetNextAttr(); - sal_Int32 nNextChg = Min( nNextAttr, rInf.GetTxt().getLength() ); + sal_Int32 nNextChg = std::min( nNextAttr, rInf.GetTxt().getLength() ); // end of script type: const sal_Int32 nNextScript = pScriptInfo->NextScriptChg( rInf.GetIdx() ); - nNextChg = Min( nNextChg, nNextScript ); + nNextChg = std::min( nNextChg, nNextScript ); // end of direction: const sal_Int32 nNextDir = pScriptInfo->NextDirChg( rInf.GetIdx() ); - nNextChg = Min( nNextChg, nNextDir ); + nNextChg = std::min( nNextChg, nNextDir ); // Turbo boost: // We assume that a font's characters are not larger than twice @@ -943,13 +943,13 @@ SwTxtPortion *SwTxtFormatter::NewTxtPortion( SwTxtFormatInfo &rInf ) CalcAscent( rInf, pPor ); const SwFont* pTmpFnt = rInf.GetFont(); - sal_Int32 nExpect = Min( sal_Int32( ((Font *)pTmpFnt)->GetSize().Height() ), + sal_Int32 nExpect = std::min( sal_Int32( ((Font *)pTmpFnt)->GetSize().Height() ), sal_Int32( pPor->GetAscent() ) ) / 8; if ( !nExpect ) nExpect = 1; nExpect = rInf.GetIdx() + ((rInf.Width() - rInf.X()) / nExpect); if( nExpect > rInf.GetIdx() && nNextChg > nExpect ) - nNextChg = Min( nExpect, rInf.GetTxt().getLength() ); + nNextChg = std::min( nExpect, rInf.GetTxt().getLength() ); // we keep an invariant during method calls: // there are no portion ending characters like hard spaces @@ -2524,7 +2524,7 @@ SwFlyCntPortion *SwTxtFormatter::NewFlyCntPortion( SwTxtFormatInfo &rInf, pFly->GetRefPoint().Y() ); if ( bUseFlyAscent ) - nAscent = static_cast<sal_uInt16>( Abs( int( bTxtFrmVertical ? + nAscent = static_cast<sal_uInt16>( std::abs( int( bTxtFrmVertical ? pFly->GetRelPos().X() : pFly->GetRelPos().Y() ) ) ); @@ -2601,7 +2601,7 @@ namespace { // something of our text has moved to the next line return 0; - xub_StrLen nReformat = Min( txtFmtInfo.GetReformatStart(), nOldLineEnd ); + xub_StrLen nReformat = std::min( txtFmtInfo.GetReformatStart(), nOldLineEnd ); // in case we do not have any fly in our line, our repaint position // is the changed position - 1 @@ -2662,7 +2662,7 @@ namespace { rThis.GetCharRect( &aRect, nReformat ); txtFmtInfo.SetMulti( bOldMulti ); - return nFormatRepaint ? Min( aRect.Left(), nFormatRepaint ) : + return nFormatRepaint ? std::min( aRect.Left(), nFormatRepaint ) : aRect.Left(); } else diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index f8cd59f64109..185979f05c46 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -179,7 +179,7 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip, SwLinePortion *pPor = bEndPor ? pCurr->GetFirstPortion() : CalcPaintOfst( rPaint ); // Optimierung! - const SwTwips nMaxRight = Min( rPaint.Right(), Right() ); + const SwTwips nMaxRight = std::min( rPaint.Right(), Right() ); const SwTwips nTmpLeft = GetInfo().X(); if( !bEndPor && nTmpLeft >= nMaxRight ) return; diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 496b07b5ed86..37c3ce031da4 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -242,7 +242,7 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf ) ubidi_getLogicalRun( pBidi, 0, &nEnd, &nCurrDir ); ubidi_close( pBidi ); const xub_StrLen nNextDirChg = (xub_StrLen)nEnd; - nNextScriptChg = Min( nNextScriptChg, nNextDirChg ); + nNextScriptChg = std::min( nNextScriptChg, nNextDirChg ); // #i89825# change the script type also to CTL // if there is no strong LTR char in the LTR run (numbers) @@ -927,7 +927,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const return; } Point aPos( rInf.X() + GRFNUM_SECURE, rInf.Y() - GetRelPos() + GRFNUM_SECURE ); - long nTmpWidth = Max( (long)0, (long)(nFixWidth - 2 * GRFNUM_SECURE) ); + long nTmpWidth = std::max( (long)0, (long)(nFixWidth - 2 * GRFNUM_SECURE) ); Size aSize( nTmpWidth, GetGrfHeight() - 2 * GRFNUM_SECURE ); const bool bTmpLeft = mbLabelAlignmentPosAndSpaceModeActive || diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx index bc20492975f9..d6d481fa934f 100644 --- a/sw/source/core/text/porglue.cxx +++ b/sw/source/core/text/porglue.cxx @@ -132,7 +132,7 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const void SwGluePortion::MoveGlue( SwGluePortion *pTarget, const short nPrtGlue ) { - short nPrt = Min( nPrtGlue, GetPrtGlue() ); + short nPrt = std::min( nPrtGlue, GetPrtGlue() ); if( 0 < nPrt ) { pTarget->AddPrtWidth( nPrt ); diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 3cd2b6bc054c..b820b8bbb3eb 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -577,14 +577,14 @@ void SwLineLayout::MaxAscentDescent( SwTwips& _orAscent, if ( bFlyCmp ) { - _orObjAscent = Max( _orObjAscent, nPortionAsc ); - _orObjDescent = Max( _orObjDescent, nPortionDesc ); + _orObjAscent = std::max( _orObjAscent, nPortionAsc ); + _orObjDescent = std::max( _orObjDescent, nPortionDesc ); } if ( !pTmpPortion->IsFlyCntPortion() && !pTmpPortion->IsGrfNumPortion() ) { - _orAscent = Max( _orAscent, nPortionAsc ); - _orDescent = Max( _orDescent, nPortionDesc ); + _orAscent = std::max( _orAscent, nPortionAsc ); + _orDescent = std::max( _orDescent, nPortionDesc ); } } pTmpPortion = pTmpPortion->GetPortion(); @@ -883,7 +883,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) else break; } - nChg = Min( nChg, nNextCTLScriptStart ); + nChg = std::min( nChg, nNextCTLScriptStart ); } // special case for dotted circle since it can be used with complex diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index f8c41ba641b7..e5e3901d4b44 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -613,7 +613,7 @@ SwDropPortion *SwTxtFormatter::NewDropPortion( SwTxtFormatInfo &rInf ) // find next attribute change / script change const xub_StrLen nTmpIdx = nNextChg; - sal_Int32 nNextAttr = Min( static_cast<sal_Int32>(GetNextAttr()), rInf.GetTxt().getLength() ); + sal_Int32 nNextAttr = std::min( static_cast<sal_Int32>(GetNextAttr()), rInf.GetTxt().getLength() ); nNextChg = pScriptInfo->NextScriptChg( nTmpIdx ); if( nNextChg > nNextAttr ) nNextChg = nNextAttr; diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 3735e52dead9..54635d759442 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -294,7 +294,7 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt, // fnGetBottom is top + height long nTmpBottom = (rLine.*fnRect->fnGetBottom)(); - Range aRange( Min( nTmpTop, nTmpBottom ), Max( nTmpTop, nTmpBottom ) ); + Range aRange( std::min( nTmpTop, nTmpBottom ), std::max( nTmpTop, nTmpBottom ) ); LongDqPtr pTmp = pTextRanger[ 0 ]->GetTextRanges( aRange ); @@ -972,8 +972,8 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList() pAnchoredObj->GetFrmFmt().GetVertOrient(); if( text::VertOrientation::BOTTOM != rTmpFmt.GetVertOrient() ) nMinBottom = ( bVert && nMinBottom ) ? - Min( nMinBottom, aBound.Left() ) : - Max( nMinBottom, (aBound.*fnRect->fnGetBottom)() ); + std::min( nMinBottom, aBound.Left() ) : + std::max( nMinBottom, (aBound.*fnRect->fnGetBottom)() ); } bOn = sal_True; @@ -1020,7 +1020,7 @@ SwTwips SwTxtFly::CalcMinBottom() const { const SwRect aBound( pAnchoredObj->GetObjRectWithSpaces() ); if( aBound.Top() < nEndOfFrm ) - nRet = Max( nRet, aBound.Bottom() ); + nRet = std::max( nRet, aBound.Bottom() ); } } } diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index e3cb0c05a4c1..3a033366ae65 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -649,7 +649,7 @@ xub_StrLen SwTxtFrm::FindBrk( const XubString &rTxt, { // #i104291# - applying patch to avoid overflow. unsigned long nFound = nStart; - const xub_StrLen nEndLine = Min( nEnd, rTxt.Len() ); + const xub_StrLen nEndLine = std::min( nEnd, rTxt.Len() ); // Wir ueberlesen erst alle Blanks am Anfang der Zeile (vgl. Bug 2235). while( nFound <= nEndLine && @@ -1883,7 +1883,7 @@ SwTestFormat::SwTestFormat( SwTxtFrm* pTxtFrm, const SwFrm* pPre, SwTwips nMaxHe (pFrm->Prt().*fnRect->fnSetPosY)( nUpper ); } (pFrm->Prt().*fnRect->fnSetHeight)( - Max( 0L , (pFrm->Frm().*fnRect->fnGetHeight)() - + std::max( 0L , (pFrm->Frm().*fnRect->fnGetHeight)() - (pFrm->Prt().*fnRect->fnGetTop)() - nLower ) ); (pFrm->Prt().*fnRect->fnSetWidth)( (pFrm->Frm().*fnRect->fnGetWidth)() - @@ -2154,7 +2154,7 @@ SwTwips SwTxtFrm::CalcFitToContent() SwHookOut aHook( aInf ); // #i54031# - assure mininum of MINLAY twips. - const SwTwips nMax = Max( (SwTwips)MINLAY, + const SwTwips nMax = std::max( (SwTwips)MINLAY, aLine._CalcFitToContent() + 1 ); Frm().Width( nOldFrmWidth ); @@ -2518,7 +2518,7 @@ void SwTxtFrm::ChgThisLines() if ( HasPara() ) { SwRepaint *pRepaint = GetPara()->GetRepaint(); - pRepaint->Bottom( Max( pRepaint->Bottom(), + pRepaint->Bottom( std::max( pRepaint->Bottom(), Frm().Top()+Prt().Bottom())); } } diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 9d4a338f12dc..7293b43fa6af 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -268,9 +268,9 @@ static SwTwips lcl_GetFtnLower( const SwTxtFrm* pFrm, SwTwips nLower ) } if ( bVert ) - nRet = Min( nRet, nFlyLower ); + nRet = std::min( nRet, nFlyLower ); else - nRet = Max( nRet, nFlyLower ); + nRet = std::max( nRet, nFlyLower ); return nRet; } diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 4db00623b187..09cecb0dd77f 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -489,7 +489,7 @@ sal_Bool SwTabPortion::PostFormat( SwTxtFormatInfo &rInf ) const bool bTabOverMargin = rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_OVER_MARGIN); // If the tab position is larger than the right margin, it gets scaled down by default. // However, if compat mode enabled, we allow tabs to go over the margin: the rest of the paragraph is not broken into lines. - const KSHORT nRight = bTabOverMargin ? GetTabPos() : Min(GetTabPos(), rInf.Width()); + const KSHORT nRight = bTabOverMargin ? GetTabPos() : std::min(GetTabPos(), rInf.Width()); const SwLinePortion *pPor = GetPortion(); KSHORT nPorWidth = 0; diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index c5ed121de5be..ee84a791d81c 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -519,7 +519,7 @@ sal_Bool WidowsAndOrphans::WouldFit( SwTxtMargin &rLine, SwTwips &rMaxHeight, sa MSHORT nLineCnt = rLine.GetLineNr(); // First satisfy the Orphans-rule and the wish for initials ... - const MSHORT nMinLines = Max( GetOrphansLines(), rLine.GetDropLines() ); + const MSHORT nMinLines = std::max( GetOrphansLines(), rLine.GetDropLines() ); if ( nLineCnt < nMinLines ) return sal_False; diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 612d7d011709..83981599c0df 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -551,7 +551,7 @@ void SwFntObj::GuessLeading( const ViewShell& // Those who lie about their Leading, may lie about their // Ascent/Descent as well, hence the Font will be lowered a // litte without changing its height. - long nDiff = Min( rMet.GetDescent() - aWinMet.GetDescent(), + long nDiff = std::min( rMet.GetDescent() - aWinMet.GetDescent(), aWinMet.GetAscent() - rMet.GetAscent() - nTmpLeading ); if( nDiff > 0 ) { @@ -1539,7 +1539,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) nCnt = 0; else nCnt = nCnt - rInf.GetIdx(); - nCnt = Min( nCnt, rInf.GetLen() ); + nCnt = std::min( nCnt, rInf.GetLen() ); long nKernSum = rInf.GetKern(); sal_Unicode cChPrev = rInf.GetText()[ rInf.GetIdx() ]; @@ -1902,7 +1902,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) nCnt=0; else nCnt = nCnt - rInf.GetIdx(); - nCnt = Min (nCnt, nLn); + nCnt = std::min (nCnt, nLn); sal_Unicode nChPrev = rInf.GetText()[ rInf.GetIdx() ]; sal_Unicode nCh; diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index 58512953a093..e2b48e44b716 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -559,7 +559,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) Size aPartSize; long nKana = 0; const XubString aTxt( CalcCaseMap( rDo.GetInf().GetText() ) ); - xub_StrLen nMaxPos = Min( sal_uInt16(rDo.GetInf().GetText().getLength() - rDo.GetInf().GetIdx()), + xub_StrLen nMaxPos = std::min( sal_uInt16(rDo.GetInf().GetText().getLength() - rDo.GetInf().GetIdx()), rDo.GetInf().GetLen() ); rDo.GetInf().SetLen( nMaxPos ); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 248255a863ef..a02f8b3b04d1 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2307,8 +2307,8 @@ void SwTxtNode::GCAttr() && ( bAll || pHt->Which() == RES_TXTATR_INETFMT ) ) { bChanged = true; - nMin = Min( nMin, *pHt->GetStart() ); - nMax = Max( nMax, *pHt->GetEnd() ); + nMin = std::min( nMin, *pHt->GetStart() ); + nMax = std::max( nMax, *pHt->GetEnd() ); DestroyAttr( m_pSwpHints->Cut(i) ); --i; } diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 52db6ad3732c..02b5addfe2b5 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -189,7 +189,7 @@ sal_uInt16 SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent ) const const long nAscent = nOldAscent + ( (long) nOrgHeight * GetEscapement() ) / 100L; if ( nAscent>0 ) - return ( Max( sal_uInt16 (nAscent), nOrgAscent )); + return ( std::max( sal_uInt16 (nAscent), nOrgAscent )); } return nOrgAscent; } @@ -672,7 +672,7 @@ sal_uInt16 SwSubFont::CalcEscHeight( const sal_uInt16 nOldHeight, { long nDescent = nOldHeight - nOldAscent - ( (long) nOrgHeight * GetEscapement() ) / 100L; - const sal_uInt16 nDesc = ( nDescent>0 ) ? Max ( sal_uInt16(nDescent), + const sal_uInt16 nDesc = ( nDescent>0 ) ? std::max ( sal_uInt16(nDescent), sal_uInt16(nOrgHeight - nOrgAscent) ) : nOrgHeight - nOrgAscent; return ( nDesc + CalcEscAscent( nOldAscent ) ); } diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index a493996f9dce..3ae2f43408be 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -799,7 +799,7 @@ sal_Bool SwScanner::NextWord() // #i89042, as discussed with HDU: don't evaluate script changes for word count. Use whole word. if ( nWordType == i18n::WordType::WORD_COUNT ) { - nBegin = Max(aBound.startPos, nBegin); + nBegin = std::max(aBound.startPos, nBegin); nLen = 0; if (aBound.endPos > nBegin) nLen = aBound.endPos - nBegin; @@ -816,7 +816,7 @@ sal_Bool SwScanner::NextWord() OUString aTmpWord = aText.copy( nBegin, aBound.endPos - nBegin ); const sal_Int32 nScriptEnd = nBegin + g_pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript ); - const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd ); + const sal_Int32 nEnd = std::min( aBound.endPos, nScriptEnd ); // restrict word start to last script change position sal_Int32 nScriptBegin = 0; @@ -830,7 +830,7 @@ sal_Bool SwScanner::NextWord() nCurrScript ); } - nBegin = Max( aBound.startPos, nScriptBegin ); + nBegin = std::max( aBound.startPos, nScriptBegin ); nLen = nEnd - nBegin; } else @@ -840,7 +840,7 @@ sal_Bool SwScanner::NextWord() aBound.endPos - aBound.startPos ); const sal_Int32 nScriptEnd = aBound.startPos + g_pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript ); - const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd ); + const sal_Int32 nEnd = std::min( aBound.endPos, nScriptEnd ); nBegin = aBound.startPos; nLen = nEnd - nBegin; } @@ -849,8 +849,8 @@ sal_Bool SwScanner::NextWord() // optionally clip the result of getWordBoundaries: if ( bClip ) { - aBound.startPos = Max( aBound.startPos, nStartPos ); - aBound.endPos = Min( aBound.endPos, nEndPos ); + aBound.startPos = std::max( aBound.startPos, nStartPos ); + aBound.endPos = std::min( aBound.endPos, nEndPos ); nBegin = aBound.startPos; nLen = aBound.endPos - nBegin; } @@ -1388,14 +1388,14 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/ if ( pSmartTagList->GetBeginInv() != STRING_LEN ) { nBegin = pSmartTagList->GetBeginInv(); - nEnd = Min( pSmartTagList->GetEndInv(), (xub_StrLen)rText.getLength() ); + nEnd = std::min( pSmartTagList->GetEndInv(), (xub_StrLen)rText.getLength() ); if ( nBegin < nEnd ) { const LanguageType aCurrLang = pNode->GetLang( nBegin ); const com::sun::star::lang::Locale aCurrLocale = g_pBreakIt->GetLocale( aCurrLang ); nBegin = static_cast< xub_StrLen >(g_pBreakIt->GetBreakIter()->beginOfSentence( rText, nBegin, aCurrLocale )); - nEnd = static_cast< xub_StrLen >(Min( rText.getLength(), g_pBreakIt->GetBreakIter()->endOfSentence( rText, nEnd, aCurrLocale ) )); + nEnd = static_cast< xub_StrLen >(std::min( rText.getLength(), g_pBreakIt->GetBreakIter()->endOfSentence( rText, nEnd, aCurrLocale ) )); } } } @@ -1436,7 +1436,7 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/ { const LanguageType nLang = aIter.GetLanguage(); const com::sun::star::lang::Locale aLocale = g_pBreakIt->GetLocale( nLang ); - nLangEnd = Min( nEnd, aIter.GetChgPos() ); + nLangEnd = std::min( nEnd, aIter.GetChgPos() ); const sal_uInt32 nExpandBegin = aConversionMap.ConvertToViewPosition( nLangBegin ); const sal_uInt32 nExpandEnd = aConversionMap.ConvertToViewPosition( nLangEnd ); diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 395f05af840d..54a3c1aeb2fc 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -2114,7 +2114,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, aMark.SetAlternativeText(lcl_AnyToString(rValue)); break; case WID_LEVEL: - aMark.SetLevel(Min( static_cast<sal_Int8>( MAXLEVEL ), + aMark.SetLevel(std::min( static_cast<sal_Int8>( MAXLEVEL ), static_cast<sal_Int8>(lcl_AnyToInt16(rValue)+1))); break; case WID_PRIMARY_KEY : diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index e0c09aad697c..49fc1a3b6ee1 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -528,8 +528,8 @@ void sw_NormalizeRange( sw_GetCellPosition( rCell2, nCol2, nRow2 ); if (nCol2 < nCol1 || nRow2 < nRow1) { - rCell1 = sw_GetCellName( Min(nCol1, nCol2), Min(nRow1, nRow2) ); - rCell2 = sw_GetCellName( Max(nCol1, nCol2), Max(nRow1, nRow2) ); + rCell1 = sw_GetCellName( std::min(nCol1, nCol2), std::min(nRow1, nRow2) ); + rCell2 = sw_GetCellName( std::max(nCol1, nCol2), std::max(nRow1, nRow2) ); } } diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index 06cf8fe326d2..dab357dd5782 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -546,17 +546,17 @@ void SwPagePreviewLayout::_CalcDocPrevwPaintRect() Size aSize; if ( mbDoesLayoutColsFitIntoWindow ) //aSize.Width() = mnPrevwLayoutWidth; - aSize.Width() = Min( mnPrevwLayoutWidth, + aSize.Width() = std::min( mnPrevwLayoutWidth, maPreviewDocRect.GetWidth() - aTopLeftPos.X() ); else - aSize.Width() = Min( maPreviewDocRect.GetWidth() - aTopLeftPos.X(), + aSize.Width() = std::min( maPreviewDocRect.GetWidth() - aTopLeftPos.X(), maWinSize.Width() - maAdditionalPaintOffset.X() ); if ( mbDoesLayoutRowsFitIntoWindow ) //aSize.Height() = mnPrevwLayoutHeight; - aSize.Height() = Min( mnPrevwLayoutHeight, + aSize.Height() = std::min( mnPrevwLayoutHeight, maPreviewDocRect.GetHeight() - aTopLeftPos.Y() ); else - aSize.Height() = Min( maPreviewDocRect.GetHeight() - aTopLeftPos.Y(), + aSize.Height() = std::min( maPreviewDocRect.GetHeight() - aTopLeftPos.Y(), maWinSize.Height() - maAdditionalPaintOffset.Y() ); maPaintedPrevwDocRect.SetSize( aSize ); } @@ -821,7 +821,7 @@ Point SwPagePreviewLayout::GetPreviewStartPosForNewScale( // check, if new y-position is outside document preview if ( aNewPaintStartPos.Y() > maPreviewDocRect.Bottom() ) aNewPaintStartPos.Y() = - Max( 0L, maPreviewDocRect.Bottom() - mnPrevwLayoutHeight ); + std::max( 0L, maPreviewDocRect.Bottom() - mnPrevwLayoutHeight ); } } diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index e22ec0f07cb1..8acd58107c4e 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -68,8 +68,8 @@ void SwViewImp::Init( const SwViewOption *pNewOpt ) const Size &rSz = pNewOpt->GetSnapSize(); pDrawView->SetGridCoarse( rSz ); const Size aFSize - ( rSz.Width() ? rSz.Width() /Max(short(1),pNewOpt->GetDivisionX()):0, - rSz.Height()? rSz.Height()/Max(short(1),pNewOpt->GetDivisionY()):0); + ( rSz.Width() ? rSz.Width() /std::max(short(1),pNewOpt->GetDivisionX()):0, + rSz.Height()? rSz.Height()/std::max(short(1),pNewOpt->GetDivisionY()):0); pDrawView->SetGridFine( aFSize ); Fraction aSnGrWdtX(rSz.Width(), pNewOpt->GetDivisionX() + 1); Fraction aSnGrWdtY(rSz.Height(), pNewOpt->GetDivisionY() + 1); diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx index 6b2362ba11d7..12bf9ba42fca 100644 --- a/sw/source/core/view/viewpg.cxx +++ b/sw/source/core/view/viewpg.cxx @@ -176,7 +176,7 @@ void ViewShell::PrintProspect( else { nMaxColSz = aNxtPageSize.Width() + aSttPageSize.Width(); - nMaxRowSz = Max( aNxtPageSize.Height(), aSttPageSize.Height() ); + nMaxRowSz = std::max( aNxtPageSize.Height(), aSttPageSize.Height() ); } // den MapMode einstellen diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index e1917983a093..9786ba67ff8e 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -299,9 +299,9 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd ) aTmp1 = GetOut()->LogicToPixel( aTmp1 ); Rectangle aTmp2( GetOut()->PixelToLogic( aTmp1 ) ); if ( aTmp2.Left() > aRect.Left() ) - aTmp1.Left() = Max( 0L, aTmp1.Left() - 1L ); + aTmp1.Left() = std::max( 0L, aTmp1.Left() - 1L ); if ( aTmp2.Top() > aRect.Top() ) - aTmp1.Top() = Max( 0L, aTmp1.Top() - 1L ); + aTmp1.Top() = std::max( 0L, aTmp1.Top() - 1L ); aTmp1.Right() += 1; aTmp1.Bottom() += 1; aTmp1 = GetOut()->PixelToLogic( aTmp1 ); @@ -1121,7 +1121,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect) { const Rectangle &rBound = pObj->GetObjRect().SVRect(); // OD 03.03.2003 #107927# - use correct datatype - const SwTwips nL = Max( 0L, rBound.Left() - nOfst ); + const SwTwips nL = std::max( 0L, rBound.Left() - nOfst ); if ( nL < nMinLeft ) nMinLeft = nL; if( rBound.Right() + nOfst > nMaxRight ) @@ -1215,7 +1215,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe } // #i75172# isolated static conditions - const bool bOnlyYScroll(!lXDiff && Abs(lYDiff) != 0 && Abs(lYDiff) < lMax); + const bool bOnlyYScroll(!lXDiff && std::abs(lYDiff) != 0 && std::abs(lYDiff) < lMax); const bool bAllowedWithChildWindows(GetWin()->GetWindowClipRegionPixel(WINDOW_GETCLIPREGION_NOCHILDREN|WINDOW_GETCLIPREGION_NULL).IsNull()); const bool bSmoothScrollAllowed(bOnlyYScroll && mbEnableSmooth && GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows); @@ -1232,9 +1232,9 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe pVout->SetFillColor( GetWin()->GetFillColor() ); MapMode aMapMode( GetWin()->GetMapMode() ); pVout->SetMapMode( aMapMode ); - Size aSize( maVisArea.Width()+2*aPixSz.Width(), Abs(lYDiff)+(2*aPixSz.Height()) ); + Size aSize( maVisArea.Width()+2*aPixSz.Width(), std::abs(lYDiff)+(2*aPixSz.Height()) ); if ( pRect ) - aSize.Width() = Min(aSize.Width(), pRect->GetWidth()+2*aPixSz.Width()); + aSize.Width() = std::min(aSize.Width(), pRect->GetWidth()+2*aPixSz.Width()); if ( pVout->SetOutputSize( aSize ) ) { mnLockPaint++; @@ -1244,14 +1244,14 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe aRect.Height( aSize.Height() ); if ( pRect ) { - aRect.Pos().X() = Max(aRect.Left(),pRect->Left()-aPixSz.Width()); - aRect.Right( Min(aRect.Right()+2*aPixSz.Width(), pRect->Right()+aPixSz.Width())); + aRect.Pos().X() = std::max(aRect.Left(),pRect->Left()-aPixSz.Width()); + aRect.Right( std::min(aRect.Right()+2*aPixSz.Width(), pRect->Right()+aPixSz.Width())); } else aRect.SSize().Width() += 2*aPixSz.Width(); aRect.Pos().Y() = lYDiff < 0 ? aOldVis.Bottom() - aPixSz.Height() : aRect.Top() - aSize.Height() + aPixSz.Height(); - aRect.Pos().X() = Max( 0L, aRect.Left()-aPixSz.Width() ); + aRect.Pos().X() = std::max( 0L, aRect.Left()-aPixSz.Width() ); aRect.Pos() = GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.Pos())); aRect.SSize()= GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.SSize())); maVisArea = aRect; @@ -1303,7 +1303,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe // as option? // ?????????????????????? long lMaDelta = aPixSz.Height(); - if ( Abs(lYDiff) > ( maVisArea.Height() / 3 ) ) + if ( std::abs(lYDiff) > ( maVisArea.Height() / 3 ) ) lMaDelta *= 6; else lMaDelta *= 2; @@ -1317,7 +1317,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe while ( lDiff ) { long lScroll; - if ( Imp()->bStopSmooth || Abs(lDiff) <= Abs(lMaDelta) ) + if ( Imp()->bStopSmooth || std::abs(lDiff) <= std::abs(lMaDelta) ) { lScroll = lDiff; lDiff = 0; @@ -2349,7 +2349,7 @@ sal_Int32 ViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwR // #i40059# Position out of bounds: SwRect aRect( rRect ); - aRect.Pos().X() = Max( aRect.Left(), GetLayout()->Frm().Left() ); + aRect.Pos().X() = std::max( aRect.Left(), GetLayout()->Frm().Left() ); const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aRect.Center() ); if ( pPage ) diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 05c1f84ac398..80b46e2eed00 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -1805,8 +1805,8 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc, // Seiten-Dialog war und ihn mit OK verlassen hat, bekommt man eine // neue Seitengroesse, die dann hier exportiert wuerde. Um das // vermeiden erlauben wir hier kleine Abweichungen. - if( Abs( rSz.Width() - aRefSz.Width() ) <= 2 && - Abs( rSz.Height() - aRefSz.Height() ) <= 2 ) + if( std::abs( rSz.Width() - aRefSz.Width() ) <= 2 && + std::abs( rSz.Height() - aRefSz.Height() ) <= 2 ) { if( bRefLandscape != rPageDesc.GetLandscape() ) { diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 88d3ed530530..e27f56954617 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1730,8 +1730,8 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj, aShadow.SetColor( Color( aShdColor ) ); - aShadow.SetWidth(writer_cast<sal_uInt16>((Abs( nShdDistX) + - Abs( nShdDistY )) / 2 )); + aShadow.SetWidth(writer_cast<sal_uInt16>((std::abs( nShdDistX) + + std::abs( nShdDistY )) / 2 )); SvxShadowLocation eShdPosi; if( 0 <= nShdDistX ) diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 643f334e1838..7b6b6490713c 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -634,7 +634,7 @@ static void SetBaseAnlv(SwNumFmt &rNum, WW8_ANLV &rAV, sal_uInt8 nSwLevel ) rNum.SetNumAdjust( eAdjA[SVBT8ToByte( rAV.aBits1 ) & 0x3] ); rNum.SetCharTextDistance( SVBT16ToShort( rAV.dxaSpace ) ); - sal_Int16 nIndent = Abs((sal_Int16)SVBT16ToShort( rAV.dxaIndent )); + sal_Int16 nIndent = std::abs((sal_Int16)SVBT16ToShort( rAV.dxaIndent )); if( SVBT8ToByte( rAV.aBits1 ) & 0x08 ) //fHang { rNum.SetFirstLineOffset( -nIndent ); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index e1ae0f6947df..39e865f7d096 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -555,7 +555,7 @@ void wwSectionManager::GetPageULData(const wwSection &rSection, rData.nSwHLo = sal::static_int_cast< sal_uInt32 >(cMinHdFtHeight); } else // kein Header -> Up einfach uebernehmen - rData.nSwUp = Abs(nWWUp); + rData.nSwUp = std::abs(nWWUp); rData.bHasFooter = (rSection.maSep.grpfIhdt & (WW8_FOOTER_EVEN | WW8_FOOTER_ODD | WW8_FOOTER_FIRST)) != 0; @@ -576,7 +576,7 @@ void wwSectionManager::GetPageULData(const wwSection &rSection, rData.nSwFUp = sal::static_int_cast< sal_uInt32 >(cMinHdFtHeight); } else // kein Footer -> Lo einfach uebernehmen - rData.nSwLo = Abs(nWWLo); + rData.nSwLo = std::abs(nWWLo); } void wwSectionManager::SetPageULSpaceItems(SwFrmFmt &rFmt, @@ -600,7 +600,7 @@ void wwSectionManager::SetPageULSpaceItems(SwFrmFmt &rFmt, else { // #i48832# - set correct spacing between header and body. - const SwTwips nHdLowerSpace( Abs(rSection.maSep.dyaTop) - rData.nSwUp - rData.nSwHLo ); + const SwTwips nHdLowerSpace( std::abs(rSection.maSep.dyaTop) - rData.nSwUp - rData.nSwHLo ); pHdFmt->SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE, 0, rData.nSwHLo + nHdLowerSpace)); aHdUL.SetLower( static_cast< sal_uInt16 >(nHdLowerSpace) ); pHdFmt->SetFmtAttr(SwHeaderAndFooterEatSpacingItem( @@ -627,7 +627,7 @@ void wwSectionManager::SetPageULSpaceItems(SwFrmFmt &rFmt, else { // #i48832# - set correct spacing between footer and body. - const SwTwips nFtUpperSpace( Abs(rSection.maSep.dyaBottom) - rData.nSwLo - rData.nSwFUp ); + const SwTwips nFtUpperSpace( std::abs(rSection.maSep.dyaBottom) - rData.nSwLo - rData.nSwFUp ); pFtFmt->SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE, 0, rData.nSwFUp + nFtUpperSpace)); aFtUL.SetUpper( static_cast< sal_uInt16 >(nFtUpperSpace) ); pFtFmt->SetFmtAttr(SwHeaderAndFooterEatSpacingItem( diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx index d0f64ab5dc0d..af2bda429438 100644 --- a/sw/source/ui/app/appenv.cxx +++ b/sw/source/ui/app/appenv.cxx @@ -346,19 +346,19 @@ void SwModule::InsertEnv( SfxRequest& rReq ) long lLeft = rItem.lShiftRight, lUpper = rItem.lShiftDown; - sal_uInt16 nPageW = (sal_uInt16) Max(rItem.lWidth, rItem.lHeight), - nPageH = (sal_uInt16) Min(rItem.lWidth, rItem.lHeight); + sal_uInt16 nPageW = (sal_uInt16) std::max(rItem.lWidth, rItem.lHeight), + nPageH = (sal_uInt16) std::min(rItem.lWidth, rItem.lHeight); switch (rItem.eAlign) { case ENV_HOR_LEFT: break; - case ENV_HOR_CNTR: lLeft += Max(0L, long(aPaperSize.Width() - nPageW)) / 2; + case ENV_HOR_CNTR: lLeft += std::max(0L, long(aPaperSize.Width() - nPageW)) / 2; break; - case ENV_HOR_RGHT: lLeft += Max(0L, long(aPaperSize.Width() - nPageW)); + case ENV_HOR_RGHT: lLeft += std::max(0L, long(aPaperSize.Width() - nPageW)); break; - case ENV_VER_LEFT: lUpper += Max(0L, long(aPaperSize.Width() - nPageH)); + case ENV_VER_LEFT: lUpper += std::max(0L, long(aPaperSize.Width() - nPageH)); break; - case ENV_VER_CNTR: lUpper += Max(0L, long(aPaperSize.Width() - nPageH)) / 2; + case ENV_VER_CNTR: lUpper += std::max(0L, long(aPaperSize.Width() - nPageH)) / 2; break; case ENV_VER_RGHT: break; } diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 0c7c0402252e..a2fc397e4026 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -740,7 +740,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) else if (pEdit == &aTextEdit) // set quantity if applicable { sal_Int32 nTmp = aTextEdit.GetText().getLength(); - aDropCapsField.SetValue(Max((sal_uInt16)1, (sal_uInt16)nTmp)); + aDropCapsField.SetValue(std::max((sal_uInt16)1, (sal_uInt16)nTmp)); sPreview = aTextEdit.GetText().copy(0, nTmp); } diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 39a946fa3cbc..e9bab71243e0 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -289,8 +289,8 @@ struct QuickHelpData inline bool IsMinMove(const Point &rStartPos, const Point &rLPt) { - return Abs(rStartPos.X() - rLPt.X()) > MIN_MOVE || - Abs(rStartPos.Y() - rLPt.Y()) > MIN_MOVE; + return std::abs(rStartPos.X() - rLPt.X()) > MIN_MOVE || + std::abs(rStartPos.Y() - rLPt.Y()) > MIN_MOVE; } /** @@ -634,10 +634,10 @@ void SwEditWin::JustifyAreaTimer() const long coMinLen = 50; #endif long nTimeout = 800, - nDiff = Max( - Max( m_aMovePos.Y() - rVisArea.Bottom(), rVisArea.Top() - m_aMovePos.Y() ), - Max( m_aMovePos.X() - rVisArea.Right(), rVisArea.Left() - m_aMovePos.X())); - m_aTimer.SetTimeout( Max( coMinLen, nTimeout - nDiff*2L) ); + nDiff = std::max( + std::max( m_aMovePos.Y() - rVisArea.Bottom(), rVisArea.Top() - m_aMovePos.Y() ), + std::max( m_aMovePos.X() - rVisArea.Right(), rVisArea.Left() - m_aMovePos.X())); + m_aTimer.SetTimeout( std::max( coMinLen, nTimeout - nDiff*2L) ); } void SwEditWin::LeaveArea(const Point &rPos) @@ -1011,10 +1011,10 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb ) aSnap = rSh.GetViewOptions()->GetSnapSize(); short nDiv = rSh.GetViewOptions()->GetDivisionX(); if ( nDiv > 0 ) - aSnap.Width() = Max( (sal_uLong)1, (sal_uLong)aSnap.Width() / nDiv ); + aSnap.Width() = std::max( (sal_uLong)1, (sal_uLong)aSnap.Width() / nDiv ); nDiv = rSh.GetViewOptions()->GetDivisionY(); if ( nDiv > 0 ) - aSnap.Height() = Max( (sal_uLong)1, (sal_uLong)aSnap.Height() / nDiv ); + aSnap.Height() = std::max( (sal_uLong)1, (sal_uLong)aSnap.Height() / nDiv ); } SwRect aBoundRect; @@ -1031,10 +1031,10 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb ) pToCharCntntPos, bFollowTextFlow, false, &aRefPoint ); } - long nLeft = Min( aTmp.Left() - aBoundRect.Left(), aSnap.Width() ); - long nRight = Min( aBoundRect.Right() - aTmp.Right(), aSnap.Width() ); - long nUp = Min( aTmp.Top() - aBoundRect.Top(), aSnap.Height() ); - long nDown = Min( aBoundRect.Bottom() - aTmp.Bottom(), aSnap.Height() ); + long nLeft = std::min( aTmp.Left() - aBoundRect.Left(), aSnap.Width() ); + long nRight = std::min( aBoundRect.Right() - aTmp.Right(), aSnap.Width() ); + long nUp = std::min( aTmp.Top() - aBoundRect.Top(), aSnap.Height() ); + long nDown = std::min( aBoundRect.Bottom() - aTmp.Bottom(), aSnap.Height() ); switch ( nDir ) { @@ -1190,10 +1190,10 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir ) Size aSnap( rSh.GetViewOptions()->GetSnapSize() ); short nDiv = rSh.GetViewOptions()->GetDivisionX(); if ( nDiv > 0 ) - aSnap.Width() = Max( (sal_uLong)1, (sal_uLong)aSnap.Width() / nDiv ); + aSnap.Width() = std::max( (sal_uLong)1, (sal_uLong)aSnap.Width() / nDiv ); nDiv = rSh.GetViewOptions()->GetDivisionY(); if ( nDiv > 0 ) - aSnap.Height() = Max( (sal_uLong)1, (sal_uLong)aSnap.Height() / nDiv ); + aSnap.Height() = std::max( (sal_uLong)1, (sal_uLong)aSnap.Height() / nDiv ); if(bOnePixel) aSnap = PixelToLogic(Size(1,1)); diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index 87b81d863908..b98334f53831 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -237,8 +237,8 @@ IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit ) long lWVal = static_cast< long >(GetFldVal(aSizeWidthField )); long lHVal = static_cast< long >(GetFldVal(aSizeHeightField)); - long lWidth = Max(lWVal, lHVal); - long lHeight = Min(lWVal, lHVal); + long lWidth = std::max(lWVal, lHVal); + long lHeight = std::min(lWVal, lHVal); if (pEdit == &aSizeWidthField || pEdit == &aSizeHeightField) { @@ -437,8 +437,8 @@ IMPL_LINK_NOARG(SwEnvFmtPage, FormatHdl) if (nPaper != (sal_uInt16)PAPER_USER) { Size aSz = SvxPaperInfo::GetPaperSize((Paper)nPaper); - lWidth = Max(aSz.Width(), aSz.Height()); - lHeight = Min(aSz.Width(), aSz.Height()); + lWidth = std::max(aSz.Width(), aSz.Height()); + lHeight = std::min(aSz.Width(), aSz.Height()); } else { @@ -471,8 +471,8 @@ void SwEnvFmtPage::SetMinMax() long lWVal = static_cast< long >(GetFldVal(aSizeWidthField )); long lHVal = static_cast< long >(GetFldVal(aSizeHeightField)); - long lWidth = Max(lWVal, lHVal), - lHeight = Min(lWVal, lHVal); + long lWidth = std::max(lWVal, lHVal), + lHeight = std::min(lWVal, lHVal); // Min and Max aAddrLeftField.SetMin((long) 100 * (GetFldVal(aSendLeftField) + 566), FUNIT_TWIP); @@ -534,15 +534,15 @@ void SwEnvFmtPage::FillItem(SwEnvItem& rItem) { long lWVal = static_cast< long >(GetFldVal(aSizeWidthField )); long lHVal = static_cast< long >(GetFldVal(aSizeHeightField)); - rItem.lWidth = Max(lWVal, lHVal); - rItem.lHeight = Min(lWVal, lHVal); + rItem.lWidth = std::max(lWVal, lHVal); + rItem.lHeight = std::min(lWVal, lHVal); } else { long lWVal = SvxPaperInfo::GetPaperSize((Paper)nPaper).Width (); long lHVal = SvxPaperInfo::GetPaperSize((Paper)nPaper).Height(); - rItem.lWidth = Max(lWVal, lHVal); - rItem.lHeight = Min(lWVal, lHVal); + rItem.lWidth = std::max(lWVal, lHVal); + rItem.lHeight = std::min(lWVal, lHVal); } } @@ -558,8 +558,8 @@ void SwEnvFmtPage::Reset(const SfxItemSet& rSet) const SwEnvItem& rItem = (const SwEnvItem&) rSet.Get(FN_ENVELOP); Paper ePaper = SvxPaperInfo::GetSvxPaper( - Size( Min(rItem.lWidth, rItem.lHeight), - Max(rItem.lWidth, rItem.lHeight)), MAP_TWIP, sal_True); + Size( std::min(rItem.lWidth, rItem.lHeight), + std::max(rItem.lWidth, rItem.lHeight)), MAP_TWIP, sal_True); for (sal_uInt16 i = 0; i < (sal_uInt16) aIDs.size(); i++) if (aIDs[i] == (sal_uInt16)ePaper) aSizeFormatBox.SelectEntryPos(i); @@ -569,8 +569,8 @@ void SwEnvFmtPage::Reset(const SfxItemSet& rSet) SetFldVal(aAddrTopField , rItem.lAddrFromTop ); SetFldVal(aSendLeftField, rItem.lSendFromLeft); SetFldVal(aSendTopField , rItem.lSendFromTop ); - SetFldVal(aSizeWidthField , Max(rItem.lWidth, rItem.lHeight)); - SetFldVal(aSizeHeightField , Min(rItem.lWidth, rItem.lHeight)); + SetFldVal(aSizeWidthField , std::max(rItem.lWidth, rItem.lHeight)); + SetFldVal(aSizeHeightField , std::min(rItem.lWidth, rItem.lHeight)); SetMinMax(); DELETEZ(GetParentSwEnvDlg()->pSenderSet); diff --git a/sw/source/ui/envelp/envimg.cxx b/sw/source/ui/envelp/envimg.cxx index 3597753d2dc0..63be8798743c 100644 --- a/sw/source/ui/envelp/envimg.cxx +++ b/sw/source/ui/envelp/envimg.cxx @@ -108,8 +108,8 @@ SwEnvItem::SwEnvItem() : lShiftRight = 0; lShiftDown = 0; - lAddrFromLeft = Max(lWidth, lHeight) / 2; - lAddrFromTop = Min(lWidth, lHeight) / 2; + lAddrFromLeft = std::max(lWidth, lHeight) / 2; + lAddrFromTop = std::min(lWidth, lHeight) / 2; } SwEnvItem::SwEnvItem(const SwEnvItem& rItem) : diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index 6a9a0b68eed4..29ab6f8bc993 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -74,8 +74,8 @@ void SwEnvPreview::Paint(const Rectangle &) const SwEnvItem& rItem = ((SwEnvDlg*) GetParentDialog())->aEnvItem; - sal_uInt16 nPageW = (sal_uInt16) Max(rItem.lWidth, rItem.lHeight), - nPageH = (sal_uInt16) Min(rItem.lWidth, rItem.lHeight); + sal_uInt16 nPageW = (sal_uInt16) std::max(rItem.lWidth, rItem.lHeight), + nPageH = (sal_uInt16) std::min(rItem.lWidth, rItem.lHeight); float fx = (float)GetOutputSizePixel().Width () / (float)nPageW, fy = (float)GetOutputSizePixel().Height() / (float)nPageH, diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 93e71b16c4d1..770ae65e3295 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -127,8 +127,8 @@ void SwLabPreview::Paint(const Rectangle &) lDispH += ROUND(aItem.lVDist / 10); // Scale factor - float fx = (float) lOutWPix23 / Max(1L, lDispW), - fy = (float) lOutHPix23 / Max(1L, lDispH), + float fx = (float) lOutWPix23 / std::max(1L, lDispW), + fy = (float) lOutHPix23 / std::max(1L, lDispH), f = fx < fy ? fx : fy; // zero point @@ -159,8 +159,8 @@ void SwLabPreview::Paint(const Rectangle &) // Labels SetClipRegion(Region(Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH)))); SetFillColor( COL_LIGHTGRAYBLUE ); - for (sal_uInt16 nRow = 0; nRow < Min((sal_uInt16) 2, (sal_uInt16) aItem.nRows); nRow++) - for (sal_uInt16 nCol = 0; nCol < Min((sal_uInt16) 2, (sal_uInt16) aItem.nCols); nCol++) + for (sal_uInt16 nRow = 0; nRow < std::min((sal_uInt16) 2, (sal_uInt16) aItem.nRows); nRow++) + for (sal_uInt16 nCol = 0; nCol < std::min((sal_uInt16) 2, (sal_uInt16) aItem.nCols); nCol++) DrawRect(Rectangle( Point(ROUND(lX0 + f * (aItem.lLeft + nCol * aItem.lHDist)), ROUND(lY0 + f * (aItem.lUpper + nRow * aItem.lVDist))), @@ -417,8 +417,8 @@ void SwLabFmtPage::ChangeMinMax() aHDistField .SetMin(nMinSize, FUNIT_CM); aVDistField .SetMin(nMinSize, FUNIT_CM); - aHDistField .SetMax((long) 100 * ((lMax - lLeft ) / Max(1L, (long) nCols)), FUNIT_TWIP); - aVDistField .SetMax((long) 100 * ((lMax - lUpper) / Max(1L, (long) nRows)), FUNIT_TWIP); + aHDistField .SetMax((long) 100 * ((lMax - lLeft ) / std::max(1L, (long) nCols)), FUNIT_TWIP); + aVDistField .SetMax((long) 100 * ((lMax - lUpper) / std::max(1L, (long) nRows)), FUNIT_TWIP); aWidthField .SetMin(nMinSize, FUNIT_CM); aHeightField.SetMin(nMinSize, FUNIT_CM); @@ -432,8 +432,8 @@ void SwLabFmtPage::ChangeMinMax() aColsField .SetMin( 1 ); aRowsField .SetMin( 1 ); - aColsField .SetMax((lMax - lLeft ) / Max(1L, lHDist)); - aRowsField .SetMax((lMax - lUpper) / Max(1L, lVDist)); + aColsField .SetMax((lMax - lLeft ) / std::max(1L, lHDist)); + aRowsField .SetMax((lMax - lUpper) / std::max(1L, lVDist)); aPWidthField .SetMin( (long) 100 * lMinPWidth, FUNIT_TWIP ); aPHeightField.SetMin( (long) 100 * lMinPHeight, FUNIT_TWIP ); diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 2750a0957788..2934718a2158 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -935,8 +935,8 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData, SwPaM *pPam ) SwChapterFieldType* pTyp = (SwChapterFieldType*)pCurShell->GetFldType(0, RES_CHAPTERFLD); pFld = new SwChapterField(pTyp, nFormatId); - nByte = Max(sal_uInt16(1), nByte); - nByte = Min(nByte, sal_uInt16(MAXLEVEL)); + nByte = std::max(sal_uInt16(1), nByte); + nByte = std::min(nByte, sal_uInt16(MAXLEVEL)); nByte -= 1; ((SwChapterField*)pFld)->SetLevel((sal_uInt8)nByte); break; @@ -1465,8 +1465,8 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat, case TYP_CHAPTERFLD: { sal_uInt16 nByte = (sal_uInt16)rPar2.ToInt32(); - nByte = Max(sal_uInt16(1), nByte); - nByte = Min(nByte, sal_uInt16(MAXLEVEL)); + nByte = std::max(sal_uInt16(1), nByte); + nByte = std::min(nByte, sal_uInt16(MAXLEVEL)); nByte -= 1; ((SwChapterField*)pTmpFld)->SetLevel((sal_uInt8)nByte); bSetPar2 = false; diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index fa6692ba268d..d889388b0e7b 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -582,8 +582,8 @@ void SwColumnPage::Reset(const SfxItemSet &rSet) delete pColMgr; pColMgr = new SwColMgr(rSet); nCols = pColMgr->GetCount() ; - m_pCLNrEdt->SetMax(Max((sal_uInt16)m_pCLNrEdt->GetMax(), (sal_uInt16)nCols)); - m_pCLNrEdt->SetLast(Max(nCols,(sal_uInt16)m_pCLNrEdt->GetMax())); + m_pCLNrEdt->SetMax(std::max((sal_uInt16)m_pCLNrEdt->GetMax(), (sal_uInt16)nCols)); + m_pCLNrEdt->SetLast(std::max(nCols,(sal_uInt16)m_pCLNrEdt->GetMax())); if(bFrm) { @@ -672,7 +672,7 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ ) sal_uInt16 i; for( i = 1; i < nCols; ++i) - nMin = Min(nMin, nColWidth[i]); + nMin = std::min(nMin, nColWidth[i]); sal_Bool bAutoWidth = m_pAutoWidthBox->IsChecked(); if(!bAutoWidth) @@ -738,8 +738,8 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ ) } //set maximum values - m_pCLNrEdt->SetMax(Max(1L, - Min(long(nMaxCols), long( pColMgr->GetActualSize() / (nGutterWidth + MINLAY)) ))); + m_pCLNrEdt->SetMax(std::max(1L, + std::min(long(nMaxCols), long( pColMgr->GetActualSize() / (nGutterWidth + MINLAY)) ))); m_pCLNrEdt->SetLast(m_pCLNrEdt->GetMax()); m_pCLNrEdt->Reformat(); @@ -820,8 +820,8 @@ void SwColumnPage::Init() // set maximum number of columns // values below 1 are not allowed - m_pCLNrEdt->SetMax(Max(1L, - Min(long(nMaxCols), long( pColMgr->GetActualSize() / nMinWidth) ))); + m_pCLNrEdt->SetMax(std::max(1L, + std::min(long(nMaxCols), long( pColMgr->GetActualSize() / nMinWidth) ))); } /*------------------------------------------------------------------------ @@ -1332,7 +1332,7 @@ void ColumnValueSet::UserDraw( const UserDrawEvent& rUDEvt ) pDev->SetFillColor(rStyleSettings.GetFieldColor()); pDev->SetLineColor(SwViewOption::GetFontColor()); - long nStep = Abs(Abs(nRectHeight * 95 /100) / 11); + long nStep = std::abs(std::abs(nRectHeight * 95 /100) / 11); long nTop = (nRectHeight - 11 * nStep ) / 2; sal_uInt16 nCols = 0; long nStarts[3]; diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx index 81420d447c4b..21ebf5502eb6 100644 --- a/sw/source/ui/frmdlg/frmmgr.cxx +++ b/sw/source/ui/frmdlg/frmmgr.cxx @@ -594,7 +594,7 @@ void SwFlyFrmAttrMgr::SetHeightSizeType( SwFrmSize eType ) void SwFlyFrmAttrMgr::SetSize( const Size& rSize ) { SwFmtFrmSize aSize( GetFrmSize() ); - aSize.SetSize(Size(Max(rSize.Width(), long(MINFLY)), Max(rSize.Height(), long(MINFLY)))); + aSize.SetSize(Size(std::max(rSize.Width(), long(MINFLY)), std::max(rSize.Height(), long(MINFLY)))); aSet.Put( aSize ); } diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 3750852f1157..01130f009590 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -1072,12 +1072,12 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) if (aRelWidthCB.IsChecked()) { - aSz.SetWidthPercent((sal_uInt8)Min( static_cast< sal_Int64 >(MAX_PERCENT_WIDTH), aWidthED.Convert(aWidthED.NormalizePercent(nNewWidth), FUNIT_TWIP, FUNIT_CUSTOM))); + aSz.SetWidthPercent((sal_uInt8)std::min( static_cast< sal_Int64 >(MAX_PERCENT_WIDTH), aWidthED.Convert(aWidthED.NormalizePercent(nNewWidth), FUNIT_TWIP, FUNIT_CUSTOM))); } else aSz.SetWidthPercent(0); if (aRelHeightCB.IsChecked()) - aSz.SetHeightPercent((sal_uInt8)Min(static_cast< sal_Int64 >(MAX_PERCENT_HEIGHT), aHeightED.Convert(aHeightED.NormalizePercent(nNewHeight), FUNIT_TWIP, FUNIT_CUSTOM))); + aSz.SetHeightPercent((sal_uInt8)std::min(static_cast< sal_Int64 >(MAX_PERCENT_HEIGHT), aHeightED.Convert(aHeightED.NormalizePercent(nNewHeight), FUNIT_TWIP, FUNIT_CUSTOM))); else aSz.SetHeightPercent(0); @@ -1756,10 +1756,10 @@ IMPL_LINK_NOARG(SwFrmPage, RangeModifyHdl) if (aVal.bAutoHeight && (nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE)) { - SwTwips nTmp = Min(nWidth * nMaxHeight / Max(nHeight, 1L), nMaxHeight); + SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max(nHeight, 1L), nMaxHeight); aWidthED.SetMax(aWidthED.NormalizePercent(nTmp), FUNIT_TWIP); - nTmp = Min(nHeight * nMaxWidth / Max(nWidth, 1L), nMaxWidth); + nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, 1L), nMaxWidth); aHeightED.SetMax(aWidthED.NormalizePercent(nTmp), FUNIT_TWIP); } else diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index cfba070c0fb8..35842327cd93 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -613,7 +613,7 @@ IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit ) { sal_Int64 nOpposite = pOpposite->GetValue(); - if (nValue + nOpposite > Max(pEdit->GetMax(), pOpposite->GetMax())) + if (nValue + nOpposite > std::max(pEdit->GetMax(), pOpposite->GetMax())) pOpposite->SetValue(pOpposite->GetMax() - nValue); } diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 073b7acd7942..c2b5a9f65a81 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -598,7 +598,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pFld ) if(nActLevel & nMask) { SwNumFmt aNumFmt(pNumRule->Get(i)); - aNumFmt.SetIncludeUpperLevels( Min( (sal_uInt8)pFld->GetValue(), + aNumFmt.SetIncludeUpperLevels( std::min( (sal_uInt8)pFld->GetValue(), (sal_uInt8)(i + 1)) ); pNumRule->Set(i, aNumFmt); } @@ -971,7 +971,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) nStart--; SwNumberTree::tNumberVector aNumVector; - sal_uInt8 nEnd = Min( (sal_uInt8)(nStart + 3), MAXLEVEL ); + sal_uInt8 nEnd = std::min( (sal_uInt8)(nStart + 3), MAXLEVEL ); for( sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel ) { const SwNumFmt &rFmt = pActNum->Get(nLevel); diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx index a961620e71ef..cf9ff24bb953 100644 --- a/sw/source/ui/misc/redlndlg.cxx +++ b/sw/source/ui/misc/redlndlg.cxx @@ -622,7 +622,7 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd) // set the cursor after the last entry because otherwise performance problem in TLB. // TLB would otherwise reset the cursor at every Remove (expensive) - sal_uInt16 nPos = Min((sal_uInt16)nCount, (sal_uInt16)aRedlineParents.size()); + sal_uInt16 nPos = std::min((sal_uInt16)nCount, (sal_uInt16)aRedlineParents.size()); SvTreeListEntry *pCurEntry = NULL; while( ( pCurEntry == NULL ) && ( nPos > 0 ) ) { @@ -689,7 +689,7 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd) String sParent; sal_uInt16 nCount = pSh->GetRedlineCount(); - nEnd = Min((sal_uInt16)nEnd, (sal_uInt16)(nCount - 1)); // also treats nEnd=USHRT_MAX (until the end) + nEnd = std::min((sal_uInt16)nEnd, (sal_uInt16)(nCount - 1)); // also treats nEnd=USHRT_MAX (until the end) if (nEnd == USHRT_MAX) return; // no redlines in the document diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index af4b5cf972b9..c3a1b07d860c 100644 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -181,7 +181,7 @@ void SwInputWindow::Resize() long nLeft = aEdit.GetPosPixel().X(); Size aEditSize = aEdit.GetSizePixel(); - aEditSize.Width() = Max( ((long)(nWidth - nLeft - 5)), (long)0 ); + aEditSize.Width() = std::max( ((long)(nWidth - nLeft - 5)), (long)0 ); aEdit.SetSizePixel( aEditSize ); aEdit.Invalidate(); } diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index 43c57935c176..aa5327fb4c14 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -228,7 +228,7 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh ) SwTwips nLeft = aLRSpace.GetLeft(); SwTwips nRight = aLRSpace.GetRight(); SwTwips nDiff = pRep->GetSpace() - nRight - nLeft - nWidth; - if(nAlign != text::HoriOrientation::FULL && Abs(nDiff) > 2) + if(nAlign != text::HoriOrientation::FULL && std::abs(nDiff) > 2) { SwTwips nLR = pRep->GetSpace() - nWidth; switch ( nAlign ) @@ -479,9 +479,9 @@ void SwTableShell::Execute(SfxRequest &rReq) { aBox = *(SvxBoxItem*)pBoxItem; if ( !rReq.IsAPI() ) - aBox.SetDistance( Max(rCoreBox.GetDistance(),sal_uInt16(55)) ); + aBox.SetDistance( std::max(rCoreBox.GetDistance(),sal_uInt16(55)) ); else if ( aBox.GetDistance() < MIN_BORDER_DIST ) - aBox.SetDistance( Max(rCoreBox.GetDistance(),(sal_uInt16)MIN_BORDER_DIST) ); + aBox.SetDistance( std::max(rCoreBox.GetDistance(),(sal_uInt16)MIN_BORDER_DIST) ); } else OSL_ENSURE( !this, "where is BoxItem?" ); diff --git a/sw/source/ui/table/swtablerep.cxx b/sw/source/ui/table/swtablerep.cxx index 88d86a8447fb..578dd6d41306 100644 --- a/sw/source/ui/table/swtablerep.cxx +++ b/sw/source/ui/table/swtablerep.cxx @@ -173,10 +173,10 @@ sal_Bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const } // intercept rounding errors - if(Abs((long)nOldLeft - (long)rTabCols.GetLeft()) < 3) + if(std::abs((long)nOldLeft - (long)rTabCols.GetLeft()) < 3) rTabCols.SetLeft(nOldLeft); - if(Abs((long)nOldRight - (long)rTabCols.GetRight()) < 3) + if(std::abs((long)nOldRight - (long)rTabCols.GetRight()) < 3) rTabCols.SetRight(nOldRight); if(GetRightSpace() >= 0 && diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index bda054f21a85..0ad320473729 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -475,7 +475,7 @@ void SwFormatTablePage::Reset( const SfxItemSet& ) pTblData->GetWidth()), FUNIT_TWIP); m_aWidthMF.SaveValue(); nSaveWidth = pTblData->GetWidth(); - nMinTableWidth = Min( nSaveWidth, nMinTableWidth ); + nMinTableWidth = std::min( nSaveWidth, nMinTableWidth ); } m_aWidthMF.SetRefValue(pTblData->GetSpace()); @@ -658,11 +658,11 @@ int SwFormatTablePage::DeactivatePage( SfxItemSet* _pSet ) } if(nColSum != pTblData->GetWidth()) { - SwTwips nMinWidth = Min( (long)MINLAY, + SwTwips nMinWidth = std::min( (long)MINLAY, (long) (pTblData->GetWidth() / pTblData->GetColCount() - 1)); SwTwips nDiff = nColSum - pTblData->GetWidth(); - while ( Abs(nDiff) > pTblData->GetColCount() + 1 ) + while ( std::abs(nDiff) > pTblData->GetColCount() + 1 ) { SwTwips nSub = nDiff / pTblData->GetColCount(); for( i = 0; i < pTblData->GetColCount(); i++) diff --git a/sw/source/ui/table/tablemgr.cxx b/sw/source/ui/table/tablemgr.cxx index 9bfe0a932464..720c5af468e6 100644 --- a/sw/source/ui/table/tablemgr.cxx +++ b/sw/source/ui/table/tablemgr.cxx @@ -147,7 +147,7 @@ void SwTableFUNC::SetColWidth(sal_uInt16 nNum, SwTwips nNewWidth ) aCols[ static_cast< sal_uInt16 >(GetRightSeparator(nNum-1)) ] -= nDiff; } else - aCols.SetRight( Min( nNewWidth, aCols.GetRightMax()) ); + aCols.SetRight( std::min( nNewWidth, aCols.GetRightMax()) ); pSh->StartAllAction(); pSh->SetTabCols( aCols, bCurrentOnly ); diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index de217bc56a49..8ce5a3220d5d 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -646,7 +646,7 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, nNewSelectedPageNum = 1; } else - nScrollAmount = - Min( aViewWin.GetOutputSize().Height(), + nScrollAmount = - std::min( aViewWin.GetOutputSize().Height(), aViewWin.GetPaintedPreviewDocRect().Top() ); } else @@ -660,7 +660,7 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, nNewSelectedPageNum = mnPageCount; } else - nScrollAmount = Min( aViewWin.GetOutputSize().Height(), + nScrollAmount = std::min( aViewWin.GetOutputSize().Height(), ( pPagePrevwLay->GetPrevwDocSize().Height() - aViewWin.GetPaintedPreviewDocRect().Bottom() ) ); } @@ -1396,13 +1396,13 @@ void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollba if(aLR.Top() < 0) { - aLR.Bottom() += Abs(aLR.Top()); + aLR.Bottom() += std::abs(aLR.Top()); aLR.Top() = 0; } if(aLR.Left() < 0) { - aLR.Right() += Abs(aLR.Left()); + aLR.Right() += std::abs(aLR.Left()); aLR.Left() = 0; } if(aLR.Right() < 0) aLR.Right() = 0; diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index a67e93c50bd3..3033e2afcce0 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -1354,7 +1354,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) long nFac = aWindowSize.Width() * 100 / nTmpWidth; long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height(); - nFac = Min( nFac, nVisPercent ); + nFac = std::min( nFac, nVisPercent ); aZoomSliderItem.AddSnappingPoint( nFac ); @@ -1362,7 +1362,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) { nTmpWidth += aPageSize.Width() + GAPBETWEENPAGES; nFac = aWindowSize.Width() * 100 / nTmpWidth; - nFac = Min( nFac, nVisPercent ); + nFac = std::min( nFac, nVisPercent ); aZoomSliderItem.AddSnappingPoint( nFac ); } } diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx index c10c99019fd6..b942edb0c37b 100644 --- a/sw/source/ui/uiview/viewmdi.cxx +++ b/sw/source/ui/uiview/viewmdi.cxx @@ -111,7 +111,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, if( nsUseOnPage::PD_MIRROR == rDesc.GetUseOn() ) // gespiegelte Seiten { const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace(); - aPageSize.Width() += Abs( long(rLeftLRSpace.GetLeft()) - long(rLRSpace.GetLeft()) ); + aPageSize.Width() += std::abs( long(rLeftLRSpace.GetLeft()) - long(rLRSpace.GetLeft()) ); } if( SVX_ZOOM_OPTIMAL == eZoomType ) @@ -132,7 +132,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, if ( SVX_ZOOM_WHOLEPAGE == eZoomType ) { long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height(); - nFac = Min( nFac, nVisPercent ); + nFac = std::min( nFac, nVisPercent ); } } else @@ -142,7 +142,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, } } - nFac = Max( long( MINZOOM ), nFac ); + nFac = std::max( long( MINZOOM ), nFac ); SwViewOption aOpt( *pOpt ); if ( !GetViewFrame()->GetFrame().IsInPlace() ) diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index db07ebb1f92b..a273495e7c60 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -138,14 +138,14 @@ long SwView::SetHScrollMax( long lMax ) // bei negativen Werten ist das Dokument vollstaendig sichtbar; // in diesem Fall kein Scrollen - return Max( Min( lMax, lSize ), 0L ); + return std::max( std::min( lMax, lSize ), 0L ); } long SwView::SetVScrollMax( long lMax ) { const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; long lSize = GetDocSz().Height() + lBorder - m_aVisArea.GetHeight(); - return Max( Min( lMax, lSize), 0L ); // siehe horz. + return std::max( std::min( lMax, lSize), 0L ); // siehe horz. } Point SwView::AlignToPixel(const Point &rPt) const @@ -259,8 +259,8 @@ void SwView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar ) { m_pWrtShell->VisPortChgd( m_aVisArea ); if ( aOldSz != m_pWrtShell->VisArea().SSize() && - ( Abs(aOldSz.Width() - m_pWrtShell->VisArea().Width()) > 2 || - Abs(aOldSz.Height() - m_pWrtShell->VisArea().Height()) > 2 ) ) + ( std::abs(aOldSz.Width() - m_pWrtShell->VisArea().Width()) > 2 || + std::abs(aOldSz.Height() - m_pWrtShell->VisArea().Height()) > 2 ) ) m_pWrtShell->CheckBrowseView( sal_False ); } @@ -359,16 +359,16 @@ void SwView::CalcPt( Point *pPt, const Rectangle &rRect, long nYScroll = GetYScroll(); long nDesHeight = rRect.GetHeight(); long nCurHeight = m_aVisArea.GetHeight(); - nYScroll = Min(nYScroll, nCurHeight - nDesHeight); // wird es knapp, dann nicht zuviel scrollen + nYScroll = std::min(nYScroll, nCurHeight - nDesHeight); // wird es knapp, dann nicht zuviel scrollen if(nDesHeight > nCurHeight) // die Hoehe reicht nicht aus, dann interessiert nYScroll nicht mehr { pPt->Y() = rRect.Top(); - pPt->Y() = Max( lMin, pPt->Y() ); + pPt->Y() = std::max( lMin, pPt->Y() ); } else if ( rRect.Top() < m_aVisArea.Top() ) //Verschiebung nach oben { pPt->Y() = rRect.Top() - (nRangeY != USHRT_MAX ? nRangeY : nYScroll); - pPt->Y() = Max( lMin, pPt->Y() ); + pPt->Y() = std::max( lMin, pPt->Y() ); } else if( rRect.Bottom() > m_aVisArea.Bottom() ) //Verschiebung nach unten { @@ -388,9 +388,9 @@ void SwView::CalcPt( Point *pPt, const Rectangle &rRect, else if ( rRect.Left() < m_aVisArea.Left() ) //Verschiebung nach links { pPt->X() = rRect.Left() - (nRangeX != USHRT_MAX ? nRangeX : nXScroll); - pPt->X() = Max( ::GetLeftMargin( *this ) + nLeftOfst, pPt->X() ); - pPt->X() = Min( rRect.Left() - nScrollX, pPt->X() ); - pPt->X() = Max( 0L, pPt->X() ); + pPt->X() = std::max( ::GetLeftMargin( *this ) + nLeftOfst, pPt->X() ); + pPt->X() = std::min( rRect.Left() - nScrollX, pPt->X() ); + pPt->X() = std::max( 0L, pPt->X() ); } } @@ -462,8 +462,8 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan aSize.Height()+ GetYScroll() > aVisSize.Height() )) { Point aPt( m_aVisArea.TopLeft() ); - aSize.Width() = Min( aSize.Width(), aVisSize.Width() ); - aSize.Height()= Min( aSize.Height(),aVisSize.Height()); + aSize.Width() = std::min( aSize.Width(), aVisSize.Width() ); + aSize.Height()= std::min( aSize.Height(),aVisSize.Height()); CalcPt( &aPt, Rectangle( rRect.TopLeft(), aSize ), static_cast< sal_uInt16 >((aVisSize.Width() - aSize.Width()) / 2), @@ -472,7 +472,7 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan if( m_bTopCrsr ) { const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0; - aPt.Y() = Min( Max( nBorder, rRect.Top() ), + aPt.Y() = std::min( std::max( nBorder, rRect.Top() ), m_aDocSz.Height() + nBorder - m_aVisArea.GetHeight() ); } @@ -489,7 +489,7 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan if( m_bTopCrsr ) { const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0; - aPt.Y() = Min( Max( nBorder, rRect.Top() ), + aPt.Y() = std::min( std::max( nBorder, rRect.Top() ), m_aDocSz.Height() + nBorder - m_aVisArea.GetHeight() ); } @@ -513,7 +513,7 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan - m_aVisArea.Left() - m_aVisArea.Right() ) / 2; aPnt.X() = SetHScrollMax( aPnt.X() ); const SwTwips lMin = IsDocumentBorder() ? DOCUMENTBORDER : 0; - aPnt.X() = Max( (GetLeftMargin( *this ) - lMin) + nLeftOfst, aPnt.X() ); + aPnt.X() = std::max( (GetLeftMargin( *this ) - lMin) + nLeftOfst, aPnt.X() ); } m_aVisArea = aOldVisArea; if( pCareWn ) @@ -566,7 +566,7 @@ long SwView::PageUp() Point aPos(m_aVisArea.TopLeft()); aPos.Y() -= m_aVisArea.GetHeight() - (GetYScroll() / 2); - aPos.Y() = Max(0L, aPos.Y()); + aPos.Y() = std::max(0L, aPos.Y()); SetVisArea( aPos ); return 1; } @@ -1259,9 +1259,9 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) { long nFact = m_pWrtShell->GetViewOptions()->GetZoom(); if( 0L > pWData->GetDelta() ) - nFact = Max( (long) 20, basegfx::zoomtools::zoomOut( nFact )); + nFact = std::max( (long) 20, basegfx::zoomtools::zoomOut( nFact )); else - nFact = Min( (long) 600, basegfx::zoomtools::zoomIn( nFact )); + nFact = std::min( (long) 600, basegfx::zoomtools::zoomIn( nFact )); SetZoom( SVX_ZOOM_PERCENT, nFact ); bOk = sal_True; @@ -1269,7 +1269,7 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) else if( pWData && COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode() ) { int newZoom = 100 * (m_pWrtShell->GetViewOptions()->GetZoom() / 100.0) * (pWData->GetDelta() / 100.0); - SetZoom( SVX_ZOOM_PERCENT, Max( 20, Min( 600, newZoom ) ) ); + SetZoom( SVX_ZOOM_PERCENT, std::max( 20, std::min( 600, newZoom ) ) ); bOk = sal_True; } else diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx index b00d5ab1c1d1..d3a9942734cf 100644 --- a/sw/source/ui/uiview/viewtab.cxx +++ b/sw/source/ui/uiview/viewtab.cxx @@ -1575,7 +1575,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) &rDesc.GetMaster().GetCol(); const SwColumns& rCols = pCols->GetColumns(); sal_uInt16 nNum = rSh.GetCurOutColNum(); - sal_uInt16 nCount = Min(sal_uInt16(nNum + 1), sal_uInt16(rCols.size())); + sal_uInt16 nCount = std::min(sal_uInt16(nNum + 1), sal_uInt16(rCols.size())); const SwRect aRect( rSh.GetAnyCurRect( pFmt ? RECT_FLY_PRT_EMBEDDED : RECT_PAGE_PRT, pPt )); diff --git a/sw/source/ui/utlui/prcntfld.cxx b/sw/source/ui/utlui/prcntfld.cxx index 00aa1d71e508..100176e00796 100644 --- a/sw/source/ui/utlui/prcntfld.cxx +++ b/sw/source/ui/utlui/prcntfld.cxx @@ -103,7 +103,7 @@ void PercentField::ShowPercent(sal_Bool bPercent) // round to 0.5 percent nPercent = ((nAktWidth * 10) / nRefValue + 5) / 10; - MetricField::SetMin(Max(static_cast< sal_Int64 >(1), nPercent)); + MetricField::SetMin(std::max(static_cast< sal_Int64 >(1), nPercent)); MetricField::SetMax(100); SetSpinSize(5); MetricField::SetBaseValue(0); @@ -169,7 +169,7 @@ void PercentFieldWrap::ShowPercent(bool bPercent) // round to 0.5 percent nPercent = ((nAktWidth * 10) / nRefValue + 5) / 10; - m_pField->SetMin(Max(static_cast< sal_Int64 >(1), nPercent)); + m_pField->SetMin(std::max(static_cast< sal_Int64 >(1), nPercent)); m_pField->SetMax(100); m_pField->SetSpinSize(5); m_pField->SetBaseValue(0); @@ -311,7 +311,7 @@ void PercentField::SetMin(sal_Int64 nNewMin, FieldUnit eInUnit) nOldMin = Convert(nNewMin, eInUnit, eOldUnit); sal_Int64 nPercent = Convert(nNewMin, eInUnit, FUNIT_CUSTOM); - MetricField::SetMin(Max( static_cast< sal_Int64 >(1), nPercent)); + MetricField::SetMin(std::max( static_cast< sal_Int64 >(1), nPercent)); } } @@ -326,7 +326,7 @@ void PercentFieldWrap::SetMin(sal_Int64 nNewMin, FieldUnit eInUnit) nOldMin = Convert(nNewMin, eInUnit, eOldUnit); sal_Int64 nPercent = Convert(nNewMin, eInUnit, FUNIT_CUSTOM); - m_pField->SetMin(Max( static_cast< sal_Int64 >(1), nPercent)); + m_pField->SetMin(std::max( static_cast< sal_Int64 >(1), nPercent)); } } diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx index 59aaf3707c93..04baf9f5c4df 100644 --- a/sw/source/ui/vba/vbatablehelper.cxx +++ b/sw/source/ui/vba/vbatablehelper.cxx @@ -263,7 +263,7 @@ void SwVbaTableHelper::SetColWidth( sal_Int32 _width, sal_Int32 nCol, sal_Int32 aCols[ static_cast< sal_uInt16 >(GetRightSeparator( aCols, nCol-1)) ] -= nDiff; } else - aCols.SetRight( Min( (long)nNewWidth, aCols.GetRightMax()) ); + aCols.SetRight( std::min( (long)nNewWidth, aCols.GetRightMax()) ); pTable->SetTabCols(aCols, aOldCols, pStart, bCurRowOnly ); } |