diff options
Diffstat (limited to 'sw/source/core')
63 files changed, 288 insertions, 288 deletions
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 ) |