diff options
337 files changed, 1211 insertions, 1224 deletions
diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx index ef4d53f01797..dad73a85cc75 100644 --- a/UnoControls/source/controls/progressmonitor.cxx +++ b/UnoControls/source/controls/progressmonitor.cxx @@ -754,14 +754,14 @@ void ProgressMonitor::impl_recalcLayout () // But "Width" is oriented on left column below progressbar to!!! "max(...)" nX_Topic_Top = PROGRESSMONITOR_FREEBORDER ; nY_Topic_Top = PROGRESSMONITOR_FREEBORDER ; - nWidth_Topic_Top = Max ( aTopicSize_Top.Width, aTopicSize_Bottom.Width ) ; + nWidth_Topic_Top = std::max( aTopicSize_Top.Width, aTopicSize_Bottom.Width ) ; nHeight_Topic_Top = aTopicSize_Top.Height ; // Right column before progressbar has relativ position to left column ... // ... and a size as rest of dialog size! nX_Text_Top = nX_Topic_Top+nWidth_Topic_Top+PROGRESSMONITOR_FREEBORDER; nY_Text_Top = nY_Topic_Top ; - nWidth_Text_Top = Max ( aTextSize_Top.Width, aTextSize_Bottom.Width ) ; + nWidth_Text_Top = std::max ( aTextSize_Top.Width, aTextSize_Bottom.Width ) ; // Fix size of this column to minimum! sal_Int32 nSummaryWidth = nWidth_Text_Top+nWidth_Topic_Top+(3*PROGRESSMONITOR_FREEBORDER) ; if ( nSummaryWidth < PROGRESSMONITOR_DEFAULT_WIDTH ) diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index ed20f7d66c34..d5c1bc86726d 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -543,8 +543,8 @@ void VCLXAccessibleList::UpdateEntryRange_Impl() if ( nTop != m_nLastTopEntry ) { UpdateVisibleLineCount(); - sal_Int32 nBegin = Min( m_nLastTopEntry, nTop ); - sal_Int32 nEnd = Max( m_nLastTopEntry + m_nVisibleLineCount, nTop + m_nVisibleLineCount ); + sal_Int32 nBegin = std::min( m_nLastTopEntry, nTop ); + sal_Int32 nEnd = std::max( m_nLastTopEntry + m_nVisibleLineCount, nTop + m_nVisibleLineCount ); for (sal_uInt16 i = static_cast<sal_uInt16>(nBegin); (i <= static_cast<sal_uInt16>(nEnd)); ++i) { sal_Bool bVisible = ( i >= nTop && i < ( nTop + m_nVisibleLineCount ) ); diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 841794356d74..962658ffda91 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -787,7 +787,7 @@ void ModulWindow::EditMacro( const OUString& rMacroName ) long nMaxY = pView->GetTextEngine()->GetTextHeight() - nVisHeight; long nOldStartY = pView->GetStartDocPos().Y(); long nNewStartY = nStart * pView->GetTextEngine()->GetCharHeight(); - nNewStartY = Min( nNewStartY, nMaxY ); + nNewStartY = std::min( nNewStartY, nMaxY ); pView->Scroll( 0, -(nNewStartY-nOldStartY) ); pView->ShowCursor( false, true ); GetEditVScrollBar().SetThumbPos( pView->GetStartDocPos().Y() ); diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index b5da3b18c9af..1e5fe154a866 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -3459,7 +3459,7 @@ RTLFUNC(Shell) { sal_Int32 iFoundSpacePos = aCmdLine.indexOf( ' ', i ); sal_Int32 iFoundTabPos = aCmdLine.indexOf( '\t', i ); - sal_Int32 iFoundPos = iFoundSpacePos >= 0 ? iFoundTabPos >= 0 ? Min( iFoundSpacePos, iFoundTabPos ) : iFoundSpacePos : -1; + sal_Int32 iFoundPos = iFoundSpacePos >= 0 ? iFoundTabPos >= 0 ? std::min( iFoundSpacePos, iFoundTabPos ) : iFoundSpacePos : -1; if( iFoundPos < 0 ) { diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx index 829780d02519..ca401941da2b 100644 --- a/chart2/source/tools/CommonConverters.cxx +++ b/chart2/source/tools/CommonConverters.cxx @@ -235,7 +235,7 @@ void addPolygon( drawing::PolyPolygonShape3D& rRet, const drawing::PolyPolygonSh void appendPoly( drawing::PolyPolygonShape3D& rRet, const drawing::PolyPolygonShape3D& rAdd ) { - sal_Int32 nOuterCount = Max( rRet.SequenceX.getLength(), rAdd.SequenceX.getLength() ); + sal_Int32 nOuterCount = std::max( rRet.SequenceX.getLength(), rAdd.SequenceX.getLength() ); rRet.SequenceX.realloc(nOuterCount); rRet.SequenceY.realloc(nOuterCount); rRet.SequenceZ.realloc(nOuterCount); diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 7eef298f8f51..99819f385106 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1314,7 +1314,7 @@ sal_Bool ODbaseTable::CreateFile(const INetURLObject& aFile, sal_Bool& bCreateMe { throwInvalidColumnType(STR_INVALID_COLUMN_PRECISION, aName); } - (*m_pFileStream) << (sal_uInt8) Min((unsigned)nPrecision, 255U); // field length + (*m_pFileStream) << (sal_uInt8) std::min((unsigned)nPrecision, 255U); // field length nRecLength = nRecLength + (sal_uInt16)::std::min((sal_uInt16)nPrecision, (sal_uInt16)255UL); (*m_pFileStream) << (sal_uInt8)0; // decimals break; diff --git a/connectivity/source/drivers/file/FNoException.cxx b/connectivity/source/drivers/file/FNoException.cxx index 10fbcbd4ba5d..7589e0f7221e 100644 --- a/connectivity/source/drivers/file/FNoException.cxx +++ b/connectivity/source/drivers/file/FNoException.cxx @@ -92,7 +92,7 @@ void OPreparedStatement::scanParameter(OSQLParseNode* pParseNode,::std::vector< OKeyValue* OResultSet::GetOrderbyKeyValue(OValueRefRow& _rRow) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "file", "Ocke.Janssen@sun.com", "OResultSet::GetOrderbyKeyValue" ); - sal_uInt32 nBookmarkValue = Abs((sal_Int32)(_rRow->get())[0]->getValue()); + sal_uInt32 nBookmarkValue = std::abs((sal_Int32)(_rRow->get())[0]->getValue()); OKeyValue* pKeyValue = OKeyValue::createKeyValue((sal_uInt32)nBookmarkValue); diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 14b195c056da..555ac12f46de 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -986,7 +986,7 @@ again: } else if (m_pFileSet.is()) { - sal_uInt32 nBookmarkValue = Abs((sal_Int32)(m_aEvaluateRow->get())[0]->getValue()); + sal_uInt32 nBookmarkValue = std::abs((sal_Int32)(m_aEvaluateRow->get())[0]->getValue()); m_pFileSet->get().push_back(nBookmarkValue); } } diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 5928ee39a735..2adfb0aace50 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -3124,7 +3124,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage( long nCtrlW = aTopLevelLabel.GetSizePixel().Width(); if ( nTxtW >= nCtrlW ) { - long nDelta = Max( (long)10, nTxtW - nCtrlW ); + long nDelta = std::max( (long)10, nTxtW - nCtrlW ); Size aNewSz = aTopLevelLabel.GetSizePixel(); aNewSz.Width() += nDelta; aTopLevelLabel.SetSizePixel( aNewSz ); diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 4f521a1e4386..e027b7480037 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -210,8 +210,8 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) { Graphic aRet; - const Size aSize( Max( FRound( GetTileWidth() * fScaleX ), 1L ), - Max( FRound( GetTileHeight() * fScaleY ), 1L ) ); + const Size aSize( std::max( FRound( GetTileWidth() * fScaleX ), 1L ), + std::max( FRound( GetTileHeight() * fScaleY ), 1L ) ); BmpFilterParam aParam( aSize ); if( rGraphic.IsAnimated() ) diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index ef193e379065..ad6cac1d5a63 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -395,9 +395,9 @@ void SvxFontSubstCheckListBox::setColSizes() return; long nW1 = rBar.GetTextWidth(rBar.GetItemText(3)); long nW2 = rBar.GetTextWidth(rBar.GetItemText(4)); - long nMax = Max( nW1, nW2 ) + 6; // width of the longest header + a little offset + long nMax = std::max( nW1, nW2 ) + 6; // width of the longest header + a little offset long nMin = rBar.LogicToPixel(Size(10, 0), MAP_APPFONT).Width(); - nMax = Max( nMax, nMin ); + nMax = std::max( nMax, nMin ); const long nDoubleMax = 2*nMax; const long nRest = GetSizePixel().Width() - nDoubleMax; long aStaticTabs[] = { 4, 0, 0, 0, 0 }; diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index f04d6a6ce811..63ea530487c5 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -130,8 +130,8 @@ sal_Bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize ) if ( pSize ) { Size aSize = pSize->GetSize(); - long nDiffW = Abs( rSize.Width () - aSize.Width () ); - long nDiffH = Abs( rSize.Height() - aSize.Height() ); + long nDiffW = std::abs( rSize.Width () - aSize.Width () ); + long nDiffH = std::abs( rSize.Height() - aSize.Height() ); return ( nDiffW < 10 && nDiffH < 10 ); } else @@ -1446,8 +1446,8 @@ IMPL_LINK_NOARG(SvxPageDescPage, RangeHdl_Impl) long nFHeight = m_pBspWin->GetFtHeight(); long nFDist = m_pBspWin->GetFtDist(); - long nHFLeft = Max( m_pBspWin->GetHdLeft(), m_pBspWin->GetFtLeft() ); - long nHFRight = Max( m_pBspWin->GetHdRight(), m_pBspWin->GetFtRight() ); + long nHFLeft = std::max( m_pBspWin->GetHdLeft(), m_pBspWin->GetFtLeft() ); + long nHFRight = std::max( m_pBspWin->GetHdRight(), m_pBspWin->GetFtRight() ); // current values for page margins long nBT = static_cast<long>(m_pTopMarginEdit->Denormalize(m_pTopMarginEdit->GetValue(FUNIT_TWIP))); diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 73c0e0fc58ff..95b0be90d8b7 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -901,12 +901,12 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet& rSet) } pItem = GetItem( rSet, SID_ATTR_TRANSFORM_WIDTH ); - sal_Int32 nWidth = Max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, (sal_uInt32)1 ); + sal_Int32 nWidth = std::max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, (sal_uInt32)1 ); m_aWidthMF.SetValue(m_aWidthMF.Normalize(nWidth), FUNIT_TWIP); pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HEIGHT ); - sal_Int32 nHeight = Max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, (sal_uInt32)1 ); + sal_Int32 nHeight = std::max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, (sal_uInt32)1 ); m_aHeightMF.SetValue(m_aHeightMF.Normalize(nHeight), FUNIT_TWIP); m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0; diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index f8f6f82ca928..e15bb8475271 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -1073,7 +1073,7 @@ void SvxColorTabPage::RgbToCmyk_Impl( Color& rColor, sal_uInt16& rK ) sal_uInt16 const nColor2 = 255 - rColor.GetGreen(); sal_uInt16 const nColor3 = 255 - rColor.GetBlue(); - rK = Min( Min( nColor1, nColor2 ), nColor3 ); + rK = std::min( std::min( nColor1, nColor2 ), nColor3 ); rColor.SetRed( sal::static_int_cast< sal_uInt8 >( nColor1 - rK ) ); rColor.SetGreen( sal::static_int_cast< sal_uInt8 >( nColor2 - rK ) ); diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index afafa2b5a61d..3319f637c6f9 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -197,7 +197,7 @@ Rectangle OConnectionLine::GetBoundingRect() const OTableWindow* pDestWin = m_pTabConn->GetDestWin(); ////////////////////////////////////////////////////////////////////// // line proceeds in in z-Form - if( pSourceWin == pDestWin || Abs(m_aSourceConnPos.X() - m_aDestConnPos.X()) > Abs(m_aSourceDescrLinePos.X() - m_aDestDescrLinePos.X()) ) + if( pSourceWin == pDestWin || std::abs(m_aSourceConnPos.X() - m_aDestConnPos.X()) > std::abs(m_aSourceDescrLinePos.X() - m_aDestDescrLinePos.X()) ) { aTopLeft.X() -= DESCRIPT_LINE_WIDTH; aBottomRight.X() += DESCRIPT_LINE_WIDTH; diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index c1899492bb7d..06afc77352a9 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -577,7 +577,7 @@ void ParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff ) { // nInvalidPosEnd = pNode->Len(); DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" ); - nInvalidPosStart = Min( nInvalidPosStart, (sal_uInt16) ( nDiff < 0 ? nStart+nDiff : nDiff ) ); + nInvalidPosStart = std::min( nInvalidPosStart, (sal_uInt16) ( nDiff < 0 ? nStart+nDiff : nDiff ) ); nInvalidDiff = 0; bSimple = sal_False; } @@ -596,7 +596,7 @@ void ParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /* nEnd */ } else { - nInvalidPosStart = Min( nInvalidPosStart, nStart ); + nInvalidPosStart = std::min( nInvalidPosStart, nStart ); // nInvalidPosEnd = pNode->Len(); } nInvalidDiff = 0; diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 1cfc48c8b494..7525db99b9ee 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -257,8 +257,8 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion, OutputD long nX1 = pEditEngine->GetXPos(pTmpPortion, pLine, nTmpStartIndex, true); long nX2 = pEditEngine->GetXPos(pTmpPortion, pLine, nTmpEndIndex); - Point aPt1( Min( nX1, nX2 ), aTopLeft.Y() ); - Point aPt2( Max( nX1, nX2 ), aBottomRight.Y() ); + Point aPt1( std::min( nX1, nX2 ), aTopLeft.Y() ); + Point aPt2( std::max( nX1, nX2 ), aBottomRight.Y() ); ImplDrawHighlightRect( pTarget, aPt1, aPt2, pPolyPoly ); @@ -765,10 +765,10 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sa long nDiffY = !IsVertical() ? nDocDiffY : nDocDiffX; // Negative: Back to the top or left edge - if ( ( Abs( nDiffY ) > pEditEngine->GetOnePixelInRef() ) && DoBigScroll() ) + if ( ( std::abs( nDiffY ) > pEditEngine->GetOnePixelInRef() ) && DoBigScroll() ) { long nH = aOutArea.GetHeight() / 4; - if ( ( nH > aEditCursor.GetHeight() ) && ( Abs( nDiffY ) < nH ) ) + if ( ( nH > aEditCursor.GetHeight() ) && ( std::abs( nDiffY ) < nH ) ) { if ( nDiffY < 0 ) nDiffY -= nH; @@ -777,10 +777,10 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sa } } - if ( ( Abs( nDiffX ) > pEditEngine->GetOnePixelInRef() ) && DoBigScroll() ) + if ( ( std::abs( nDiffX ) > pEditEngine->GetOnePixelInRef() ) && DoBigScroll() ) { long nW = aOutArea.GetWidth() / 4; - if ( Abs( nDiffX ) < nW ) + if ( std::abs( nDiffX ) < nW ) { if ( nDiffY < 0 ) nDiffY -= nW; diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 75169ca3e593..e75a7f9c314f 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -3709,7 +3709,7 @@ sal_uInt16 ImpEditEngine::GetChar( pParaPortion->GetNode()->GetString(), nRight, aLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount ); if ( ( nLeft != nChar ) && ( nRight != nChar ) ) { - nChar = ( Abs( nRight - nChar ) < Abs( nLeft - nChar ) ) ? nRight : nLeft; + nChar = ( std::abs( nRight - nChar ) < std::abs( nLeft - nChar ) ) ? nRight : nLeft; } } } @@ -4145,7 +4145,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_uInt16 nIndex if ( nFlags & GETCRSR_TXTONLY ) aEditCursor.Top() = aEditCursor.Bottom() - pLine->GetTxtHeight() + 1; else - aEditCursor.Top() = aEditCursor.Bottom() - Min( pLine->GetTxtHeight(), pLine->GetHeight() ) + 1; + aEditCursor.Top() = aEditCursor.Bottom() - std::min( pLine->GetTxtHeight(), pLine->GetHeight() ) + 1; return aEditCursor; } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index da52915fa92b..b682fdc5897c 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -415,7 +415,7 @@ void ImpEditEngine::FormatDoc() if ( aInvalidRect.IsEmpty() ) { // For Paperwidth 0 (AutoPageSize) it would otherwise be Empty()... - long nWidth = Max( (long)1, ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) ); + long nWidth = std::max( (long)1, ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) ); Range aInvRange( GetInvalidYOffsets( pParaPortion ) ); aInvalidRect = Rectangle( Point( 0, nY+aInvRange.Min() ), Size( nWidth, aInvRange.Len() ) ); @@ -442,7 +442,7 @@ void ImpEditEngine::FormatDoc() aStatus.GetStatusWord() |= !IsVertical() ? EE_STAT_TEXTHEIGHTCHANGED : EE_STAT_TEXTWIDTHCHANGED; if ( nNewHeight < nCurTextHeight ) { - aInvalidRect.Bottom() = (long)Max( nNewHeight, nCurTextHeight ); + aInvalidRect.Bottom() = (long)std::max( nNewHeight, nCurTextHeight ); if ( aInvalidRect.IsEmpty() ) { aInvalidRect.Top() = 0; @@ -632,7 +632,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY ) const short nInvalidDiff = pParaPortion->GetInvalidDiff(); const sal_uInt16 nInvalidStart = pParaPortion->GetInvalidPosStart(); - const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff ); + const sal_uInt16 nInvalidEnd = nInvalidStart + std::abs( nInvalidDiff ); sal_Bool bQuickFormat = sal_False; if ( !bEmptyNodeWithPolygon && !HasScriptType( nPara, i18n::ScriptType::COMPLEX ) ) @@ -864,7 +864,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY ) { // Try further down in the polygon. // Below the polygon use the Paper Width. - nTextExtraYOffset += Max( (long)(nTextLineHeight / 10), (long)1 ); + nTextExtraYOffset += std::max( (long)(nTextLineHeight / 10), (long)1 ); if ( ( nTextY + nTextExtraYOffset ) > GetTextRanger()->GetBoundRect().Bottom() ) { nXWidth = !IsVertical() ? GetPaperSize().Width() : GetPaperSize().Height(); @@ -3956,8 +3956,8 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNe { // in this case one can redraw directly without invalidating the // Portions - sal_uInt16 nFirstPortion = Min( (sal_uInt16)aOldPositions.Min(), nNewPos ); - sal_uInt16 nLastPortion = Max( (sal_uInt16)aOldPositions.Max(), nNewPos ); + sal_uInt16 nFirstPortion = std::min( (sal_uInt16)aOldPositions.Min(), nNewPos ); + sal_uInt16 nLastPortion = std::max( (sal_uInt16)aOldPositions.Max(), nNewPos ); ParaPortion* pUpperPortion = GetParaPortions().SafeGetObject( nFirstPortion ); ParaPortion* pLowerPortion = GetParaPortions().SafeGetObject( nLastPortion ); @@ -3973,7 +3973,7 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNe else { // redraw from the upper invalid position - sal_uInt16 nFirstInvPara = Min( (sal_uInt16)aOldPositions.Min(), nNewPos ); + sal_uInt16 nFirstInvPara = std::min( (sal_uInt16)aOldPositions.Min(), nNewPos ); InvalidateFromParagraph( nFirstInvPara ); } return aSel; diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 34ef278174f2..08aed29dbd6a 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -988,7 +988,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, rOutput << "{\\*\\updnprop" << OString::valueOf( static_cast<sal_Int32>(nProp100)).getStr() << '}'; } - long nUpDown = nFontHeight * Abs( nEsc ) / 100; + long nUpDown = nFontHeight * std::abs( nEsc ) / 100; OString aUpDown = OString::valueOf( static_cast<sal_Int32>(nUpDown)); if ( nEsc < 0 ) diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx index 837c0325fba2..0c6648dbce77 100644 --- a/editeng/source/items/svxfont.cxx +++ b/editeng/source/items/svxfont.cxx @@ -209,7 +209,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const const xub_StrLen nLen = STRING_LEN == nPartLen ? rDo.GetLen() : nPartLen; const XubString aTxt( CalcCaseMap( rTxt ) ); - const sal_uInt16 nTxtLen = Min( rTxt.Len(), nLen ); + const sal_uInt16 nTxtLen = std::min( rTxt.Len(), nLen ); sal_uInt16 nPos = 0; sal_uInt16 nOldPos = nPos; diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 31d316bd82bf..66f5fa3c539f 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -2491,7 +2491,7 @@ bool SvxEscapementItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case MID_ESC: { sal_Int16 nVal = sal_Int16(); - if( (rVal >>= nVal) && (Abs(nVal) <= 101)) + if( (rVal >>= nVal) && (std::abs(nVal) <= 101)) nEsc = nVal; else return sal_False; diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index d9adae804867..7a53b0e524a0 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -240,7 +240,7 @@ void Outliner::SetMaxDepth( sal_Int16 nDepth, sal_Bool bCheckParagraphs ) { if( nMaxDepth != nDepth ) { - nMaxDepth = Min( nDepth, (sal_Int16)(SVX_MAX_NUM-1) ); + nMaxDepth = std::min( nDepth, (sal_Int16)(SVX_MAX_NUM-1) ); if( bCheckParagraphs ) { @@ -1580,7 +1580,7 @@ Rectangle Outliner::ImpCalcBulletArea( sal_uInt16 nPara, sal_Bool bAdjust, sal_B const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&) pEditEngine->GetParaAttrib( nPara, bOutlineMode ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE ); aTopLeft.X() = rLR.GetTxtLeft() + rLR.GetTxtFirstLineOfst() + nSpaceBefore; - long nBulletWidth = Max( (long) -rLR.GetTxtFirstLineOfst(), (long) ((-pFmt->GetFirstLineOffset()) + pFmt->GetCharTextDistance()) ); + long nBulletWidth = std::max( (long) -rLR.GetTxtFirstLineOfst(), (long) ((-pFmt->GetFirstLineOffset()) + pFmt->GetCharTextDistance()) ); if ( nBulletWidth < aBulletSize.Width() ) // The Bullet creates its space nBulletWidth = aBulletSize.Width(); @@ -1839,7 +1839,7 @@ IMPL_LINK( Outliner, EndMovingParagraphsHdl, MoveParagraphsInfo*, pInfos ) DBG_CHKTHIS(Outliner,0); pParaList->MoveParagraphs( pInfos->nStartPara, pInfos->nDestPara, pInfos->nEndPara - pInfos->nStartPara + 1 ); - sal_uInt16 nChangesStart = Min( pInfos->nStartPara, pInfos->nDestPara ); + sal_uInt16 nChangesStart = std::min( pInfos->nStartPara, pInfos->nDestPara ); sal_uInt16 nParas = (sal_uInt16)pParaList->GetParagraphCount(); for ( sal_uInt16 n = nChangesStart; n < nParas; n++ ) ImplCalcBulletText( n, sal_False, sal_False ); diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index a4ab343098e4..abfb3d398644 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -694,7 +694,7 @@ void Writer::Impl_writeText( const Point& rPos, const String& rText, const sal_I if( ( aOldFont.GetStrikeout() != STRIKEOUT_NONE ) || ( aOldFont.GetUnderline() != UNDERLINE_NONE ) ) { Polygon aPoly( 4 ); - const long nLineHeight = Max( (long) FRound( aMetric.GetLineHeight() * 0.05 ), (long) 1 ); + const long nLineHeight = std::max( (long) FRound( aMetric.GetLineHeight() * 0.05 ), (long) 1 ); if( aOldFont.GetStrikeout() != STRIKEOUT_NONE ) { diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index c72efcd1fdbf..a0543a00f6ed 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -854,11 +854,11 @@ sal_Bool TIFFReader::ConvertScanline( sal_uLong nY ) } } nBlack = nSamp[ 3 ]; - nRed = (sal_uInt8) Max( 0L, 255L - ( ( (long) nSamp[ 0 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) * + nRed = (sal_uInt8) std::max( 0L, 255L - ( ( (long) nSamp[ 0 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) * 255L/(long)(nMaxSampleValue-nMinSampleValue) ) ); - nGreen = (sal_uInt8) Max( 0L, 255L - ( ( (long) nSamp[ 1 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) * + nGreen = (sal_uInt8) std::max( 0L, 255L - ( ( (long) nSamp[ 1 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) * 255L/(long)(nMaxSampleValue-nMinSampleValue) ) ); - nBlue = (sal_uInt8) Max( 0L, 255L - ( ( (long) nSamp[ 2 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) * + nBlue = (sal_uInt8) std::max( 0L, 255L - ( ( (long) nSamp[ 2 ] + nBlack - ( ( (long) nMinSampleValue ) << 1 ) ) * 255L/(long)(nMaxSampleValue-nMinSampleValue) ) ); pAcc->SetPixel( nY, nx, Color ( (sal_uInt8)nRed, (sal_uInt8)nGreen, (sal_uInt8)nBlue ) ); } @@ -1156,7 +1156,7 @@ sal_Bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) pTIFF->ResetError(); break; }; - nMaxPos = Max( pTIFF->Tell(), nMaxPos ); + nMaxPos = std::max( pTIFF->Tell(), nMaxPos ); *pTIFF >> nNumTags; @@ -1166,15 +1166,15 @@ sal_Bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) *pTIFF >> nTagType >> nDataType >> nDataLen >> nOffset; if( DataTypeSize() * nDataLen > 4 ) - nMaxPos = Max( nOrigPos + nOffset + DataTypeSize() * nDataLen, nMaxPos ); + nMaxPos = std::max( nOrigPos + nOffset + DataTypeSize() * nDataLen, nMaxPos ); } *pTIFF >> nOffset; if ( pTIFF->IsEof() ) nOffset = 0; - nMaxPos = Max( pTIFF->Tell(), nMaxPos ); + nMaxPos = std::max( pTIFF->Tell(), nMaxPos ); if ( !nOffset ) - nMaxPos = Max( pTIFF->Tell(), nMaxPos ); + nMaxPos = std::max( pTIFF->Tell(), nMaxPos ); } while( nOffset ); @@ -1301,9 +1301,9 @@ sal_Bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) if ( bStatus && ReadMap( 10, 60 ) ) { - nMaxPos = Max( pTIFF->Tell(), nMaxPos ); + nMaxPos = std::max( pTIFF->Tell(), nMaxPos ); MakePalCol(); - nMaxPos = Max( pTIFF->Tell(), nMaxPos ); + nMaxPos = std::max( pTIFF->Tell(), nMaxPos ); } else bStatus = sal_False; diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 80cd9ca509d9..a223a2b9f9c3 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2706,7 +2706,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, if( rFont.GetStrikeout() != STRIKEOUT_NONE || rFont.GetUnderline() != UNDERLINE_NONE ) { Polygon aPoly( 4 ); - const long nLineHeight = Max( (long) FRound( aMetric.GetLineHeight() * 0.05 ), (long) 1 ); + const long nLineHeight = std::max( (long) FRound( aMetric.GetLineHeight() * 0.05 ), (long) 1 ); if( rFont.GetStrikeout() ) { diff --git a/forms/source/component/GroupManager.cxx b/forms/source/component/GroupManager.cxx index 86234c3db591..926c0cf34e79 100644 --- a/forms/source/component/GroupManager.cxx +++ b/forms/source/component/GroupManager.cxx @@ -119,7 +119,7 @@ OGroupComp::OGroupComp(const Reference<XPropertySet>& rxSet, sal_Int32 nInsertPo { if (hasProperty( PROPERTY_TABINDEX, m_xComponent ) ) // Indices kleiner 0 werden wie 0 behandelt - m_nTabIndex = Max(getINT16(m_xComponent->getPropertyValue( PROPERTY_TABINDEX )) , sal_Int16(0)); + m_nTabIndex = std::max(getINT16(m_xComponent->getPropertyValue( PROPERTY_TABINDEX )) , sal_Int16(0)); } } diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index acc3d8a9ba63..a4eaec8b3011 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -2537,7 +2537,7 @@ sal_Bool SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilt if ( INET_PROT_NOT_VALID != eProt && INET_PROT_FILE != eProt ) nQuestionMarkPos = STRING_NOTFOUND; } - sal_uInt16 nWildCardPos = Min( rPath.Search( FILEDIALOG_DEF_WILDCARD ), nQuestionMarkPos ); + sal_uInt16 nWildCardPos = std::min( rPath.Search( FILEDIALOG_DEF_WILDCARD ), nQuestionMarkPos ); rFilter = aEmpty; if ( nWildCardPos != STRING_NOTFOUND ) diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 96cb9e08348f..083f4c5cc6bb 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -698,7 +698,7 @@ sal_Bool DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > x DBG_ASSERT(!bNeedEntries, "lng : entries still not loaded"); if (nCount >= aEntries.getLength()) - aEntries.realloc( Max(2 * nCount, nCount + 32) ); + aEntries.realloc( std::max(2 * nCount, nCount + 32) ); uno::Reference< XDictionaryEntry > *pEntry = aEntries.getArray(); // shift old entries right diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index 293bf774392f..82178a3df94e 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.cxx @@ -152,7 +152,7 @@ Sequence< OUString > MergeProposalSeqs( sal_Int32 nAltCount2 = rAlt2.getLength(); const OUString *pAlt2 = rAlt2.getConstArray(); - sal_Int32 nCountNew = Min( nAltCount1 + nAltCount2, (sal_Int32) MAX_PROPOSALS ); + sal_Int32 nCountNew = std::min( nAltCount1 + nAltCount2, (sal_Int32) MAX_PROPOSALS ); aMerged.realloc( nCountNew ); OUString *pMerged = aMerged.getArray(); diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index d915dce80df1..65a1bee796f7 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -758,8 +758,8 @@ sal_Bool DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) checkMovementAllowed(rMEvt); if ( !m_rView.AreObjectsMarked() && - Abs(m_aMDPos.X() - aPos.X()) < nHitLog && - Abs(m_aMDPos.Y() - aPos.Y()) < nHitLog && + std::abs(m_aMDPos.X() - aPos.X()) < nHitLog && + std::abs(m_aMDPos.Y() - aPos.Y()) < nHitLog && !rMEvt.IsShift() && !rMEvt.IsMod2() ) { SdrPageView* pPV = m_rView.GetSdrPageView(); diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index 66db88a2094b..965e316a7f66 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -225,7 +225,7 @@ inline const ScPatternAttr* ScAttrIterator::Next( SCROW& rTop, SCROW& rBottom ) if ( nPos < pArray->nCount && nRow <= nEndRow ) { rTop = nRow; - rBottom = Min( pArray->pData[nPos].nRow, nEndRow ); + rBottom = std::min( pArray->pData[nPos].nRow, nEndRow ); pRet = pArray->pData[nPos].pPattern; nRow = rBottom + 1; ++nPos; diff --git a/sc/inc/bigrange.hxx b/sc/inc/bigrange.hxx index d36fa9ab8d14..a3efe5ade28c 100644 --- a/sc/inc/bigrange.hxx +++ b/sc/inc/bigrange.hxx @@ -222,9 +222,9 @@ inline sal_Bool ScBigRange::In( const ScBigRange& r ) const inline sal_Bool ScBigRange::Intersects( const ScBigRange& r ) const { return !( - Min( aEnd.Col(), r.aEnd.Col() ) < Max( aStart.Col(), r.aStart.Col() ) - || Min( aEnd.Row(), r.aEnd.Row() ) < Max( aStart.Row(), r.aStart.Row() ) - || Min( aEnd.Tab(), r.aEnd.Tab() ) < Max( aStart.Tab(), r.aStart.Tab() ) + std::min( aEnd.Col(), r.aEnd.Col() ) < std::max( aStart.Col(), r.aStart.Col() ) + || std::min( aEnd.Row(), r.aEnd.Row() ) < std::max( aStart.Row(), r.aStart.Row() ) + || std::min( aEnd.Tab(), r.aEnd.Tab() ) < std::max( aStart.Tab(), r.aStart.Tab() ) ); } diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index fbb74439c89c..7ef31030722d 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -431,8 +431,8 @@ void ScAttrArray::SetPatternArea(SCROW nStartRow, SCROW nEndRow, const ScPattern if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged, rNewSet, rOldSet ) ) { - aAdrStart.SetRow( Max(nStartRow,ns) ); - aAdrEnd .SetRow( Min(nEndRow,pData[nx].nRow) ); + aAdrStart.SetRow( std::max(nStartRow,ns) ); + aAdrEnd .SetRow( std::min(nEndRow,pData[nx].nRow) ); pDocument->InvalidateTextWidth( &aAdrStart, &aAdrEnd, bNumFormatChanged ); } ns = pData[nx].nRow + 1; @@ -1077,7 +1077,7 @@ void ScAttrArray::MergeBlockFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLine { pPattern = (ScPatternAttr*) pData[i].pPattern; lcl_MergeToFrame( pLineOuter, pLineInner, rFlags, pPattern, bLeft, nDistRight, false, - nEndRow - Min( pData[i].nRow, (SCROW)(nEndRow-1) ) ); + nEndRow - std::min( pData[i].nRow, (SCROW)(nEndRow-1) ) ); // nDistBottom here always > 0 } @@ -1185,7 +1185,7 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInf SCROW nTmpEnd; for (SCSIZE i=nStartIndex; i<=nEndIndex;) { - nTmpEnd = Min( (SCROW)(nEndRow-1), (SCROW)(pData[i].nRow) ); + nTmpEnd = std::min( (SCROW)(nEndRow-1), (SCROW)(pData[i].nRow) ); bool bChanged = ApplyFrame( pLineOuter, pLineInner, nTmpStart, nTmpEnd, bLeft, nDistRight, false, nEndRow-nTmpEnd ); nTmpStart = nTmpEnd+1; @@ -1496,7 +1496,7 @@ void ScAttrArray::SetPatternAreaSafe( SCROW nStartRow, SCROW nEndRow, { if (nThisRow < nStartRow) nThisRow = nStartRow; nRow = pData[nIndex].nRow; - SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow ); + SCROW nAttrRow = std::min( (SCROW)nRow, (SCROW)nEndRow ); pItem = (const ScMergeFlagAttr*) &pOldPattern->GetItem( ATTR_MERGE_FLAG ); if (pItem->IsOverlapped() || pItem->HasAutoFilter()) @@ -1554,7 +1554,7 @@ bool ScAttrArray::ApplyFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags ) if ( (nOldValue | nFlags) != nOldValue ) { nRow = pData[nIndex].nRow; - SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow ); + SCROW nAttrRow = std::min( (SCROW)nRow, (SCROW)nEndRow ); ScPatternAttr aNewPattern(*pOldPattern); aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue | nFlags ) ); SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true ); @@ -1591,7 +1591,7 @@ bool ScAttrArray::RemoveFlags( SCROW nStartRow, SCROW nEndRow, sal_Int16 nFlags if ( (nOldValue & ~nFlags) != nOldValue ) { nRow = pData[nIndex].nRow; - SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow ); + SCROW nAttrRow = std::min( (SCROW)nRow, (SCROW)nEndRow ); ScPatternAttr aNewPattern(*pOldPattern); aNewPattern.GetItemSet().Put( ScMergeFlagAttr( nOldValue & ~nFlags ) ); SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true ); @@ -1628,7 +1628,7 @@ void ScAttrArray::ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* aNewPattern.ClearItems( pWhich ); nRow = pData[nIndex].nRow; - SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow ); + SCROW nAttrRow = std::min( (SCROW)nRow, (SCROW)nEndRow ); SetPatternArea( nThisRow, nAttrRow, &aNewPattern, true ); Search( nThisRow, nIndex ); // data changed } @@ -1678,7 +1678,7 @@ void ScAttrArray::ChangeIndent( SCROW nStartRow, SCROW nEndRow, bool bIncrement if ( bNeedJust || nNewValue != nOldValue ) { SCROW nThisEnd = pData[nIndex].nRow; - SCROW nAttrRow = Min( nThisEnd, nEndRow ); + SCROW nAttrRow = std::min( nThisEnd, nEndRow ); ScPatternAttr aNewPattern(*pOldPattern); aNewPattern.GetItemSet().Put( SfxUInt16Item( ATTR_INDENT, nNewValue ) ); if ( bNeedJust ) @@ -2179,7 +2179,7 @@ void ScAttrArray::DeleteHardAttr(SCROW nStartRow, SCROW nEndRow) if ( pOldPattern->GetItemSet().Count() ) // hard attributes ? { nRow = pData[nIndex].nRow; - SCROW nAttrRow = Min( (SCROW)nRow, (SCROW)nEndRow ); + SCROW nAttrRow = std::min( (SCROW)nRow, (SCROW)nEndRow ); ScPatternAttr aNewPattern(*pOldPattern); SfxItemSet& rSet = aNewPattern.GetItemSet(); @@ -2211,10 +2211,10 @@ void ScAttrArray::MoveTo(SCROW nStartRow, SCROW nEndRow, ScAttrArray& rAttrArray if ((pData[i].nRow >= nStartRow) && ((i==0) ? true : pData[i-1].nRow < nEndRow)) { // copy (bPutToPool=TRUE) - rAttrArray.SetPatternArea( nStart, Min( (SCROW)pData[i].nRow, (SCROW)nEndRow ), + rAttrArray.SetPatternArea( nStart, std::min( (SCROW)pData[i].nRow, (SCROW)nEndRow ), pData[i].pPattern, true ); } - nStart = Max( (SCROW)nStart, (SCROW)(pData[i].nRow + 1) ); + nStart = std::max( (SCROW)nStart, (SCROW)(pData[i].nRow + 1) ); } DeleteArea(nStartRow, nEndRow); } @@ -2228,8 +2228,8 @@ void ScAttrArray::CopyArea( nStartRow -= nDy; // Source nEndRow -= nDy; - SCROW nDestStart = Max((long)((long)nStartRow + nDy), (long) 0); - SCROW nDestEnd = Min((long)((long)nEndRow + nDy), (long) MAXROW); + SCROW nDestStart = std::max((long)((long)nStartRow + nDy), (long) 0); + SCROW nDestEnd = std::min((long)((long)nEndRow + nDy), (long) MAXROW); ScDocumentPool* pSourceDocPool = pDocument->GetPool(); ScDocumentPool* pDestDocPool = rAttrArray.pDocument->GetPool(); @@ -2277,12 +2277,12 @@ void ScAttrArray::CopyArea( } rAttrArray.SetPatternArea(nDestStart, - Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern); + std::min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern); } // when pasting from clipboard and skipping filtered rows, the adjusted // end position can be negative - nDestStart = Max((long)nDestStart, (long)(pData[i].nRow + nDy + 1)); + nDestStart = std::max((long)nDestStart, (long)(pData[i].nRow + nDy + 1)); } } @@ -2295,8 +2295,8 @@ void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttr nStartRow -= nDy; // Source nEndRow -= nDy; - SCROW nDestStart = Max((long)((long)nStartRow + nDy), (long) 0); - SCROW nDestEnd = Min((long)((long)nEndRow + nDy), (long) MAXROW); + SCROW nDestStart = std::max((long)((long)nStartRow + nDy), (long) 0); + SCROW nDestEnd = std::min((long)((long)nEndRow + nDy), (long) MAXROW); if ( !rAttrArray.HasAttrib( nDestStart, nDestEnd, HASATTR_OVERLAPPED ) ) { @@ -2321,12 +2321,12 @@ void ScAttrArray::CopyAreaSafe( SCROW nStartRow, SCROW nEndRow, long nDy, ScAttr pNewPattern = pOldPattern->PutInPool( rAttrArray.pDocument, pDocument ); rAttrArray.SetPatternAreaSafe(nDestStart, - Min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern, false); + std::min((SCROW)(pData[i].nRow + nDy), nDestEnd), pNewPattern, false); } // when pasting from clipboard and skipping filtered rows, the adjusted // end position can be negative - nDestStart = Max((long)nDestStart, (long)(pData[i].nRow + nDy + 1)); + nDestStart = std::max((long)nDestStart, (long)(pData[i].nRow + nDy + 1)); } } diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 90b0927d78ec..8ecb82e212f0 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -501,8 +501,8 @@ void ScColumn::ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, nRow = nRow2; else { - SCROW nNewRow1 = Max( nRow1, nRow ); - SCROW nNewRow2 = Min( nRow2, nEndRow ); + SCROW nNewRow1 = std::max( nRow1, nRow ); + SCROW nNewRow2 = std::min( nRow2, nEndRow ); pAttrArray->ApplyCacheArea( nNewRow1, nNewRow2, &aCache ); nRow = nNewRow2; } @@ -731,7 +731,7 @@ bool ScColumn::Search( SCROW nRow, SCSIZE& nIndex ) const long nOldLo, nOldHi; long nLo = nOldLo = 0; - long nHi = nOldHi = Min(static_cast<long>(maItems.size())-1, static_cast<long>(nRow) ); + long nHi = nOldHi = std::min(static_cast<long>(maItems.size())-1, static_cast<long>(nRow) ); long i = 0; bool bFound = false; // quite continuous distribution? => interpolating search @@ -1450,7 +1450,7 @@ void ScColumn::CopyToColumn( while ( aIter.Next( nStart, nEnd ) && nStart <= nRow2 ) { if ( nEnd >= nRow1 ) - CopyToColumn( Max(nRow1,nStart), Min(nRow2,nEnd), + CopyToColumn( std::max(nRow1,nStart), std::min(nRow2,nEnd), nFlags, false, rColumn, pMarkData, bAsLink ); } } diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index abbcd99701e3..60e4b6423f8c 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -952,7 +952,7 @@ void ScColumn::MixData( SCROW nRow1, SCROW nRow2, while ( nNextThis <= nRow2 || nNextSrc <= nRow2 ) { - SCROW nRow = Min( nNextThis, nNextSrc ); + SCROW nRow = std::min( nNextThis, nNextSrc ); ScBaseCell* pSrc = NULL; ScBaseCell* pDest = NULL; diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 5228bc1d45f9..173905ae51ea 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -140,7 +140,7 @@ bool ScDocumentIterator::GetThisCol() } else { - nRow = Min( (SCROW)nColRow, (SCROW)(nAttrEnd+1) ); + nRow = std::min( (SCROW)nColRow, (SCROW)(nAttrEnd+1) ); } } while (!bFound && nRow <= MAXROW); diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 66a3e82ff429..5a45fda988f7 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -961,7 +961,7 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, { NumFmtMergeHandler aNumFmtMergeHdl(this, pSrcDoc); - nDestPos = Min(nDestPos, (SCTAB)(GetTableCount() - 1)); + nDestPos = std::min(nDestPos, (SCTAB)(GetTableCount() - 1)); { // scope for bulk broadcast ScBulkBroadcast aBulkBroadcast( pBASM); pSrcDoc->maTabs[nSrcPos]->CopyToTable(0, 0, MAXCOL, MAXROW, diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index f19cd8cc5272..37e4be0db04e 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -242,7 +242,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera aRef.Set( nCol1, nRow1, nTab1, false, true, true ); aForString.append(aRef.GetRefString(this, nTab1)); nCol1++; - nCol2 = Min( nCol2, (SCCOL)(rParam.aRefFormulaEnd.Col() - + nCol2 = std::min( nCol2, (SCCOL)(rParam.aRefFormulaEnd.Col() - rParam.aRefFormulaCell.Col() + nCol1 + 1)); } else if (rParam.nMode == 1) // nur zeilenweise @@ -255,7 +255,7 @@ void ScDocument::InsertTableOp(const ScTabOpParam& rParam, // Mehrfachopera aRef.Set( nCol1, nRow1, nTab1, true, false, true ); aForString.append(aRef.GetRefString(this, nTab1)); nRow1++; - nRow2 = Min( nRow2, (SCROW)(rParam.aRefFormulaEnd.Row() - + nRow2 = std::min( nRow2, (SCROW)(rParam.aRefFormulaEnd.Row() - rParam.aRefFormulaCell.Row() + nRow1 + 1)); } else // beides @@ -892,7 +892,7 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW SCCOLROW nTempOther = nOtherRow; bool bFound = false; sal_uInt16 nBest = SC_DOCCOMP_MAXDIFF; - SCCOLROW nMax = Min( nOtherEndRow, static_cast<SCCOLROW>(( nTempOther + nMaxCont + nUnknown )) ); + SCCOLROW nMax = std::min( nOtherEndRow, static_cast<SCCOLROW>(( nTempOther + nMaxCont + nUnknown )) ); for (SCCOLROW i=nTempOther; i<=nMax && nBest>0; i++) // bei 0 abbrechen { if (bColumns) @@ -942,7 +942,7 @@ void ScDocument::FindOrder( SCCOLROW* pOtherRows, SCCOLROW nThisEndRow, SCCOLROW { SCROW nDiff1 = nThisOther - nFillStart; SCROW nDiff2 = nThisRow - nFillPos; - SCROW nMinDiff = Min(nDiff1, nDiff2); + SCROW nMinDiff = std::min(nDiff1, nDiff2); for (SCROW i=0; i<nMinDiff; i++) pOtherRows[nFillPos+i] = nFillStart+i; } @@ -1001,7 +1001,7 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) { SCTAB nDiff1 = nThisOther - nFillStart; SCTAB nDiff2 = nThisTab - nFillPos; - SCTAB nMinDiff = Min(nDiff1, nDiff2); + SCTAB nMinDiff = std::min(nDiff1, nDiff2); for (SCTAB i=0; i<nMinDiff; i++) if ( !IsScenario(nFillPos+i) && !rOtherDoc.IsScenario(nFillStart+i) ) pOtherTabs[nFillPos+i] = nFillStart+i; @@ -1031,8 +1031,8 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) SCROW nOtherEndRow = 0; GetCellArea( nThisTab, nThisEndCol, nThisEndRow ); rOtherDoc.GetCellArea( nOtherTab, nOtherEndCol, nOtherEndRow ); - SCCOL nEndCol = Max(nThisEndCol, nOtherEndCol); - SCROW nEndRow = Max(nThisEndRow, nOtherEndRow); + SCCOL nEndCol = std::max(nThisEndCol, nOtherEndCol); + SCROW nEndRow = std::max(nThisEndRow, nOtherEndRow); SCCOL nThisCol; SCROW nThisRow; sal_uLong n1,n2; // fuer AppendDeleteRange diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index fe6d921236df..9d86d45b05f7 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1630,8 +1630,8 @@ void ScDocument::FitBlock( const ScRange& rOld, const ScRange& rNew, bool bClear if ( bInsCol || bInsRow ) { ScRange aGrowSource = rOld; - aGrowSource.aEnd.SetCol(Min( rOld.aEnd.Col(), rNew.aEnd.Col() )); - aGrowSource.aEnd.SetRow(Min( rOld.aEnd.Row(), rNew.aEnd.Row() )); + aGrowSource.aEnd.SetCol(std::min( rOld.aEnd.Col(), rNew.aEnd.Col() )); + aGrowSource.aEnd.SetRow(std::min( rOld.aEnd.Row(), rNew.aEnd.Row() )); SCCOL nGrowX = bInsCol ? ( rNew.aEnd.Col() - rOld.aEnd.Col() ) : 0; SCROW nGrowY = bInsRow ? ( rNew.aEnd.Row() - rOld.aEnd.Row() ) : 0; UpdateGrow( aGrowSource, nGrowX, nGrowY ); @@ -2522,7 +2522,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar nDx, nDy, &aCBFCP, nClipStartRow ); } nC1 = nC2 + 1; - nC2 = Min((SCCOL)(nC1 + nXw), nCol2); + nC2 = std::min((SCCOL)(nC1 + nXw), nCol2); } while (nC1 <= nCol2); if (nClipStartRow > nClipEndRow) nClipStartRow = aClipRange.aStart.Row(); @@ -2531,7 +2531,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar if (nC2 > nCol2) nC2 = nCol2; nR1 = nR2 + 1; - nR2 = Min((SCROW)(nR1 + nYw), nRow2); + nR2 = std::min((SCROW)(nR1 + nYw), nRow2); } while (nR1 <= nRow2); } @@ -5059,7 +5059,7 @@ bool ScDocument::ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow, if (((ScMergeFlagAttr&)pAttrArray->pData[nIndex].pPattern-> GetItem(ATTR_MERGE_FLAG)).IsHorOverlapped()) { - SCROW nLoopEndRow = Min( nEndRow, pAttrArray->pData[nIndex].nRow ); + SCROW nLoopEndRow = std::min( nEndRow, pAttrArray->pData[nIndex].nRow ); for (SCROW nAttrRow = nAttrPos; nAttrRow <= nLoopEndRow; nAttrRow++) { SCCOL nTempCol = nOldCol; diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 6f83b9e1fa29..c38ee38dba5a 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -1241,7 +1241,7 @@ void ScDPDimensions::CountChanged() if ( ppDims ) { long i; - long nCopy = Min( nNewCount, nDimCount ); + long nCopy = std::min( nNewCount, nDimCount ); ScDPDimension** ppNew = new ScDPDimension*[nNewCount]; for (i=0; i<nCopy; i++) // copy existing dims diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 97dea58f6725..fccbbdabaa19 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -1442,12 +1442,12 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const sal_Bool bResize = false; // sizes can differ by 1 from twips->1/100mm conversion for equal cell sizes, // don't resize to empty size when pasting into hidden columns or rows - if ( Abs(nWidthDiff) > 1 && nDestWidth > 1 && nSourceWidth > 1 ) + if ( std::abs(nWidthDiff) > 1 && nDestWidth > 1 && nSourceWidth > 1 ) { aHorFract = Fraction( nDestWidth, nSourceWidth ); bResize = sal_True; } - if ( Abs(nHeightDiff) > 1 && nDestHeight > 1 && nSourceHeight > 1 ) + if ( std::abs(nHeightDiff) > 1 && nDestHeight > 1 && nSourceHeight > 1 ) { aVerFract = Fraction( nDestHeight, nSourceHeight ); bResize = sal_True; diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx index 44f9e65bb06e..b6691c650da0 100644 --- a/sc/source/core/data/funcdesc.cxx +++ b/sc/source/core/data/funcdesc.cxx @@ -792,7 +792,7 @@ const formula::IFunctionDescription* ScFunctionMgr::getFunctionByName(const OUSt void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const { const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions(); - sal_uInt16 nLRUFuncCount = Min( rAppOpt.GetLRUFuncListCount(), (sal_uInt16)LRU_MAX ); + sal_uInt16 nLRUFuncCount = std::min( rAppOpt.GetLRUFuncListCount(), (sal_uInt16)LRU_MAX ); sal_uInt16* pLRUListIds = rAppOpt.GetLRUFuncList(); if ( pLRUListIds ) diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx index 307aba11973a..4357cd89525c 100644 --- a/sc/source/core/data/olinetab.cxx +++ b/sc/source/core/data/olinetab.cxx @@ -216,7 +216,7 @@ bool ScOutlineArray::Insert( sal_uInt16 nFindMax; FindEntry( nStartCol, nStartLevel, nStartIndex ); // nLevel = neuer Level (alter+1) !!! FindEntry( nEndCol, nEndLevel, nEndIndex ); - nFindMax = Max(nStartLevel,nEndLevel); + nFindMax = std::max(nStartLevel,nEndLevel); do { bCont = false; diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 06a3e3969ac2..9c52585df5d2 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -993,7 +993,7 @@ SCSIZE ScTable::GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, { nCount = static_cast<SCSIZE>(nEndRow - nStartRow); for (nCol = nStartCol; nCol <= nEndCol; nCol++) - nCount = Min(nCount, aCol[nCol].GetEmptyLinesInBlock(nStartRow, nEndRow, eDir)); + nCount = std::min(nCount, aCol[nCol].GetEmptyLinesInBlock(nStartRow, nEndRow, eDir)); } else if (eDir == DIR_RIGHT) { diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index fd0db12f4d72..5b024fd53ea8 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -945,10 +945,10 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMergeAttr& rOldMerge = (const ScMergeAttr&)rSet.Get(ATTR_MERGE); if (rOldMerge.IsMerged()) - rNewSet.Put( ScMergeAttr( Min( + rNewSet.Put( ScMergeAttr( std::min( static_cast<SCsCOL>(rOldMerge.GetRowMerge()), static_cast<SCsCOL>(MAXCOL+1 - (nAttrRow2-nRow1))), - Min( + std::min( static_cast<SCsROW>(rOldMerge.GetColMerge()), static_cast<SCsROW>(MAXROW+1 - (nCol-nCol1))))); const ScMergeFlagAttr& rOldFlag = (const ScMergeFlagAttr&)rSet.Get(ATTR_MERGE_FLAG); diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 0a1e4b087e4f..ec4e67bb4912 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -749,8 +749,8 @@ void ScTable::Sort(const ScSortParam& rSortParam, bool bKeepQuery, ScProgress* p { SCROW nLastRow = 0; for (SCCOL nCol = aSortParam.nCol1; nCol <= aSortParam.nCol2; nCol++) - nLastRow = Max(nLastRow, aCol[nCol].GetLastDataPos()); - nLastRow = Min(nLastRow, aSortParam.nRow2); + nLastRow = std::max(nLastRow, aCol[nCol].GetLastDataPos()); + nLastRow = std::min(nLastRow, aSortParam.nRow2); SCROW nRow1 = (rSortParam.bHasHeader ? aSortParam.nRow1 + 1 : aSortParam.nRow1); if (!IsSorted(nRow1, nLastRow)) diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index e4d89f04e90e..8b8b67ba5020 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -132,7 +132,7 @@ static OUString lcl_ValueString( sal_Int32 nValue, sal_uInt16 nMinDigits ) return OUString::number( nValue ); // simple case... else { - OUString aStr = OUString::number( Abs( nValue ) ); + OUString aStr = OUString::number( std::abs( nValue ) ); if ( aStr.getLength() < nMinDigits ) { OUStringBuffer aZero; @@ -604,8 +604,8 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, if (pNewPattern || pSrcPattern != pDocument->GetDefPattern()) { // Default is already present (DeleteArea) - SCROW nY1 = static_cast<SCROW>(Min( nIStart, nIEnd )); - SCROW nY2 = static_cast<SCROW>(Max( nIStart, nIEnd )); + SCROW nY1 = static_cast<SCROW>(std::min( nIStart, nIEnd )); + SCROW nY2 = static_cast<SCROW>(std::max( nIStart, nIEnd )); if ( pStyleSheet ) aCol[nCol].ApplyStyleArea( nY1, nY2, *pStyleSheet ); if ( pNewPattern ) @@ -1253,7 +1253,7 @@ void ScTable::IncDate(double& rVal, sal_uInt16& nDayOfMonth, double nStep, FillD aDate.SetMonth((sal_uInt16) nMonth); aDate.SetYear((sal_uInt16) nYear); if ( nDayOfMonth > 28 ) - aDate.SetDay( Min( aDate.GetDaysInMonth(), nDayOfMonth ) ); + aDate.SetDay( std::min( aDate.GetDaysInMonth(), nDayOfMonth ) ); } } break; diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index e9c916a64914..729f91254663 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -287,8 +287,8 @@ bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, if (!bAll && rSearchItem.GetBackward()) { SCROW nLastNonFilteredRow = MAXROW + 1; - nCol = Min(nCol, (SCCOL)(nLastCol + 1)); - nRow = Min(nRow, (SCROW)(nLastRow + 1)); + nCol = std::min(nCol, (SCCOL)(nLastCol + 1)); + nRow = std::min(nRow, (SCROW)(nLastRow + 1)); if (rSearchItem.GetRowDirection()) { nCol--; diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index cdc13803a4cf..e21aa1917b59 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1331,9 +1331,9 @@ sal_uInt16 ScAddress::Parse( const String& r, ScDocument* pDoc, bool ScRange::Intersects( const ScRange& r ) const { return !( - Min( aEnd.Col(), r.aEnd.Col() ) < Max( aStart.Col(), r.aStart.Col() ) - || Min( aEnd.Row(), r.aEnd.Row() ) < Max( aStart.Row(), r.aStart.Row() ) - || Min( aEnd.Tab(), r.aEnd.Tab() ) < Max( aStart.Tab(), r.aStart.Tab() ) + std::min( aEnd.Col(), r.aEnd.Col() ) < std::max( aStart.Col(), r.aStart.Col() ) + || std::min( aEnd.Row(), r.aEnd.Row() ) < std::max( aStart.Row(), r.aStart.Row() ) + || std::min( aEnd.Tab(), r.aEnd.Tab() ) < std::max( aStart.Tab(), r.aStart.Tab() ) ); } diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 1e099602e1a7..afd50e1c8f57 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3110,7 +3110,7 @@ bool ScCompiler::IsColRowName( const String& rName ) { // right or below bTwo = true; aTwo.Set( nCol, nRow, aAddress.Tab() ); - nMax = Max( nMyCol + Abs( nC ), nMyRow + Abs( nR ) ); + nMax = std::max( nMyCol + std::abs( nC ), nMyRow + std::abs( nR ) ); nDistance = nD; } else if ( !(nRow < aOne.Row() && nMyRow >= (long)aOne.Row()) ) @@ -3120,7 +3120,7 @@ bool ScCompiler::IsColRowName( const String& rName ) // runs column-wise) bTwo = false; aOne.Set( nCol, nRow, aAddress.Tab() ); - nMax = Max( nMyCol + nC, nMyRow + nR ); + nMax = std::max( nMyCol + nC, nMyRow + nR ); nDistance = nD; } } @@ -3129,7 +3129,8 @@ bool ScCompiler::IsColRowName( const String& rName ) { aOne.Set( nCol, nRow, aAddress.Tab() ); nDistance = nC * nC + nR * nR; - nMax = Max( nMyCol + Abs( nC ), nMyRow + Abs( nR ) ); + nMax = std::max( nMyCol + std::abs( nC ), nMyRow + std::abs( nR ) ); + } bFound = true; } @@ -3173,7 +3174,7 @@ bool ScCompiler::IsColRowName( const String& rName ) { // right or below bTwo = true; aTwo.Set( nCol, nRow, aIter.GetPos().Tab() ); - nMax = Max( nMyCol + Abs( nC ), nMyRow + Abs( nR ) ); + nMax = std::max( nMyCol + std::abs( nC ), nMyRow + std::abs( nR ) ); nDistance = nD; } else if ( !(nRow < aOne.Row() && nMyRow >= (long)aOne.Row()) ) @@ -3183,7 +3184,7 @@ bool ScCompiler::IsColRowName( const String& rName ) // runs column-wise) bTwo = false; aOne.Set( nCol, nRow, aIter.GetPos().Tab() ); - nMax = Max( nMyCol + nC, nMyRow + nR ); + nMax = std::max( nMyCol + nC, nMyRow + nR ); nDistance = nD; } } @@ -3192,7 +3193,7 @@ bool ScCompiler::IsColRowName( const String& rName ) { aOne.Set( nCol, nRow, aIter.GetPos().Tab() ); nDistance = nC * nC + nR * nR; - nMax = Max( nMyCol + Abs( nC ), nMyRow + Abs( nR ) ); + nMax = std::max( nMyCol + std::abs( nC ), nMyRow + std::abs( nR ) ); } bFound = true; } diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx index 1d7309aec4f9..286261e28978 100644 --- a/sc/source/core/tool/consoli.cxx +++ b/sc/source/core/tool/consoli.cxx @@ -311,7 +311,7 @@ void ScConsData::AddName( const String& rName ) SCSIZE nMax = 0; for (nArrX=0; nArrX<nColCount; nArrX++) if (ppUsed[nArrX][nArrY]) - nMax = Max( nMax, ppRefs[nArrX][nArrY].GetCount() ); + nMax = std::max( nMax, ppRefs[nArrX][nArrY].GetCount() ); for (nArrX=0; nArrX<nColCount; nArrX++) { @@ -642,7 +642,7 @@ SCROW ScConsData::GetInsertCount() const SCSIZE nNeeded = 0; for (nArrX=0; nArrX<nColCount; nArrX++) if (ppUsed[nArrX][nArrY]) - nNeeded = Max( nNeeded, ppRefs[nArrX][nArrY].GetCount() ); + nNeeded = std::max( nNeeded, ppRefs[nArrX][nArrY].GetCount() ); nInsert += nNeeded; } @@ -721,7 +721,7 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow, SCSIZE nNeeded = 0; for (nArrX=0; nArrX<nColCount; nArrX++) if (ppUsed[nArrX][nArrY]) - nNeeded = Max( nNeeded, ppRefs[nArrX][nArrY].GetCount() ); + nNeeded = std::max( nNeeded, ppRefs[nArrX][nArrY].GetCount() ); if (nNeeded) { diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 54277e05a59d..0c16240afa24 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -1155,8 +1155,8 @@ ScMatrixRef ScInterpreter::CompareMat( ScCompareOptions* pOptions ) SCSIZE nR0, nR1; pMat[0]->GetDimensions( nC0, nR0 ); pMat[1]->GetDimensions( nC1, nR1 ); - SCSIZE nC = Max( nC0, nC1 ); - SCSIZE nR = Max( nR0, nR1 ); + SCSIZE nC = std::max( nC0, nC1 ); + SCSIZE nR = std::max( nR0, nR1 ); pResMat = GetNewMat( nC, nR); if ( !pResMat ) return NULL; diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 7a2df402ee8a..4e0cde4fc896 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2382,7 +2382,7 @@ void ScInterpreter::ScBase() { const xub_StrLen nConstBuf = 128; sal_Unicode aBuf[nConstBuf]; - xub_StrLen nBuf = Max( (xub_StrLen) fChars, (xub_StrLen) (nMinLen+1) ); + xub_StrLen nBuf = std::max( (xub_StrLen) fChars, (xub_StrLen) (nMinLen+1) ); sal_Unicode* pBuf = (nBuf <= nConstBuf ? aBuf : new sal_Unicode[nBuf]); for ( xub_StrLen j = 0; j < nBuf; ++j ) { diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index a6571ab729a5..b95b66035a8f 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -220,7 +220,7 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList ) { Add( new XclExpBoolRecord( EXC_ID_DSF, false ) ); Add( new XclExpEmptyRecord( EXC_ID_XL9FILE ) ); - rR.pTabId = new XclExpChTrTabId( Max( nExcTabCount, nCodenames ) ); + rR.pTabId = new XclExpChTrTabId( std::max( nExcTabCount, nCodenames ) ); Add( rR.pTabId ); if( HasVbaStorage() ) { diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index e288d8326b43..34bda87e8c60 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -1446,7 +1446,7 @@ void ExcelToSc8::ExcRelToScRel8( sal_uInt16 nRow, sal_uInt16 nC, ScSingleRefData rSRD.nRelRow = static_cast<SCsROW>(static_cast<sal_Int16>(nRow)); else // abs Row - rSRD.nRow = Min( static_cast<SCROW>(nRow), MAXROW); + rSRD.nRow = std::min( static_cast<SCROW>(nRow), MAXROW); // T A B // abs needed if rel in shared formula for ScCompiler UpdateNameReference diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 91a5bc10cdc4..fc8be48a3e57 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -408,7 +408,7 @@ void ExcBundlesheet::SaveCont( XclExpStream& rStrm ) sal_Size ExcBundlesheet::GetLen() const { - return 7 + Min( aName.getLength(), (sal_Int32) 255 ); + return 7 + std::min( aName.getLength(), (sal_Int32) 255 ); } diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 0c85a4d9ddcd..4851f2069810 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1467,7 +1467,7 @@ bool XclExpDefcolwidth::IsDefWidth( sal_uInt16 nXclColWidth ) const { double fNewColWidth = lclGetCorrectedColWidth( GetRoot(), nXclColWidth ); // exactly matched, if difference is less than 1/16 of a character to the left or to the right - return Abs( static_cast< long >( GetValue() * 256.0 - fNewColWidth + 0.5 ) ) < 16; + return std::abs( static_cast< long >( GetValue() * 256.0 - fNewColWidth + 0.5 ) ) < 16; } void XclExpDefcolwidth::SetDefWidth( sal_uInt16 nXclColWidth ) diff --git a/sc/source/filter/excel/xlpage.cxx b/sc/source/filter/excel/xlpage.cxx index 14a590d93592..70cac7caf478 100644 --- a/sc/source/filter/excel/xlpage.cxx +++ b/sc/source/filter/excel/xlpage.cxx @@ -242,8 +242,8 @@ void XclPageData::SetScPaperSize( const Size& rSize, bool bPortrait, bool bStric for( const XclPaperSize* pEntry = pPaperSizeTable; pEntry != STATIC_ARRAY_END( pPaperSizeTable ); ++pEntry ) { - long nWDiff = Abs( pEntry->mnWidth - nWidth ); - long nHDiff = Abs( pEntry->mnHeight - nHeight ); + long nWDiff = std::abs( pEntry->mnWidth - nWidth ); + long nHDiff = std::abs( pEntry->mnHeight - nHeight ); if( ((nWDiff <= nMaxWDiff) && (nHDiff < nMaxHDiff)) || ((nWDiff < nMaxWDiff) && (nHDiff <= nMaxHDiff)) ) { diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index d7dd473e23ea..1517c8109084 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -920,7 +920,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) SCROW nR; sal_uLong v; if ( pGraphEntry ) - nC = Max( SCCOL(pGraphEntry->aRange.aEnd.Col() - nCol + 1), + nC = std::max( SCCOL(pGraphEntry->aRange.aEnd.Col() - nCol + 1), SCCOL(rMergeAttr.GetColMerge()) ); else nC = rMergeAttr.GetColMerge(); @@ -934,7 +934,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) } if ( pGraphEntry ) - nR = Max( SCROW(pGraphEntry->aRange.aEnd.Row() - nRow + 1), + nR = std::max( SCROW(pGraphEntry->aRange.aEnd.Row() - nRow + 1), SCROW(rMergeAttr.GetRowMerge()) ); else nR = rMergeAttr.GetRowMerge(); diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 94bd17dc1e4f..0a6a89cca1f2 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -736,7 +736,7 @@ void ScHTMLLayoutParser::SetWidths() sal_uInt16 nTotal = 0; bool bFound = false; SCCOL nHere = 0; - SCCOL nStop = Min( static_cast<SCCOL>(nCol + pE->nColOverlap), nColsPerRow ); + SCCOL nStop = std::min( static_cast<SCCOL>(nCol + pE->nColOverlap), nColsPerRow ); for ( ; nCol < nStop; nCol++ ) { if ( pWidths[nCol] ) diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index b7c514b9e023..64287b9c7530 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -743,7 +743,7 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc ) SC10TOSTRING( pHeadFootLine->LogFont.lfFaceName ), EMPTY_STRING, PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ), EE_CHAR_FONTINFO ); - aEditAttribs.Put( SvxFontHeightItem( Abs( pHeadFootLine->LogFont.lfHeight ), 100, EE_CHAR_FONTHEIGHT ), + aEditAttribs.Put( SvxFontHeightItem( std::abs( pHeadFootLine->LogFont.lfHeight ), 100, EE_CHAR_FONTHEIGHT ), EE_CHAR_FONTHEIGHT); Sc10Color nColor = pHeadFootLine->TextColor; @@ -1184,7 +1184,7 @@ void Sc10Import::LoadPatternCollection() } rItemSet.Put( SvxFontItem( eFam, SC10TOSTRING( pPattern->LogFont.lfFaceName ), EMPTY_STRING, PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, ATTR_FONT ) ); - rItemSet.Put( SvxFontHeightItem( Abs( pPattern->LogFont.lfHeight ), 100, ATTR_FONT_HEIGHT ) ); + rItemSet.Put( SvxFontHeightItem( std::abs( pPattern->LogFont.lfHeight ), 100, ATTR_FONT_HEIGHT ) ); Color TextColor( COL_BLACK ); lcl_ChangeColor( ( pPattern->nColor & 0x000F ), TextColor ); rItemSet.Put( SvxColorItem( TextColor, ATTR_FONT_COLOR ) ); @@ -1239,7 +1239,7 @@ void Sc10Import::LoadPatternCollection() else if( ( OJustify & ojTopBottom ) == ojTopBottom ) rItemSet.Put( SfxInt32Item( ATTR_ROTATE_VALUE, 27000 ) ); - sal_Int16 Margin = Max( ( sal_uInt16 ) 20, ( sal_uInt16 ) ( EJustify * 20 ) ); + sal_Int16 Margin = std::max( ( sal_uInt16 ) 20, ( sal_uInt16 ) ( EJustify * 20 ) ); if( ( ( OJustify & ojBottomTop ) == ojBottomTop ) ) rItemSet.Put( SvxMarginItem( 20, Margin, 20, Margin, ATTR_MARGIN ) ); else @@ -1760,7 +1760,7 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab) ScPatternAttr aScPattern(pDoc->GetPool()); aScPattern.GetItemSet().Put(SvxFontItem(eFam, SC10TOSTRING( pFont->FaceName ), EMPTY_STRING, PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, ATTR_FONT )); - aScPattern.GetItemSet().Put(SvxFontHeightItem(Abs(pFont->Height), 100, ATTR_FONT_HEIGHT )); + aScPattern.GetItemSet().Put(SvxFontHeightItem(std::abs(pFont->Height), 100, ATTR_FONT_HEIGHT )); pDoc->ApplyPatternAreaTab(Col, nStart, Col, nEnd, Tab, aScPattern); } } @@ -1861,7 +1861,7 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab) else if (OJustify & ojTopBottom) aScPattern.GetItemSet().Put(SfxInt32Item(ATTR_ROTATE_VALUE,27000)); - sal_Int16 Margin = Max((sal_uInt16)20, (sal_uInt16)(EJustify * 20)); + sal_Int16 Margin = std::max((sal_uInt16)20, (sal_uInt16)(EJustify * 20)); if (OJustify & ojBottomTop) aScPattern.GetItemSet().Put(SvxMarginItem(20, Margin, 20, Margin, ATTR_MARGIN)); else diff --git a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx index b13efc2d5309..9696efc91968 100644 --- a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx +++ b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx @@ -99,7 +99,7 @@ ScXMLCellRangeSourceContext::ScXMLCellRangeSourceContext( { double fTime; if (::sax::Converter::convertDuration( fTime, sValue )) - pCellRangeSource->nRefresh = Max( (sal_Int32)(fTime * 86400.0), (sal_Int32)0 ); + pCellRangeSource->nRefresh = std::max( (sal_Int32)(fTime * 86400.0), (sal_Int32)0 ); } break; } diff --git a/sc/source/filter/xml/XMLConsolidationContext.cxx b/sc/source/filter/xml/XMLConsolidationContext.cxx index 3cf06b1f063c..245e2cbdc2eb 100644 --- a/sc/source/filter/xml/XMLConsolidationContext.cxx +++ b/sc/source/filter/xml/XMLConsolidationContext.cxx @@ -105,7 +105,7 @@ void ScXMLConsolidationContext::EndElement() aConsParam.nTab = aTargetAddr.Tab(); aConsParam.eFunction = eFunction; - sal_uInt16 nCount = (sal_uInt16) Min( ScRangeStringConverter::GetTokenCount( sSourceList ), (sal_Int32)0xFFFF ); + sal_uInt16 nCount = (sal_uInt16) std::min( ScRangeStringConverter::GetTokenCount( sSourceList ), (sal_Int32)0xFFFF ); ScArea** ppAreas = nCount ? new ScArea*[ nCount ] : NULL; if( ppAreas ) { diff --git a/sc/source/filter/xml/XMLTableSourceContext.cxx b/sc/source/filter/xml/XMLTableSourceContext.cxx index ea854786b64c..9116ff86973b 100644 --- a/sc/source/filter/xml/XMLTableSourceContext.cxx +++ b/sc/source/filter/xml/XMLTableSourceContext.cxx @@ -76,7 +76,7 @@ ScXMLTableSourceContext::ScXMLTableSourceContext( ScXMLImport& rImport, { double fTime; if (::sax::Converter::convertDuration( fTime, sValue )) - nRefresh = Max( (sal_Int32)(fTime * 86400.0), (sal_Int32)0 ); + nRefresh = std::max( (sal_Int32)(fTime * 86400.0), (sal_Int32)0 ); } } } diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index cd34058438eb..85f451bb7fc6 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -203,7 +203,7 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport, { double fTime; if (::sax::Converter::convertDuration( fTime, sValue )) - nRefresh = Max( (sal_Int32)(fTime * 86400.0), (sal_Int32)0 ); + nRefresh = std::max( (sal_Int32)(fTime * 86400.0), (sal_Int32)0 ); } break; } diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index aa069dbf7659..311fab420650 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -568,7 +568,7 @@ void ScInputWindow::Resize() long nLeft = aTextWindow.GetPosPixel().X(); Size aSize = aTextWindow.GetSizePixel(); - aSize.Width() = Max( ((long)(nWidth - nLeft - 5)), (long)0 ); + aSize.Width() = std::max( ((long)(nWidth - nLeft - 5)), (long)0 ); aTextWindow.SetSizePixel( aSize ); aTextWindow.Invalidate(); @@ -951,7 +951,7 @@ void ScInputBarGroup::Resize() long nLeft = GetPosPixel().X(); Size aSize = GetSizePixel(); - aSize.Width() = Max( ((long)(nWidth - nLeft - LEFT_OFFSET)), (long)0 ); + aSize.Width() = std::max( ((long)(nWidth - nLeft - LEFT_OFFSET)), (long)0 ); aScrollBar.SetPosPixel(Point( aSize.Width() - aButton.GetSizePixel().Width(), aButton.GetSizePixel().Height() ) ); @@ -1889,7 +1889,7 @@ void ScTextWnd::SetTextString( const String& rNewString ) long nSize1 = GetTextWidth(aString); long nSize2 = GetTextWidth(rNewString); if ( nSize1>0 && nSize2>0 ) - nTextSize = Max( nSize1, nSize2 ); + nTextSize = std::max( nSize1, nSize2 ); else nTextSize = GetOutputSize().Width(); // Ueberlauf diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 63ab473ea7a9..ac3daadc55fa 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -765,7 +765,7 @@ void ScModule::InsertEntryToLRUList(sal_uInt16 nFIndex) if(nFIndex != 0) { const ScAppOptions& rAppOpt = GetAppOptions(); - sal_uInt16 nLRUFuncCount = Min( rAppOpt.GetLRUFuncListCount(), (sal_uInt16)LRU_MAX ); + sal_uInt16 nLRUFuncCount = std::min( rAppOpt.GetLRUFuncListCount(), (sal_uInt16)LRU_MAX ); sal_uInt16* pLRUListIds = rAppOpt.GetLRUFuncList(); sal_uInt16 aIdxList[LRU_MAX]; diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index 9dbab51bbff3..62552c29fa4b 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -168,7 +168,7 @@ sal_uInt16 ScZoomSliderWnd::Offset2Zoom( long nOffset ) const ++aSnappingPointIter ) { const long nCurrent = *aSnappingPointIter; - if ( Abs(nCurrent - nOffset) < nSnappingEpsilon ) + if ( std::abs(nCurrent - nOffset) < nSnappingEpsilon ) { nOffset = nCurrent; nRet = mpImpl->maSnappingPointZooms[ nCount ]; diff --git a/sc/source/ui/dbgui/csvcontrol.cxx b/sc/source/ui/dbgui/csvcontrol.cxx index 343788198772..9b05b8b7b329 100644 --- a/sc/source/ui/dbgui/csvcontrol.cxx +++ b/sc/source/ui/dbgui/csvcontrol.cxx @@ -182,7 +182,7 @@ sal_Int32 ScCsvControl::GetVisPosCount() const sal_Int32 ScCsvControl::GetMaxPosOffset() const { - return Max( GetPosCount() - GetVisPosCount() + 2L, 0L ); + return std::max( GetPosCount() - GetVisPosCount() + 2L, 0L ); } bool ScCsvControl::IsValidSplitPos( sal_Int32 nPos ) const @@ -227,12 +227,12 @@ sal_Int32 ScCsvControl::GetVisLineCount() const sal_Int32 ScCsvControl::GetLastVisLine() const { - return Min( GetFirstVisLine() + GetVisLineCount(), GetLineCount() ) - 1; + return std::min( GetFirstVisLine() + GetVisLineCount(), GetLineCount() ) - 1; } sal_Int32 ScCsvControl::GetMaxLineOffset() const { - return Max( GetLineCount() - GetVisLineCount() + 1L, 0L ); + return std::max( GetLineCount() - GetVisLineCount() + 1L, 0L ); } bool ScCsvControl::IsValidLine( sal_Int32 nLine ) const diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index 4b0dd47a9035..e1595b12c821 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -122,7 +122,7 @@ void ScCsvGrid::UpdateOffsetX() sal_Int32 nLastLine = GetLastVisLine() + 1; sal_Int32 nDigits = 2; while( nLastLine /= 10 ) ++nDigits; - nDigits = Max( nDigits, sal_Int32( 3 ) ); + nDigits = std::max( nDigits, sal_Int32( 3 ) ); Execute( CSVCMD_SETHDRWIDTH, GetTextWidth( OUString( '0' ) ) * nDigits ); } @@ -398,7 +398,7 @@ sal_uInt32 ScCsvGrid::GetFirstVisColumn() const sal_uInt32 ScCsvGrid::GetLastVisColumn() const { - return GetColumnFromPos( Min( GetLastVisPos(), GetPosCount() ) - 1 ); + return GetColumnFromPos( std::min( GetLastVisPos(), GetPosCount() ) - 1 ); } bool ScCsvGrid::IsValidColumn( sal_uInt32 nColIndex ) const @@ -533,7 +533,7 @@ void ScCsvGrid::FillColumnDataSep( ScAsciiOptions& rOptions ) const void ScCsvGrid::FillColumnDataFix( ScAsciiOptions& rOptions ) const { - sal_uInt32 nCount = Min( GetColumnCount(), static_cast<sal_uInt32>(MAXCOLCOUNT) ); + sal_uInt32 nCount = std::min( GetColumnCount(), static_cast<sal_uInt32>(MAXCOLCOUNT) ); ScCsvExpDataVec aDataVec( nCount + 1 ); for( sal_uInt32 nColIx = 0; nColIx < nCount; ++nColIx ) @@ -653,8 +653,8 @@ void ScCsvGrid::MoveCursor( sal_uInt32 nColIndex ) { sal_Int32 nPosBeg = GetColumnPos( nColIndex ); sal_Int32 nPosEnd = GetColumnPos( nColIndex + 1 ); - sal_Int32 nMinPos = Max( nPosBeg - CSV_SCROLL_DIST, sal_Int32( 0 ) ); - sal_Int32 nMaxPos = Min( nPosEnd - GetVisPosCount() + CSV_SCROLL_DIST + sal_Int32( 1 ), nMinPos ); + sal_Int32 nMinPos = std::max( nPosBeg - CSV_SCROLL_DIST, sal_Int32( 0 ) ); + sal_Int32 nMaxPos = std::min( nPosEnd - GetVisPosCount() + CSV_SCROLL_DIST + sal_Int32( 1 ), nMinPos ); if( nPosBeg - CSV_SCROLL_DIST + 1 <= GetFirstVisPos() ) Execute( CSVCMD_SETPOSOFFSET, nMinPos ); else if( nPosEnd + CSV_SCROLL_DIST >= GetLastVisPos() ) @@ -744,7 +744,7 @@ void ScCsvGrid::ImplSetTextLineSep( /* TODO: signal overflow somewhere in UI */ // update column width - sal_Int32 nWidth = Max( CSV_MINCOLWIDTH, aCellText.Len() + sal_Int32( 1 ) ); + sal_Int32 nWidth = std::max( CSV_MINCOLWIDTH, aCellText.Len() + sal_Int32( 1 ) ); if( IsValidColumn( nColIx ) ) { // expand existing column @@ -876,7 +876,7 @@ void ScCsvGrid::Tracking( const TrackingEvent& rTEvt ) sal_Int32 nPos = (rMEvt.GetPosPixel().X() - GetFirstX()) / GetCharWidth() + GetFirstVisPos(); // on mouse tracking: keep position valid - nPos = Max( Min( nPos, GetPosCount() - sal_Int32( 1 ) ), sal_Int32( 0 ) ); + nPos = std::max( std::min( nPos, GetPosCount() - sal_Int32( 1 ) ), sal_Int32( 0 ) ); Execute( CSVCMD_MAKEPOSVISIBLE, nPos ); sal_uInt32 nColIx = GetColumnFromPos( nPos ); @@ -965,8 +965,8 @@ void ScCsvGrid::Command( const CommandEvent& rCEvt ) sal_uInt32 nColIx = GetFocusColumn(); if( !IsSelected( nColIx ) ) Select( nColIx ); - sal_Int32 nX1 = Max( GetColumnX( nColIx ), GetFirstX() ); - sal_Int32 nX2 = Min( GetColumnX( nColIx + 1 ), GetWidth() ); + sal_Int32 nX1 = std::max( GetColumnX( nColIx ), GetFirstX() ); + sal_Int32 nX2 = std::min( GetColumnX( nColIx + 1 ), GetWidth() ); ExecutePopup( Point( (nX1 + nX2) / 2, GetHeight() / 2 ) ); } } @@ -1037,8 +1037,8 @@ EditEngine* ScCsvGrid::GetEditEngine() void ScCsvGrid::ImplSetColumnClipRegion( OutputDevice& rOutDev, sal_uInt32 nColIndex ) { rOutDev.SetClipRegion( Region( Rectangle( - Max( GetColumnX( nColIndex ), GetFirstX() ) + 1, 0, - Min( GetColumnX( nColIndex + 1 ), GetLastX() ), GetHeight() - 1 ) ) ); + std::max( GetColumnX( nColIndex ), GetFirstX() ) + 1, 0, + std::min( GetColumnX( nColIndex + 1 ), GetLastX() ), GetHeight() - 1 ) ) ); } void ScCsvGrid::ImplDrawColumnHeader( OutputDevice& rOutDev, sal_uInt32 nColIndex, Color aFillColor ) @@ -1119,7 +1119,7 @@ void ScCsvGrid::ImplDrawFirstLineSep( bool bSet ) if( IsVisibleLine( mnFirstImpLine ) && (mnFirstImpLine != GetFirstVisLine() ) ) { sal_Int32 nY = GetY( mnFirstImpLine ); - sal_Int32 nX = Min( GetColumnX( GetLastVisColumn() + 1 ), GetLastX() ); + sal_Int32 nX = std::min( GetColumnX( GetLastVisColumn() + 1 ), GetLastX() ); maBackgrDev.SetLineColor( bSet ? maGridPBColor : maGridColor ); maBackgrDev.DrawLine( Point( GetFirstX() + 1, nY ), Point( nX, nY ) ); } @@ -1278,7 +1278,7 @@ void ScCsvGrid::ImplDrawHorzScrolled( sal_Int32 nOldPos ) sal_Int32 nPos = GetFirstVisPos(); if( !IsValidGfx() || (nPos == nOldPos) ) return; - if( Abs( nPos - nOldPos ) > GetVisPosCount() / 2 ) + if( std::abs( nPos - nOldPos ) > GetVisPosCount() / 2 ) { ImplDrawBackgrDev(); ImplDrawGridDev(); @@ -1298,8 +1298,8 @@ void ScCsvGrid::ImplDrawHorzScrolled( sal_Int32 nOldPos ) { aSrc = Point( GetFirstX() + GetCharWidth() * (nPos - nOldPos) + 1, 0 ); aDest = Point( GetFirstX() + 1, 0 ); - nFirstColIx = GetColumnFromPos( Min( nOldPos + GetVisPosCount(), GetPosCount() ) - 1 ); - nLastColIx = GetColumnFromPos( Min( nPos + GetVisPosCount(), GetPosCount() ) - 1 ); + nFirstColIx = GetColumnFromPos( std::min( nOldPos + GetVisPosCount(), GetPosCount() ) - 1 ); + nLastColIx = GetColumnFromPos( std::min( nPos + GetVisPosCount(), GetPosCount() ) - 1 ); } ImplInvertCursor( GetRulerCursorPos() + (nPos - nOldPos) ); @@ -1346,9 +1346,9 @@ void ScCsvGrid::ImplDrawTrackingRect( sal_uInt32 nColIndex ) { if( HasFocus() && IsVisibleColumn( nColIndex ) ) { - sal_Int32 nX1 = Max( GetColumnX( nColIndex ), GetFirstX() ) + 1; - sal_Int32 nX2 = Min( GetColumnX( nColIndex + 1 ) - sal_Int32( 1 ), GetLastX() ); - sal_Int32 nY2 = Min( GetY( GetLastVisLine() + 1 ), GetHeight() ) - 1; + sal_Int32 nX1 = std::max( GetColumnX( nColIndex ), GetFirstX() ) + 1; + sal_Int32 nX2 = std::min( GetColumnX( nColIndex + 1 ) - sal_Int32( 1 ), GetLastX() ); + sal_Int32 nY2 = std::min( GetY( GetLastVisLine() + 1 ), GetHeight() ) - 1; InvertTracking( Rectangle( nX1, 0, nX2, nY2 ), SHOWTRACK_SMALL | SHOWTRACK_WINDOW ); } } diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx index d790c6c54c2d..974225d4bf91 100644 --- a/sc/source/ui/dbgui/csvruler.cxx +++ b/sc/source/ui/dbgui/csvruler.cxx @@ -161,7 +161,7 @@ void ScCsvRuler::InitSizeData() mnSplitSize = (GetCharWidth() * 3 / 5) | 1; // make an odd number - sal_Int32 nActiveWidth = Min( GetWidth() - GetHdrWidth(), GetPosCount() * GetCharWidth() ); + sal_Int32 nActiveWidth = std::min( GetWidth() - GetHdrWidth(), GetPosCount() * GetCharWidth() ); sal_Int32 nActiveHeight = GetTextHeight(); maActiveRect.SetPos( Point( GetFirstX(), (GetHeight() - nActiveHeight - 1) / 2 ) ); @@ -261,12 +261,12 @@ sal_Int32 ScCsvRuler::GetNoScrollPos( sal_Int32 nPos ) const if( nNewPos < GetFirstVisPos() + CSV_SCROLL_DIST ) { sal_Int32 nScroll = (GetFirstVisPos() > 0) ? CSV_SCROLL_DIST : 0; - nNewPos = Max( nPos, GetFirstVisPos() + nScroll ); + nNewPos = std::max( nPos, GetFirstVisPos() + nScroll ); } else if( nNewPos > GetLastVisPos() - CSV_SCROLL_DIST - 1L ) { sal_Int32 nScroll = (GetFirstVisPos() < GetMaxPosOffset()) ? CSV_SCROLL_DIST : 0; - nNewPos = Min( nNewPos, GetLastVisPos() - nScroll - sal_Int32( 1 ) ); + nNewPos = std::min( nNewPos, GetLastVisPos() - nScroll - sal_Int32( 1 ) ); } } return nNewPos; @@ -316,10 +316,10 @@ sal_Int32 ScCsvRuler::FindEmptyPos( sal_Int32 nPos, ScMoveMode eDir ) const switch( eDir ) { case MOVE_FIRST: - nNewPos = Min( nPos, FindEmptyPos( 0, MOVE_NEXT ) ); + nNewPos = std::min( nPos, FindEmptyPos( 0, MOVE_NEXT ) ); break; case MOVE_LAST: - nNewPos = Max( nPos, FindEmptyPos( GetPosCount(), MOVE_PREV ) ); + nNewPos = std::max( nPos, FindEmptyPos( GetPosCount(), MOVE_PREV ) ); break; case MOVE_PREV: while( HasSplit( --nNewPos ) ) ; @@ -413,7 +413,7 @@ void ScCsvRuler::MouseMove( const MouseEvent& rMEvt ) if( IsTracking() ) { // on mouse tracking: keep position valid - nPos = Max( Min( nPos, GetPosCount() - sal_Int32( 1 ) ), sal_Int32( 1 ) ); + nPos = std::max( std::min( nPos, GetPosCount() - sal_Int32( 1 ) ), sal_Int32( 1 ) ); MoveMouseTracking( nPos ); } else @@ -551,8 +551,8 @@ void ScCsvRuler::ImplDrawArea( sal_Int32 nPosX, sal_Int32 nWidth ) maBackgrDev.DrawRect( aRect ); aRect = maActiveRect; - aRect.Left() = Max( GetFirstX(), nPosX ); - aRect.Right() = Min( Min( GetX( GetPosCount() ), GetLastX() ), nPosX + nWidth - sal_Int32( 1 ) ); + aRect.Left() = std::max( GetFirstX(), nPosX ); + aRect.Right() = std::min( std::min( GetX( GetPosCount() ), GetLastX() ), nPosX + nWidth - sal_Int32( 1 ) ); if( aRect.Left() <= aRect.Right() ) { maBackgrDev.SetFillColor( maActiveColor ); @@ -573,7 +573,7 @@ void ScCsvRuler::ImplDrawBackgrDev() maBackgrDev.SetFillColor(); sal_Int32 nPos; - sal_Int32 nFirstPos = Max( GetPosFromX( 0 ) - (sal_Int32)(1L), (sal_Int32)(0L) ); + sal_Int32 nFirstPos = std::max( GetPosFromX( 0 ) - (sal_Int32)(1L), (sal_Int32)(0L) ); sal_Int32 nLastPos = GetPosFromX( GetWidth() ); sal_Int32 nY = (maActiveRect.Top() + maActiveRect.Bottom()) / 2; for( nPos = nFirstPos; nPos <= nLastPos; ++nPos ) diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx index b0c2e3bb1ea8..d02a32032bbf 100644 --- a/sc/source/ui/dbgui/csvtablebox.cxx +++ b/sc/source/ui/dbgui/csvtablebox.cxx @@ -333,33 +333,33 @@ IMPL_LINK( ScCsvTableBox, CsvCmdHdl, ScCsvControl*, pCtrl ) switch( eType ) { case CSVCMD_SETPOSCOUNT: - maData.mnPosCount = Max( nParam1, sal_Int32( 1 ) ); + maData.mnPosCount = std::max( nParam1, sal_Int32( 1 ) ); ImplSetPosOffset( GetFirstVisPos() ); break; case CSVCMD_SETPOSOFFSET: ImplSetPosOffset( nParam1 ); break; case CSVCMD_SETHDRWIDTH: - maData.mnHdrWidth = Max( nParam1, sal_Int32( 0 ) ); + maData.mnHdrWidth = std::max( nParam1, sal_Int32( 0 ) ); ImplSetPosOffset( GetFirstVisPos() ); break; case CSVCMD_SETCHARWIDTH: - maData.mnCharWidth = Max( nParam1, sal_Int32( 1 ) ); + maData.mnCharWidth = std::max( nParam1, sal_Int32( 1 ) ); ImplSetPosOffset( GetFirstVisPos() ); break; case CSVCMD_SETLINECOUNT: - maData.mnLineCount = Max( nParam1, sal_Int32( 1 ) ); + maData.mnLineCount = std::max( nParam1, sal_Int32( 1 ) ); ImplSetLineOffset( GetFirstVisLine() ); break; case CSVCMD_SETLINEOFFSET: ImplSetLineOffset( nParam1 ); break; case CSVCMD_SETHDRHEIGHT: - maData.mnHdrHeight = Max( nParam1, sal_Int32( 0 ) ); + maData.mnHdrHeight = std::max( nParam1, sal_Int32( 0 ) ); ImplSetLineOffset( GetFirstVisLine() ); break; case CSVCMD_SETLINEHEIGHT: - maData.mnLineHeight = Max( nParam1, sal_Int32( 1 ) ); + maData.mnLineHeight = std::max( nParam1, sal_Int32( 1 ) ); ImplSetLineOffset( GetFirstVisLine() ); break; case CSVCMD_MOVERULERCURSOR: diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index df3c944d2314..5c5e725184aa 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -288,7 +288,7 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter, if( FindExtRange( aTokenRange, pSrcDoc, aToken ) ) { // columns: find maximum - nWidth = Max( nWidth, (SCCOL)(aTokenRange.aEnd.Col() - aTokenRange.aStart.Col() + 1) ); + nWidth = std::max( nWidth, (SCCOL)(aTokenRange.aEnd.Col() - aTokenRange.aStart.Col() + 1) ); // rows: add row range + 1 empty row nHeight += aTokenRange.aEnd.Row() - aTokenRange.aStart.Row() + 2; } @@ -321,7 +321,7 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter, SCCOL nNewEndX = aNewRange.aEnd.Col(); SCROW nNewEndY = aNewRange.aEnd.Row(); ScRange aMaxRange( aDestPos, - ScAddress(Max(nOldEndX,nNewEndX), Max(nOldEndY,nNewEndY), nDestTab) ); + ScAddress(std::max(nOldEndX,nNewEndX), std::max(nOldEndY,nNewEndY), nDestTab) ); // Undo initialisieren @@ -438,8 +438,8 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter, if ( nNewRefresh != GetRefreshDelay() ) SetRefreshDelay( nNewRefresh ); - SCCOL nPaintEndX = Max( aOldRange.aEnd.Col(), aNewRange.aEnd.Col() ); - SCROW nPaintEndY = Max( aOldRange.aEnd.Row(), aNewRange.aEnd.Row() ); + SCCOL nPaintEndX = std::max( aOldRange.aEnd.Col(), aNewRange.aEnd.Col() ); + SCROW nPaintEndY = std::max( aOldRange.aEnd.Row(), aNewRange.aEnd.Row() ); if ( aOldRange.aEnd.Col() != aNewRange.aEnd.Col() ) nPaintEndX = MAXCOL; diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 0730d04ba080..a54b1f0b232d 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -463,7 +463,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, // keep formatting of title and first data row from the document // CopyToDocument also copies styles, Apply... needs separate calls - SCCOL nMinEndCol = Min( rParam.nCol2, nEndCol ); // not too much + SCCOL nMinEndCol = std::min( rParam.nCol2, nEndCol ); // not too much nMinEndCol = sal::static_int_cast<SCCOL>( nMinEndCol + nFormulaCols ); // only if column count unchanged pImportDoc->DeleteAreaTab( 0,0, MAXCOL,MAXROW, nTab, IDF_ATTRIB ); pDoc->CopyToDocument( rParam.nCol1, rParam.nRow1, nTab, @@ -496,8 +496,8 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, // copy old data for undo // - SCCOL nUndoEndCol = Max( nEndCol, rParam.nCol2 ); // rParam = old end - SCROW nUndoEndRow = Max( nEndRow, rParam.nRow2 ); + SCCOL nUndoEndCol = std::max( nEndCol, rParam.nCol2 ); // rParam = old end + SCROW nUndoEndRow = std::max( nEndRow, rParam.nRow2 ); ScDocument* pUndoDoc = NULL; ScDBData* pUndoDBData = NULL; diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 663a6b7a5d9e..9bc4a40bb639 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1458,7 +1458,7 @@ bool ScDocShell::AdjustPrintZoom( const ScRange& rRange ) if ( nBlkTwipsY == 0 ) nBlkTwipsY = 1; - long nNeeded = Min( aPhysPage.Width() * 100 / nBlkTwipsX, + long nNeeded = std::min( aPhysPage.Width() * 100 / nBlkTwipsX, aPhysPage.Height() * 100 / nBlkTwipsY ); if ( nNeeded < ZOOM_MIN ) nNeeded = ZOOM_MIN; // Begrenzung diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index e40ae12de3c1..2a18ea8fb652 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -477,8 +477,8 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, sal_Bool bReco for (nPos=0; nPos<rParam.nDataAreaCount; nPos++) { ScArea* pArea = rParam.ppDataAreas[nPos]; - nColSize = Max( nColSize, SCCOL( pArea->nColEnd - pArea->nColStart + 1 ) ); - nRowSize = Max( nRowSize, SCROW( pArea->nRowEnd - pArea->nRowStart + 1 ) ); + nColSize = std::max( nColSize, SCCOL( pArea->nColEnd - pArea->nColStart + 1 ) ); + nRowSize = std::max( nRowSize, SCROW( pArea->nRowEnd - pArea->nRowStart + 1 ) ); // Test, ob Quelldaten verschoben wuerden if (rParam.bReferenceData) diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 6c158ca0bcb3..283fe42e48ad 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -104,15 +104,15 @@ void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea, sal_Bool bModifySt // Move the VisArea, otherwise only the upper left position would // be changed in SnapVisArea, and the size would be wrong. - Point aNewPos( 0, Max( aArea.Top(), (long) 0 ) ); + Point aNewPos( 0, std::max( aArea.Top(), (long) 0 ) ); if ( bNegativePage ) { - aNewPos.X() = Min( aArea.Right(), (long) 0 ); + aNewPos.X() = std::min( aArea.Right(), (long) 0 ); lcl_SetTopRight( aArea, aNewPos ); } else { - aNewPos.X() = Max( aArea.Left(), (long) 0 ); + aNewPos.X() = std::max( aArea.Left(), (long) 0 ); aArea.SetPos( aNewPos ); } } diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx index c566dfb4dd4e..5d8f2706e714 100644 --- a/sc/source/ui/drawfunc/fuconstr.cxx +++ b/sc/source/ui/drawfunc/fuconstr.cxx @@ -162,8 +162,8 @@ sal_Bool FuConstruct::MouseMove(const MouseEvent& rMEvt) { Point aOldPixel = pWindow->LogicToPixel( aMDPos ); Point aNewPixel = rMEvt.GetPosPixel(); - if ( Abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE || - Abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE ) + if ( std::abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE || + std::abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE ) aDragTimer.Stop(); } diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index ece660700fa3..e2265717498e 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -342,8 +342,8 @@ sal_Bool FuSelection::MouseMove(const MouseEvent& rMEvt) { Point aOldPixel = pWindow->LogicToPixel( aMDPos ); Point aNewPixel = rMEvt.GetPosPixel(); - if ( Abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE || - Abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE ) + if ( std::abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE || + std::abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE ) aDragTimer.Stop(); } @@ -432,8 +432,8 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) } if (!rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && - Abs(aPnt.X() - aMDPos.X()) < nDrgLog && - Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) + std::abs(aPnt.X() - aMDPos.X()) < nDrgLog && + std::abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) { /************************************************************* * If a user wants to click on an object in front of a marked diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index 75ec4bca1f45..5b6e0b124b7c 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -385,8 +385,8 @@ sal_Bool FuText::MouseMove(const MouseEvent& rMEvt) { Point aOldPixel = pWindow->LogicToPixel( aMDPos ); Point aNewPixel = rMEvt.GetPosPixel(); - if ( Abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE || - Abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE ) + if ( std::abs( aOldPixel.X() - aNewPixel.X() ) > SC_MAXDRAGMOVE || + std::abs( aOldPixel.Y() - aNewPixel.Y() ) > SC_MAXDRAGMOVE ) aDragTimer.Stop(); } diff --git a/sc/source/ui/inc/csvtablebox.hxx b/sc/source/ui/inc/csvtablebox.hxx index 3caa4bf73b94..b23c3a03f021 100644 --- a/sc/source/ui/inc/csvtablebox.hxx +++ b/sc/source/ui/inc/csvtablebox.hxx @@ -88,10 +88,10 @@ private: /** Calculates and sets valid position offset nearest to nPos. */ SC_DLLPRIVATE inline void ImplSetPosOffset( sal_Int32 nPos ) - { maData.mnPosOffset = Max( Min( nPos, GetMaxPosOffset() ), sal_Int32( 0 ) ); } + { maData.mnPosOffset = std::max( std::min( nPos, GetMaxPosOffset() ), sal_Int32( 0 ) ); } /** Calculates and sets valid line offset nearest to nLine. */ SC_DLLPRIVATE inline void ImplSetLineOffset( sal_Int32 nLine ) - { maData.mnLineOffset = Max( Min( nLine, GetMaxLineOffset() ), sal_Int32( 0 ) ); } + { maData.mnLineOffset = std::max( std::min( nLine, GetMaxLineOffset() ), sal_Int32( 0 ) ); } /** Moves controls (not cursors!) so that nPos becomes visible. */ SC_DLLPRIVATE void MakePosVisible( sal_Int32 nPos ); diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx index 0ac4aaf6d46c..e692f3db7979 100644 --- a/sc/source/ui/miscdlgs/crnrdlg.cxx +++ b/sc/source/ui/miscdlgs/crnrdlg.cxx @@ -1083,7 +1083,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, ColClickHdl) aEdAssign.SetText( aStr ); } ScRange aRange( theCurData ); - aRange.aStart.SetRow( Min( (long)(theCurArea.aEnd.Row() + 1), (long)MAXROW ) ); + aRange.aStart.SetRow( std::min( (long)(theCurArea.aEnd.Row() + 1), (long)MAXROW ) ); aRange.aEnd.SetRow( MAXROW ); AdjustColRowData( aRange ); } @@ -1121,7 +1121,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, RowClickHdl) aEdAssign.SetText( aStr ); } ScRange aRange( theCurData ); - aRange.aStart.SetCol( static_cast<SCCOL>(Min( (long)(theCurArea.aEnd.Col() + 1), (long)MAXCOL )) ); + aRange.aStart.SetCol( static_cast<SCCOL>(std::min( (long)(theCurArea.aEnd.Col() + 1), (long)MAXCOL )) ); aRange.aEnd.SetCol( MAXCOL ); AdjustColRowData( aRange ); } diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index d92222ceba6d..5d32ee48dbf7 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -556,9 +556,9 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper( Size aInfoSize = pParent->GetOutputSizePixel(); // von aussen vorgegebene Groesse Size aNavSize = pNavigator->GetOutputSizePixel(); // Default-Groesse - aNavSize.Width() = Max( aInfoSize.Width(), aNavSize.Width() ); - aNavSize.Height() = Max( aInfoSize.Height(), aNavSize.Height() ); - pNavigator->nListModeHeight = Max( aNavSize.Height(), pNavigator->nListModeHeight ); + aNavSize.Width() = std::max( aInfoSize.Width(), aNavSize.Width() ); + aNavSize.Height() = std::max( aInfoSize.Height(), aNavSize.Height() ); + pNavigator->nListModeHeight = std::max( aNavSize.Height(), pNavigator->nListModeHeight ); // Die Groesse kann in einem anderen Modul geaendert worden sein, // deshalb muessen in Abhaengigkeit von der momentanen Groesse die @@ -661,7 +661,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Win aTitleBase = GetText(); long nListboxYPos = - Max( aTbxCmd.GetPosPixel().Y() + aTbxCmd.GetSizePixel().Height(), + std::max( aTbxCmd.GetPosPixel().Y() + aTbxCmd.GetSizePixel().Height(), aEdRow.GetPosPixel().Y() + aEdRow.GetSizePixel().Height() ) + 4; aLbEntries.setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y); diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index afe6f72286fe..a6049f1dba78 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1236,8 +1236,8 @@ void ScUndoDragDrop::DoUndo( ScRange aRange ) const if ( pDoc->HasAttrib( aRange, HASATTR_MERGED ) ) pDoc->ExtendMerge( aRange, sal_True ); - aPaintRange.aEnd.SetCol( Max( aPaintRange.aEnd.Col(), aRange.aEnd.Col() ) ); - aPaintRange.aEnd.SetRow( Max( aPaintRange.aEnd.Row(), aRange.aEnd.Row() ) ); + aPaintRange.aEnd.SetCol( std::max( aPaintRange.aEnd.Col(), aRange.aEnd.Col() ) ); + aPaintRange.aEnd.SetRow( std::max( aPaintRange.aEnd.Row(), aRange.aEnd.Row() ) ); pDocShell->UpdatePaintExt( nExtFlags, aPaintRange ); PaintArea( aPaintRange, nExtFlags ); diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 3c9b86a0eebb..6066984a2f55 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -1653,9 +1653,9 @@ void ScUndoUpdateAreaLink::DoChange( const sal_Bool bUndo ) const { ScDocument* pDoc = pDocShell->GetDocument(); - SCCOL nEndX = Max( aOldRange.aEnd.Col(), aNewRange.aEnd.Col() ); - SCROW nEndY = Max( aOldRange.aEnd.Row(), aNewRange.aEnd.Row() ); - SCTAB nEndZ = Max( aOldRange.aEnd.Tab(), aNewRange.aEnd.Tab() ); //? + SCCOL nEndX = std::max( aOldRange.aEnd.Col(), aNewRange.aEnd.Col() ); + SCROW nEndY = std::max( aOldRange.aEnd.Row(), aNewRange.aEnd.Row() ); + SCTAB nEndZ = std::max( aOldRange.aEnd.Tab(), aNewRange.aEnd.Tab() ); //? if ( bUndo ) { diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx index 41fc7ae9663b..3135e9599fd2 100644 --- a/sc/source/ui/unoobj/appluno.cxx +++ b/sc/source/ui/unoobj/appluno.cxx @@ -665,7 +665,7 @@ void SAL_CALL ScRecentFunctionsObj::setRecentFunctionIds( throw(uno::RuntimeException) { SolarMutexGuard aGuard; - sal_uInt16 nCount = (sal_uInt16) Min( aRecentFunctionIds.getLength(), (sal_Int32) LRU_MAX ); + sal_uInt16 nCount = (sal_uInt16) std::min( aRecentFunctionIds.getLength(), (sal_Int32) LRU_MAX ); const sal_Int32* pAry = aRecentFunctionIds.getConstArray(); sal_uInt16* pFuncs = nCount ? new sal_uInt16[nCount] : NULL; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 067e3f4b50cd..600618194116 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -3827,12 +3827,12 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryIntersec { ScRange aTemp( *aRanges[ i ] ); if ( aTemp.Intersects( aMask ) ) - aNew.Join( ScRange( Max( aTemp.aStart.Col(), aMask.aStart.Col() ), - Max( aTemp.aStart.Row(), aMask.aStart.Row() ), - Max( aTemp.aStart.Tab(), aMask.aStart.Tab() ), - Min( aTemp.aEnd.Col(), aMask.aEnd.Col() ), - Min( aTemp.aEnd.Row(), aMask.aEnd.Row() ), - Min( aTemp.aEnd.Tab(), aMask.aEnd.Tab() ) ) ); + aNew.Join( ScRange( std::max( aTemp.aStart.Col(), aMask.aStart.Col() ), + std::max( aTemp.aStart.Row(), aMask.aStart.Row() ), + std::max( aTemp.aStart.Tab(), aMask.aStart.Tab() ), + std::min( aTemp.aEnd.Col(), aMask.aEnd.Col() ), + std::min( aTemp.aEnd.Row(), aMask.aEnd.Row() ), + std::min( aTemp.aEnd.Tab(), aMask.aEnd.Tab() ) ) ); } return new ScCellRangesObj( pDocShell, aNew ); // kann leer sein diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 8ef65b3fb935..5410437a5f5c 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -1022,12 +1022,12 @@ void lclIntersectRanges( ListOfScRange& rList, const uno::Any& rArg ) if( aOuterIt->Intersects( *aInnerIt ) ) { ScRange aIsectRange( - Max( aOuterIt->aStart.Col(), aInnerIt->aStart.Col() ), - Max( aOuterIt->aStart.Row(), aInnerIt->aStart.Row() ), - Max( aOuterIt->aStart.Tab(), aInnerIt->aStart.Tab() ), - Min( aOuterIt->aEnd.Col(), aInnerIt->aEnd.Col() ), - Min( aOuterIt->aEnd.Row(), aInnerIt->aEnd.Row() ), - Min( aOuterIt->aEnd.Tab(), aInnerIt->aEnd.Tab() ) ); + std::max( aOuterIt->aStart.Col(), aInnerIt->aStart.Col() ), + std::max( aOuterIt->aStart.Row(), aInnerIt->aStart.Row() ), + std::max( aOuterIt->aStart.Tab(), aInnerIt->aStart.Tab() ), + std::min( aOuterIt->aEnd.Col(), aInnerIt->aEnd.Col() ), + std::min( aOuterIt->aEnd.Row(), aInnerIt->aEnd.Row() ), + std::min( aOuterIt->aEnd.Tab(), aInnerIt->aEnd.Tab() ) ); rList.push_back( aIsectRange ); } } diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index cd829dca0680..cf82d0eb70f9 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -805,8 +805,8 @@ void ScCellShell::Execute( SfxRequest& rReq ) GetViewData()->GetSimpleArea( nStartCol,nStartRow,nStartTab, nEndCol,nEndRow,nEndTab ); - if ( ( Abs((SCsCOL)nEndCol-(SCsCOL)nStartCol) > 1 ) - && ( Abs((SCsROW)nEndRow-(SCsROW)nStartRow) > 1 ) ) + if ( ( std::abs((SCsCOL)nEndCol-(SCsCOL)nStartCol) > 1 ) + && ( std::abs((SCsROW)nEndRow-(SCsROW)nStartRow) > 1 ) ) { if ( pReqArgs ) { diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index bf6124787b84..b5c76fdf4b17 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1066,7 +1066,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, // 40% of width or 60% of height long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.Width(); long nSizeY = 60 * ( aPageEnd.Y() - aPageStart.Y() ) / aSize100.Height(); - nHeight = Min(nSizeX,nSizeY); + nHeight = std::min(nSizeX,nSizeY); pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT ) ); pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CJK ) ); pEditEng->SetDefaultItem( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT_CTL ) ); @@ -1087,7 +1087,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, // 40% of width or 60% of height long nSizeX = 40 * ( aPageEnd.X() - aPageStart.X() ) / aSize100.Width(); long nSizeY = 60 * ( aPageEnd.Y() - aPageStart.Y() ) / aSize100.Height(); - aFont.SetSize( Size( 0,Min(nSizeX,nSizeY) ) ); + aFont.SetSize( Size( 0,std::min(nSizeX,nSizeY) ) ); pContentDev->SetFont( aFont ); // centered output with DrawText diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index aceb806b888e..4acfe81231cd 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -149,11 +149,11 @@ void ScHeaderControl::SetMark( sal_Bool bNewSet, SCCOLROW nNewStart, SCCOLROW nN if ( nNewStart == nOldStart ) { if ( nNewEnd != nOldEnd ) - DoPaint( Min( nNewEnd, nOldEnd ) + 1, Max( nNewEnd, nOldEnd ) ); + DoPaint( std::min( nNewEnd, nOldEnd ) + 1, std::max( nNewEnd, nOldEnd ) ); // sonst nix } else if ( nNewEnd == nOldEnd ) - DoPaint( Min( nNewStart, nOldStart ), Max( nNewStart, nOldStart ) - 1 ); + DoPaint( std::min( nNewStart, nOldStart ), std::max( nNewStart, nOldStart ) - 1 ); else if ( nNewStart > nOldEnd || nNewEnd < nOldStart ) { // zwei Bereiche... @@ -161,7 +161,7 @@ void ScHeaderControl::SetMark( sal_Bool bNewSet, SCCOLROW nNewStart, SCCOLROW nN DoPaint( nNewStart, nNewEnd ); } else // irgendwie ueberlappend... (kommt eh nicht oft vor) - DoPaint( Min( nNewStart, nOldStart ), Max( nNewEnd, nOldEnd ) ); + DoPaint( std::min( nNewStart, nOldStart ), std::max( nNewEnd, nOldEnd ) ); } else DoPaint( nNewStart, nNewEnd ); // komplett neu diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx index 47aeac7ef63a..ab53ab7b38be 100644 --- a/sc/source/ui/view/hintwin.cxx +++ b/sc/source/ui/view/hintwin.cxx @@ -61,7 +61,7 @@ ScHintWindow::ScHintWindow( Window* pParent, const String& rTit, const String& r aTextStart = Point( HINT_MARGIN + HINT_INDENT, aHeadSize.Height() + HINT_MARGIN + HINT_LINESPACE ); - Size aWinSize( Max( aHeadSize.Width(), aTextSize.Width() ) + 2 * HINT_MARGIN + 1, + Size aWinSize( std::max( aHeadSize.Width(), aTextSize.Width() ) + 2 * HINT_MARGIN + 1, aHeadSize.Height() + aTextSize.Height() + HINT_LINESPACE + 2 * HINT_MARGIN + 1 ); SetOutputSizePixel( aWinSize ); } diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx index aa2efe27b841..a6de25b34dff 100644 --- a/sc/source/ui/view/olinewin.cxx +++ b/sc/source/ui/view/olinewin.cxx @@ -291,7 +291,7 @@ bool ScOutlineWindow::GetEntryPos( rnStartPos + nEntriesSign; long nCenter = (rnStartPos + rnEndPos - SC_OL_BITMAPSIZE * nEntriesSign + ( mbMirrorEntries ? 1 : 0 )) / 2L; - rnImagePos = mbMirrorEntries ? Max( rnImagePos, nCenter ) : Min( rnImagePos, nCenter ); + rnImagePos = mbMirrorEntries ? std::max( rnImagePos, nCenter ) : std::min( rnImagePos, nCenter ); // --- refinements --- diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 1eef35b0f5a7..5826efde66dc 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -586,10 +586,10 @@ void ScOutputData::SetPagebreakMode( ScPageBreakData* pPageData ) { ScRange aRange = pPageData->GetData( nPos ).GetPrintRange(); - SCCOL nStartX = Max( aRange.aStart.Col(), nX1 ); - SCCOL nEndX = Min( aRange.aEnd.Col(), nX2 ); - SCROW nStartY = Max( aRange.aStart.Row(), nY1 ); - SCROW nEndY = Min( aRange.aEnd.Row(), nY2 ); + SCCOL nStartX = std::max( aRange.aStart.Col(), nX1 ); + SCCOL nEndX = std::min( aRange.aEnd.Col(), nX2 ); + SCROW nStartY = std::max( aRange.aStart.Row(), nY1 ); + SCROW nEndY = std::min( aRange.aEnd.Row(), nY2 ); for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++) { @@ -1395,7 +1395,7 @@ void ScOutputData::DrawFrame() size_t nCol = lclGetArrayColFromCellInfoX( nInfoIdx, nX1, nX2, bLayoutRTL ); long nNewPosX = nOldPosX + pRowInfo[ 0 ].pCellInfo[ nInfoIdx ].nWidth * nLayoutSign; long nNewSnapX = lclGetSnappedX( *mpDev, nNewPosX, bSnapPixel ); - rArray.SetColWidth( nCol, Abs( nNewSnapX - nOldSnapX ) ); + rArray.SetColWidth( nCol, std::abs( nNewSnapX - nOldSnapX ) ); nOldPosX = nNewPosX; nOldSnapX = nNewSnapX; } diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 4713a2ac4954..d4fb35f8f48f 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1894,7 +1894,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) long nBot = (long)( aVars.GetMargin()->GetBottomMargin() * mnPPTY ); nJustPosY += ( nOutHeight + nTop - aVars.GetTextSize().Height() - nBot ) / 2; - nTestClipHeight += Abs( nTop - nBot ); + nTestClipHeight += std::abs( nTop - nBot ); } break; default: @@ -5124,7 +5124,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic) if ( eRotMode != SVX_ROTATE_MODE_STANDARD ) { nGridWidth = aCellSize.Width() + - Abs((long) ( aCellSize.Height() * nCos / nSin )); + std::abs((long) ( aCellSize.Height() * nCos / nSin )); bNegative = ( pInfo->nRotateDir == SC_ROTDIR_LEFT ); if ( bLayoutRTL ) bNegative = !bNegative; diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 1ad8f0f06259..710fe9f23e2d 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -498,9 +498,9 @@ sal_Bool ScPreviewShell::ScrollCommand( const CommandEvent& rCEvt ) long nOld = pPreview->GetZoom(); long nNew = nOld; if ( pData->GetDelta() < 0 ) - nNew = Max( (long) MINZOOM, basegfx::zoomtools::zoomOut( nOld )); + nNew = std::max( (long) MINZOOM, basegfx::zoomtools::zoomOut( nOld )); else - nNew = Min( (long) MAXZOOM, basegfx::zoomtools::zoomIn( nOld )); + nNew = std::min( (long) MAXZOOM, basegfx::zoomtools::zoomIn( nOld )); if ( nNew != nOld ) { diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 15fea31959dc..9ac82304976b 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -465,8 +465,8 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr // if no lines, still space for the outline frame (20 Twips = 1pt) // (HasLines initalizes aLines to 0,0,0,0) - nTwipsSizeX += aLines.Left() + Max( aLines.Right(), 20L ); - nTwipsSizeY += aLines.Top() + Max( aLines.Bottom(), 20L ); + nTwipsSizeX += aLines.Left() + std::max( aLines.Right(), 20L ); + nTwipsSizeY += aLines.Top() + std::max( aLines.Bottom(), 20L ); double nScaleX = (double) nDevSizeX / nTwipsSizeX; double nScaleY = (double) nDevSizeY / nTwipsSizeY; @@ -753,15 +753,15 @@ void ScPrintFunc::UpdateHFHeight( ScPrintHFParam& rParam ) long nMaxHeight = 0; if ( rParam.pLeft ) { - nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pLeft->GetLeftArea() ) ); - nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pLeft->GetCenterArea() ) ); - nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pLeft->GetRightArea() ) ); + nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pLeft->GetLeftArea() ) ); + nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pLeft->GetCenterArea() ) ); + nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pLeft->GetRightArea() ) ); } if ( rParam.pRight ) { - nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pRight->GetLeftArea() ) ); - nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pRight->GetCenterArea() ) ); - nMaxHeight = Max( nMaxHeight, TextHeight( rParam.pRight->GetRightArea() ) ); + nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pRight->GetLeftArea() ) ); + nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pRight->GetCenterArea() ) ); + nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pRight->GetRightArea() ) ); } rParam.nHeight = nMaxHeight + rParam.nDistance; @@ -1744,9 +1744,9 @@ void ScPrintFunc::PrintHF( long nPageNo, sal_Bool bHeader, long nStartY, // and probably other breaks by variable (page number etc.) long nMaxHeight = 0; - nMaxHeight = Max( nMaxHeight, TextHeight( pHFItem->GetLeftArea() ) ); - nMaxHeight = Max( nMaxHeight, TextHeight( pHFItem->GetCenterArea() ) ); - nMaxHeight = Max( nMaxHeight, TextHeight( pHFItem->GetRightArea() ) ); + nMaxHeight = std::max( nMaxHeight, TextHeight( pHFItem->GetLeftArea() ) ); + nMaxHeight = std::max( nMaxHeight, TextHeight( pHFItem->GetCenterArea() ) ); + nMaxHeight = std::max( nMaxHeight, TextHeight( pHFItem->GetRightArea() ) ); if (rParam.pBorder) nMaxHeight += lcl_LineTotal( rParam.pBorder->GetTop() ) + lcl_LineTotal( rParam.pBorder->GetBottom() ) + diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index a0394a4169b0..4fce1138d80d 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -300,7 +300,7 @@ void ScTabControl::UpdateStatus() SCTAB nCount = pDoc->GetTableCount(); SCTAB i; OUString aString; - SCTAB nMaxCnt = Max( nCount, static_cast<SCTAB>(GetMaxId()) ); + SCTAB nMaxCnt = std::max( nCount, static_cast<SCTAB>(GetMaxId()) ); Color aTabBgColor; sal_Bool bModified = false; // Tabellen-Namen diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 0f94f9bed8bd..d96a06e35887 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -980,9 +980,9 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ) } else { if ( pData->GetDelta() < 0 ) - nNew = Max( (long) MINZOOM, basegfx::zoomtools::zoomOut( nOld )); + nNew = std::max( (long) MINZOOM, basegfx::zoomtools::zoomOut( nOld )); else - nNew = Min( (long) MAXZOOM, basegfx::zoomtools::zoomIn( nOld )); + nNew = std::min( (long) MAXZOOM, basegfx::zoomtools::zoomIn( nOld )); } if ( nNew != nOld ) { diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index 33d7cec19bb4..227d3d55bdb9 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -352,7 +352,7 @@ static long lcl_GetScrollRange( SCCOLROW nDocEnd, SCCOLROW nPos, SCCOLROW nVis, ++nVis; ++nMax; // for partially visible cells - SCCOLROW nEnd = Max(nDocEnd, (SCCOLROW)(nPos+nVis)) + nVis; + SCCOLROW nEnd = std::max(nDocEnd, (SCCOLROW)(nPos+nVis)) + nVis; if (nEnd > nMax) nEnd = nMax; diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 0068209e7a46..7a4863bbbd36 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -992,7 +992,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, //! should be limited to whole cells in both directions long nLeft = aPixRect.Left(); long nRight = pView->GetGridWidth(eHWhich) - aPixRect.Right(); - nSizeXPix = aPixRect.GetWidth() + 2 * Min( nLeft, nRight ); + nSizeXPix = aPixRect.GetWidth() + 2 * std::min( nLeft, nRight ); } else if ( bGrowToLeft ) nSizeXPix = aPixRect.Right(); // space that's available in the window when growing to the left diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index b17bf6d0f830..9c7ca49fb994 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -312,7 +312,7 @@ static sal_Bool lcl_AddFunction( ScAppOptions& rAppOpt, sal_uInt16 nOpCode ) if ( !lcl_FunctionKnown( nOpCode ) ) return false; // not in function list -> no change - sal_uInt16 nNewCount = Min( (sal_uInt16)(nOldCount + 1), (sal_uInt16)LRU_MAX ); + sal_uInt16 nNewCount = std::min( (sal_uInt16)(nOldCount + 1), (sal_uInt16)LRU_MAX ); sal_uInt16 nNewList[LRU_MAX]; nNewList[0] = nOpCode; for (nPos=1; nPos<nNewCount; nPos++) diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 4fb088c1fb13..35458d3b5e26 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -424,35 +424,35 @@ sal_Bool ScUpdateRect::GetDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ) return false; } - rX1 = Min(nNewStartX,nOldStartX); - rY1 = Min(nNewStartY,nOldStartY); - rX2 = Max(nNewEndX,nOldEndX); - rY2 = Max(nNewEndY,nOldEndY); + rX1 = std::min(nNewStartX,nOldStartX); + rY1 = std::min(nNewStartY,nOldStartY); + rX2 = std::max(nNewEndX,nOldEndX); + rY2 = std::max(nNewEndY,nOldEndY); if ( nNewStartX == nOldStartX && nNewEndX == nOldEndX ) { if ( nNewStartY == nOldStartY ) { - rY1 = Min( nNewEndY, nOldEndY ); - rY2 = Max( nNewEndY, nOldEndY ); + rY1 = std::min( nNewEndY, nOldEndY ); + rY2 = std::max( nNewEndY, nOldEndY ); } else if ( nNewEndY == nOldEndY ) { - rY1 = Min( nNewStartY, nOldStartY ); - rY2 = Max( nNewStartY, nOldStartY ); + rY1 = std::min( nNewStartY, nOldStartY ); + rY2 = std::max( nNewStartY, nOldStartY ); } } else if ( nNewStartY == nOldStartY && nNewEndY == nOldEndY ) { if ( nNewStartX == nOldStartX ) { - rX1 = Min( nNewEndX, nOldEndX ); - rX2 = Max( nNewEndX, nOldEndX ); + rX1 = std::min( nNewEndX, nOldEndX ); + rX2 = std::max( nNewEndX, nOldEndX ); } else if ( nNewEndX == nOldEndX ) { - rX1 = Min( nNewStartX, nOldStartX ); - rX2 = Max( nNewStartX, nOldStartX ); + rX1 = std::min( nNewStartX, nOldStartX ); + rX2 = std::max( nNewStartX, nOldStartX ); } } diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 94e2da88fd4f..9c0095c4498b 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -2755,7 +2755,7 @@ void ScaDate::setDay() if( b30Days ) { // 30-days-mode: set nDay to 30 if original was last day in month - nDay = Min( nOrigDay, static_cast< sal_uInt16 >( 30 ) ); + nDay = std::min( nOrigDay, static_cast< sal_uInt16 >( 30 ) ); if( bLastDay || (nDay >= ::DaysInMonth( nMonth, nYear )) ) nDay = 30; } @@ -2763,7 +2763,7 @@ void ScaDate::setDay() { // set nDay to last day in this month if original was last day sal_uInt16 nLastDay = ::DaysInMonth( nMonth, nYear ); - nDay = bLastDay ? nLastDay : Min( nOrigDay, nLastDay ); + nDay = bLastDay ? nLastDay : std::min( nOrigDay, nLastDay ); } } @@ -2821,7 +2821,7 @@ void ScaDate::addMonths( sal_Int32 nMonthCount ) throw( lang::IllegalArgumentExc sal_Int32 ScaDate::getDate( sal_Int32 nNullDate ) const { sal_uInt16 nLastDay = ::DaysInMonth( nMonth, nYear ); - sal_uInt16 nRealDay = (bLastDayMode && bLastDay) ? nLastDay : Min( nLastDay, nOrigDay ); + sal_uInt16 nRealDay = (bLastDayMode && bLastDay) ? nLastDay : std::min( nLastDay, nOrigDay ); return ::DateToDays( nRealDay, nMonth, nYear ) - nNullDate; } diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 9e4adb22aa48..107d198eef4a 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -357,7 +357,7 @@ void SdDrawDocument::MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos) { FmFormModel::MovePage(nPgNum, nNewPos); - sal_uInt16 nMin = Min(nPgNum, nNewPos); + sal_uInt16 nMin = std::min(nPgNum, nNewPos); UpdatePageObjectsInNotes(nMin); } @@ -541,8 +541,8 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ ) sal_uLong nTop = aPageOffset.Y(); sal_uLong nLeft = aPageOffset.X(); - sal_uLong nBottom = Max((long)(aDefSize.Height() - aOutSize.Height() - nTop + nOffset), 0L); - sal_uLong nRight = Max((long)(aDefSize.Width() - aOutSize.Width() - nLeft + nOffset), 0L); + sal_uLong nBottom = std::max((long)(aDefSize.Height() - aOutSize.Height() - nTop + nOffset), 0L); + sal_uLong nRight = std::max((long)(aDefSize.Width() - aOutSize.Width() - nLeft + nOffset), 0L); pPage->SetBorder(nLeft, nTop, nRight, nBottom); } diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index d79c838f8422..a0a590096213 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2440,9 +2440,9 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj } else if ( pSlideLayout->eLayout == PPT_LAYOUT_2COLUMNSANDTITLE ) { // position in outline area left - if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE || - Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE || - Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE || + if (std::abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE || + std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE || + std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE || aLogicSize.Width() / aOutlineSize.Width() < 0.48 || aLogicSize.Width() / aOutlineSize.Width() > 0.5) { @@ -2451,15 +2451,15 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj } else if ( pSlideLayout->eLayout == PPT_LAYOUT_2ROWSANDTITLE ) { // position in outline area top - if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE || - Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE || - Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE) + if (std::abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE || + std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE || + std::abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE) { pPresObj->SetUserCall( NULL ); } } - else if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE || - Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE) + else if (std::abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE || + std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE) { // position in outline area top left pPresObj->SetUserCall( NULL ); } @@ -2470,9 +2470,9 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj { if ( pSlideLayout->eLayout == PPT_LAYOUT_2COLUMNSANDTITLE ) { // position in outline area right - if (Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE || - Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE || - Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE || + if (std::abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE || + std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE || + std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE || aLogicSize.Width() / aOutlineSize.Width() < 0.48 || aLogicSize.Width() / aOutlineSize.Width() > 0.5) { @@ -2481,15 +2481,15 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj } else if ( pSlideLayout->eLayout == PPT_LAYOUT_2ROWSANDTITLE ) { // position in outline area bottom - if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE || - Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE || - Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE) + if (std::abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE || + std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE || + std::abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE) { pPresObj->SetUserCall( NULL ); } } - else if (Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE || - Abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE) + else if (std::abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE || + std::abs(aLogicRect.Top() - aOutlineRect.Top()) > MAX_USER_MOVE) { // position in outline area top right pPresObj->SetUserCall(NULL); } @@ -2498,8 +2498,8 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj case 3: { // position in outline area bottom left - if (Abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE || - Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE) + if (std::abs(aLogicRect.Left() - aOutlineRect.Left()) > MAX_USER_MOVE || + std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE) { pPresObj->SetUserCall( NULL ); } @@ -2508,8 +2508,8 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj case 4: { // position in outline area bottom right - if (Abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE || - Abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE) + if (std::abs(aLogicRect.Right() - aOutlineRect.Right()) > MAX_USER_MOVE || + std::abs(aLogicRect.Bottom() - aOutlineRect.Bottom()) > MAX_USER_MOVE) { pObj->SetUserCall( NULL ); } diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index e1e46157253a..14c4f0701cf6 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -690,8 +690,8 @@ Fraction AnimationWindow::GetScale() { BitmapEx *const pBitmap = m_FrameList[i].first; Size aTempSize( pBitmap->GetBitmap().GetSizePixel() ); - aBmpSize.Width() = Max( aBmpSize.Width(), aTempSize.Width() ); - aBmpSize.Height() = Max( aBmpSize.Height(), aTempSize.Height() ); + aBmpSize.Width() = std::max( aBmpSize.Width(), aTempSize.Width() ); + aBmpSize.Height() = std::max( aBmpSize.Height(), aTempSize.Height() ); } aBmpSize.Width() += 10; @@ -1044,11 +1044,11 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) else aTmpSizeLog = pDefDev->LogicToLogic( aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), aMap100 ); - aMaxSizeLog.Width() = Max( aMaxSizeLog.Width(), aTmpSizeLog.Width() ); - aMaxSizeLog.Height() = Max( aMaxSizeLog.Height(), aTmpSizeLog.Height() ); + aMaxSizeLog.Width() = std::max( aMaxSizeLog.Width(), aTmpSizeLog.Width() ); + aMaxSizeLog.Height() = std::max( aMaxSizeLog.Height(), aTmpSizeLog.Height() ); - aMaxSizePix.Width() = Max( aMaxSizePix.Width(), aTmpSizePix.Width() ); - aMaxSizePix.Height() = Max( aMaxSizePix.Height(), aTmpSizePix.Height() ); + aMaxSizePix.Width() = std::max( aMaxSizePix.Width(), aTmpSizePix.Width() ); + aMaxSizePix.Height() = std::max( aMaxSizePix.Height(), aTmpSizePix.Height() ); } SdrPageView* pPV = rView.GetSdrPageView(); diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index 85c87d593fcb..43e0b747c8b4 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -199,7 +199,7 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe aVDev.SetMapMode( aMapMode ); const Size aPixSize( aVDev.LogicToPixel( aSize ) ); - const sal_uLong nMaxEdgePix = Max( aPixSize.Width(), aPixSize.Height() ); + const sal_uLong nMaxEdgePix = std::max( aPixSize.Width(), aPixSize.Height() ); Fraction aFrac( nMaxEdgePixel, nMaxEdgePix ); aMapMode.SetScaleX( aFrac ); diff --git a/sd/source/ui/docshell/sdclient.cxx b/sd/source/ui/docshell/sdclient.cxx index 192c1cd5d754..abda2f4eb764 100644 --- a/sd/source/ui/docshell/sdclient.cxx +++ b/sd/source/ui/docshell/sdclient.cxx @@ -93,10 +93,10 @@ void Client::RequestNewObjectArea( Rectangle& aObjRect ) Point aWorkAreaTL = aWorkArea.TopLeft(); Point aWorkAreaBR = aWorkArea.BottomRight(); - aPos.X() = Max(aPos.X(), aWorkAreaTL.X()); - aPos.X() = Min(aPos.X(), aWorkAreaBR.X()-aSize.Width()); - aPos.Y() = Max(aPos.Y(), aWorkAreaTL.Y()); - aPos.Y() = Min(aPos.Y(), aWorkAreaBR.Y()-aSize.Height()); + aPos.X() = std::max(aPos.X(), aWorkAreaTL.X()); + aPos.X() = std::min(aPos.X(), aWorkAreaBR.X()-aSize.Width()); + aPos.Y() = std::max(aPos.Y(), aWorkAreaTL.Y()); + aPos.Y() = std::min(aPos.Y(), aWorkAreaBR.Y()-aSize.Height()); aObjRect.SetPos(aPos); } diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index f932e68e8e48..27e937ba285e 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -185,8 +185,8 @@ sal_Bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt) } else if (rMEvt.IsLeft() && !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !bSelectionChanged && - Abs(aPnt.X() - aMDPos.X()) < nDrgLog && - Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) + std::abs(aPnt.X() - aMDPos.X()) < nDrgLog && + std::abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) { // toggle between selection and rotation SdrObject* pSingleObj = NULL; diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index a9845356aec3..490b9db6257c 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -193,13 +193,13 @@ void FuCopy::DoExecute( SfxRequest& rReq ) if( lWidth < 0L ) { long nTmp = ( aRect.Right() - aRect.Left() ) / -lWidth; - nNumber = (sal_uInt16) Min( nTmp, (long)nNumber ); + nNumber = (sal_uInt16) std::min( nTmp, (long)nNumber ); } if( lHeight < 0L ) { long nTmp = ( aRect.Bottom() - aRect.Top() ) / -lHeight; - nNumber = (sal_uInt16) Min( nTmp, (long)nNumber ); + nNumber = (sal_uInt16) std::min( nTmp, (long)nNumber ); } for( sal_uInt16 i = 1; i <= nNumber; i++ ) diff --git a/sd/source/ui/func/fuediglu.cxx b/sd/source/ui/func/fuediglu.cxx index e796e9dcf16e..2e5bd6f4d713 100644 --- a/sd/source/ui/func/fuediglu.cxx +++ b/sd/source/ui/func/fuediglu.cxx @@ -238,8 +238,8 @@ sal_Bool FuEditGluePoints::MouseButtonUp(const MouseEvent& rMEvt) sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() ); - if (Abs(aMDPos.X() - aPos.X()) < nDrgLog && - Abs(aMDPos.Y() - aPos.Y()) < nDrgLog && + if (std::abs(aMDPos.X() - aPos.X()) < nDrgLog && + std::abs(aMDPos.Y() - aPos.Y()) < nDrgLog && !rMEvt.IsShift() && !rMEvt.IsMod2()) { SdrViewEvent aVEvt; diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 821b156116e9..96de0c01aa15 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -516,8 +516,8 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) limit object size if necessary */ Size aSize(pOutliner->CalcTextSize()); Size aMaxSize = mpDoc->GetMaxObjSize(); - aSize.Height() = Min(aSize.Height(), aMaxSize.Height()); - aSize.Width() = Min(aSize.Width(), aMaxSize.Width()); + aSize.Height() = std::min(aSize.Height(), aMaxSize.Height()); + aSize.Width() = std::min(aSize.Width(), aMaxSize.Width()); aSize = mpWindow->LogicToPixel(aSize); // put it at the center of the window diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index c6e14a9d9d45..882fd1451387 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -653,8 +653,8 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) if (!rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !bSelectionChanged && - Abs(aPnt.X() - aMDPos.X()) < nDrgLog && - Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) + std::abs(aPnt.X() - aMDPos.X()) < nDrgLog && + std::abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) { /************************************************************* * If a user wants to click on an object in front of a marked @@ -735,8 +735,8 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) } else if (rMEvt.IsMod1() && !rMEvt.IsMod2() - && Abs(aPnt.X() - aMDPos.X()) < nDrgLog - && Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) + && std::abs(aPnt.X() - aMDPos.X()) < nDrgLog + && std::abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) { // Enter group mpView->MarkObj(aPnt, nHitLog, rMEvt.IsShift(), rMEvt.IsMod1()); @@ -858,8 +858,8 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) sal_uInt16 nDrgLog2 = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() ); - if (Abs(aMDPos.X() - aPos.X()) < nDrgLog2 && - Abs(aMDPos.Y() - aPos.Y()) < nDrgLog2 && + if (std::abs(aMDPos.X() - aPos.X()) < nDrgLog2 && + std::abs(aMDPos.Y() - aPos.Y()) < nDrgLog2 && !rMEvt.IsShift() && !rMEvt.IsMod2()) { SdrViewEvent aVEvt; @@ -874,8 +874,8 @@ sal_Bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) } } else if (!rMEvt.IsShift() && rMEvt.IsMod1() && !rMEvt.IsMod2() && - Abs(aPnt.X() - aMDPos.X()) < nDrgLog && - Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) + std::abs(aPnt.X() - aMDPos.X()) < nDrgLog && + std::abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) { // Enter group mpView->MarkObj(aPnt, nHitLog, sal_False, rMEvt.IsMod1()); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 5724d2e4a7d5..7830f199a29c 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -640,8 +640,8 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt) } if ((rMEvt.GetClicks() != 2) && !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsRight() && - Abs(aPnt.X() - aMDPos.X()) < nDrgLog && - Abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) + std::abs(aPnt.X() - aMDPos.X()) < nDrgLog && + std::abs(aPnt.Y() - aMDPos.Y()) < nDrgLog) { /************************************************************* * From text mode, you don't want to rotate immediately. @@ -729,8 +729,8 @@ sal_Bool FuText::MouseButtonUp(const MouseEvent& rMEvt) sal_uInt16 nDrgLog1 = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); if ( mpView && !mpView->AreObjectsMarked() && - Abs(aMDPos.X() - aPnt.X()) < nDrgLog1 && - Abs(aMDPos.Y() - aPnt.Y()) < nDrgLog1 && + std::abs(aMDPos.X() - aPnt.X()) < nDrgLog1 && + std::abs(aMDPos.Y() - aPnt.Y()) < nDrgLog1 && !rMEvt.IsShift() && !rMEvt.IsMod2() ) { SdrPageView* pPV2 = mpView->GetSdrPageView(); diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index 13542df3b150..81b624d695db 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -526,8 +526,8 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly ) else aGrfSize = LogicToLogic( maLogo.GetPrefSize(), maLogo.GetPrefMapMode(), rMap ); - const Point aGrfPos( Max( aOutOrg.X() + aOutSize.Width() - aGrfSize.Width() - aOffset.Width(), aOutOrg.X() ), - Max( aOutOrg.Y() + aOutSize.Height() - aGrfSize.Height() - aOffset.Height(), aOutOrg.Y() ) ); + const Point aGrfPos( std::max( aOutOrg.X() + aOutSize.Width() - aGrfSize.Width() - aOffset.Width(), aOutOrg.X() ), + std::max( aOutOrg.Y() + aOutSize.Height() - aGrfSize.Height() - aOffset.Height(), aOutOrg.Y() ) ); if( maLogo.IsAnimated() ) maLogo.StartAnimation( this, aGrfPos, aGrfSize, (long) this ); diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx index fc5248384358..b718c8f7c160 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx @@ -138,7 +138,7 @@ void InsertionIndicatorOverlay::Create ( RoundToInt(aOriginalPreviewSize.Width()*nPreviewScale), RoundToInt(aOriginalPreviewSize.Height()*nPreviewScale)); const sal_Int32 nOffset ( - RoundToInt(Min(aPreviewSize.Width(),aPreviewSize.Height()) * gnPreviewOffsetScale)); + RoundToInt(std::min(aPreviewSize.Width(),aPreviewSize.Height()) * gnPreviewOffsetScale)); // Determine size and offset depending on the number of previews. sal_Int32 nCount (rRepresentatives.size()); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 6ff443fc69d9..4d4746e123d2 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -469,7 +469,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, sal_Bool bDuplicate else { // here we determine the page after which we should insert - SdPage* pPreviousStandardPage = mpDoc->GetSdPage( Min( (sal_uInt16)(nPageCount - 1), nPage ), PK_STANDARD ); + SdPage* pPreviousStandardPage = mpDoc->GetSdPage( std::min( (sal_uInt16)(nPageCount - 1), nPage ), PK_STANDARD ); SetOfByte aVisibleLayers = pPreviousStandardPage->TRG_GetMasterPageVisibleLayers(); sal_Bool bIsPageBack = aVisibleLayers.IsSet( aBckgrnd ); sal_Bool bIsPageObj = aVisibleLayers.IsSet( aBckgrndObj ); diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 25eb71a565df..2ba19abff3d4 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -439,7 +439,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) { const SfxItemSet& rItems = pOLV->GetOutliner()->GetParaAttribs( (sal_uInt16)nPara ); const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) rItems.Get( EE_PARA_ULSPACE ); - nUpper = Max( nUpper, (long)rItem.GetUpper() ); + nUpper = std::max( nUpper, (long)rItem.GetUpper() ); } if( nUpper == 0L ) rSet.DisableItem( SID_PARASPACE_DECREASE ); diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 2d6b18aba829..f550f9d99967 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -158,7 +158,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) else { nUpper -= 100; - nUpper = Max( (long) nUpper, 0L ); + nUpper = std::max( (long) nUpper, 0L ); } pNewItem->SetUpper( (sal_uInt16) nUpper ); @@ -168,7 +168,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) else { nLower -= 100; - nLower = Max( (long) nLower, 0L ); + nLower = std::max( (long) nLower, 0L ); } pNewItem->SetLower( (sal_uInt16) nLower ); @@ -199,7 +199,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) else { nUpper -= 100; - nUpper = Max( (long) nUpper, 0L ); + nUpper = std::max( (long) nUpper, 0L ); } pNewItem->SetUpper( (sal_uInt16) nUpper ); @@ -209,7 +209,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) else { nLower -= 100; - nLower = Max( (long) nLower, 0L ); + nLower = std::max( (long) nLower, 0L ); } pNewItem->SetLower( (sal_uInt16) nLower ); diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index c69c2efae8a2..8166e9b63af9 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -587,7 +587,7 @@ IMPL_LINK( DrawViewShell, TabSplitHdl, TabBar *, pTab ) - maTabControl.GetPosPixel().X() ; Size aTabSize = maTabControl.GetSizePixel(); - aTabSize.Width() = Min(pTab->GetSplitSize(), (long)(nMax-1)); + aTabSize.Width() = std::min(pTab->GetSplitSize(), (long)(nMax-1)); maTabControl.SetSizePixel(aTabSize); GetLayerTabControl()->SetSizePixel(aTabSize); @@ -635,7 +635,7 @@ void DrawViewShell::ResetActualPage() sal_uInt16 nCurrentPage = maTabControl.GetCurPageId() - 1; sal_uInt16 nPageCount = (meEditMode == EM_PAGE)?GetDoc()->GetSdPageCount(mePageKind):GetDoc()->GetMasterSdPageCount(mePageKind); if (nPageCount > 0) - nCurrentPage = Min((sal_uInt16)(nPageCount - 1), nCurrentPage); + nCurrentPage = std::min((sal_uInt16)(nPageCount - 1), nCurrentPage); else nCurrentPage = 0; diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index d9cee3c2af1f..94dba94af530 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -507,8 +507,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) } else { - long nLeft = Max(0L, rLRSpace.GetLeft() - aPagePos.X()); - long nRight = Max(0L, rLRSpace.GetRight() + aPagePos.X() + + long nLeft = std::max(0L, rLRSpace.GetLeft() - aPagePos.X()); + long nRight = std::max(0L, rLRSpace.GetRight() + aPagePos.X() + aPageSize.Width() - aViewSize.Width()); sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind); @@ -565,8 +565,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) } else { - long nUpper = Max(0L, rULSpace.GetUpper() - aPagePos.Y()); - long nLower = Max(0L, rULSpace.GetLower() + aPagePos.Y() + + long nUpper = std::max(0L, rULSpace.GetUpper() - aPagePos.Y()); + long nLower = std::max(0L, rULSpace.GetLower() + aPagePos.Y() + aPageSize.Height() - aViewSize.Height()); sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind); diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx index a3fe056e496c..54862dfddb38 100644 --- a/sd/source/ui/view/drviewsb.cxx +++ b/sd/source/ui/view/drviewsb.cxx @@ -184,7 +184,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq) if ( aPrevLayer == aName ) { - nPrevLayer = Max(nLayer, (sal_uInt16) 4); + nPrevLayer = std::max(nLayer, (sal_uInt16) 4); } } diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 023766a8a3b5..70f36e437e2a 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -1116,7 +1116,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) case SID_ZOOM_IN: // BASIC { mbZoomOnPage = sal_False; - SetZoom( Max( (long) ( GetActiveWindow()->GetZoom() / 2 ), (long) GetActiveWindow()->GetMinZoom() ) ); + SetZoom( std::max( (long) ( GetActiveWindow()->GetZoom() / 2 ), (long) GetActiveWindow()->GetMinZoom() ) ); Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), GetActiveWindow()->GetOutputSizePixel()) ); mpZoomList->InsertZoomRect(aVisAreaWin); diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx index fd36400f7031..26279941d69c 100644 --- a/sd/source/ui/view/grviewsh.cxx +++ b/sd/source/ui/view/grviewsh.cxx @@ -125,7 +125,7 @@ IMPL_LINK(GraphicViewShell, TabBarSplitHandler, TabBar*, pTabBar) - pTabBar->GetPosPixel().X(); Size aTabSize = pTabBar->GetSizePixel(); - aTabSize.Width() = Min(pTabBar->GetSplitSize(), (long)(nMax-1)); + aTabSize.Width() = std::min(pTabBar->GetSplitSize(), (long)(nMax-1)); pTabBar->SetSizePixel (aTabSize); diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index 715da282e61e..6585a3c7b459 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -164,7 +164,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) case SID_ZOOM_IN: { - SetZoom( Max( (long) ( GetActiveWindow()->GetZoom() / 2 ), (long) GetActiveWindow()->GetMinZoom() ) ); + SetZoom( std::max( (long) ( GetActiveWindow()->GetZoom() / 2 ), (long) GetActiveWindow()->GetMinZoom() ) ); Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), GetActiveWindow()->GetOutputSizePixel()) ); mpZoomList->InsertZoomRect(aVisAreaWin); diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 595886d3b07d..6cb2004271af 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1094,7 +1094,7 @@ long OutlineViewShell::VirtHScrollHdl(ScrollBar* pHScroll) long nViewWidth = pWin->PixelToLogic( pWin->GetSizePixel()).Width(); long nTextWidth = pOlView->GetPaperWidth(); - nViewWidth = Max(nViewWidth, nTextWidth); + nViewWidth = std::max(nViewWidth, nTextWidth); long nCurrentPos = pOutlinerView->GetVisArea().Left(); long nTargetPos = (long)(fX * nViewWidth); long nDelta = nTargetPos - nCurrentPos; diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 867d06bdf1c0..13d2676a3837 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -936,8 +936,8 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, Size aMaxSize( mrDoc.GetMaxObjSize() ); - maDropPos.X() -= Min( aSize.Width(), aMaxSize.Width() ) >> 1; - maDropPos.Y() -= Min( aSize.Height(), aMaxSize.Height() ) >> 1; + maDropPos.X() -= std::min( aSize.Width(), aMaxSize.Width() ) >> 1; + maDropPos.Y() -= std::min( aSize.Height(), aMaxSize.Height() ) >> 1; Rectangle aRect( maDropPos, aSize ); SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect ); @@ -1102,8 +1102,8 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper, Size aMaxSize( mrDoc.GetMaxObjSize() ); - maDropPos.X() -= Min( aSize.Width(), aMaxSize.Width() ) >> 1; - maDropPos.Y() -= Min( aSize.Height(), aMaxSize.Height() ) >> 1; + maDropPos.X() -= std::min( aSize.Width(), aMaxSize.Width() ) >> 1; + maDropPos.Y() -= std::min( aSize.Height(), aMaxSize.Height() ) >> 1; Rectangle aRect( maDropPos, aSize ); SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect ); diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index d02f9c1703bd..fdcd2b125796 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -155,13 +155,13 @@ void Window::CalcMinZoom() // Decide whether to take the larger or the smaller factor. sal_uLong nFact; if (mbCalcMinZoomByMinSide) - nFact = Min(nX, nY); + nFact = std::min(nX, nY); else - nFact = Max(nX, nY); + nFact = std::max(nX, nY); // The factor is tansfomed according to the current zoom factor. nFact = nFact * nZoom / ZOOM_MULTIPLICATOR; - mnMinZoom = Max((sal_uInt16) MIN_ZOOM, (sal_uInt16) nFact); + mnMinZoom = std::max((sal_uInt16) MIN_ZOOM, (sal_uInt16) nFact); } // If the current zoom factor is smaller than the calculated minimal // zoom factor then set the new minimal factor as the current zoom @@ -465,7 +465,7 @@ long Window::GetZoomForRect( const Rectangle& rZoomRect ) // Use the smaller one of both so that the zoom rectangle will be // fully visible with respect to both coordinate directions. - sal_uLong nFact = Min(nX, nY); + sal_uLong nFact = std::min(nX, nY); // Transform the current zoom factor so that it leads to the desired // scaling. @@ -538,7 +538,7 @@ long Window::SetZoomRect (const Rectangle& rZoomRect) // Use the smaller one of both so that the zoom rectangle will be // fully visible with respect to both coordinate directions. - sal_uLong nFact = Min(nX, nY); + sal_uLong nFact = std::min(nX, nY); // Transform the current zoom factor so that it leads to the desired // scaling. diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 2b1060998376..50716b156818 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -660,9 +660,9 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi long nNewZoom; if( pData->GetDelta() < 0L ) - nNewZoom = Max( (long) pWin->GetMinZoom(), basegfx::zoomtools::zoomOut( nOldZoom )); + nNewZoom = std::max( (long) pWin->GetMinZoom(), basegfx::zoomtools::zoomOut( nOldZoom )); else - nNewZoom = Min( (long) pWin->GetMaxZoom(), basegfx::zoomtools::zoomIn( nOldZoom )); + nNewZoom = std::min( (long) pWin->GetMaxZoom(), basegfx::zoomtools::zoomIn( nOldZoom )); SetZoom( nNewZoom ); Invalidate( SID_ATTR_ZOOM ); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 5ccb89b35801..55ef86a3b272 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1008,7 +1008,7 @@ SearchTabPage_Impl::~SearchTabPage_Impl() nChecked = aScopeCB.IsChecked() ? 1 : 0; aUserData += OUString::number( nChecked ); aUserData += ';'; - sal_uInt16 nCount = Min( aSearchED.GetEntryCount(), (sal_uInt16)10 ); // save only 10 entries + sal_uInt16 nCount = std::min( aSearchED.GetEntryCount(), (sal_uInt16)10 ); // save only 10 entries for ( sal_uInt16 i = 0; i < nCount; ++i ) { @@ -2246,7 +2246,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText ) void SfxHelpTextWindow_Impl::SetOnStartupBoxPosition() { - long nX = Max( GetOutputSizePixel().Width() - aOnStartupCB.GetSizePixel().Width(), nMinPos ); + long nX = std::max( GetOutputSizePixel().Width() - aOnStartupCB.GetSizePixel().Width(), nMinPos ); Point aPos = aOnStartupCB.GetPosPixel(); aPos.X() = nX; aOnStartupCB.SetPosPixel( aPos ); diff --git a/sfx2/source/bastyp/bitset.cxx b/sfx2/source/bastyp/bitset.cxx index 1e536aa8a46c..f1798f515d81 100644 --- a/sfx2/source/bastyp/bitset.cxx +++ b/sfx2/source/bastyp/bitset.cxx @@ -23,6 +23,7 @@ #include <string.h> // memset(), memcpy() #include <limits.h> // USHRT_MAX +#include <algorithm> //==================================================================== // add nOffset to each bit-value in the set @@ -189,7 +190,7 @@ BitSet& BitSet::operator-=(sal_uInt16 nBit) BitSet& BitSet::operator|=( const BitSet& rSet ) { - sal_uInt16 nMax = Min(nBlocks, rSet.nBlocks); + sal_uInt16 nMax = std::min(nBlocks, rSet.nBlocks); // expand the bitmap if ( nBlocks < rSet.nBlocks ) diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 5df40c1ff372..722c93f17f12 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -853,7 +853,7 @@ void SfxBindings::Invalidate if ( pCache ) { pCache->Invalidate(sal_False); - pImp->nMsgPos = Min(GetSlotPos(nId), pImp->nMsgPos); + pImp->nMsgPos = std::min(GetSlotPos(nId), pImp->nMsgPos); if ( !nRegLevel ) { pImp->aTimer.Stop(); @@ -890,7 +890,7 @@ void SfxBindings::Invalidate if ( !pDispatcher || pImp->bAllDirty ) return; - pImp->nMsgPos = Min(GetSlotPos(nId), pImp->nMsgPos); + pImp->nMsgPos = std::min(GetSlotPos(nId), pImp->nMsgPos); if ( !nRegLevel ) { pImp->aTimer.Stop(); @@ -1721,7 +1721,7 @@ sal_uInt16 SfxBindings::EnterRegistrations(const char *pFile, int nLine) { SAL_INFO( "sfx2.control", - std::setw(Min(nRegLevel, sal_uInt16(8))) << ' ' << "this = " << this + std::setw(std::min(nRegLevel, sal_uInt16(8))) << ' ' << "this = " << this << " Level = " << nRegLevel << " SfxBindings::EnterRegistrations " << (pFile ? SAL_STREAM("File: " << pFile << " Line: " << nLine) : "")); @@ -1820,7 +1820,7 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int SAL_INFO( "sfx2.control", - std::setw(Min(nRegLevel, sal_uInt16(8))) << ' ' << "this = " << this + std::setw(std::min(nRegLevel, sal_uInt16(8))) << ' ' << "this = " << this << " Level = " << nRegLevel << " SfxBindings::LeaveRegistrations " << (pFile ? SAL_STREAM("File: " << pFile << " Line: " << nLine) : "")); diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx index b53ab74dbfa0..dedd23f6ffce 100644 --- a/sfx2/source/dialog/printopt.cxx +++ b/sfx2/source/dialog/printopt.cxx @@ -231,7 +231,7 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOpt pCurrentOptions->SetReduceBitmaps( m_pReduceBitmapsCB->IsChecked() ); pCurrentOptions->SetReducedBitmapMode( m_pReduceBitmapsOptimalRB->IsChecked() ? PRINTER_BITMAP_OPTIMAL : ( m_pReduceBitmapsNormalRB->IsChecked() ? PRINTER_BITMAP_NORMAL : PRINTER_BITMAP_RESOLUTION ) ); - pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) m_pReduceBitmapsResolutionLB->GetSelectEntryPos(), + pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ std::min( (sal_uInt16) m_pReduceBitmapsResolutionLB->GetSelectEntryPos(), (sal_uInt16)( (sizeof (aDPIArray) / sizeof (aDPIArray[0])) - 1 ) ) ] ); pCurrentOptions->SetReducedBitmapIncludesTransparency( m_pReduceBitmapsTransparencyCB->IsChecked() ); pCurrentOptions->SetConvertToGreyscales( m_pConvertToGreyscalesCB->IsChecked() ); diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx index 40e5027d7fb7..7ed252816258 100644 --- a/sfx2/source/dialog/srchdlg.cxx +++ b/sfx2/source/dialog/srchdlg.cxx @@ -111,7 +111,7 @@ void SearchDialog::SaveConfig() SvtViewOptions aViewOpt( E_DIALOG, m_sConfigName ); aViewOpt.SetWindowState(OStringToOUString(m_sWinState, RTL_TEXTENCODING_ASCII_US)); String sUserData; - sal_uInt16 i = 0, nCount = Min( m_aSearchEdit.GetEntryCount(), MAX_SAVE_COUNT ); + sal_uInt16 i = 0, nCount = std::min( m_aSearchEdit.GetEntryCount(), MAX_SAVE_COUNT ); for ( ; i < nCount; ++i ) { sUserData += m_aSearchEdit.GetEntry(i); diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 6d993e8515c5..610684d1d384 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -531,7 +531,7 @@ void SfxDocTplService_Impl::readFolderList() NamePair_Impl* pPair; - sal_uInt16 nCount = (sal_uInt16)( Min( aShortNames.Count(), aLongNames.Count() ) ); + sal_uInt16 nCount = (sal_uInt16)( std::min( aShortNames.Count(), aLongNames.Count() ) ); for ( sal_uInt16 i=0; i<nCount; i++ ) { diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index 02ed5f8739b4..418aab4f42ed 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -679,8 +679,8 @@ OUString SAL_CALL SmGraphicAccessible::getTextRange( SolarMutexGuard aGuard; OUString aTxt( GetAccessibleText_Impl() ); - sal_Int32 nStart = Min(nStartIndex, nEndIndex); - sal_Int32 nEnd = Max(nStartIndex, nEndIndex); + sal_Int32 nStart = std::min(nStartIndex, nEndIndex); + sal_Int32 nEnd = std::max(nStartIndex, nEndIndex); if (!(nStart <= aTxt.getLength()) || !(nEnd <= aTxt.getLength())) throw IndexOutOfBoundsException(); diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index ee6b8b39213e..047a414efb96 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -1174,7 +1174,7 @@ void SmBinVerNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) long nFontHeight = GetFont().GetSize().Height(), nExtLen = nFontHeight * rFormat.GetDistance(DIS_FRACTION) / 100L, nThick = nFontHeight * rFormat.GetDistance(DIS_STROKEWIDTH) / 100L, - nWidth = Max(pNum->GetItalicWidth(), pDenom->GetItalicWidth()), + nWidth = std::max(pNum->GetItalicWidth(), pDenom->GetItalicWidth()), nNumDist = bIsTextmode ? 0 : nFontHeight * rFormat.GetDistance(DIS_NUMERATOR) / 100L, nDenomDist = bIsTextmode ? 0 : @@ -1735,7 +1735,7 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) Size aTmpSize (pLeft->GetFont().GetSize()); OSL_ENSURE(pRight->GetFont().GetSize() == aTmpSize, "Sm : different font sizes"); - aTmpSize.Width() = Min((long) nBraceHeight * 60L / 100L, + aTmpSize.Width() = std::min((long) nBraceHeight * 60L / 100L, rFormat.GetBaseSize().Height() * 3L / 2L); // correction factor since change from StarMath to OpenSymbol font // because of the different font width in the FontMetric @@ -2543,7 +2543,7 @@ void SmMatrixNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { pNode->Arrange(rDev, rFormat); int nCol = nIdx % nNumCols; - pColWidth[nCol] = Max(pColWidth[nCol], pNode->GetItalicWidth()); + pColWidth[nCol] = std::max(pColWidth[nCol], pNode->GetItalicWidth()); } } diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index 93f7d4dbd9ee..19459867bba6 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -448,8 +448,8 @@ SmRect & SmRect::ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode) { // get some values used for (italic) spaces adaption // ! (need to be done before changing current SmRect) ! - long nL = Min(GetItalicLeft(), rRect.GetItalicLeft()), - nR = Max(GetItalicRight(), rRect.GetItalicRight()); + long nL = std::min(GetItalicLeft(), rRect.GetItalicLeft()), + nR = std::max(GetItalicRight(), rRect.GetItalicRight()); Union(rRect); @@ -458,10 +458,10 @@ SmRect & SmRect::ExtendBy(const SmRect &rRect, RectCopyMBL eCopyMode) if (!HasAlignInfo()) CopyAlignInfo(rRect); else if (rRect.HasAlignInfo()) - { nAlignT = Min(GetAlignT(), rRect.GetAlignT()); - nAlignB = Max(GetAlignB(), rRect.GetAlignB()); - nHiAttrFence = Min(GetHiAttrFence(), rRect.GetHiAttrFence()); - nLoAttrFence = Max(GetLoAttrFence(), rRect.GetLoAttrFence()); + { nAlignT = std::min(GetAlignT(), rRect.GetAlignT()); + nAlignB = std::max(GetAlignB(), rRect.GetAlignB()); + nHiAttrFence = std::min(GetHiAttrFence(), rRect.GetHiAttrFence()); + nLoAttrFence = std::max(GetLoAttrFence(), rRect.GetLoAttrFence()); OSL_ENSURE(HasAlignInfo(), "Sm: ooops..."); switch (eCopyMode) @@ -571,7 +571,7 @@ long SmRect::OrientedDist(const Point &rPoint) const long nAbsX = labs(aDist.X()), nAbsY = labs(aDist.Y()); - return bIsInside ? - Min(nAbsX, nAbsY) : Max (nAbsX, nAbsY); + return bIsInside ? - std::min(nAbsX, nAbsY) : std::max (nAbsX, nAbsY); } diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index bca602edade9..6d403b1a6c9c 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -602,7 +602,7 @@ IMPL_LINK_INLINE_END( SmGraphicWindow, MenuSelectHdl, Menu *, pMenu ) void SmGraphicWindow::SetZoom(sal_uInt16 Factor) { - nZoom = Min(Max((sal_uInt16) Factor, (sal_uInt16) MINZOOM), (sal_uInt16) MAXZOOM); + nZoom = std::min(std::max((sal_uInt16) Factor, (sal_uInt16) MINZOOM), (sal_uInt16) MAXZOOM); Fraction aFraction (nZoom, 100); SetMapMode( MapMode(MAP_100TH_MM, Point(), aFraction, aFraction) ); SetTotalSize(); @@ -625,7 +625,7 @@ void SmGraphicWindow::ZoomToFitInWindow() if (aSize.Width() > 0 && aSize.Height() > 0) { - long nVal = Min ((85 * aWindowSize.Width()) / aSize.Width(), + long nVal = std::min ((85 * aWindowSize.Width()) / aSize.Width(), (85 * aWindowSize.Height()) / aSize.Height()); SetZoom ( sal::static_int_cast< sal_uInt16 >(nVal) ); } @@ -1065,7 +1065,7 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M aLine = aLine.replaceAt(0, m, ""); aSize = GetTextLineSize(rDevice, aText); TextSize.Height() += aSize.Height(); - TextSize.Width() = Max(TextSize.Width(), Min(aSize.Width(), MaxWidth)); + TextSize.Width() = std::max(TextSize.Width(), std::min(aSize.Width(), MaxWidth)); aLine = comphelper::string::stripStart(aLine, ' '); aLine = comphelper::string::stripStart(aLine, '\t'); @@ -1076,7 +1076,7 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M else { TextSize.Height() += aSize.Height(); - TextSize.Width() = Max(TextSize.Width(), aSize.Width()); + TextSize.Width() = std::max(TextSize.Width(), aSize.Width()); } } @@ -1288,9 +1288,9 @@ void SmViewShell::Impl_Print( Size OutputSize (rOutDev.LogicToPixel(Size(aOutRect.GetWidth(), aOutRect.GetHeight()), MapMode(MAP_100TH_MM))); Size GraphicSize (rOutDev.LogicToPixel(aSize, MapMode(MAP_100TH_MM))); - sal_uInt16 nZ = (sal_uInt16) Min((long)Fraction(OutputSize.Width() * 100L, GraphicSize.Width()), + sal_uInt16 nZ = (sal_uInt16) std::min((long)Fraction(OutputSize.Width() * 100L, GraphicSize.Width()), (long)Fraction(OutputSize.Height() * 100L, GraphicSize.Height())); - Fraction aFraction ((sal_uInt16) Max ((sal_uInt16) MINZOOM, Min((sal_uInt16) MAXZOOM, (sal_uInt16) (nZ - 10))), (sal_uInt16) 100); + Fraction aFraction ((sal_uInt16) std::max ((sal_uInt16) MINZOOM, std::min((sal_uInt16) MAXZOOM, (sal_uInt16) (nZ - 10))), (sal_uInt16) 100); OutputMapMode = MapMode(MAP_100TH_MM, aZeroPoint, aFraction, aFraction); } @@ -1816,7 +1816,7 @@ void SmViewShell::Execute(SfxRequest& rReq) Size OutputSize(pPrinter->LogicToPixel(Size(OutputRect.GetWidth(), OutputRect.GetHeight()), aMap)); Size GraphicSize(pPrinter->LogicToPixel(GetDoc()->GetSize(), aMap)); - sal_uInt16 nZ = (sal_uInt16) Min((long)Fraction(OutputSize.Width() * 100L, GraphicSize.Width()), + sal_uInt16 nZ = (sal_uInt16) std::min((long)Fraction(OutputSize.Width() * 100L, GraphicSize.Width()), (long)Fraction(OutputSize.Height() * 100L, GraphicSize.Height())); aGraphic.SetZoom (nZ); break; diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index fd7d9c8247e4..f80d7291e9eb 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1587,7 +1587,7 @@ input for the following reasons: case 0: // none if (nMonthPos) // only month (Jan) { - pCal->setValue( CalendarFieldIndex::MONTH, Abs(nMonth)-1 ); + pCal->setValue( CalendarFieldIndex::MONTH, std::abs(nMonth)-1 ); } else { @@ -1625,7 +1625,7 @@ input for the following reasons: break; } case 1: // month at the beginning (Jan 01) - pCal->setValue( CalendarFieldIndex::MONTH, Abs(nMonth)-1 ); + pCal->setValue( CalendarFieldIndex::MONTH, std::abs(nMonth)-1 ); switch (DateFmt) { case MDY: @@ -1652,7 +1652,7 @@ input for the following reasons: } break; case 3: // month at the end (10 Jan) - pCal->setValue( CalendarFieldIndex::MONTH, Abs(nMonth)-1 ); + pCal->setValue( CalendarFieldIndex::MONTH, std::abs(nMonth)-1 ); switch (DateFmt) { case DMY: @@ -1787,7 +1787,7 @@ input for the following reasons: // The input is valid as MDY in almost any // constellation, there is no date order (M)YD except if // set in a format applied. - pCal->setValue( CalendarFieldIndex::MONTH, Abs(nMonth)-1 ); + pCal->setValue( CalendarFieldIndex::MONTH, std::abs(nMonth)-1 ); sal_uInt32 nExactDateOrder = (bFormatTurn ? pFormat->GetExactDateOrder() : 0); if ((((nExactDateOrder >> 8) & 0xff) == 'Y') && ((nExactDateOrder & 0xff) == 'D')) { @@ -1803,7 +1803,7 @@ input for the following reasons: } case 2: // month in the middle (10 Jan 94) { - pCal->setValue( CalendarFieldIndex::MONTH, Abs(nMonth)-1 ); + pCal->setValue( CalendarFieldIndex::MONTH, std::abs(nMonth)-1 ); DateFormat eDF = (MayBeMonthDate() ? (nMayBeMonthDate == 2 ? DMY : YMD) : DateFmt); switch (eDF) { @@ -1878,7 +1878,7 @@ input for the following reasons: { case MDY: pCal->setValue( CalendarFieldIndex::DAY_OF_MONTH, ImplGetDay(0) ); - pCal->setValue( CalendarFieldIndex::MONTH, Abs(nMonth)-1 ); + pCal->setValue( CalendarFieldIndex::MONTH, std::abs(nMonth)-1 ); pCal->setValue( CalendarFieldIndex::YEAR, ImplGetYear(1) ); break; default: @@ -1888,7 +1888,7 @@ input for the following reasons: break; case 2: // month in the middle (10 Jan 94 8:23) nCounter = 2; - pCal->setValue( CalendarFieldIndex::MONTH, Abs(nMonth)-1 ); + pCal->setValue( CalendarFieldIndex::MONTH, std::abs(nMonth)-1 ); switch (DateFmt) { case DMY: diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 5d59ff2cdc2f..0fbca4c5d3b8 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -1070,9 +1070,9 @@ long BrowseBox::ScrollRows( long nRows ) return 0; // compute new top row - long nTmpMin = Min( (long)(nTopRow + nRows), (long)(nRowCount - 1) ); + long nTmpMin = std::min( (long)(nTopRow + nRows), (long)(nRowCount - 1) ); - long nNewTopRow = Max( (long)nTmpMin, (long)0 ); + long nNewTopRow = std::max( (long)nTmpMin, (long)0 ); if ( nNewTopRow == nTopRow ) return 0; @@ -1083,9 +1083,9 @@ long BrowseBox::ScrollRows( long nRows ) VisibleRowsChanged(nNewTopRow, nVisibleRows); // compute new top row again (nTopRow might have changed!) - nTmpMin = Min( (long)(nTopRow + nRows), (long)(nRowCount - 1) ); + nTmpMin = std::min( (long)(nTopRow + nRows), (long)(nRowCount - 1) ); - nNewTopRow = Max( (long)nTmpMin, (long)0 ); + nNewTopRow = std::max( (long)nTmpMin, (long)0 ); StartScroll(); @@ -1100,8 +1100,8 @@ long BrowseBox::ScrollRows( long nRows ) pVScroll->SetThumbPos( nTopRow ); if( pDataWin->GetBackground().IsScrollable() && - Abs( nDeltaY ) > 0 && - Abs( nDeltaY ) < pDataWin->GetSizePixel().Height() ) + std::abs( nDeltaY ) > 0 && + std::abs( nDeltaY ) < pDataWin->GetSizePixel().Height() ) { pDataWin->Scroll( 0, (short)-nDeltaY, SCROLL_FLAGS ); } @@ -1348,7 +1348,7 @@ void BrowseBox::RowRemoved( long nRow, long nNumRows, sal_Bool bDoPaint ) nCurRow = BROWSER_ENDOFSELECTION; else if ( nRow < nCurRow ) { - nCurRow -= Min( nCurRow - nRow, nNumRows ); + nCurRow -= std::min( nCurRow - nRow, nNumRows ); // with the above nCurRow points a) to the first row after the removed block or b) to the same line // as before, but moved up nNumRows // case a) needs an additional correction if the last n lines were deleted, as 'the first row after the @@ -1723,7 +1723,7 @@ void BrowseBox::SelectAll() Rectangle aHighlightRect; sal_uInt16 nVisibleRows = (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); - for ( long nRow = Max( nTopRow, uRow.pSel->FirstSelected() ); + for ( long nRow = std::max( nTopRow, uRow.pSel->FirstSelected() ); nRow != BROWSER_ENDOFSELECTION && nRow < nTopRow + nVisibleRows; nRow = uRow.pSel->NextSelected() ) aHighlightRect.Union( Rectangle( diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index fd027fc0e1fa..a93d65bf12e0 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -1240,7 +1240,7 @@ void BrowseBox::UpdateScrollbars() ? (short)( pCols->size() - nFirstCol ) : (short)( nLastCol - nFirstCol ); - short nRange = Max( nScrollCols, (short)0 ); + short nRange = std::max( nScrollCols, (short)0 ); aHScroll.SetVisibleSize( nVisibleHSize ); aHScroll.SetRange( Range( 0, nRange )); if ( bNeedsHScroll && !aHScroll.IsVisible() ) @@ -1257,7 +1257,7 @@ void BrowseBox::UpdateScrollbars() if ( pVScroll->GetThumbPos() != nTopRow ) pVScroll->SetThumbPos( nTopRow ); - long nVisibleSize = Min( Min( nRowCount, nMaxRows ), long(nRowCount-nTopRow) ); + long nVisibleSize = std::min( std::min( nRowCount, nMaxRows ), long(nRowCount-nTopRow) ); pVScroll->SetVisibleSize( nVisibleSize ? nVisibleSize : 1 ); pVScroll->SetRange( Range( 0, nRowCount ) ); pVScroll->SetPosSizePixel( @@ -1473,7 +1473,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt ) long nR = nX + pCol->Width() - 1; // at the end of a column (and not handle column)? - if ( pCol->GetId() && Abs( nR - rEvtPos.X() ) < 2 ) + if ( pCol->GetId() && std::abs( nR - rEvtPos.X() ) < 2 ) { // start resizing the column bResizing = sal_True; @@ -1527,7 +1527,7 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt ) // show resize-pointer? if ( bResizing || ( pCol->GetId() && - Abs( ((long) nR ) - rEvt.GetPosPixel().X() ) < MIN_COLUMNWIDTH ) ) + std::abs( ((long) nR ) - rEvt.GetPosPixel().X() ) < MIN_COLUMNWIDTH ) ) { aNewPointer = Pointer( POINTER_HSPLIT ); if ( bResizing ) @@ -1536,7 +1536,7 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt ) pDataWin->HideTracking() ; // check allowed width and new delta - nDragX = Max( rEvt.GetPosPixel().X(), nMinResizeX ); + nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX ); long nDeltaX = nDragX - nResizeX; sal_uInt16 nId = GetColumnId(nResizeCol); sal_uLong nOldWidth = GetColumnWidth(nId); @@ -1570,12 +1570,12 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt ) pDataWin->HideTracking(); // width changed? - nDragX = Max( rEvt.GetPosPixel().X(), nMinResizeX ); + nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX ); if ( (nDragX - nResizeX) != (long)(*pCols)[ nResizeCol ]->Width() ) { // resize column long nMaxX = pDataWin->GetSizePixel().Width(); - nDragX = Min( nDragX, nMaxX ); + nDragX = std::min( nDragX, nMaxX ); long nDeltaX = nDragX - nResizeX; sal_uInt16 nId = GetColumnId(nResizeCol); SetColumnWidth( GetColumnId(nResizeCol), GetColumnWidth(nId) + nDeltaX ); diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 36930e7a6f4b..9e0ab710991a 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -1248,7 +1248,7 @@ namespace svt sal_uInt32 nCurColWidth = GetColumnWidth(nColId); sal_uInt32 nMinColWidth = CalcZoom(20); // minimum sal_uInt32 nNewColWidth = nMinColWidth; - long nMaxRows = Min(long(GetVisibleRows()), GetRowCount()); + long nMaxRows = std::min(long(GetVisibleRows()), GetRowCount()); long nLastVisRow = GetTopRow() + nMaxRows - 1; if (GetTopRow() <= nLastVisRow) // calc the column with using the cell contents diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx index ffae299aafc9..f75866f38cc5 100644 --- a/svtools/source/config/printoptions.cxx +++ b/svtools/source/config/printoptions.cxx @@ -674,7 +674,7 @@ void SvtBasePrintOptions::GetPrinterOptions( PrinterOptions& rOptions ) const rOptions.SetReducedGradientStepCount( GetReducedGradientStepCount() ); rOptions.SetReduceBitmaps( IsReduceBitmaps() ); rOptions.SetReducedBitmapMode( (PrinterBitmapMode) GetReducedBitmapMode() ); - rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) GetReducedBitmapResolution(), (sal_uInt16)( DPI_COUNT - 1 ) ) ] ); + rOptions.SetReducedBitmapResolution( aDPIArray[ std::min( (sal_uInt16) GetReducedBitmapResolution(), (sal_uInt16)( DPI_COUNT - 1 ) ) ] ); rOptions.SetReducedBitmapIncludesTransparency( IsReducedBitmapIncludesTransparency() ); rOptions.SetConvertToGreyscales( IsConvertToGreyscales() ); rOptions.SetPDFAsStandardPrintJobFormat( IsPDFAsStandardPrintJobFormat() ); diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 0c9e425de2e0..805ce6fb45c6 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -2105,7 +2105,7 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingWidth( SvxIconChoiceCtrlEntry* pEntry ) switch( nWinBits & (VIEWMODE_MASK) ) { case WB_ICON: - nWidth = Max( nStringWidth, aImageSize.Width() ); + nWidth = std::max( nStringWidth, aImageSize.Width() ); break; case WB_SMALLICON: @@ -2133,7 +2133,7 @@ long SvxIconChoiceCtrl_Impl::CalcBoundingHeight( SvxIconChoiceCtrlEntry* pEntry case WB_SMALLICON: case WB_DETAILS: - nHeight = Max( aImageSize.Height(), nStringHeight ); + nHeight = std::max( aImageSize.Height(), nStringHeight ); break; } if( nHeight > nMaxBoundHeight ) diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 3e10acb130b8..0099dd22a9c0 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -185,7 +185,7 @@ void SvImpLBox::UpdateContextBmpWidthVectorFromMovedEntry( SvTreeListEntry* pEnt SvLBoxContextBmp* pBmpItem = static_cast< SvLBoxContextBmp* >( pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP ) ); short nExpWidth = (short)pBmpItem->GetBitmap1().GetSizePixel().Width(); short nColWidth = (short)pBmpItem->GetBitmap2().GetSizePixel().Width(); - short nMax = Max(nExpWidth, nColWidth); + short nMax = std::max(nExpWidth, nColWidth); UpdateContextBmpWidthVector( pEntry, nMax ); if( pEntry->HasChildren() ) // recursive call, whether expanded or not diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 5fa6021abce0..a418330ba887 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -3676,7 +3676,7 @@ void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvTreeListEntry* pE break; const Image& rBitmap1( pBmpItem->GetBitmap1() ); const Image& rBitmap2( pBmpItem->GetBitmap2() ); - short nMaxWidth = short( Max( rBitmap1.GetSizePixel().Width(), rBitmap2.GetSizePixel().Width() ) ); + short nMaxWidth = short( std::max( rBitmap1.GetSizePixel().Width(), rBitmap2.GetSizePixel().Width() ) ); nMaxWidth = pImp->UpdateContextBmpWidthVector( pEntry, nMaxWidth ); if( nMaxWidth > nContextBmpWidthMax ) { diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index ab7e320c03fe..bd999746c007 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -1004,7 +1004,7 @@ void Ruler::ImplCalc() mnWinWidth = mnWidth - mnVirOff; if ( mpData->bAutoPageWidth ) mpData->nPageWidth = mnWinWidth; - mpData->nRulWidth = Min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth ); + mpData->nRulWidth = std::min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth ); if ( nRulWinOff+mpData->nRulWidth > mnWidth ) mpData->nRulWidth = mnWidth-nRulWinOff; } @@ -1014,7 +1014,7 @@ void Ruler::ImplCalc() mnWinWidth = mnHeight - mnVirOff; if ( mpData->bAutoPageWidth ) mpData->nPageWidth = mnWinWidth; - mpData->nRulWidth = Min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth ); + mpData->nRulWidth = std::min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth ); if ( nRulWinOff+mpData->nRulWidth > mnHeight ) mpData->nRulWidth = mnHeight-nRulWinOff; } diff --git a/svtools/source/control/scriptedtext.cxx b/svtools/source/control/scriptedtext.cxx index 146ceeb37c7b..46f40fc1a1b9 100644 --- a/svtools/source/control/scriptedtext.cxx +++ b/svtools/source/control/scriptedtext.cxx @@ -170,11 +170,11 @@ void SvtScriptedTextHelper_Impl::CalculateSizes() // calculate maximum font height SetOutDevFont( i18n::ScriptType::LATIN ); - maTextSize.Height() = Max( maTextSize.Height(), mrOutDevice.GetTextHeight() ); + maTextSize.Height() = std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ); SetOutDevFont( i18n::ScriptType::ASIAN ); - maTextSize.Height() = Max( maTextSize.Height(), mrOutDevice.GetTextHeight() ); + maTextSize.Height() = std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ); SetOutDevFont( i18n::ScriptType::COMPLEX ); - maTextSize.Height() = Max( maTextSize.Height(), mrOutDevice.GetTextHeight() ); + maTextSize.Height() = std::max( maTextSize.Height(), mrOutDevice.GetTextHeight() ); mrOutDevice.SetFont( maDefltFont ); } diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx index b20343f04ff9..c66a31eba5f6 100644 --- a/svtools/source/control/scrwin.cxx +++ b/svtools/source/control/scrwin.cxx @@ -358,8 +358,8 @@ void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 ) Update(); // does the new area overlap the old one? - if ( Abs( (int)aDeltaPix.Height() ) < aOutPixSz.Height() || - Abs( (int)aDeltaPix.Width() ) < aOutPixSz.Width() ) + if ( std::abs( (int)aDeltaPix.Height() ) < aOutPixSz.Height() || + std::abs( (int)aDeltaPix.Width() ) < aOutPixSz.Width() ) { // scroll the overlapping area SetMapMode( aMap ); diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index d8d9b396f2ab..3405dac90448 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -621,7 +621,7 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo ) { rRadioHeight = aNativeBounds.GetHeight(); - rMaxWidth = Max (rMaxWidth, aNativeContent.GetWidth()); + rMaxWidth = std::max (rMaxWidth, aNativeContent.GetWidth()); } } return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight; diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index 372ecf96f1e0..f0d462967ca5 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -1035,7 +1035,7 @@ void GraphicCache::SetMaxObjDisplayCacheSize( sal_uLong nNewMaxObjSize, sal_Bool { const sal_Bool bDestroy = ( bDestroyGreaterCached && ( nNewMaxObjSize < mnMaxObjDisplaySize ) ); - mnMaxObjDisplaySize = Min( nNewMaxObjSize, mnMaxDisplaySize ); + mnMaxObjDisplaySize = std::min( nNewMaxObjSize, mnMaxDisplaySize ); if( bDestroy ) { diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 456db307cead..bec3886d0db1 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -132,7 +132,7 @@ void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) co void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const { OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("poly ")); - const sal_uInt16 nCount = Min( aPoly.GetSize(), (sal_uInt16) 100 ); + const sal_uInt16 nCount = std::min( aPoly.GetSize(), (sal_uInt16) 100 ); AppendNCSAURL(aStrBuf, rBaseURL); diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index ac134b8282fd..d932210f3a96 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -786,16 +786,16 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf ) nTol = ( pTols[i] * 255L ) / 100L; nVal = ( (long) pSrcCols[i].GetRed() ); - pMinR[i] = Max( nVal - nTol, 0L ); - pMaxR[i] = Min( nVal + nTol, 255L ); + pMinR[i] = std::max( nVal - nTol, 0L ); + pMaxR[i] = std::min( nVal + nTol, 255L ); nVal = ( (long) pSrcCols[i].GetGreen() ); - pMinG[i] = Max( nVal - nTol, 0L ); - pMaxG[i] = Min( nVal + nTol, 255L ); + pMinG[i] = std::max( nVal - nTol, 0L ); + pMaxG[i] = std::min( nVal + nTol, 255L ); nVal = ( (long) pSrcCols[i].GetBlue() ); - pMinB[i] = Max( nVal - nTol, 0L ); - pMaxB[i] = Min( nVal + nTol, 255L ); + pMinB[i] = std::max( nVal - nTol, 0L ); + pMaxB[i] = std::min( nVal + nTol, 255L ); pTrans[ i ] = ( pDstCols[ i ] == TRANSP_COL ); } diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index d5007a275807..681d1c62ba92 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -1743,7 +1743,7 @@ void BrokenRecoveryDialog::impl_askForSavePath() if ( nTxtW >= nBtnW ) { const long nMinDelta = 10; - long nDelta = Max( nTxtW - nBtnW, nMinDelta ); + long nDelta = std::max( nTxtW - nBtnW, nMinDelta ); sal_uInt32 i = 0; Window* pWins[] = { @@ -2043,12 +2043,12 @@ void BrokenRecoveryDialog::impl_askForSavePath() Size aBtnSz = maOKBtn.GetSizePixel(); Point aEditPnt = maContentML.GetPosPixel(); - long nNewHeight = Max( aWinSz.Height() - aEditPnt.Y() - 3 * a3Sz.Height() - aBtnSz.Height(), mnMinHeight ); + long nNewHeight = std::max( aWinSz.Height() - aEditPnt.Y() - 3 * a3Sz.Height() - aBtnSz.Height(), mnMinHeight ); long nNewWidth = aWinSz.Width() - 4 * a3Sz.Width(); Size aNewSize( nNewWidth, nNewHeight ); maContentML.SetSizePixel( aNewSize ); - Point aNewPoint( Max( aEditPnt.X() + aNewSize.Width() - aBtnSz.Width(), aEditPnt.X() ), + Point aNewPoint( std::max( aEditPnt.X() + aNewSize.Width() - aBtnSz.Width(), aEditPnt.X() ), aEditPnt.Y() + aNewSize.Height() + a3Sz.Height() ); maOKBtn.SetPosPixel( aNewPoint ); } diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx index 43811e395e7e..20fdd3f68c3d 100644 --- a/svx/source/dialog/framelink.cxx +++ b/svx/source/dialog/framelink.cxx @@ -1264,7 +1264,7 @@ bool operator<( const Style& rL, const Style& rR ) double GetHorDiagAngle( long nWidth, long nHeight ) { - return atan2( static_cast< double >( Abs( nHeight ) ), static_cast< double >( Abs( nWidth ) ) ); + return atan2( static_cast< double >( std::abs( nHeight ) ), static_cast< double >( std::abs( nWidth ) ) ); } // ============================================================================ diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index 1db80abc1fb3..f680f43510ee 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -331,7 +331,7 @@ void FrameSelectorImpl::InitGlobalGeometry() /* nMinSize is the lower of width and height (control will always be squarish). FRAMESEL_GEOM_OUTER is the minimal distance between inner control border and any element. */ - long nMinSize = Min( aCtrlSize.Width(), aCtrlSize.Height() ) - 2 * FRAMESEL_GEOM_OUTER; + long nMinSize = std::min( aCtrlSize.Width(), aCtrlSize.Height() ) - 2 * FRAMESEL_GEOM_OUTER; /* nFixedSize is the size all existing elements need in one direction: the diag. arrow, space betw. arrow and frame border, outer frame border, inner frame border, other outer frame border, space betw. frame border diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index f864f4ed760f..e0097e671f4c 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -877,7 +877,7 @@ IMPL_LINK_NOARG(SvxHFPage, RangeHdl) long nFHeight = m_pBspWin->GetFtHeight(); long nFDist = m_pBspWin->GetFtDist(); - long nHeight = Max( (long)MINBODY, + long nHeight = std::max( (long)MINBODY, static_cast<long>(m_pHeightEdit->Denormalize( m_pHeightEdit->GetValue( FUNIT_TWIP ) ) ) ); long nDist = m_pTurnOnBox->IsChecked() ? static_cast<long>(m_pDistEdit->Denormalize( m_pDistEdit->GetValue( FUNIT_TWIP ) )) : 0; @@ -910,11 +910,11 @@ IMPL_LINK_NOARG(SvxHFPage, RangeHdl) { // Header nMin = ( nH - nBB - nBT ) / 5; // 20% - nMax = Max( nH - nMin - nHDist - nFDist - nFHeight - nBB - nBT, + nMax = std::max( nH - nMin - nHDist - nFDist - nFHeight - nBB - nBT, nMin ); m_pHeightEdit->SetMax( m_pHeightEdit->Normalize( nMax ), FUNIT_TWIP ); nMin = ( nH - nBB - nBT ) / 5; // 20% - nDist = Max( nH - nMin - nHHeight - nFDist - nFHeight - nBB - nBT, + nDist = std::max( nH - nMin - nHHeight - nFDist - nFHeight - nBB - nBT, long(0) ); m_pDistEdit->SetMax( m_pDistEdit->Normalize( nDist ), FUNIT_TWIP ); } @@ -922,11 +922,11 @@ IMPL_LINK_NOARG(SvxHFPage, RangeHdl) { // Footer nMin = ( nH - nBT - nBB ) / 5; // 20% - nMax = Max( nH - nMin - nFDist - nHDist - nHHeight - nBT - nBB, + nMax = std::max( nH - nMin - nFDist - nHDist - nHHeight - nBT - nBB, nMin ); m_pHeightEdit->SetMax( m_pHeightEdit->Normalize( nMax ), FUNIT_TWIP ); nMin = ( nH - nBT - nBB ) / 5; // 20% - nDist = Max( nH - nMin - nFHeight - nHDist - nHHeight - nBT - nBB, + nDist = std::max( nH - nMin - nFHeight - nHDist - nHHeight - nBT - nBB, long(0) ); m_pDistEdit->SetMax( m_pDistEdit->Normalize( nDist ), FUNIT_TWIP ); } diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 9e7296061f1f..ee4f809432ec 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -676,7 +676,7 @@ void SvxSearchDialog::InitControls_Impl() LINK( this, SvxSearchDialog, AttributeHdl_Impl ) ); // check if buttontext is to wide - long nTxtW = Max( pMoreBtn->GetCtrlTextWidth( pMoreBtn->GetMoreText() ), + long nTxtW = std::max( pMoreBtn->GetCtrlTextWidth( pMoreBtn->GetMoreText() ), pMoreBtn->GetCtrlTextWidth( pMoreBtn->GetLessText() ) ); nTxtW += ( pMoreBtn->GetTextHeight() * 2 ); // add image size + offset long nBtnW = pMoreBtn->GetSizePixel().Width(); @@ -684,7 +684,7 @@ void SvxSearchDialog::InitControls_Impl() { // broaden the button const long nMinDelta = 10; - long nDelta = Max( nTxtW - nBtnW, nMinDelta ); + long nDelta = std::max( nTxtW - nBtnW, nMinDelta ); Size aNewSize = pMoreBtn->GetSizePixel(); aNewSize.Width() += nDelta; pMoreBtn->SetSizePixel( aNewSize ); diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 24f856f09de0..e8fd30c46d88 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -1948,7 +1948,7 @@ ADD_DEBUG_TEXT("lLastLMargin: ", OUString::number(pRuler_Imp->lLastLMargin)) { long l = pBorders[i].nPos; pBorders[i].nPos += lDiff; - pBorders[i].nPos = Min(pBorders[i].nPos, nRight - pBorders[i].nWidth); + pBorders[i].nPos = std::min(pBorders[i].nPos, nRight - pBorders[i].nWidth); nRight = pBorders[i].nPos - lMinFrame; // RR update the column if(i == GetActRightColumn()) @@ -2172,7 +2172,7 @@ void SvxRuler::ApplyMargins() else pLRSpaceItem->SetRight( PixelHAdjust( - Max((long)0,pPagePosItem->GetWidth() - + std::max((long)0,pPagePosItem->GetWidth() - pLRSpaceItem->GetLeft() - (ConvertHPosLogic(GetMargin2()) - lAppNullOffset)),pLRSpaceItem->GetRight())); @@ -2192,7 +2192,7 @@ void SvxRuler::ApplyMargins() lAppNullOffset += lLogicNullOffset - lOldNull; pULSpaceItem->SetLower( PixelVAdjust( - Max((long)0, pPagePosItem->GetHeight() - + std::max((long)0, pPagePosItem->GetHeight() - pULSpaceItem->GetUpper() - (ConvertVPosLogic(GetMargin2()) - lAppNullOffset)),pULSpaceItem->GetLower())); @@ -2688,8 +2688,8 @@ void SvxRuler::Click() sal_Bool bContentProtected = pRuler_Imp->aProtectItem.IsCntntProtected(); if( bContentProtected ) return; const long lPos = GetClickPos(); - if((bRTL && lPos < Min(GetFirstLineIndent(), GetLeftIndent()) && lPos > GetRightIndent()) || - (!bRTL && lPos > Min(GetFirstLineIndent(), GetLeftIndent()) && lPos < GetRightIndent())) + if((bRTL && lPos < std::min(GetFirstLineIndent(), GetLeftIndent()) && lPos > GetRightIndent()) || + (!bRTL && lPos > std::min(GetFirstLineIndent(), GetLeftIndent()) && lPos < GetRightIndent())) { //convert position in left-to-right text long nTabPos; @@ -2758,13 +2758,13 @@ void SvxRuler::CalcMinMax() if(bRTL) { nMaxRight = lNullPix - GetRightIndent() + - Max(GetFirstLineIndent(), GetLeftIndent()) - + std::max(GetFirstLineIndent(), GetLeftIndent()) - lMinFrame; } else { nMaxRight = lNullPix + GetRightIndent() - - Max(GetFirstLineIndent(), GetLeftIndent()) - + std::max(GetFirstLineIndent(), GetLeftIndent()) - lMinFrame; } } @@ -2806,22 +2806,22 @@ void SvxRuler::CalcMinMax() { if(bRTL) { - nMaxRight += Min( + nMaxRight += std::min( pBorders[0].nPos, - Max(GetFirstLineIndent(), GetLeftIndent()) - GetRightIndent()); + std::max(GetFirstLineIndent(), GetLeftIndent()) - GetRightIndent()); } else { - nMaxRight += Min( + nMaxRight += std::min( pBorders[0].nPos, GetRightIndent() - - Max(GetFirstLineIndent(), GetLeftIndent())); + std::max(GetFirstLineIndent(), GetLeftIndent())); } } else if( pColumnItem->Count() > 1 ) nMaxRight += pBorders[0].nPos; else nMaxRight +=GetRightIndent() - - Max(GetFirstLineIndent(), GetLeftIndent()); + std::max(GetFirstLineIndent(), GetLeftIndent()); // Do not drag the left table edge over the edge of the page if(pLRSpaceItem&&pColumnItem->IsTable()) { @@ -2846,13 +2846,13 @@ void SvxRuler::CalcMinMax() if(bRTL) { nMaxLeft = GetMargin2() + GetRightIndent() - - Max(GetFirstLineIndent(),GetLeftIndent()) - GetMargin1()+ + std::max(GetFirstLineIndent(),GetLeftIndent()) - GetMargin1()+ lMinFrame + lNullPix; } else { nMaxLeft = GetMargin2() - GetRightIndent() + - Max(GetFirstLineIndent(),GetLeftIndent()) - GetMargin1()+ + std::max(GetFirstLineIndent(),GetLeftIndent()) - GetMargin1()+ lMinFrame + lNullPix; } } @@ -2891,13 +2891,13 @@ void SvxRuler::CalcMinMax() if(bRTL) { nMaxLeft = lMinFrame + lNullPix + GetMargin2() + - GetRightIndent() - Max(GetFirstLineIndent(), + GetRightIndent() - std::max(GetFirstLineIndent(), GetLeftIndent()); } else { nMaxLeft = lMinFrame + lNullPix + GetMargin2() - - GetRightIndent() + Max(GetFirstLineIndent(), + GetRightIndent() + std::max(GetFirstLineIndent(), GetLeftIndent()); } } @@ -2907,7 +2907,7 @@ void SvxRuler::CalcMinMax() lMinFrame + lNullPix + pBorders[pColumnItem->Count()-2].nPos + pBorders[pColumnItem->Count()-2].nWidth; - nMaxLeft=Max(nMaxLeft,nNewMaxLeft); + nMaxLeft=std::max(nMaxLeft,nNewMaxLeft); } } @@ -2933,13 +2933,13 @@ void SvxRuler::CalcMinMax() if(bRTL) { nMaxLeft += pBorders[nIdx].nPos + - GetRightIndent() - Max(GetFirstLineIndent(), + GetRightIndent() - std::max(GetFirstLineIndent(), GetLeftIndent()); } else { nMaxLeft += pBorders[nIdx].nPos - - GetRightIndent() + Max(GetFirstLineIndent(), + GetRightIndent() + std::max(GetFirstLineIndent(), GetLeftIndent()); } if(0 != nIdx) @@ -3023,7 +3023,7 @@ void SvxRuler::CalcMinMax() if(bRTL) { nMaxLeft += pBorders[nIdx].nPos + - GetRightIndent() - Max(GetFirstLineIndent(), + GetRightIndent() - std::max(GetFirstLineIndent(), GetLeftIndent()); if(nActLeftCol!=USHRT_MAX) nMaxLeft -= pBorders[nActLeftCol].nPos + @@ -3032,7 +3032,7 @@ void SvxRuler::CalcMinMax() else { nMaxLeft += pBorders[nIdx].nPos - - GetRightIndent() + Max(GetFirstLineIndent(), + GetRightIndent() + std::max(GetFirstLineIndent(), GetLeftIndent()); if(nActLeftCol!=USHRT_MAX) nMaxLeft -= pBorders[nActLeftCol].nPos + @@ -3065,14 +3065,14 @@ void SvxRuler::CalcMinMax() { nMaxRight -= GetMargin2() + GetRightIndent() - - Max(GetFirstLineIndent(), + std::max(GetFirstLineIndent(), GetLeftIndent()); } else { nMaxRight -= GetMargin2() - GetRightIndent() + - Max(GetFirstLineIndent(), + std::max(GetFirstLineIndent(), GetLeftIndent()); } nMaxRight += pBorders[nIdx].nPos + @@ -3094,13 +3094,13 @@ void SvxRuler::CalcMinMax() if(bRTL) { nMaxRight -= nBorder + GetRightIndent() - - Max(GetFirstLineIndent(), + std::max(GetFirstLineIndent(), GetLeftIndent()); } else { nMaxRight -= nBorder - GetRightIndent() + - Max(GetFirstLineIndent(), + std::max(GetFirstLineIndent(), GetLeftIndent()); } nMaxRight += pBorders[nIdx].nPos + @@ -3139,7 +3139,7 @@ void SvxRuler::CalcMinMax() if(pColumnItem->IsLastAct()) { nMaxRight -= GetMargin2() - GetRightIndent() + - Max(GetFirstLineIndent(), + std::max(GetFirstLineIndent(), GetLeftIndent()); nMaxRight += pBorders[nIdx].nPos + pBorders[nIdx].nWidth; @@ -3149,7 +3149,7 @@ void SvxRuler::CalcMinMax() nMaxRight = lNullPix + pBorders[nIdx+1].nPos; if(pColumnItem->GetActColumn()-1 == nIdx) { nMaxRight -= pBorders[nIdx+1].nPos - GetRightIndent() + - Max(GetFirstLineIndent(), + std::max(GetFirstLineIndent(), GetLeftIndent()); nMaxRight += pBorders[nIdx].nPos + pBorders[nIdx].nWidth; @@ -3217,7 +3217,7 @@ void SvxRuler::CalcMinMax() if(bRTL) { nMaxLeft = lNullPix; - nMaxRight = lNullPix + Min(GetFirstLineIndent(), GetLeftIndent()) - lMinFrame; + nMaxRight = lNullPix + std::min(GetFirstLineIndent(), GetLeftIndent()) - lMinFrame; if(pColumnItem) { sal_uInt16 nRightCol=GetActRightColumn( sal_True ); @@ -3233,7 +3233,7 @@ void SvxRuler::CalcMinMax() else { nMaxLeft = lNullPix + - Max(GetFirstLineIndent(), GetLeftIndent()); + std::max(GetFirstLineIndent(), GetLeftIndent()); nMaxRight = lNullPix; if(pColumnItem) { @@ -3258,7 +3258,7 @@ void SvxRuler::CalcMinMax() right = NOf + RAR */ nMaxLeft = bRTL ? lNullPix + GetRightIndent() - : lNullPix + Min(GetFirstLineIndent(), GetLeftIndent()); + : lNullPix + std::min(GetFirstLineIndent(), GetLeftIndent()); pRuler_Imp->lMaxRightLogic=GetLogicRightIndent()+lLogicNullOffset; nMaxRight = ConvertSizePixel(pRuler_Imp->lMaxRightLogic); break; diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index 2dfdebe603a8..740fef4c738e 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -202,15 +202,15 @@ void SvxSwFrameExample::InitAllRects_Impl() aFrmSize = Size(nLBorder - 3, (aTextLine.GetHeight() + 2) * 3); break; } - aFrmSize.Width() = Max(5L, aFrmSize.Width()); - aFrmSize.Height() = Max(5L, aFrmSize.Height()); + aFrmSize.Width() = std::max(5L, aFrmSize.Width()); + aFrmSize.Height() = std::max(5L, aFrmSize.Height()); } else { sal_uIntPtr nFreeWidth = aPagePrtArea.GetWidth() - GetTextWidth(OUString(DEMOTEXT)); aFrmSize = Size(nFreeWidth / 2, (aTextLine.GetHeight() + 2) * 3); - aDrawObj.SetSize(Size(Max(5L, (long)nFreeWidth / 3L), Max(5L, aFrmSize.Height() * 3L))); + aDrawObj.SetSize(Size(std::max(5L, (long)nFreeWidth / 3L), std::max(5L, aFrmSize.Height() * 3L))); aDrawObj.SetPos(Point(aParaPrtArea.Right() + 1, aParaPrtArea.Bottom() / 2)); aParaPrtArea.Right() = aDrawObj.Right(); } diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index a34d4f3a6c7b..64bf73436454 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -1888,7 +1888,7 @@ void DbGridControl::RecalcRows(long nNewTopRow, sal_uInt16 nLinesOnScreen, sal_B if (nDelta < nLimit && (nDelta > 0 || (bCacheAligned && m_nTotalCount < 0)) ) SeekCursor(nNewTopRow + nLinesOnScreen - 1, sal_False); - else if (nDelta < 0 && Abs(nDelta) < nLimit) + else if (nDelta < 0 && std::abs(nDelta) < nLimit) SeekCursor(nNewTopRow, sal_False); else if (nDelta != 0 || bUpdateCursor) SeekCursor(nNewTopRow, sal_True); diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 8ec224214b92..b523d22f36e7 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -2245,8 +2245,8 @@ namespace svxform Window::Resize(); Size aOutSz = GetOutputSizePixel(); - long nWidth = Max( aOutSz.Width(), m_nMinWidth ); - long nHeight = Max( aOutSz.Height(), m_nMinHeight ); + long nWidth = std::max( aOutSz.Width(), m_nMinWidth ); + long nHeight = std::max( aOutSz.Height(), m_nMinHeight ); Size aSz = m_aModelsBox.GetSizePixel(); aSz.Width() = nWidth - 3*m_a3Size.Width() - m_aModelBtn.GetSizePixel().Width(); diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index 273aca1f58c1..30b0a238241e 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -753,7 +753,7 @@ void FmFormShell::Execute(SfxRequest &rReq) { const SfxInt32Item* pTypedItem = PTR_CAST( SfxInt32Item, pItem ); if ( pTypedItem ) - nRecord = Max( pTypedItem->GetValue(), sal_Int32(0) ); + nRecord = std::max( pTypedItem->GetValue(), sal_Int32(0) ); } } else diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 3a85aacdb586..e449a02e3e81 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -650,8 +650,8 @@ IMPL_LINK_NOARG(GalleryBrowser1, ShowContextMenuHdl) const Rectangle aThemesRect( mpThemes->GetPosPixel(), mpThemes->GetOutputSizePixel() ); Point aSelPos( mpThemes->GetBoundingRectangle( mpThemes->GetSelectEntryPos() ).Center() ); - aSelPos.X() = Max( Min( aSelPos.X(), aThemesRect.Right() ), aThemesRect.Left() ); - aSelPos.Y() = Max( Min( aSelPos.Y(), aThemesRect.Bottom() ), aThemesRect.Top() ); + aSelPos.X() = std::max( std::min( aSelPos.X(), aThemesRect.Right() ), aThemesRect.Left() ); + aSelPos.Y() = std::max( std::min( aSelPos.Y(), aThemesRect.Bottom() ), aThemesRect.Top() ); aMenu.Execute( this, aSelPos ); } diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 2a5a28416ea0..00b975236a65 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -869,8 +869,8 @@ sal_uIntPtr GalleryBrowser2::ImplGetSelectedItemId( const Point* pSelPos, Point& } } - rSelPos.X() = Max( Min( rSelPos.X(), aOutputSizePixel.Width() - 1L ), 0L ); - rSelPos.Y() = Max( Min( rSelPos.Y(), aOutputSizePixel.Height() - 1L ), 0L ); + rSelPos.X() = std::max( std::min( rSelPos.X(), aOutputSizePixel.Width() - 1L ), 0L ); + rSelPos.Y() = std::max( std::min( rSelPos.Y(), aOutputSizePixel.Height() - 1L ), 0L ); if( nRet && ( !mpCurTheme || ( nRet > mpCurTheme->GetObjectCount() ) ) ) { diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index c6cc85839a0c..848a230509c4 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -547,8 +547,8 @@ void GalleryListView::PaintField( OutputDevice& rDev, const Rectangle& rRect, sa } } - aSize.Width() = Max( aSize.Width(), 4L ); - aSize.Height() = Max( aSize.Height(), 4L ); + aSize.Width() = std::max( aSize.Width(), 4L ); + aSize.Height() = std::max( aSize.Height(), 4L ); const Point aPos( ( ( aOutputRect.GetWidth() - aSize.Width() ) >> 1 ) + aOutputRect.Left(), ( ( aOutputRect.GetHeight() - aSize.Height() ) >> 1 ) + aOutputRect.Top() ); diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index b22091e086db..5def7f04a440 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -438,7 +438,7 @@ GalleryProgress::~GalleryProgress() void GalleryProgress::Update( sal_uIntPtr nVal, sal_uIntPtr nMaxVal ) { if( mxProgressBar.is() && nMaxVal ) - mxProgressBar->setValue( Min( (sal_uIntPtr)( (double) nVal / nMaxVal * GALLERY_PROGRESS_RANGE ), (sal_uIntPtr) GALLERY_PROGRESS_RANGE ) ); + mxProgressBar->setValue( std::min( (sal_uIntPtr)( (double) nVal / nMaxVal * GALLERY_PROGRESS_RANGE ), (sal_uIntPtr) GALLERY_PROGRESS_RANGE ) ); } // ----------------------- diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 6ef09c95adbe..763790a15e48 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -98,8 +98,8 @@ sal_Bool SgaObject::CreateThumb( const Graphic& rGraphic ) else { const float fFactor = (float) aBmpSize.Width() / aBmpSize.Height(); - const Size aNewSize( Max( (long) (fFactor < 1. ? S_THUMB * fFactor : S_THUMB), 8L ), - Max( (long) (fFactor < 1. ? S_THUMB : S_THUMB / fFactor), 8L ) ); + const Size aNewSize( std::max( (long) (fFactor < 1. ? S_THUMB * fFactor : S_THUMB), 8L ), + std::max( (long) (fFactor < 1. ? S_THUMB : S_THUMB / fFactor), 8L ) ); if( aThumbBmp.Scale( (double) aNewSize.Width() / aBmpSize.Width(), (double) aNewSize.Height() / aBmpSize.Height(), BMP_SCALE_BEST ) ) diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 44188f1f2d18..35bb9218d8fb 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -1388,7 +1388,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const delete pCompat; // Rest des Puffers auffuellen - const long nRest = Max( 512L - ( (long) rOStm.Tell() - nReservePos ), 0L ); + const long nRest = std::max( 512L - ( (long) rOStm.Tell() - nReservePos ), 0L ); if( nRest ) { diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 0a1082f51fa3..05e709db15ba 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -308,7 +308,7 @@ namespace sdr aLocalGrafInfo.SetChannelG(((SdrGrafGreenItem&)rItemSet.Get(SDRATTR_GRAFGREEN)).GetValue()); aLocalGrafInfo.SetChannelB(((SdrGrafBlueItem&)rItemSet.Get(SDRATTR_GRAFBLUE)).GetValue()); aLocalGrafInfo.SetGamma(((SdrGrafGamma100Item&)rItemSet.Get(SDRATTR_GRAFGAMMA)).GetValue() * 0.01); - aLocalGrafInfo.SetTransparency((sal_uInt8)::basegfx::fround(Min(nTrans, (sal_uInt16)100) * 2.55)); + aLocalGrafInfo.SetTransparency((sal_uInt8)::basegfx::fround(std::min(nTrans, (sal_uInt16)100) * 2.55)); aLocalGrafInfo.SetInvert(((SdrGrafInvertItem&)rItemSet.Get(SDRATTR_GRAFINVERT)).GetValue()); aLocalGrafInfo.SetDrawMode(((SdrGrafModeItem&)rItemSet.Get(SDRATTR_GRAFMODE)).GetValue()); aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom()); diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx index 18c33eaf92fa..94e2777fdf59 100644 --- a/svx/source/stbctrls/zoomsliderctrl.cxx +++ b/svx/source/stbctrls/zoomsliderctrl.cxx @@ -99,7 +99,7 @@ sal_uInt16 SvxZoomSliderControl::Offset2Zoom( long nOffset ) const ++aSnappingPointIter ) { const long nCurrent = *aSnappingPointIter; - if ( Abs(nCurrent - nOffset) < nSnappingEpsilon ) + if ( std::abs(nCurrent - nOffset) < nSnappingEpsilon ) { nOffset = nCurrent; nRet = mpImpl->maSnappingPointZooms[ nCount ]; diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 8fdc6b8581e3..d79d5f2add25 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1550,7 +1550,7 @@ void SdrDragMove::ImpCheckSnap(const Point& rPt) { if (bXSnapped) { - if (Abs(aPt.X())<Abs(nBestXSnap)) + if (std::abs(aPt.X())<std::abs(nBestXSnap)) { nBestXSnap=aPt.X(); } @@ -1566,7 +1566,7 @@ void SdrDragMove::ImpCheckSnap(const Point& rPt) { if (bYSnapped) { - if (Abs(aPt.Y())<Abs(nBestYSnap)) + if (std::abs(aPt.Y())<std::abs(nBestYSnap)) { nBestYSnap=aPt.Y(); } @@ -1780,8 +1780,8 @@ void SdrDragResize::TakeSdrDragComment(XubString& rStr) const if(!nYDiv) nYDiv = 1; - bool bX(aXFact != aFact1 && Abs(nXDiv) > 1); - bool bY(aYFact != aFact1 && Abs(nYDiv) > 1); + bool bX(aXFact != aFact1 && std::abs(nXDiv) > 1); + bool bY(aYFact != aFact1 && std::abs(nYDiv) > 1); if(bX || bY) { @@ -1961,7 +1961,7 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) if (!DragStat().IsHorFixed() && !DragStat().IsVerFixed()) { - if (Abs(nXDiv)<=1 || Abs(nYDiv)<=1) + if (std::abs(nXDiv)<=1 || std::abs(nYDiv)<=1) bOrtho=false; if (bOrtho) @@ -2545,7 +2545,7 @@ void SdrDragMirror::TakeSdrDragComment(XubString& rStr) const ImpTakeDescriptionStr(STR_DragMethMirrorHori,rStr); else if (aDif.Y()==0) ImpTakeDescriptionStr(STR_DragMethMirrorVert,rStr); - else if (Abs(aDif.X())==Abs(aDif.Y())) + else if (std::abs(aDif.X()) == std::abs(aDif.Y())) ImpTakeDescriptionStr(STR_DragMethMirrorDiag,rStr); else ImpTakeDescriptionStr(STR_DragMethMirrorFree,rStr); @@ -2567,7 +2567,7 @@ bool SdrDragMirror::BeginSdrDrag() Ref2()=pH2->GetPos(); aDif=pH2->GetPos()-pH1->GetPos(); bool b90=(aDif.X()==0) || aDif.Y()==0; - bool b45=b90 || (Abs(aDif.X())==Abs(aDif.Y())); + bool b45=b90 || (std::abs(aDif.X()) == std::abs(aDif.Y())); nWink=NormAngle360(GetAngle(aDif)); if (!getSdrDragView().IsMirrorAllowed(false,false) && !b45) @@ -2842,7 +2842,7 @@ void SdrDragCrook::TakeSdrDragComment(XubString& rStr) const if(bAtCenter) nVal *= 2; - nVal = Abs(nVal); + nVal = std::abs(nVal); OUString aStr; getSdrDragView().GetModel()->TakeWinkStr(nVal, aStr); rStr.Append(aStr); @@ -3185,9 +3185,9 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) if (bValid) { if (bVertical) - bValid=Abs(dx1)*100>Abs(dy1); + bValid = std::abs(dx1)*100>std::abs(dy1); else - bValid=Abs(dy1)*100>Abs(dx1); + bValid = std::abs(dy1)*100>std::abs(dx1); } long nNeuRad=0; @@ -3235,10 +3235,10 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) if (nNeuRad<0) nPntWink+=18000; if (bVertical) nPntWink=18000-nPntWink; nPntWink=NormAngle180(nPntWink); - nPntWink=Abs(nPntWink); + nPntWink = std::abs(nPntWink); } - double nUmfang=2*Abs(nNeuRad)*nPi; + double nUmfang = 2 * std::abs(nNeuRad)*nPi; if (bResize) { @@ -3311,7 +3311,7 @@ void SdrDragCrook::MoveSdrDrag(const Point& rPnt) if (bAtCenter) { nMul*=2; - nMul=Abs(nMul); + nMul = std::abs(nMul); } aNeuFact=Fraction(nMul,nDiv); diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 9a0528cf9318..fcf7dd7ea49d 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -316,7 +316,7 @@ void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool b Point aDif(rRef2-rRef1); if (aDif.X()==0) ImpTakeDescriptionStr(STR_EditMirrorHori,aStr); else if (aDif.Y()==0) ImpTakeDescriptionStr(STR_EditMirrorVert,aStr); - else if (Abs(aDif.X())==Abs(aDif.Y())) ImpTakeDescriptionStr(STR_EditMirrorDiag,aStr); + else if (std::abs(aDif.X()) == std::abs(aDif.Y())) ImpTakeDescriptionStr(STR_EditMirrorDiag,aStr); else ImpTakeDescriptionStr(STR_EditMirrorFree,aStr); if (bCopy) aStr+=ImpGetResStr(STR_EditWithCopy); BegUndo(aStr); diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 67e5914d4829..75a3c79e38a7 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -248,7 +248,7 @@ void _SdrItemBrowserControl::ImpCtor() InsertDataColumn( ITEMBROWSER_STATECOL_ID, String("State", aTextEncoding), - Max(GetTextWidth(String(" State ", aTextEncoding)) + 2 , + std::max(GetTextWidth(String(" State ", aTextEncoding)) + 2 , GetTextWidth(String("DontCare", aTextEncoding)) + 2)); InsertDataColumn( ITEMBROWSER_TYPECOL_ID , diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index ab050d847b41..312c9c605fe7 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -1738,7 +1738,7 @@ void SdrModel::Merge(SdrModel& rSourceModel, // get the drawing pages if (bInsPages) { sal_uInt16 nSourcePos=nFirstPageNum; - sal_uInt16 nMergeCount=sal_uInt16(Abs((long)((long)nFirstPageNum-nLastPageNum))+1); + sal_uInt16 nMergeCount=sal_uInt16(std::abs((long)((long)nFirstPageNum-nLastPageNum))+1); if (nDestPos>GetPageCount()) nDestPos=GetPageCount(); while (nMergeCount>0) { SdrPage* pPg=NULL; diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 5a5f53669f4a..8385b07bb70a 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1288,10 +1288,10 @@ Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const long nYDiv=nHgt0; bool bXNeg=(nXMul<0)!=(nXDiv<0); bool bYNeg=(nYMul<0)!=(nYDiv<0); - nXMul=Abs(nXMul); - nYMul=Abs(nYMul); - nXDiv=Abs(nXDiv); - nYDiv=Abs(nYDiv); + nXMul=std::abs(nXMul); + nYMul=std::abs(nYMul); + nXDiv=std::abs(nXDiv); + nYDiv=std::abs(nYDiv); Fraction aXFact(nXMul,nXDiv); // fractions for canceling Fraction aYFact(nYMul,nYDiv); // and for comparing nXMul=aXFact.GetNumerator(); diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index fec1d31f55ff..9390388327b8 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -64,7 +64,7 @@ Point GetWinkPnt(const Rectangle& rR, long nWink) if (nWdt>nHgt) { if (nWdt!=0) { // stop possible overruns for very large objects - if (Abs(nHgt)>32767 || Abs(aRetval.Y())>32767) { + if (std::abs(nHgt)>32767 || std::abs(aRetval.Y())>32767) { aRetval.Y()=BigMulDiv(aRetval.Y(),nHgt,nWdt); } else { aRetval.Y()=aRetval.Y()*nHgt/nWdt; @@ -73,7 +73,7 @@ Point GetWinkPnt(const Rectangle& rR, long nWink) } else { if (nHgt!=0) { // stop possible overruns for very large objects - if (Abs(nWdt)>32767 || Abs(aRetval.X())>32767) { + if (std::abs(nWdt)>32767 || std::abs(aRetval.X())>32767) { aRetval.X()=BigMulDiv(aRetval.X(),nWdt,nHgt); } else { aRetval.X()=aRetval.X()*nWdt/nHgt; diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 617ea4361088..c4a176314367 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -589,11 +589,11 @@ sal_uInt16 SdrEdgeObj::ImpCalcEscAngle(SdrObject* pObj, const Point& rPt) const long dyo=rPt.Y()-aR.Top(); long dxr=aR.Right()-rPt.X(); long dyu=aR.Bottom()-rPt.Y(); - bool bxMitt=Abs(dxl-dxr)<2; - bool byMitt=Abs(dyo-dyu)<2; - long dx=Min(dxl,dxr); - long dy=Min(dyo,dyu); - bool bDiag=Abs(dx-dy)<2; + bool bxMitt=std::abs(dxl-dxr)<2; + bool byMitt=std::abs(dyo-dyu)<2; + long dx=std::min(dxl,dxr); + long dy=std::min(dyo,dyu); + bool bDiag=std::abs(dx-dy)<2; if (bxMitt && byMitt) return SDRESC_ALL; // in the center if (bDiag) { // diagonally sal_uInt16 nRet=0; @@ -844,7 +844,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec aXP[0]=rPt1; aXP[1]=rPt2; if (pnQuality!=NULL) { - *pnQuality=Abs(rPt1.X()-rPt2.X())+Abs(rPt1.Y()-rPt2.Y()); + *pnQuality=std::abs(rPt1.X()-rPt2.X())+std::abs(rPt1.Y()-rPt2.Y()); } return aXP; } else if (eKind==SDREDGE_THREELINES) { @@ -862,9 +862,9 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec if (bLks2) aXP[2].X()=aBewareRect2.Left(); //-=500; if (bUnt2) aXP[2].Y()=aBewareRect2.Bottom(); //+=500; if (pnQuality!=NULL) { - long nQ=Abs(aXP[1].X()-aXP[0].X())+Abs(aXP[1].Y()-aXP[0].Y()); - nQ+=Abs(aXP[2].X()-aXP[1].X())+Abs(aXP[2].Y()-aXP[1].Y()); - nQ+=Abs(aXP[3].X()-aXP[2].X())+Abs(aXP[3].Y()-aXP[2].Y()); + long nQ=std::abs(aXP[1].X()-aXP[0].X())+std::abs(aXP[1].Y()-aXP[0].Y()); + nQ+=std::abs(aXP[2].X()-aXP[1].X())+std::abs(aXP[2].Y()-aXP[1].Y()); + nQ+=std::abs(aXP[3].X()-aXP[2].X())+std::abs(aXP[3].Y()-aXP[2].Y()); *pnQuality=nQ; } if (bInfo) { @@ -889,8 +889,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec Point aC2(aBewareRect2.Center()); if (aBewareRect1.Left()<=aBewareRect2.Right() && aBewareRect1.Right()>=aBewareRect2.Left()) { // overlapping on the x axis - long n1=Max(aBewareRect1.Left(),aBewareRect2.Left()); - long n2=Min(aBewareRect1.Right(),aBewareRect2.Right()); + long n1=std::max(aBewareRect1.Left(),aBewareRect2.Left()); + long n2=std::min(aBewareRect1.Right(),aBewareRect2.Right()); aMeeting.X()=(n1+n2+1)/2; } else { // otherwise the center point of the empty space @@ -902,8 +902,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec } if (aBewareRect1.Top()<=aBewareRect2.Bottom() && aBewareRect1.Bottom()>=aBewareRect2.Top()) { // overlapping on the x axis - long n1=Max(aBewareRect1.Top(),aBewareRect2.Top()); - long n2=Min(aBewareRect1.Bottom(),aBewareRect2.Bottom()); + long n1=std::max(aBewareRect1.Top(),aBewareRect2.Top()); + long n2=std::min(aBewareRect1.Bottom(),aBewareRect2.Bottom()); aMeeting.Y()=(n1+n2+1)/2; } else { // otherwise the center point of the empty space @@ -917,10 +917,10 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec // 1. both go into the same direction // 2. both go into opposite directions // 3. one is vertical, the other is horizontal - long nXMin=Min(aBewareRect1.Left(),aBewareRect2.Left()); - long nXMax=Max(aBewareRect1.Right(),aBewareRect2.Right()); - long nYMin=Min(aBewareRect1.Top(),aBewareRect2.Top()); - long nYMax=Max(aBewareRect1.Bottom(),aBewareRect2.Bottom()); + long nXMin=std::min(aBewareRect1.Left(),aBewareRect2.Left()); + long nXMax=std::max(aBewareRect1.Right(),aBewareRect2.Right()); + long nYMin=std::min(aBewareRect1.Top(),aBewareRect2.Top()); + long nYMax=std::max(aBewareRect1.Bottom(),aBewareRect2.Bottom()); bool bBewareOverlap=aBewareRect1.Right()>aBewareRect2.Left() && aBewareRect1.Left()<aBewareRect2.Right() && aBewareRect1.Bottom()>aBewareRect2.Top() && aBewareRect1.Top()<aBewareRect2.Bottom(); unsigned nMainCase=3; @@ -1016,7 +1016,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec } } if (!bCase29Direct) { - bool bObenLang=Abs(nYMin-aMeeting.Y())<=Abs(nYMax-aMeeting.Y()); + bool bObenLang=std::abs(nYMin-aMeeting.Y())<=std::abs(nYMax-aMeeting.Y()); if (bObenLang) { aMeeting.Y()=nYMin; } else { @@ -1077,7 +1077,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec } } if (!bCase29Direct) { - bool bLinksLang=Abs(nXMin-aMeeting.X())<=Abs(nXMax-aMeeting.X()); + bool bLinksLang=std::abs(nXMin-aMeeting.X())<=std::abs(nXMax-aMeeting.X()); if (bLinksLang) { aMeeting.X()=nXMin; } else { @@ -1299,7 +1299,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec Point aPt0(aXP1[0]); for (sal_uInt16 nPntNum=1; nPntNum<nPntAnz; nPntNum++) { Point aPt1b(aXP1[nPntNum]); - nQual+=Abs(aPt1b.X()-aPt0.X())+Abs(aPt1b.Y()-aPt0.Y()); + nQual+=std::abs(aPt1b.X()-aPt0.X())+std::abs(aPt1b.Y()-aPt0.Y()); if (nQual<nQual0) bOverflow = true; nQual0=nQual; aPt0=aPt1b; @@ -1308,9 +1308,9 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec sal_uInt16 nTmp=nPntAnz; if (cForm=='Z') { nTmp=2; // Z shape with good quality (nTmp=2 instead of 4) - sal_uIntPtr n1=Abs(aXP1[1].X()-aXP1[0].X())+Abs(aXP1[1].Y()-aXP1[0].Y()); - sal_uIntPtr n2=Abs(aXP1[2].X()-aXP1[1].X())+Abs(aXP1[2].Y()-aXP1[1].Y()); - sal_uIntPtr n3=Abs(aXP1[3].X()-aXP1[2].X())+Abs(aXP1[3].Y()-aXP1[2].Y()); + sal_uIntPtr n1=std::abs(aXP1[1].X()-aXP1[0].X())+std::abs(aXP1[1].Y()-aXP1[0].Y()); + sal_uIntPtr n2=std::abs(aXP1[2].X()-aXP1[1].X())+std::abs(aXP1[2].Y()-aXP1[1].Y()); + sal_uIntPtr n3=std::abs(aXP1[3].X()-aXP1[2].X())+std::abs(aXP1[3].Y()-aXP1[2].Y()); // try to make lines lengths similar sal_uIntPtr nBesser=0; n1+=n3; @@ -2163,7 +2163,7 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO if (bOk && aMouseRect.IsInside(aConPos)) { if (bUser) bUserFnd = true; bFnd = true; - sal_uIntPtr nDist=(sal_uIntPtr)Abs(aConPos.X()-rPt.X())+(sal_uIntPtr)Abs(aConPos.Y()-rPt.Y()); + sal_uIntPtr nDist=(sal_uIntPtr)std::abs(aConPos.X()-rPt.X())+(sal_uIntPtr)std::abs(aConPos.Y()-rPt.Y()); if (nDist<nBestDist) { nBestDist=nDist; aTestCon.pObj=pObj; diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index a0041ee8de1a..46b88dae7de3 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1220,7 +1220,7 @@ void SdrGrafObj::ImpSetAttrToGrafInfo() aGrafInfo.SetChannelG( ( (SdrGrafGreenItem&) rSet.Get( SDRATTR_GRAFGREEN ) ).GetValue() ); aGrafInfo.SetChannelB( ( (SdrGrafBlueItem&) rSet.Get( SDRATTR_GRAFBLUE ) ).GetValue() ); aGrafInfo.SetGamma( ( (SdrGrafGamma100Item&) rSet.Get( SDRATTR_GRAFGAMMA ) ).GetValue() * 0.01 ); - aGrafInfo.SetTransparency( (sal_uInt8) FRound( Min( nTrans, (sal_uInt16) 100 ) * 2.55 ) ); + aGrafInfo.SetTransparency( (sal_uInt8) FRound( std::min( nTrans, (sal_uInt16) 100 ) * 2.55 ) ); aGrafInfo.SetInvert( ( (SdrGrafInvertItem&) rSet.Get( SDRATTR_GRAFINVERT ) ).GetValue() ); aGrafInfo.SetDrawMode( ( (SdrGrafModeItem&) rSet.Get( SDRATTR_GRAFMODE ) ).GetValue() ); aGrafInfo.SetCrop( rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom() ); diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 3f3288de38fa..f416ceae9311 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -308,7 +308,7 @@ bool ImpPathCreateUser::CalcCircle(const Point& rP1, const Point& rP2, const Poi if (bRet) { double cs=cos(nTmpAngle*nPi180); double nR=(double)GetLen(Point(dx,dy))/cs/2; - nRad=Abs(Round(nR)); + nRad=std::abs(Round(nR)); } if (dAngle<18000) { nCircStWink=NormAngle360(nTangAngle-9000); @@ -335,7 +335,7 @@ bool ImpPathCreateUser::CalcCircle(const Point& rP1, const Point& rP2, const Poi } } nCircRadius=nRad; - if (nRad==0 || Abs(nCircRelWink)<5) bRet=sal_False; + if (nRad==0 || std::abs(nCircRelWink)<5) bRet=sal_False; bCircle=bRet; return bRet; } @@ -376,8 +376,8 @@ Point ImpPathCreateUser::CalcLine(const Point& aCsr, long nDirX, long nDirY, Sdr else { x1=BigMulDiv(y,nDirX,nDirY); y2=BigMulDiv(x,nDirY,nDirX); - long l1=Abs(x1)+Abs(y1); - long l2=Abs(x2)+Abs(y2); + long l1=std::abs(x1)+std::abs(y1); + long l2=std::abs(x2)+std::abs(y2); if ((l1<=l2) != (pView!=NULL && pView->IsBigOrtho())) { x=x1; y=y1; } else { @@ -396,8 +396,8 @@ bool ImpPathCreateUser::CalcLine(const Point& rP1, const Point& rP2, const Point Point aTmpPt(rP2-rP1); long nDirX=rDir.X(); long nDirY=rDir.Y(); - Point aP1(CalcLine(aTmpPt, nDirX, nDirY,pView)); aP1-=aTmpPt; long nQ1=Abs(aP1.X())+Abs(aP1.Y()); - Point aP2(CalcLine(aTmpPt, nDirY,-nDirX,pView)); aP2-=aTmpPt; long nQ2=Abs(aP2.X())+Abs(aP2.Y()); + Point aP1(CalcLine(aTmpPt, nDirX, nDirY,pView)); aP1-=aTmpPt; long nQ1=std::abs(aP1.X())+std::abs(aP1.Y()); + Point aP2(CalcLine(aTmpPt, nDirY,-nDirX,pView)); aP2-=aTmpPt; long nQ2=std::abs(aP2.X())+std::abs(aP2.Y()); if (pView!=NULL && pView->IsOrtho()) nQ1=0; // Ortho turns off at right angle bLine90=nQ1>2*nQ2; if (!bLine90) { // smooth transition @@ -447,10 +447,10 @@ bool ImpPathCreateUser::CalcRect(const Point& rP1, const Point& rP2, const Point aRectP2.X()+=x; aRectP2.Y()+=y; if (pView!=NULL && pView->IsOrtho()) { - long dx1=aRectP2.X()-aRectP1.X(); long dx1a=Abs(dx1); - long dy1=aRectP2.Y()-aRectP1.Y(); long dy1a=Abs(dy1); - long dx2=aRectP3.X()-aRectP2.X(); long dx2a=Abs(dx2); - long dy2=aRectP3.Y()-aRectP2.Y(); long dy2a=Abs(dy2); + long dx1=aRectP2.X()-aRectP1.X(); long dx1a=std::abs(dx1); + long dy1=aRectP2.Y()-aRectP1.Y(); long dy1a=std::abs(dy1); + long dx2=aRectP3.X()-aRectP2.X(); long dx2a=std::abs(dx2); + long dy2=aRectP3.Y()-aRectP2.Y(); long dy2a=std::abs(dy2); bool b1MoreThan2=dx1a+dy1a>dx2a+dy2a; if (b1MoreThan2 != pView->IsBigOrtho()) { long xtemp=dy2a-dx1a; if (dx1<0) xtemp=-xtemp; @@ -741,7 +741,7 @@ bool ImpPathForDragAndCreate::movePathDrag( SdrDragStat& rDrag ) const aPt-=mpSdrPathDragData->aXP[nPrevPnt]; long nWink2=GetAngle(aPt); long nDiff=nWink1-nWink2; - nDiff=Abs(nDiff); + nDiff=std::abs(nDiff); mpSdrPathDragData->bEliminate=nDiff<=rDrag.GetView()->GetEliminatePolyPointLimitAngle(); if (mpSdrPathDragData->bEliminate) { // adapt position, Smooth is true for the ends aPt=mpSdrPathDragData->aXP[nNextPnt]; @@ -938,7 +938,7 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag) if(pU->bCircle) { - mrSdrPathObject.GetModel()->TakeWinkStr(Abs(pU->nCircRelWink), aMetr); + mrSdrPathObject.GetModel()->TakeWinkStr(std::abs(pU->nCircRelWink), aMetr); aStr.Append(aMetr); aStr.AppendAscii(" r="); mrSdrPathObject.GetModel()->TakeMetricStr(pU->nCircRadius, aMetr, sal_True); diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index 3e2e1d094ecf..da2d9fe77021 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -326,7 +326,7 @@ SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const case 1: { long a = GetEckenradius(); - long b = Max(aRect.GetWidth(),aRect.GetHeight())/2; // rounded up, because GetWidth() adds 1 + long b = std::max(aRect.GetWidth(),aRect.GetHeight())/2; // rounded up, because GetWidth() adds 1 if (a>b) a=b; if (a<0) a=0; aPnt=aRect.TopLeft(); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 1863dd8e8a2e..20551221b7d1 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -945,7 +945,7 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextS // correct stretching factors long nMul=nWantWdt; long nDiv=aSiz.Width(); - if (Abs(nXDiff)<=2*nXKorr) { + if (std::abs(nXDiff)<=2*nXKorr) { if (nMul>nDiv) nDiv+=(nMul-nDiv)/2; // but only add half of what we calculated, else nMul+=(nDiv-nMul)/2; // because the EditEngine calculates wrongly later on } diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx index 1402a426879b..27d033d34750 100644 --- a/svx/source/svdraw/svdotxdr.cxx +++ b/svx/source/svdraw/svdotxdr.cxx @@ -100,10 +100,10 @@ Rectangle SdrTextObj::ImpDragCalcRect(const SdrDragStat& rDrag) const long nYDiv=nHgt0; bool bXNeg=(nXMul<0)!=(nXDiv<0); bool bYNeg=(nYMul<0)!=(nYDiv<0); - nXMul=Abs(nXMul); - nYMul=Abs(nYMul); - nXDiv=Abs(nXDiv); - nYDiv=Abs(nYDiv); + nXMul=std::abs(nXMul); + nYMul=std::abs(nYMul); + nXDiv=std::abs(nXDiv); + nYDiv=std::abs(nYDiv); Fraction aXFact(nXMul,nXDiv); // fractions for canceling Fraction aYFact(nYMul,nYDiv); // and for comparing nXMul=aXFact.GetNumerator(); diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx index 60706a297ec4..b19615434714 100644 --- a/svx/source/svdraw/svdotxtr.cxx +++ b/svx/source/svdraw/svdotxtr.cxx @@ -249,7 +249,7 @@ void SdrTextObj::NbcMirror(const Point& rRef1, const Point& rRef2) bool bRota90Merk = false; if (bNoShearMerk && (rRef1.X()==rRef2.X() || rRef1.Y()==rRef2.Y() || - Abs(rRef1.X()-rRef2.X())==Abs(rRef1.Y()-rRef2.Y()))) { + std::abs(rRef1.X()-rRef2.X())==std::abs(rRef1.Y()-rRef2.Y()))) { bRota90Merk=aGeo.nDrehWink % 9000 ==0; } Polygon aPol(Rect2Poly(aRect,aGeo)); diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx index 63120c7dc4db..65337d25a116 100644 --- a/svx/source/svdraw/svdsnpv.cxx +++ b/svx/source/svdraw/svdsnpv.cxx @@ -308,18 +308,18 @@ sal_uInt16 SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const switch (rHL.GetKind()) { case SDRHELPLINE_VERTICAL: { long a=x-rPos.X(); - if (Abs(a)<=mx) { dx1=-a; if (Abs(dx1)<Abs(dx)) dx=dx1; } + if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } } break; case SDRHELPLINE_HORIZONTAL: { long b=y-rPos.Y(); - if (Abs(b)<=my) { dy1=-b; if (Abs(dy1)<Abs(dy)) dy=dy1; } + if (std::abs(b)<=my) { dy1=-b; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } } break; case SDRHELPLINE_POINT: { long a=x-rPos.X(); long b=y-rPos.Y(); - if (Abs(a)<=mx && Abs(b)<=my) { + if (std::abs(a)<=mx && std::abs(b)<=my) { dx1=-a; dy1=-b; - if (Abs(dx1)<Abs(dx) && Abs(dy1)<Abs(dy)) { dx=dx1; dy=dy1; } + if (std::abs(dx1)<std::abs(dx) && std::abs(dy1)<std::abs(dy)) { dx=dx1; dy=dy1; } } } break; } // switch @@ -334,14 +334,14 @@ sal_uInt16 SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const long upp=pPage->GetUppBorder(); long lwr=pPage->GetLwrBorder(); long a; - a=x- lft ; if (Abs(a)<=mx) { dx1=-a; if (Abs(dx1)<Abs(dx)) dx=dx1; } // left margin - a=x-(xs-rgt); if (Abs(a)<=mx) { dx1=-a; if (Abs(dx1)<Abs(dx)) dx=dx1; } // right margin - a=x ; if (Abs(a)<=mx) { dx1=-a; if (Abs(dx1)<Abs(dx)) dx=dx1; } // left edge of paper - a=x- xs ; if (Abs(a)<=mx) { dx1=-a; if (Abs(dx1)<Abs(dx)) dx=dx1; } // right edge of paper - a=y- upp ; if (Abs(a)<=my) { dy1=-a; if (Abs(dy1)<Abs(dy)) dy=dy1; } // left margin - a=y-(ys-lwr); if (Abs(a)<=my) { dy1=-a; if (Abs(dy1)<Abs(dy)) dy=dy1; } // right margin - a=y ; if (Abs(a)<=my) { dy1=-a; if (Abs(dy1)<Abs(dy)) dy=dy1; } // left edge of paper - a=y- ys ; if (Abs(a)<=my) { dy1=-a; if (Abs(dy1)<Abs(dy)) dy=dy1; } // right edge of paper + a=x- lft ; if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // left margin + a=x-(xs-rgt); if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // right margin + a=x ; if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // left edge of paper + a=x- xs ; if (std::abs(a)<=mx) { dx1=-a; if (std::abs(dx1)<std::abs(dx)) dx=dx1; } // right edge of paper + a=y- upp ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // left margin + a=y-(ys-lwr); if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // right margin + a=y ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // left edge of paper + a=y- ys ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // right edge of paper } if (bOFrmSnap || bOPntSnap) { sal_uIntPtr nMaxPointSnapCount=200; @@ -366,7 +366,7 @@ sal_uInt16 SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const Point aP(pO->GetSnapPoint(i)); dx1=x-aP.X(); dy1=y-aP.Y(); - if (Abs(dx1)<=mx && Abs(dy1)<=my && Abs(dx1)<Abs(dx) && Abs(dy1)<Abs(dy)) { + if (std::abs(dx1)<=mx && std::abs(dy1)<=my && std::abs(dx1)<std::abs(dx) && std::abs(dy1)<std::abs(dy)) { dx=-dx1; dy=-dy1; } @@ -381,10 +381,10 @@ sal_uInt16 SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const aR1.Top ()-=my; aR1.Bottom()+=my; if (aR1.IsInside(rPnt)) { - if (Abs(x-aLog.Left ())<=mx) { dx1=-(x-aLog.Left ()); if (Abs(dx1)<Abs(dx)) dx=dx1; } - if (Abs(x-aLog.Right ())<=mx) { dx1=-(x-aLog.Right ()); if (Abs(dx1)<Abs(dx)) dx=dx1; } - if (Abs(y-aLog.Top ())<=my) { dy1=-(y-aLog.Top ()); if (Abs(dy1)<Abs(dy)) dy=dy1; } - if (Abs(y-aLog.Bottom())<=my) { dy1=-(y-aLog.Bottom()); if (Abs(dy1)<Abs(dy)) dy=dy1; } + if (std::abs(x-aLog.Left ())<=mx) { dx1=-(x-aLog.Left ()); if (std::abs(dx1)<std::abs(dx)) dx=dx1; } + if (std::abs(x-aLog.Right ())<=mx) { dx1=-(x-aLog.Right ()); if (std::abs(dx1)<std::abs(dx)) dx=dx1; } + if (std::abs(y-aLog.Top ())<=my) { dy1=-(y-aLog.Top ()); if (std::abs(dy1)<std::abs(dy)) dy=dy1; } + if (std::abs(y-aLog.Bottom())<=my) { dy1=-(y-aLog.Bottom()); if (std::abs(dy1)<std::abs(dy)) dy=dy1; } } nMaxFrameSnapCount--; } @@ -439,7 +439,7 @@ void SdrSnapView::CheckSnap(const Point& rPt, const SdrPageView* pPV, long& nBes aPt-=rPt; if ((nRet & SDRSNAP_XSNAPPED) !=0) { if (bXSnapped) { - if (Abs(aPt.X())<Abs(nBestXSnap)) { + if (std::abs(aPt.X())<std::abs(nBestXSnap)) { nBestXSnap=aPt.X(); } } else { @@ -449,7 +449,7 @@ void SdrSnapView::CheckSnap(const Point& rPt, const SdrPageView* pPV, long& nBes } if ((nRet & SDRSNAP_YSNAPPED) !=0) { if (bYSnapped) { - if (Abs(aPt.Y())<Abs(nBestYSnap)) { + if (std::abs(aPt.Y())<std::abs(nBestYSnap)) { nBestYSnap=aPt.Y(); } } else { diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx index eadaa82d9b6d..91e3f77a2f18 100644 --- a/svx/source/svdraw/svdtrans.cxx +++ b/svx/source/svdraw/svdtrans.cxx @@ -443,8 +443,8 @@ sal_uInt16 GetAngleSector(long nWink) long GetLen(const Point& rPnt) { - long x=Abs(rPnt.X()); - long y=Abs(rPnt.Y()); + long x=std::abs(rPnt.X()); + long y=std::abs(rPnt.Y()); if (x+y<0x8000) { // because 7FFF * 7FFF * 2 = 7FFE0002 x*=x; y*=y; @@ -552,8 +552,8 @@ void OrthoDistance8(const Point& rPt0, Point& rPt, bool bBigOrtho) { long dx=rPt.X()-rPt0.X(); long dy=rPt.Y()-rPt0.Y(); - long dxa=Abs(dx); - long dya=Abs(dy); + long dxa=std::abs(dx); + long dya=std::abs(dy); if (dx==0 || dy==0 || dxa==dya) return; if (dxa>=dya*2) { rPt.Y()=rPt0.Y(); return; } if (dya>=dxa*2) { rPt.X()=rPt0.X(); return; } @@ -568,8 +568,8 @@ void OrthoDistance4(const Point& rPt0, Point& rPt, bool bBigOrtho) { long dx=rPt.X()-rPt0.X(); long dy=rPt.Y()-rPt0.Y(); - long dxa=Abs(dx); - long dya=Abs(dy); + long dxa=std::abs(dx); + long dya=std::abs(dy); if ((dxa<dya) != bBigOrtho) { rPt.Y()=rPt0.Y()+(dxa* (dy>=0 ? 1 : -1) ); } else { @@ -617,7 +617,7 @@ void Kuerzen(Fraction& rF, unsigned nDigits) // count how many decimal places can be removed int nMulWeg=nMulDigits-nDigits; if (nMulWeg<0) nMulWeg=0; int nDivWeg=nDivDigits-nDigits; if (nDivWeg<0) nDivWeg=0; - int nWeg=Min(nMulWeg,nDivWeg); + int nWeg=std::min(nMulWeg,nDivWeg); nMul>>=nWeg; nDiv>>=nWeg; if (nMul==0 || nDiv==0) { diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index c8e7d176fc68..65616bd8d0c0 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1099,7 +1099,7 @@ Pointer SdrView::GetPreferedPointer(const Point& rMousePos, const OutputDevice* if (pH1!=NULL && pH2!=NULL) { aDif=pH2->GetPos()-pH1->GetPos(); b90=(aDif.X()==0) || aDif.Y()==0; - b45=b90 || (Abs(aDif.X())==Abs(aDif.Y())); + b45=b90 || (std::abs(aDif.X())==std::abs(aDif.Y())); } bool bNo=false; if (!IsMirrorAllowed(sal_True,sal_True)) bNo=true; // any mirroring is forbidden diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index ac1fb637b6ac..7dd6574fd01f 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -522,7 +522,7 @@ FillControl::FillControl( Window* pParent, WinBits nStyle ) : Point aAttrPnt = pLbFillAttr->GetPosPixel(); SetSizePixel( Size( aAttrPnt.X() + aAttrSize.Width(), - Max( aAttrSize.Height(), aTypeSize.Height() ) ) ); + std::max( aAttrSize.Height(), aTypeSize.Height() ) ) ); pLbFillType->SetSelectHdl( LINK( this, FillControl, SelectFillTypeHdl ) ); pLbFillAttr->SetSelectHdl( LINK( this, FillControl, SelectFillAttrHdl ) ); @@ -822,7 +822,7 @@ void FillControl::DataChanged( const DataChangedEvent& rDCEvt ) SetSizePixel( Size( aAttrPnt.X() + aAttrSize.Width(), - Max( aAttrSize.Height(), aTypeSize.Height() ) ) ); + std::max( aAttrSize.Height(), aTypeSize.Height() ) ) ); } Window::DataChanged( rDCEvt ); } diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index bd21a7a656bd..58c7dd1cd7ba 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -291,7 +291,7 @@ ImplGrafControl::ImplGrafControl( maImage.SetPosPixel( Point( nOffset, nImgY ) ); maField.SetPosPixel( Point( aImgSize.Width() + SYMBOL_TO_FIELD_OFFSET, nFldY ) ); SetSizePixel( Size( aImgSize.Width() + aFldSize.Width() + SYMBOL_TO_FIELD_OFFSET + nOffset, - Max( aImgSize.Height(), aFldSize.Height() ) ) ); + std::max( aImgSize.Height(), aFldSize.Height() ) ) ); SetBackground( Wallpaper() ); // transparent background diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx index 9ec8f635d928..b5fa71776b22 100644 --- a/svx/source/tbxctrls/linectrl.cxx +++ b/svx/source/tbxctrls/linectrl.cxx @@ -533,7 +533,7 @@ void SvxLineEndWindow::FillValueSet() aLineEndSet.InsertItem( (sal_uInt16)((i+1L)*2L+1L), aVD.GetBitmap( aPt0, aBmpSize ), pEntry->GetName() ); aLineEndSet.InsertItem( (sal_uInt16)((i+2L)*2L), aVD.GetBitmap( aPt1, aBmpSize ), pEntry->GetName() ); } - nLines = Min( (sal_uInt16)(nCount + 1), (sal_uInt16) MAX_LINES ); + nLines = std::min( (sal_uInt16)(nCount + 1), (sal_uInt16) MAX_LINES ); aLineEndSet.SetLineCount( nLines ); SetSize(); @@ -582,14 +582,14 @@ void SvxLineEndWindow::Resizing( Size& rNewSize ) // Spalten ermitteln long nItemW = aItemSize.Width(); long nW = rNewSize.Width(); - nCols = (sal_uInt16) Max( ( (sal_uIntPtr)(( nW + nItemW ) / ( nItemW * 2 ) )), + nCols = (sal_uInt16) std::max( ( (sal_uIntPtr)(( nW + nItemW ) / ( nItemW * 2 ) )), (sal_uIntPtr) 1L ); nCols *= 2; // Reihen ermitteln long nItemH = aItemSize.Height(); long nH = rNewSize.Height(); - nLines = (sal_uInt16) Max( ( ( nH + nItemH / 2 ) / nItemH ), 1L ); + nLines = (sal_uInt16) std::max( ( ( nH + nItemH / 2 ) / nItemH ), 1L ); sal_uInt16 nMaxCols = nItemCount / nLines; if( nItemCount % nLines ) @@ -601,7 +601,7 @@ void SvxLineEndWindow::Resizing( Size& rNewSize ) // Keine ungerade Anzahl von Spalten if( nCols % 2 ) nCols--; - nCols = Max( nCols, (sal_uInt16) 2 ); + nCols = std::max( nCols, (sal_uInt16) 2 ); sal_uInt16 nMaxLines = nItemCount / nCols; if( nItemCount % nCols ) diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 658fde0f7f89..b0d4aadc14bb 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2087,7 +2087,7 @@ void SvxStyleToolBoxControl::FillStyleBox() pBox->SetUpdateMode( sal_True ); pBox->SetFamily( eFamily ); - sal_uInt16 nLines = Min( pBox->GetEntryCount(), MAX_STYLES_ENTRIES ); + sal_uInt16 nLines = std::min( pBox->GetEntryCount(), MAX_STYLES_ENTRIES ); pBox->SetDropDownLineCount( nLines ); } } diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index b33f75417d39..29a7fd1158c5 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -176,7 +176,7 @@ public: void SetTableModel( sal_Bool bNew ){ bNewModel = bNew; } sal_Bool IsNewModel() const { return bNewModel; } - sal_uInt16 GetRowsToRepeat() const { return Min( (sal_uInt16)GetTabLines().size(), nRowsToRepeat ); } + sal_uInt16 GetRowsToRepeat() const { return std::min( (sal_uInt16)GetTabLines().size(), nRowsToRepeat ); } sal_uInt16 _GetRowsToRepeat() const { return nRowsToRepeat; } void SetRowsToRepeat( sal_uInt16 nNumOfRows ) { nRowsToRepeat = nNumOfRows; } diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 8ebcd45d7622..c21e6bc76562 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -535,7 +535,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, if( (bSrchForward || pSttNd != &rNdIdx.GetNode()) && Move( fnMoveForward, fnGoCntnt ) && (!bSrchForward || pSttNd != &GetPoint()->nNode.GetNode()) && - 1 == Abs( (int)( GetPoint()->nNode.GetIndex() - + 1 == std::abs( (int)( GetPoint()->nNode.GetIndex() - GetMark()->nNode.GetIndex()) ) ) { // if backward search, switch point and mark diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index e6fb6e431519..54715ed1ed7b 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1732,7 +1732,7 @@ void SwCursor::DoSetBidiLevelUpDown() if ( nCurrLevel % 2 != nPrevLevel % 2 ) { // set cursor level to the lower of the two levels - SetCrsrBidiLevel( Min( nCurrLevel, nPrevLevel ) ); + SetCrsrBidiLevel( std::min( nCurrLevel, nPrevLevel ) ); } else SetCrsrBidiLevel( nCurrLevel ); diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 858782edb65b..ab8319998cfd 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1647,7 +1647,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr, MarkBase* pMark = dynamic_cast<MarkBase*>(pMarkAccess->getMarksBegin()[aSave.GetCount()].get()); SwPosition aNewPos(pMark->GetMarkPos()); aNewPos.nNode = rNd; - aNewPos.nContent.Assign(pCNd, Min(aSave.GetContent(), nLen)); + aNewPos.nContent.Assign(pCNd, std::min(aSave.GetContent(), nLen)); pMark->SetMarkPos(aNewPos); } break; @@ -1656,7 +1656,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr, MarkBase* pMark = dynamic_cast<MarkBase*>(pMarkAccess->getMarksBegin()[aSave.GetCount()].get()); SwPosition aNewPos(pMark->GetOtherMarkPos()); aNewPos.nNode = rNd; - aNewPos.nContent.Assign(pCNd, Min(aSave.GetContent(), nLen)); + aNewPos.nContent.Assign(pCNd, std::min(aSave.GetContent(), nLen)); pMark->SetOtherMarkPos(aNewPos); } break; @@ -1678,7 +1678,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr, aNewPos.nNode = rNd; if ( FLY_AT_CHAR == rFlyAnchor.GetAnchorId() ) { - aNewPos.nContent.Assign( pCNd, Min( + aNewPos.nContent.Assign( pCNd, std::min( aSave.GetContent(), nLen ) ); } else @@ -1776,7 +1776,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr, if( pPos ) { pPos->nNode = rNd; - pPos->nContent.Assign( pCNd, Min( aSave.GetContent(), nLen ) ); + pPos->nContent.Assign( pCNd, std::min( aSave.GetContent(), nLen ) ); } n -= 2; rSaveArr.erase( rSaveArr.begin() + n, rSaveArr.begin() + n + 2); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 13be89d9dec9..038f01eea263 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -559,7 +559,7 @@ bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset ) // If a Position inside the special nodes array sections was calculated, // set it to document start instead. // Sections or Tables at the document start will be pushed backwards. - nNewPos = Max( nNewPos, GetNodes().GetEndOfExtras().GetIndex() + 2 ); + nNewPos = std::max( nNewPos, GetNodes().GetEndOfExtras().GetIndex() + 2 ); long nOffs = nNewPos - ( 0 < nOffset ? aEndRg.GetIndex() : aSttRg.GetIndex()); SwPaM aPam( aSttRg, aEndRg, 0, -1 ); diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 306736366ff9..ab89350ab04d 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -858,7 +858,7 @@ sal_uInt16 FlatFndBox::GetRowCount(const _FndBox& rBox) for(sal_uInt16 j=0; j < rBoxes.size(); ++j) if (rBoxes[j].GetLines().size()) // Iterate recursively over the Lines - nLn = Max(GetRowCount(rBoxes[j]), nLn); + nLn = std::max(GetRowCount(rBoxes[j]), nLn); nLines = nLines + nLn; } diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 53be8e01a11d..d1a784b1beae 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -1556,7 +1556,7 @@ static void lcl_ResizeLine( const SwTableLine* pLine, sal_uInt16 *pWidth ) BOOST_FOREACH( const SwTableBox* pBox, pLine->GetTabBoxes() ) lcl_ResizeBox(pBox, pWidth ); - SAL_WARN_IF( nOldWidth && Abs(*pWidth-nOldWidth) >= COLFUZZY, "sw.core", + SAL_WARN_IF( nOldWidth && std::abs(*pWidth-nOldWidth) >= COLFUZZY, "sw.core", "A box's rows have all a different length" ); } @@ -1626,7 +1626,7 @@ void SwHTMLTableLayout::SetWidths( sal_Bool bCallPass2, sal_uInt16 nAbsAvail, sal_uInt16 nCalcTabWidth = 0; BOOST_FOREACH( const SwTableLine *pLine, pSwTable->GetTabLines() ) lcl_ResizeLine( pLine, &nCalcTabWidth ); - SAL_WARN_IF( Abs( nRelTabWidth-nCalcTabWidth ) >= COLFUZZY, "sw.core", + SAL_WARN_IF( std::abs( nRelTabWidth-nCalcTabWidth ) >= COLFUZZY, "sw.core", "Table width is not equal to the row width" ); // Lock the table format when altering it, or else the box formats diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index bf9c7e880561..06b6ee389b13 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -358,7 +358,7 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect, } else { - nLeftCrop = Max( aOrigSz.Width() - + nLeftCrop = std::max( aOrigSz.Width() - (rCrop.GetRight() + rCrop.GetLeft()), long(1) ); const double nScale = double(Prt().Width()) / double(nLeftCrop); nLeftCrop = long(nScale * -rCrop.GetLeft() ); @@ -381,7 +381,7 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect, } else { - nTopCrop = Max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), long(1) ); + nTopCrop = std::max( aOrigSz.Height() - (rCrop.GetTop() + rCrop.GetBottom()), long(1) ); const double nScale = double(Prt().Height()) / double(nTopCrop); nTopCrop = long(nScale * -rCrop.GetTop() ); nBottomCrop= long(nScale * -rCrop.GetBottom() ); @@ -480,7 +480,7 @@ void SwNoTxtFrm::Format( const SwBorderAttrs * ) if( nChgHght > 0) Grow( nChgHght ); else if( nChgHght < 0) - Shrink( Min(Prt().Height(), -nChgHght) ); + Shrink( std::min(Prt().Height(), -nChgHght) ); } sal_Bool SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos, diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 988b6101cfb9..0de8a736d641 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -873,8 +873,8 @@ lcl_FndNxtPrvDelBox( const SwTableLines& rTblLns, pFndBox = rLowLns.back()->GetTabBoxes().front(); } - if( Abs( nFndWidth ) > COLFUZZY || - Abs( nBoxWidth - nFndBoxWidth ) > COLFUZZY ) + if( std::abs( nFndWidth ) > COLFUZZY || + std::abs( nBoxWidth - nFndBoxWidth ) > COLFUZZY ) pFndBox = 0; else if( pAllDelBoxes ) { @@ -2456,7 +2456,7 @@ static bool lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam, // Collect all "ContentBoxes" if( ( 0 != ( bGreaterBox = TBLFIX_CHGABS != rParam.nMode && ( nDist + ( rParam.bLeft ? 0 : nWidth ) ) >= rParam.nSide)) || - ( !rParam.bBigger && ( Abs( nDist + (( rParam.nMode && rParam.bLeft ) ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY ) ) ) + ( !rParam.bBigger && ( std::abs( nDist + (( rParam.nMode && rParam.bLeft ) ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY ) ) ) { rParam.bAnyBoxFnd = true; SwTwips nLowerDiff; @@ -2492,7 +2492,7 @@ static bool lcl_SetSelBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam, if( nLowerDiff || ( 0 != ( bGreaterBox = !nOldLower && TBLFIX_CHGABS != rParam.nMode && ( nDist + ( rParam.bLeft ? 0 : nWidth ) ) >= rParam.nSide)) || - ( Abs( nDist + ( (rParam.nMode && rParam.bLeft) ? 0 : nWidth ) + ( std::abs( nDist + ( (rParam.nMode && rParam.bLeft) ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY )) { // This column contains the Cursor - so decrease/increase @@ -2555,7 +2555,7 @@ static bool lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam, return false; if( rParam.bBigger && ( TBLFIX_CHGABS == rParam.nMode - ? Abs( nDist - rParam.nSide ) < COLFUZZY + ? std::abs( nDist - rParam.nSide ) < COLFUZZY : ( rParam.bLeft ? nDist < rParam.nSide - COLFUZZY : nDist >= rParam.nSide - COLFUZZY )) ) { @@ -2591,7 +2591,7 @@ static bool lcl_SetOtherBoxWidth( SwTableLine* pLine, CR_SetBoxWidth& rParam, if( nLowerDiff || ( TBLFIX_CHGABS == rParam.nMode - ? Abs( nDist - rParam.nSide ) < COLFUZZY + ? std::abs( nDist - rParam.nSide ) < COLFUZZY : ( rParam.bLeft ? nDist < rParam.nSide - COLFUZZY : nDist >= rParam.nSide - COLFUZZY) ) ) @@ -2650,7 +2650,7 @@ static bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam, return false; // Collect all "ContentBoxes" - if( Abs( nDist + ( rParam.bLeft ? 0 : nWidth ) + if( std::abs( nDist + ( rParam.bLeft ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY ) nCmp = 1; else if( nDist + ( rParam.bLeft ? 0 : nWidth/2 ) > rParam.nSide ) @@ -2692,7 +2692,7 @@ static bool lcl_InsSelBox( SwTableLine* pLine, CR_SetBoxWidth& rParam, if( nLowerDiff ) nCmp = 1; - else if( Abs( nDist + ( rParam.bLeft ? 0 : nWidth ) + else if( std::abs( nDist + ( rParam.bLeft ? 0 : nWidth ) - rParam.nSide ) < COLFUZZY ) nCmp = 2; else if( nDist + nWidth / 2 > rParam.nSide ) @@ -2943,8 +2943,8 @@ SwComparePosition _CheckBoxInRange( sal_uInt16 nStt, sal_uInt16 nEnd, { if( nEnd + COLFUZZY >= nBoxEnd ) { - if( COLFUZZY > Abs( long(nEnd) - long(nBoxEnd) ) && - COLFUZZY > Abs( long(nStt) - long(nBoxStt) ) ) + if( COLFUZZY > std::abs( long(nEnd) - long(nBoxEnd) ) && + COLFUZZY > std::abs( long(nStt) - long(nBoxStt) ) ) nRet = POS_EQUAL; else nRet = POS_INSIDE; @@ -2969,7 +2969,7 @@ static void lcl_DelSelBox_CorrLowers( SwTableLine& rLine, CR_SetBoxWidth& rParam for( n = rBoxes.size(); n; ) nBoxWidth += rBoxes[ --n ]->GetFrmFmt()->GetFrmSize().GetWidth(); - if( COLFUZZY < Abs( nWidth - nBoxWidth )) + if( COLFUZZY < std::abs( nWidth - nBoxWidth )) { // Thus, they need to be adjusted for( n = rBoxes.size(); n; ) @@ -3027,7 +3027,7 @@ static void lcl_ChgBoxSize( SwTableBox& rBox, CR_SetBoxWidth& rParam, break; case TBLVAR_CHGABS: // Variable table, change all neighbors - if( COLFUZZY < Abs( rParam.nBoxWidth - + if( COLFUZZY < std::abs( rParam.nBoxWidth - ( rDelWidth + rParam.nLowerDiff ))) { nDiff = rDelWidth + rParam.nLowerDiff - rParam.nBoxWidth; @@ -3207,7 +3207,7 @@ static bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam, // if it's as large as the change in the Table. if( (( TBLVAR_CHGABS != rParam.nMode || nDelWidth != rParam.nBoxWidth ) && - COLFUZZY > Abs( rParam.bLeft + COLFUZZY > std::abs( rParam.bLeft ? nWidth - nDist : (nDist + nWidth - rParam.nTblWidth ))) || !::lcl_DeleteBox_Rekursiv( rParam, *pBox, bCheck ) ) @@ -3247,7 +3247,7 @@ static bool lcl_DelSelBox( SwTableLine* pTabLine, CR_SetBoxWidth& rParam, pLine == pBox->GetTabLines()[ i ] ) { if( !bFirst && !bCorrLowers && - COLFUZZY < Abs( nLowerDiff - rParam.nLowerDiff ) ) + COLFUZZY < std::abs( nLowerDiff - rParam.nLowerDiff ) ) bCorrLowers = true; // The largest deletion width counts, but only if we don't @@ -3400,7 +3400,7 @@ void _CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize ) _CheckBoxWidth( *pBox->GetTabLines()[ j ], nBoxW ); } - if (sal::static_int_cast< unsigned long >(Abs(nAktSize - nSize)) > + if (sal::static_int_cast< unsigned long >(std::abs(nAktSize - nSize)) > (COLFUZZY * rBoxes.size())) { OSL_FAIL( "Line's Boxes are too small or too large" ); @@ -3680,7 +3680,7 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType, } } else if( bInsDel || - ( bLeft ? nDist : Abs( rSz.GetWidth() - nDist ) > COLFUZZY ) ) + ( bLeft ? nDist : std::abs( rSz.GetWidth() - nDist ) > COLFUZZY ) ) { bRet = true; if( bLeft && TBLFIX_CHGABS == eTblChgMode && !bInsDel ) diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 5cad0d70ea8e..f8b224fdd977 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -2639,7 +2639,7 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , else { nLowerBorder = (*aIter).first; - long nNewLowerBorderUpperBoundary = Max( (*aIter).second.first, nUpperBorder ); + long nNewLowerBorderUpperBoundary = std::max( (*aIter).second.first, nUpperBorder ); aPair.first = nNewLowerBorderUpperBoundary; aPair.second = LONG_MAX; } aBoundaries[ nLowerBorder ] = aPair; diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 3eb533b8da22..95e2163b993c 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -58,7 +58,7 @@ extern void ClearFEShellTabCols(); // See swtable.cxx too #define COLFUZZY 20L -inline bool IsSame( long nA, long nB ) { return Abs(nA-nB) <= COLFUZZY; } +inline bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; } class SwTblFmtCmp { @@ -329,7 +329,7 @@ void SwDoc::SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew ) } std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( Max( 255, (int)aRowArr.size() ) ); + aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for( sal_uInt16 i = 0; i < aRowArr.size(); ++i ) ::lcl_ProcessRowAttr( aFmtCmp, aRowArr[i], rNew ); @@ -381,7 +381,7 @@ void SwDoc::SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew ) } std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( Max( 255, (int)aRowArr.size() ) ); + aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for ( sal_uInt16 i = 0; i < aRowArr.size(); ++i ) ::lcl_ProcessRowSize( aFmtCmp, aRowArr[i], rNew ); SwTblFmtCmp::Delete( aFmtCmp ); @@ -438,7 +438,7 @@ sal_Bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly ) SwFrm* pFrm = aIter.First(); while ( pFrm ) { - nHeight = Max( nHeight, pFrm->Frm().Height() ); + nHeight = std::max( nHeight, pFrm->Frm().Height() ); pFrm = aIter.Next(); } } @@ -451,7 +451,7 @@ sal_Bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly ) } std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( Max( 255, (int)aRowArr.size() ) ); + aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for( i = 0; i < aRowArr.size(); ++i ) ::lcl_ProcessRowSize( aFmtCmp, (SwTableLine*)aRowArr[i], aNew ); SwTblFmtCmp::Delete( aFmtCmp ); @@ -480,7 +480,7 @@ void SwDoc::SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew } std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( Max( 255, (int)aRowArr.size() ) ); + aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for( sal_uInt16 i = 0; i < aRowArr.size(); ++i ) ::lcl_ProcessRowAttr( aFmtCmp, aRowArr[i], rNew ); @@ -1286,7 +1286,7 @@ static sal_uInt16 lcl_CalcCellFit( const SwLayoutFrm *pCell ) ((SwTxtFrm*)pFrm)->CalcFitToContent() : (pFrm->Prt().*fnRect->fnGetWidth)(); - nRet = Max( nRet, nCalcFitToContent + nAdd ); + nRet = std::max( nRet, nCalcFitToContent + nAdd ); pFrm = pFrm->GetNext(); } // Surrounding border as well as left and Right Border also need to be respected @@ -1296,7 +1296,7 @@ static sal_uInt16 lcl_CalcCellFit( const SwLayoutFrm *pCell ) // To compensate for the accuracy of calculation later on in SwTable::SetTabCols // we keep adding up a little. nRet += COLFUZZY; - return (sal_uInt16)Max( long(MINLAY), nRet ); + return (sal_uInt16)std::max( long(MINLAY), nRet ); } /** diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 0047c409ad9a..eb996809be97 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -789,7 +789,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, } nMin -= MINFLY; } - aSz.Width() = Max( aSz.Width(), nMin ); + aSz.Width() = std::max( aSz.Width(), nMin ); } SwFrmFmt *pFmt = GetFmt(); diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 5cb58fd7df5b..b2ebf5ec8d2d 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1525,7 +1525,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) else { bChgBullet = true; - SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_BUL_LEVEL1 + ( Min( nLvl, cnNumBullColls ) * 4 )) ); + SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_BUL_LEVEL1 + ( std::min( nLvl, cnNumBullColls ) * 4 )) ); } } else @@ -1545,7 +1545,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) // Ebene 0 und Einrueckung dann wird die Ebene durch den linken // Einzug und der default NumEinrueckung bestimmt. if( !nDigitLevel && nLeftTxtPos ) - nLvl = Min( sal_uInt16( nLeftTxtPos / lNumIndent ), + nLvl = std::min( sal_uInt16( nLeftTxtPos / lNumIndent ), sal_uInt16( MAXLEVEL - 1 ) ); else nLvl = nDigitLevel; @@ -1622,7 +1622,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) } } else if( !aFlags.bAFmtByInput ) - SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_NUM_LEVEL1 + ( Min( nLvl, cnNumBullColls ) * 4 ) )); + SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_NUM_LEVEL1 + ( std::min( nLvl, cnNumBullColls ) * 4 ) )); else bChgEnum = false; } @@ -1791,7 +1791,7 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) SwTxtFrmInfo aFInfo( pAktTxtFrm ); const SwTxtNode* pNxtNd = GetNextNode(); while( CanJoin( pNxtNd ) && - 20 < Abs( (long)(nSpaces - aFInfo.SetFrm( + 20 < std::abs( (long)(nSpaces - aFInfo.SetFrm( GetFrm( *pNxtNd ) ).GetLineStart() )) ) { diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index c3c63381b527..017ce7152aa9 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -734,7 +734,7 @@ void SwDBNumSetField::Evaluate(SwDoc* pDoc) if( bCondValid && pMgr && pMgr->IsInMerge() && pMgr->IsDataSourceOpen(aTmpData.sDataSource, aTmpData.sCommand, sal_True)) { // Bedingug OK -> aktuellen Set einstellen - pMgr->ToRecordId(Max((sal_uInt16)aPar2.ToInt32(), sal_uInt16(1))-1); + pMgr->ToRecordId(std::max((sal_uInt16)aPar2.ToInt32(), sal_uInt16(1))-1); } } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index eee6211c0328..7f0f2e953a26 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -2308,7 +2308,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld, ? (sal_uInt32)SVX_NUM_ARABIC : pPgFrm->GetPageDesc()->GetNumType().GetNumberingType() ) : pGetFld->GetFormat(); - short nPageNum = static_cast<short>(Max(0, pSetFld->GetOffset() + (short)nDiff)); + short nPageNum = static_cast<short>(std::max(0, pSetFld->GetOffset() + (short)nDiff)); pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) ); } } @@ -2395,7 +2395,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm, sal_uInt32 nTmpFmt = SVX_NUM_PAGEDESC == pGetFld->GetFormat() ? pPgFrm->GetPageDesc()->GetNumType().GetNumberingType() : pGetFld->GetFormat(); - short nPageNum = static_cast<short>(Max(0, pSetFld->GetOffset() + (short)nDiff )); + short nPageNum = static_cast<short>(std::max(0, pSetFld->GetOffset() + (short)nDiff )); pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) ); } } diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 2819819160b5..ed33b5c79460 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -1404,7 +1404,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < { aNewSz.Height() += pChgFly->Frm().Height() - pFly->Prt().Height(); - if( Abs( aNewSz.Height() - pChgFly->Frm().Height()) > 1 ) + if( std::abs( aNewSz.Height() - pChgFly->Frm().Height()) > 1 ) aFrmSz.SetHeight( aNewSz.Height() ); } // via Doc for the Undo! @@ -1861,8 +1861,8 @@ sal_Bool SwFEShell::ReplaceSdrObj( const String& rGrfName, const String& rFltNam const long nWidth = rBound.Right() - rBound.Left(); const long nHeight= rBound.Bottom() - rBound.Top(); aFrmSet.Put( SwFmtFrmSize( ATT_MIN_SIZE, - Max( nWidth, long(MINFLY) ), - Max( nHeight, long(MINFLY) ))); + std::max( nWidth, long(MINFLY) ), + std::max( nHeight, long(MINFLY) ))); if( SFX_ITEM_SET != aFrmSet.GetItemState( RES_HORI_ORIENT )) aFrmSet.Put( SwFmtHoriOrient( aRelPos.X(), text::HoriOrientation::NONE, text::RelOrientation::FRAME )); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 4982e4377148..4c979791352d 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1774,8 +1774,8 @@ sal_Bool SwFEShell::ImpEndCreate() // For OBJ_NONE a fly is inserted. const long nWidth = rBound.Right() - rBound.Left(); const long nHeight= rBound.Bottom() - rBound.Top(); - aSet.Put( SwFmtFrmSize( ATT_MIN_SIZE, Max( nWidth, long(MINFLY) ), - Max( nHeight, long(MINFLY) ))); + aSet.Put( SwFmtFrmSize( ATT_MIN_SIZE, std::max( nWidth, long(MINFLY) ), + std::max( nHeight, long(MINFLY) ))); SwFmtHoriOrient aHori( nXOffset, text::HoriOrientation::NONE, text::RelOrientation::FRAME ); SwFmtVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME ); diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 72a0a8920478..bbf751670506 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -66,7 +66,7 @@ using namespace ::com::sun::star; // also see swtable.cxx #define COLFUZZY 20L -inline bool IsSame( long nA, long nB ) { return Abs(nA-nB) <= COLFUZZY; } +inline bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; } // table column cache SwTabCols *pLastCols = 0; @@ -1147,7 +1147,7 @@ sal_uInt16 SwFEShell::GetRowSelectionFromTop() const if ( ( nPtLine == 0 && nMkLine != USHRT_MAX ) || ( nMkLine == 0 && nPtLine != USHRT_MAX ) ) { - nRet = Max( nPtLine, nMkLine ) + 1; + nRet = std::max( nPtLine, nMkLine ) + 1; } } @@ -1727,7 +1727,7 @@ static double lcl_DistancePoint2Segment( const Point& rA, const Point& rB, const } } - return Abs(nRet); + return std::abs(nRet); } /* Helper function*/ diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 358a383f2dd1..f0687c88e75e 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -1815,7 +1815,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart, const long nStSz = pStart->GetFmt()->GetFrmSize().GetWidth(); const long nEdSz = pEnd->GetFmt()->GetFrmSize().GetWidth(); - const long nWish = Max( 1L, pTable->GetFmt()->GetFrmSize().GetWidth() ); + const long nWish = std::max( 1L, pTable->GetFmt()->GetFrmSize().GetWidth() ); while ( pTable ) { SWRECTFN( pTable ) diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 5b52817bc967..0c15ce703c5a 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -1150,7 +1150,7 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA, const sal_uInt16 nTrans = rSet.GetTransparencyGrf().GetValue(); rGA.SetTransparency( (sal_uInt8) FRound( - Min( nTrans, (sal_uInt16) 100 ) * 2.55 ) ); + std::min( nTrans, (sal_uInt16) 100 ) * 2.55 ) ); return rGA; } diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx index 478a4a78bb68..ab4a193a5673 100644 --- a/sw/source/core/layout/anchoredobject.cxx +++ b/sw/source/core/layout/anchoredobject.cxx @@ -669,8 +669,8 @@ const SwRect& SwAnchoredObject::GetObjRectWithSpaces() const const SvxULSpaceItem& rUL = rFmt.GetULSpace(); const SvxLRSpaceItem& rLR = rFmt.GetLRSpace(); { - maObjRectWithSpaces.Top ( Max( maObjRectWithSpaces.Top() - long(rUL.GetUpper()), 0L )); - maObjRectWithSpaces.Left( Max( maObjRectWithSpaces.Left()- long(rLR.GetLeft()), 0L )); + maObjRectWithSpaces.Top ( std::max( maObjRectWithSpaces.Top() - long(rUL.GetUpper()), 0L )); + maObjRectWithSpaces.Left( std::max( maObjRectWithSpaces.Left()- long(rLR.GetLeft()), 0L )); maObjRectWithSpaces.SSize().Height() += rUL.GetLower(); maObjRectWithSpaces.SSize().Width() += rLR.GetRight(); } diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 447f55d4b44a..5bd0c2d487e5 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1067,7 +1067,7 @@ bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) const text::TextColumn* pArray = aSetColumns.getConstArray(); aColumns.clear(); //max count is 64k here - this is something the array can't do - sal_uInt16 nCount = Min( (sal_uInt16)aSetColumns.getLength(), + sal_uInt16 nCount = std::min( (sal_uInt16)aSetColumns.getLength(), (sal_uInt16) 0x3fff ); sal_uInt16 nWidthSum = 0; // #101224# one column is no column diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 44059617882d..884bfbad4226 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -113,7 +113,7 @@ sal_Bool SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool } SWRECTFN( this ) SWRECTFNX( pNewUpper ) - if( Abs( (pNewUpper->Prt().*fnRectX->fnGetWidth)() - + if( std::abs( (pNewUpper->Prt().*fnRectX->fnGetWidth)() - (GetUpper()->Prt().*fnRect->fnGetWidth)() ) > 1 ) { // In this case, only a _WouldFit with test move is possible nMoveAnyway = 2; @@ -671,10 +671,10 @@ static void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* pFrm, long& rBot } else nTmp = pObj->GetObjRect().Bottom(); - nMax = Max( nTmp, nMax ); + nMax = std::max( nTmp, nMax ); } ++nMax; // Lower edge vs. height! - rBot = Max( rBot, nMax ); + rBot = std::max( rBot, nMax ); } void SwPageFrm::MakeAll() @@ -722,7 +722,7 @@ void SwPageFrm::MakeAll() nWidth = pSh->GetBrowseWidth(); nWidth += + 2 * aBorder.Width(); - nWidth = Max( nWidth, 2L * aBorder.Width() + 4L*MM50 ); + nWidth = std::max( nWidth, 2L * aBorder.Width() + 4L*MM50 ); Frm().Width( nWidth ); SwLayoutFrm *pBody = FindBodyCont(); @@ -760,7 +760,7 @@ void SwPageFrm::MakeAll() ( pFrm->Frm().Height() < pFrm->Prt().Height() ) ) { - nTmp = Min( nTmp, pFrm->Frm().Height() ); + nTmp = std::min( nTmp, pFrm->Frm().Height() ); } else { @@ -770,7 +770,7 @@ void SwPageFrm::MakeAll() nTmp += pFrm->Frm().Height() - pFrm->Prt().Height(); } if ( !pFrm->IsBodyFrm() ) - nTmp = Min( nTmp, pFrm->Frm().Height() ); + nTmp = std::min( nTmp, pFrm->Frm().Height() ); nBot += nTmp; // Here we check whether paragraph anchored objects // protrude outside the Body/FtnCont. @@ -789,11 +789,11 @@ void SwPageFrm::MakeAll() // visible area. if ( !GetPrev() && !GetNext() ) { - nBot = Max( nBot, pSh->VisArea().Height() ); + nBot = std::max( nBot, pSh->VisArea().Height() ); } // #i35143# - Assure, that the page // doesn't exceed the defined browse height. - Frm().Height( Min( nBot, BROWSE_HEIGHT ) ); + Frm().Height( std::min( nBot, BROWSE_HEIGHT ) ); } Prt().Left ( pAttrs->CalcLeftLine() + aBorder.Width() ); Prt().Top ( nTop ); @@ -1007,7 +1007,7 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) if ( FLY_AS_CHAR == rFmt.GetAnchor().GetAnchorId() ) { - nMinWidth = Max( nMinWidth, + nMinWidth = std::max( nMinWidth, bFly ? rFmt.GetFrmSize().GetWidth() : pObj->GetObjRect().Width() ); } @@ -1017,8 +1017,8 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) long nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() ); nWidth -= (Prt().*fnRect->fnGetLeft)(); nWidth -= rAttrs.CalcRightLine(); - nWidth = Max( nMinWidth, nWidth ); - (Prt().*fnRect->fnSetWidth)( Min( nWidth, + nWidth = std::max( nMinWidth, nWidth ); + (Prt().*fnRect->fnSetWidth)( std::min( nWidth, (Prt().*fnRect->fnGetWidth)() ) ); } @@ -1026,7 +1026,7 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) { // The PrtArea should already be at least MINLAY wide, matching the // minimal values of the UI - (Prt().*fnRect->fnSetWidth)( Min( long(MINLAY), + (Prt().*fnRect->fnSetWidth)( std::min( long(MINLAY), (Frm().*fnRect->fnGetWidth)() ) ); SwTwips nTmp = (Frm().*fnRect->fnGetWidth)() - (Prt().*fnRect->fnGetWidth)(); diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index 2e0f2226cdfc..a73a8b425973 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -274,7 +274,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew, bAdjustAttributes = sal_True; else { - sal_uInt16 nCount = Min( rNew.GetColumns().size(), rOld.GetColumns().size() ); + sal_uInt16 nCount = std::min( rNew.GetColumns().size(), rOld.GetColumns().size() ); for ( sal_uInt16 i = 0; i < nCount; ++i ) if ( !(rOld.GetColumns()[i] == rNew.GetColumns()[i]) ) { @@ -393,16 +393,16 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttribut { if ( i == 0 ) { - aLR.SetRight( Max( nRight, nMin ) ); + aLR.SetRight( std::max( nRight, nMin ) ); } else if ( i == pAttr->GetNumCols() - 1 ) { - aLR.SetLeft ( Max( nLeft, nMin ) ); + aLR.SetLeft ( std::max( nLeft, nMin ) ); } else { - aLR.SetLeft ( Max( nLeft, nMin ) ); - aLR.SetRight( Max( nRight, nMin ) ); + aLR.SetLeft ( std::max( nLeft, nMin ) ); + aLR.SetRight( std::max( nRight, nMin ) ); } } diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index a8bc8fe7b33e..14bfc39b80f6 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1511,7 +1511,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, // former consideration if ( pOwn->IsTxtFrm() ) { - nAdd = Max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace() ); + nAdd = std::max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace() ); } nUpper += nAdd; } @@ -1537,7 +1537,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, } else { - nAdd = Max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) ); + nAdd = std::max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) ); } } nUpper += nAdd; @@ -1545,7 +1545,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, } else { - nUpper = Max( static_cast<long>(nPrevLowerSpace), + nUpper = std::max( static_cast<long>(nPrevLowerSpace), static_cast<long>(pAttrs->GetULSpace().GetUpper()) ); // OD 07.01.2004 #i11859# - consideration of the line spacing // for the upper spacing of a text frame @@ -1553,10 +1553,10 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, { // former consideration if ( pOwn->IsTxtFrm() ) - nUpper = Max( nUpper, ((SwTxtFrm*)pOwn)->GetLineSpace() ); + nUpper = std::max( nUpper, ((SwTxtFrm*)pOwn)->GetLineSpace() ); if ( nPrevLineSpacing != 0 ) { - nUpper = Max( nUpper, nPrevLineSpacing ); + nUpper = std::max( nUpper, nPrevLineSpacing ); } } else @@ -1583,7 +1583,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, } else { - nAdd = Max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) ); + nAdd = std::max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) ); } } nUpper += nAdd; @@ -1709,7 +1709,7 @@ SwTwips SwFlowFrm::_GetUpperSpaceAmountConsideredForPrevFrm() const } else { - nUpperSpaceAmountOfPrevFrm = Max( nPrevLowerSpace, nPrevLineSpacing ); + nUpperSpaceAmountOfPrevFrm = std::max( nPrevLowerSpace, nPrevLineSpacing ); } } } diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 42890b9d051b..f72a1eeb4e4c 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -909,10 +909,10 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, SwRect aNew( GetObjRectWithSpaces() ); SwRect aOld( maFrm ); const SvxULSpaceItem &rUL = ((SwFmtChg*)pOld)->pChangedFmt->GetULSpace(); - aOld.Top( Max( aOld.Top() - long(rUL.GetUpper()), 0L ) ); + aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) ); aOld.SSize().Height()+= rUL.GetLower(); const SvxLRSpaceItem &rLR = ((SwFmtChg*)pOld)->pChangedFmt->GetLRSpace(); - aOld.Left ( Max( aOld.Left() - long(rLR.GetLeft()), 0L ) ); + aOld.Left ( std::max( aOld.Left() - long(rLR.GetLeft()), 0L ) ); aOld.SSize().Width() += rLR.GetRight(); aNew.Union( aOld ); NotifyBackground( FindPageFrm(), aNew, PREP_CLEAR ); @@ -1001,13 +1001,13 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, if ( RES_UL_SPACE == nWhich ) { const SvxULSpaceItem &rUL = *(SvxULSpaceItem*)pNew; - aOld.Top( Max( aOld.Top() - long(rUL.GetUpper()), 0L ) ); + aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) ); aOld.SSize().Height()+= rUL.GetLower(); } else { const SvxLRSpaceItem &rLR = *(SvxLRSpaceItem*)pNew; - aOld.Left ( Max( aOld.Left() - long(rLR.GetLeft()), 0L ) ); + aOld.Left ( std::max( aOld.Left() - long(rLR.GetLeft()), 0L ) ); aOld.SSize().Width() += rLR.GetRight(); } aNew.Union( aOld ); @@ -1459,7 +1459,7 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs ) if ( nAutoWidth ) { if( ATT_MIN_SIZE == rFrmSz.GetWidthSizeType() ) - nNewSize = Max( nNewSize - nLR, nAutoWidth ); + nNewSize = std::max( nNewSize - nLR, nAutoWidth ); else nNewSize = nAutoWidth; } @@ -1949,7 +1949,7 @@ SwTwips SwFlyFrm::_Shrink( SwTwips nDist, sal_Bool bTst ) const SwFmtFrmSize& rFmtSize = GetFmt()->GetFrmSize(); SwTwips nFmtHeight = bVert ? rFmtSize.GetWidth() : rFmtSize.GetHeight(); - nVal = Min( nDist, nHeight - nFmtHeight ); + nVal = std::min( nDist, nHeight - nFmtHeight ); } if ( nVal <= 0L ) @@ -2501,15 +2501,15 @@ Size SwFlyFrm::CalcRel( const SwFmtFrmSize &rSz ) const if ( nDiff > 0 ) nRelHeight -= nDiff; } - nRelWidth = Min( nRelWidth, pRel->Prt().Width() ); - nRelHeight = Min( nRelHeight, pRel->Prt().Height() ); + nRelWidth = std::min( nRelWidth, pRel->Prt().Width() ); + nRelHeight = std::min( nRelHeight, pRel->Prt().Height() ); if( !pRel->IsPageFrm() ) { const SwPageFrm* pPage = FindPageFrm(); if( pPage ) { - nRelWidth = Min( nRelWidth, pPage->Prt().Width() ); - nRelHeight = Min( nRelHeight, pPage->Prt().Height() ); + nRelWidth = std::min( nRelWidth, pPage->Prt().Width() ); + nRelHeight = std::min( nRelHeight, pPage->Prt().Height() ); } } diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index d1bcb832c9b9..41057cdf31d2 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -917,10 +917,10 @@ static sal_uLong lcl_FindCntDiff( const Point &rPt, const SwLayoutFrm *pLay, { //Calculate the distance between those two points. //'delta' X^2 + 'delta' Y^2 = 'distance'^2 - sal_uInt32 dX = Max( pCnt->Frm().Left(), rPt.X() ) - - Min( pCnt->Frm().Left(), rPt.X() ), - dY = Max( pCnt->Frm().Top(), rPt.Y() ) - - Min( pCnt->Frm().Top(), rPt.Y() ); + sal_uInt32 dX = std::max( pCnt->Frm().Left(), rPt.X() ) - + std::min( pCnt->Frm().Left(), rPt.X() ), + dY = std::max( pCnt->Frm().Top(), rPt.Y() ) - + std::min( pCnt->Frm().Top(), rPt.Y() ); BigInt dX1( dX ), dY1( dY ); dX1 *= dX1; dY1 *= dY1; const sal_uLong nDiff = ::SqRt( dX1 + dY1 ); diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index e9522c1de9cd..fece11426d71 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -317,7 +317,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz ) if ( !pHeader || !pHeader->IsHeaderFrm() ) { const long nOld = Frm().Top(); - Frm().Pos().Y() = Max( aClip.Top(), nClipBot - Frm().Height() ); + Frm().Pos().Y() = std::max( aClip.Top(), nClipBot - Frm().Height() ); if ( Frm().Top() != nOld ) bAgain = true; bHeightClipped = sal_True; @@ -326,7 +326,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz ) if ( bRig ) { const long nOld = Frm().Left(); - Frm().Pos().X() = Max( aClip.Left(), nClipRig - Frm().Width() ); + Frm().Pos().X() = std::max( aClip.Left(), nClipRig - Frm().Width() ); if ( Frm().Left() != nOld ) { const SwFmtHoriOrient &rH = GetFmt()->GetHoriOrient(); @@ -441,7 +441,7 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz ) const long nPrtWidthDiff = Frm().Width() - Prt().Width(); maUnclippedFrm = SwRect( Frm() ); Frm().Height( aFrmRect.Height() ); - Frm().Width ( Max( long(MINLAY), aFrmRect.Width() ) ); + Frm().Width ( std::max( long(MINLAY), aFrmRect.Width() ) ); if ( Lower() && Lower()->IsColumnFrm() ) { ColLock(); //lock grow/shrink diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 51ab0afe3b6e..6fcef9bfeb1d 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2873,8 +2873,8 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld, { SwRect aTmp( rOld ); aTmp.Union( aFrm ); - aTmp.Left( Min(aFrm.Left(), rOld.Left()) ); - aTmp.Right( Max(aFrm.Left(), rOld.Left()) ); + aTmp.Left( std::min(aFrm.Left(), rOld.Left()) ); + aTmp.Right( std::max(aFrm.Left(), rOld.Left()) ); pFly->NotifyBackground( pOld, aTmp, PREP_FLY_CHGD ); } SwTwips nOld = rOld.Right(); @@ -2883,16 +2883,16 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld, { SwRect aTmp( rOld ); aTmp.Union( aFrm ); - aTmp.Left( Min(nNew, nOld) ); - aTmp.Right( Max(nNew, nOld) ); + aTmp.Left( std::min(nNew, nOld) ); + aTmp.Right( std::max(nNew, nOld) ); pFly->NotifyBackground( pOld, aTmp, PREP_FLY_CHGD ); } if ( rOld.Top() != aFrm.Top() ) { SwRect aTmp( rOld ); aTmp.Union( aFrm ); - aTmp.Top( Min(aFrm.Top(), rOld.Top()) ); - aTmp.Bottom( Max(aFrm.Top(), rOld.Top()) ); + aTmp.Top( std::min(aFrm.Top(), rOld.Top()) ); + aTmp.Bottom( std::max(aFrm.Top(), rOld.Top()) ); pFly->NotifyBackground( pOld, aTmp, PREP_FLY_CHGD ); } nOld = rOld.Bottom(); @@ -2901,8 +2901,8 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld, { SwRect aTmp( rOld ); aTmp.Union( aFrm ); - aTmp.Top( Min(nNew, nOld) ); - aTmp.Bottom( Max(nNew, nOld) ); + aTmp.Top( std::min(nNew, nOld) ); + aTmp.Bottom( std::max(nNew, nOld) ); pFly->NotifyBackground( pOld, aTmp, PREP_FLY_CHGD ); } } @@ -3282,8 +3282,8 @@ static SwTwips lcl_CalcCellRstHeight( SwLayoutFrm *pCell ) nLow += ((SwTxtFrm*)pLow)->GetParHeight()-pLow->Prt().Height(); else if( pLow->IsSctFrm() && ((SwSectionFrm*)pLow)->IsUndersized() ) nLow += ((SwSectionFrm*)pLow)->Undersize(); - nFlyAdd = Max( 0L, nFlyAdd - nLow ); - nFlyAdd = Max( nFlyAdd, ::CalcHeightWidthFlys( pLow ) ); + nFlyAdd = std::max( 0L, nFlyAdd - nLow ); + nFlyAdd = std::max( nFlyAdd, ::CalcHeightWidthFlys( pLow ) ); nHeight += nLow; pLow = pLow->GetNext(); } while ( pLow ); @@ -3319,7 +3319,7 @@ SwTwips CalcRowRstHeight( SwLayoutFrm *pRow ) SwLayoutFrm *pLow = (SwLayoutFrm*)pRow->Lower(); while ( pLow ) { - nRstHeight = Min( nRstHeight, ::lcl_CalcCellRstHeight( pLow ) ); + nRstHeight = std::min( nRstHeight, ::lcl_CalcCellRstHeight( pLow ) ); pLow = (SwLayoutFrm*)pLow->GetNext(); } return nRstHeight; diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 673f31046949..ff798b5a2818 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -288,7 +288,7 @@ void SwFtnContFrm::Format( const SwBorderAttrs * ) SwTwips nPrtHeight = (Prt().*fnRect->fnGetHeight)(); if( nPrtHeight < 0 ) { - const SwTwips nTmpDiff = Max( (Prt().*fnRect->fnGetTop)(), + const SwTwips nTmpDiff = std::max( (Prt().*fnRect->fnGetTop)(), -nPrtHeight ); (Prt().*fnRect->fnSubTop)( nTmpDiff ); } @@ -344,7 +344,7 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool ) { if ( pBoss->GetMaxFtnHeight() != LONG_MAX ) { - nDist = Min( nDist, pBoss->GetMaxFtnHeight() + nDist = std::min( nDist, pBoss->GetMaxFtnHeight() - (Frm().*fnRect->fnGetHeight)() ); if ( nDist <= 0 ) return 0L; diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 807a40b14c67..1753d8544e50 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -570,10 +570,10 @@ sal_uLong SwLayHelper::CalcPageCount() nMaxParaPerPage = nNdCount / nPgCount; else { - nMaxParaPerPage = Max( sal_uLong(20), + nMaxParaPerPage = std::max( sal_uLong(20), sal_uLong(20 + nNdCount / 1000 * 3) ); const sal_uLong nMax = 53; - nMaxParaPerPage = Min( nMaxParaPerPage, nMax ); + nMaxParaPerPage = std::min( nMaxParaPerPage, nMax ); nPgCount = nNdCount / nMaxParaPerPage; } if ( nNdCount < 1000 ) @@ -716,7 +716,7 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex ) ++nCnt; pTmp = pTmp->GetNext(); } while( pTmp ); - nMaxRowPerPage = Max( sal_uLong(2), nMaxParaPerPage / nCnt ); + nMaxRowPerPage = std::max( sal_uLong(2), nMaxParaPerPage / nCnt ); } bLongTab = true; } diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 8c5429ab7743..5421332650bb 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -658,8 +658,8 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, ((SwFmtChg*)pNew)->pChangedFmt->GetFrmSize() : (const SwFmtFrmSize&)*pNew; - Frm().Height( Max( rSz.GetHeight(), long(MINLAY) ) ); - Frm().Width ( Max( rSz.GetWidth(), long(MINLAY) ) ); + Frm().Height( std::max( rSz.GetHeight(), long(MINLAY) ) ); + Frm().Width ( std::max( rSz.GetWidth(), long(MINLAY) ) ); if ( GetUpper() ) static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 ); @@ -1769,7 +1769,7 @@ void SwRootFrm::ImplCalcBrowseWidth() ((const SwTabFrm *)pFrm)->GetTable() ->GetHTMLTableLayout(); if ( pLayoutInfo ) - nWidth = Min( nWidth, pLayoutInfo->GetBrowseWidthMin() ); + nWidth = std::min( nWidth, pLayoutInfo->GetBrowseWidthMin() ); switch ( rHori.GetHoriOrient() ) { @@ -1784,7 +1784,7 @@ void SwRootFrm::ImplCalcBrowseWidth() break; } - nBrowseWidth = Max( nBrowseWidth, nWidth ); + nBrowseWidth = std::max( nBrowseWidth, nWidth ); } } else if ( pFrm->GetDrawObjs() ) @@ -1843,7 +1843,7 @@ void SwRootFrm::ImplCalcBrowseWidth() break; default: /* do nothing */; } - nBrowseWidth = Max( nBrowseWidth, nWidth ); + nBrowseWidth = std::max( nBrowseWidth, nWidth ); } } pFrm = pFrm->FindNextCnt(); @@ -2193,7 +2193,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi nWidthRemain = nWidthRemain - nPageWidth; nCurrentRowWidth = nCurrentRowWidth + nPageWidth; - nCurrentRowHeight = Max( nCurrentRowHeight, nPageHeight ); + nCurrentRowHeight = std::max( nCurrentRowHeight, nPageHeight ); pPageFrm = static_cast<SwPageFrm*>(pPageFrm->GetNext()); @@ -2307,8 +2307,8 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi const bool bLastColumn = pPageToAdjust->GetNext() == pEndOfRow; const bool bLastRow = !pEndOfRow; - nMinPageLeft = Min( nMinPageLeft, aNewPagePos.X() ); - nMaxPageRight = Max( nMaxPageRight, aNewPagePos.X() + nCurrentPageWidth); + nMinPageLeft = std::min( nMinPageLeft, aNewPagePos.X() ); + nMaxPageRight = std::max( nMaxPageRight, aNewPagePos.X() + nCurrentPageWidth); // border of nGapBetweenPages around the current page: SwRect aPageRectWithBorders( aNewPagePos.X() - nGapBetweenPages, diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 3e5f308c0a02..45b0fd41214d 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -551,8 +551,8 @@ bool SwLineRect::MakeUnion( const SwRect &rRect ) if ( Bottom() + nAdd >= rRect.Top() && Top() - nAdd <= rRect.Bottom() ) { - Bottom( Max( Bottom(), rRect.Bottom() ) ); - Top ( Min( Top(), rRect.Top() ) ); + Bottom( std::max( Bottom(), rRect.Bottom() ) ); + Top ( std::min( Top(), rRect.Top() ) ); return true; } } @@ -566,8 +566,8 @@ bool SwLineRect::MakeUnion( const SwRect &rRect ) if ( Right() + nAdd >= rRect.Left() && Left() - nAdd <= rRect.Right() ) { - Right( Max( Right(), rRect.Right() ) ); - Left ( Min( Left(), rRect.Left() ) ); + Right( std::max( Right(), rRect.Right() ) ); + Left ( std::min( Left(), rRect.Left() ) ); return true; } } @@ -951,7 +951,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut ) if ( rLRect.IsLocked() ) { - nMinCount = Min( nMinCount, i ); + nMinCount = std::min( nMinCount, i ); continue; } @@ -1015,7 +1015,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut ) if ( rLRect.IsLocked() ) { - nMinCount = Min( nMinCount, i ); + nMinCount = std::min( nMinCount, i ); continue; } @@ -1312,7 +1312,7 @@ static long lcl_AlignWidth( const long nWidth ) const long nW = nWidth % nPixelSzW; if ( !nW || nW > nHalfPixelSzW ) - return Max(1L, nWidth - nHalfPixelSzW); + return std::max(1L, nWidth - nHalfPixelSzW); } return nWidth; } @@ -1324,7 +1324,7 @@ static long lcl_AlignHeight( const long nHeight ) const long nH = nHeight % nPixelSzH; if ( !nH || nH > nHalfPixelSzH ) - return Max(1L, nHeight - nHalfPixelSzH); + return std::max(1L, nHeight - nHalfPixelSzH); } return nHeight; } @@ -1333,7 +1333,7 @@ static long lcl_MinHeightDist( const long nDist ) { if ( aScaleX < aMinDistScale || aScaleY < aMinDistScale ) return nDist; - return ::lcl_AlignHeight( Max( nDist, nMinDistPixelH )); + return ::lcl_AlignHeight( std::max( nDist, nMinDistPixelH )); } //Calculate PrtArea plus surrounding plus shadow. @@ -2374,8 +2374,8 @@ void SwTabFrmPainter::PaintLines( OutputDevice& rDev, const SwRect& rRect ) cons // The following stuff if necessary to have the new table borders fit // into a ::SwAlignRect adjusted world. - const SwTwips nTwipXCorr = bVert ? 0 : Max( 0L, nHalfPixelSzW - 2 ); // 1 < 2 < 3 ;-) - const SwTwips nTwipYCorr = !bVert ? 0 : Max( 0L, nHalfPixelSzW - 2 ); // 1 < 2 < 3 ;-) + const SwTwips nTwipXCorr = bVert ? 0 : std::max( 0L, nHalfPixelSzW - 2 ); // 1 < 2 < 3 ;-) + const SwTwips nTwipYCorr = !bVert ? 0 : std::max( 0L, nHalfPixelSzW - 2 ); // 1 < 2 < 3 ;-) const SwFrm* pUpper = mrTabFrm.GetUpper(); SwRect aUpper( pUpper->Prt() ); aUpper.Pos() += pUpper->Frm().Pos(); @@ -2457,11 +2457,11 @@ void SwTabFrmPainter::PaintLines( OutputDevice& rDev, const SwRect& rRect ) cons sal_uInt16 nSecn = aStyles[ i ].Secn(); if ( nPrim > 0 ) - nPrim = (sal_uInt16)( Max( 1L, nPixelSzH * ( nPrim / nPixelSzH ) ) ); + nPrim = (sal_uInt16)( std::max( 1L, nPixelSzH * ( nPrim / nPixelSzH ) ) ); if ( nDist > 0 ) - nDist = (sal_uInt16)( Max( 1L, nPixelSzH * ( nDist / nPixelSzH ) ) ); + nDist = (sal_uInt16)( std::max( 1L, nPixelSzH * ( nDist / nPixelSzH ) ) ); if ( nSecn > 0 ) - nSecn = (sal_uInt16)( Max( 1L, nPixelSzH * ( nSecn / nPixelSzH ) ) ); + nSecn = (sal_uInt16)( std::max( 1L, nPixelSzH * ( nSecn / nPixelSzH ) ) ); aStyles[ i ].Set( nPrim, nDist, nSecn ); } @@ -5289,8 +5289,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const if( bGrid ) { nY -= nGrid; - SwTwips nPosY = Max( aInter.Left(), nY ); - SwTwips nHeight = Min(nRight, aTmp.Pos().X())-nPosY; + SwTwips nPosY = std::max( aInter.Left(), nY ); + SwTwips nHeight = std::min(nRight, aTmp.Pos().X())-nPosY; if( nHeight > 0 ) { if( bCell ) @@ -5322,8 +5322,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const nY -= nRuby; if( bBorder ) { - SwTwips nPos = Max( aInter.Left(), nY ); - SwTwips nW = Min(nRight, aTmp.Pos().X()) - nPos; + SwTwips nPos = std::max( aInter.Left(), nY ); + SwTwips nW = std::min(nRight, aTmp.Pos().X()) - nPos; SwRect aVert( Point( nPos, aGrid.Top() ), Size( nW, 1 ) ); if( nW > 0 ) @@ -5348,7 +5348,7 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const { nY -= nGrid; SwTwips nHeight = aTmp.Pos().X() - - Max(aInter.Left(), nY ); + - std::max(aInter.Left(), nY ); if( nHeight > 0 ) { if( bCell ) @@ -5380,8 +5380,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const nY -= nRuby; if( bBorder ) { - SwTwips nPos = Max( aInter.Left(), nY ); - SwTwips nW = Min(nRight, aTmp.Pos().X()) - nPos; + SwTwips nPos = std::max( aInter.Left(), nY ); + SwTwips nW = std::min(nRight, aTmp.Pos().X()) - nPos; SwRect aVert( Point( nPos, aGrid.Top() ), Size( nW, 1 ) ); if( nW > 0 ) @@ -5420,8 +5420,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const if( bGrid ) { nY += nGrid; - SwTwips nPosY = Max( aInter.Top(), aTmp.Pos().Y() ); - SwTwips nHeight = Min(nBottom, nY ) - nPosY; + SwTwips nPosY = std::max( aInter.Top(), aTmp.Pos().Y() ); + SwTwips nHeight = std::min(nBottom, nY ) - nPosY; if( nHeight ) { if( bCell ) @@ -5453,8 +5453,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const nY += nRuby; if( bBorder ) { - SwTwips nPos = Max(aInter.Top(),aTmp.Pos().Y()); - SwTwips nH = Min( nBottom, nY ) - nPos; + SwTwips nPos = std::max(aInter.Top(),aTmp.Pos().Y()); + SwTwips nH = std::min( nBottom, nY ) - nPos; SwRect aVert( Point( aGrid.Left(), nPos ), Size( 1, nH ) ); if( nH > 0 ) @@ -5478,7 +5478,7 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const if( bGrid ) { nY += nGrid; - SwTwips nHeight = Min(nBottom, nY) - aTmp.Pos().Y(); + SwTwips nHeight = std::min(nBottom, nY) - aTmp.Pos().Y(); if( nHeight ) { if( bCell ) @@ -5510,8 +5510,8 @@ void SwPageFrm::PaintGrid( OutputDevice* pOut, SwRect &rRect ) const nY += nRuby; if( bBorder ) { - SwTwips nPos = Max(aInter.Top(),aTmp.Pos().Y()); - SwTwips nH = Min( nBottom, nY ) - nPos; + SwTwips nPos = std::max(aInter.Top(),aTmp.Pos().Y()); + SwTwips nH = std::min( nBottom, nY ) - nPos; SwRect aVert( Point( aGrid.Left(), nPos ), Size( 1, nH ) ); if( nH > 0 ) diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 12d831bc34d4..dde50560d6d5 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -563,13 +563,13 @@ static void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine, SwBorderAttrAccess aAccess( SwFrm::GetCache(), pCell ); const SwBorderAttrs &rAttrs = *aAccess.Get(); - nMinHeight = Max( nMinHeight, lcl_CalcTopAndBottomMargin( *(SwLayoutFrm*)pCell, rAttrs ) ); + nMinHeight = std::max( nMinHeight, lcl_CalcTopAndBottomMargin( *(SwLayoutFrm*)pCell, rAttrs ) ); pCell = pCell->GetNext(); } const SwFmtFrmSize &rSz = pTmpLastLineRow->GetFmt()->GetFrmSize(); if ( rSz.GetHeightSizeType() == ATT_MIN_SIZE ) - nMinHeight = Max( nMinHeight, rSz.GetHeight() ); + nMinHeight = std::max( nMinHeight, rSz.GetHeight() ); } // @@ -2741,7 +2741,7 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper, const long nWidth = (*fnRect->fnXDiff)( (aFlyRect.*fnRect->fnGetRight)(), (pFly->GetAnchorFrm()->Frm().*fnRect->fnGetLeft)() ); - rLeftOffset = Max( rLeftOffset, nWidth ); + rLeftOffset = std::max( rLeftOffset, nWidth ); bInvalidatePrtArea = sal_True; } if ( (SURROUND_LEFT == rSur.GetSurround() || @@ -2751,7 +2751,7 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper, const long nWidth = (*fnRect->fnXDiff)( (pFly->GetAnchorFrm()->Frm().*fnRect->fnGetRight)(), (aFlyRect.*fnRect->fnGetLeft)() ); - rRightOffset = Max( rRightOffset, nWidth ); + rRightOffset = std::max( rRightOffset, nWidth ); bInvalidatePrtArea = sal_True; } } @@ -2798,7 +2798,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) nLeftOffset = 0; if( CalcFlyOffsets( nUpper, nLeftOffset, nTmpRight ) ) mbValidPrtArea = sal_False; - long nRightOffset = Max( 0L, nTmpRight ); + long nRightOffset = std::max( 0L, nTmpRight ); SwTwips nLower = pAttrs->CalcBottomLine(); // #i29550# @@ -2853,7 +2853,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) // surrounding fly frames on the right // -> right indent is maximun of given right offset // and wished right offset. - nRightSpacing = nRightLine + Max( nRightOffset, nWishRight ); + nRightSpacing = nRightLine + std::max( nRightOffset, nWishRight ); } else { @@ -2865,7 +2865,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) nRightSpacing = nRightLine + ( ( (nWishRight+nLeftOffset) < 0 ) ? (nWishRight+nLeftOffset) : - Max( 0L, nWishRight ) ); + std::max( 0L, nWishRight ) ); } } break; @@ -2884,7 +2884,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) // surrounding fly frames on the left // -> right indent is maximun of given left offset // and wished left offset. - nLeftSpacing = nLeftLine + Max( nLeftOffset, nWishLeft ); + nLeftSpacing = nLeftLine + std::max( nLeftOffset, nWishLeft ); } else { @@ -2896,7 +2896,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) nLeftSpacing = nLeftLine + ( ( (nWishLeft+nRightOffset) < 0 ) ? (nWishLeft+nRightOffset) : - Max( 0L, nWishLeft ) ); + std::max( 0L, nWishLeft ) ); } } break; @@ -2907,11 +2907,11 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) const SwTwips nCenterSpacing = ( nMax - nWishedTableWidth ) / 2; nLeftSpacing = nLeftLine + ( (nLeftOffset > 0) ? - Max( nCenterSpacing, nLeftOffset ) : + std::max( nCenterSpacing, nLeftOffset ) : nCenterSpacing ); nRightSpacing = nRightLine + ( (nRightOffset > 0) ? - Max( nCenterSpacing, nRightOffset ) : + std::max( nCenterSpacing, nRightOffset ) : nCenterSpacing ); } break; @@ -2934,7 +2934,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) // they overlap with the table. // Thus, take maximun of left spacing and left offset. // OD 10.03.2003 #i9040# - consider left line attribute. - nLeftSpacing = Max( nLeftSpacing, ( nLeftOffset + nLeftLine ) ); + nLeftSpacing = std::max( nLeftSpacing, ( nLeftOffset + nLeftLine ) ); } // OD 23.01.2003 #106895# - add 1st param to <SwBorderAttrs::CalcRight(..)> nRightSpacing = pAttrs->CalcRight( this ); @@ -2944,7 +2944,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) // they overlap with the table. // Thus, take maximun of right spacing and right offset. // OD 10.03.2003 #i9040# - consider right line attribute. - nRightSpacing = Max( nRightSpacing, ( nRightOffset + nRightLine ) ); + nRightSpacing = std::max( nRightSpacing, ( nRightOffset + nRightLine ) ); } } break; @@ -2960,14 +2960,14 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) // they overlap with the table. // Thus, take maximun of right spacing and right offset. // OD 10.03.2003 #i9040# - consider left line attribute. - nLeftSpacing = Max( nLeftSpacing, ( pAttrs->CalcLeftLine() + nLeftOffset ) ); + nLeftSpacing = std::max( nLeftSpacing, ( pAttrs->CalcLeftLine() + nLeftOffset ) ); } // OD 10.03.2003 #i9040# - consider right and left line attribute. const SwTwips nWishRight = nMax - (nLeftSpacing-pAttrs->CalcLeftLine()) - nWishedTableWidth; nRightSpacing = nRightLine + ( (nRightOffset > 0) ? - Max( nWishRight, nRightOffset ) : + std::max( nWishRight, nRightOffset ) : nWishRight ); } break; @@ -3000,7 +3000,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs ) long nWidth = pSh->GetBrowseWidth(); nWidth -= Prt().Left(); nWidth -= pAttrs->CalcRightLine(); - Prt().Width( Min( nWidth, Prt().Width() ) ); + Prt().Width( std::min( nWidth, Prt().Width() ) ); } if ( nOldHeight != (Prt().*fnRect->fnGetHeight)() ) @@ -3067,7 +3067,7 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) if ( IsRestrictTableGrowth() ) { - nTmp = Min( nDist, nReal + nTmp ); + nTmp = std::min( nDist, nReal + nTmp ); nDist = nTmp < 0 ? 0 : nTmp; } } @@ -3415,7 +3415,7 @@ sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &r long nOldWidth = (GetUpper()->Prt().*fnRect->fnGetWidth)(); SWRECTFNX( pNewUpper ); long nNewWidth = (pNewUpper->Prt().*fnRectX->fnGetWidth)(); - if( Abs( nNewWidth - nOldWidth ) < 2 ) + if( std::abs( nNewWidth - nOldWidth ) < 2 ) { if( !( bMoveAnyway = (BwdMoveNecessary( pOldPage, Frm() ) > 1) ) ) { @@ -3835,7 +3835,7 @@ long CalcHeightWidthFlys( const SwFrm *pFrm ) (pTmp->Frm().*fnRect->fnGetTop)(), (pFrm->Frm().*fnRect->fnGetTop)() ); - nHeight = Max( nHeight, nDistOfFlyBottomToAnchorTop + nFrmDiff - + nHeight = std::max( nHeight, nDistOfFlyBottomToAnchorTop + nFrmDiff - (pFrm->Frm().*fnRect->fnGetHeight)() ); // #i56115# The first height calculation @@ -3849,7 +3849,7 @@ long CalcHeightWidthFlys( const SwFrm *pFrm ) (pAnchoredObj->GetObjRect().*fnRect->fnGetBottom)(), (pFrm->Frm().*fnRect->fnGetBottom)() ); - nHeight = Max( nHeight, nDistOfFlyBottomToAnchorTop2 ); + nHeight = std::max( nHeight, nDistOfFlyBottomToAnchorTop2 ); } } } @@ -3925,8 +3925,8 @@ static SwTwips lcl_CalcMinCellHeight( const SwLayoutFrm *_pCell, // #i26945# if ( _bConsiderObjs ) { - nFlyAdd = Max( 0L, nFlyAdd - nLowHeight ); - nFlyAdd = Max( nFlyAdd, ::CalcHeightWidthFlys( pLow ) ); + nFlyAdd = std::max( 0L, nFlyAdd - nLowHeight ); + nFlyAdd = std::max( nFlyAdd, ::CalcHeightWidthFlys( pLow ) ); } } @@ -4006,7 +4006,7 @@ static SwTwips lcl_CalcMinRowHeight( const SwRowFrm* _pRow, pLow = static_cast<const SwCellFrm*>(pLow->GetNext()); } if ( rSz.GetHeightSizeType() == ATT_MIN_SIZE && !_pRow->IsRowSpanLine() ) - nHeight = Max( nHeight, rSz.GetHeight() ); + nHeight = std::max( nHeight, rSz.GetHeight() ); return nHeight; } @@ -4028,7 +4028,7 @@ static sal_uInt16 lcl_GetTopSpace( const SwRowFrm& rRow ) const SvxBoxItem& rBoxItem = rSet.GetBox(); nTmpTopSpace = rBoxItem.CalcLineSpace( BOX_LINE_TOP, sal_True ); } - nTopSpace = Max( nTopSpace, nTmpTopSpace ); + nTopSpace = std::max( nTopSpace, nTmpTopSpace ); } return nTopSpace; } @@ -4049,7 +4049,7 @@ static sal_uInt16 lcl_GetTopLineDist( const SwRowFrm& rRow ) const SvxBoxItem& rBoxItem = rSet.GetBox(); nTmpTopLineDist = rBoxItem.GetDistance( BOX_LINE_TOP ); } - nTopLineDist = Max( nTopLineDist, nTmpTopLineDist ); + nTopLineDist = std::max( nTopLineDist, nTmpTopLineDist ); } return nTopLineDist; } @@ -4074,7 +4074,7 @@ static sal_uInt16 lcl_GetBottomLineSize( const SwRowFrm& rRow ) nTmpBottomLineSize = rBoxItem.CalcLineSpace( BOX_LINE_BOTTOM, sal_True ) - rBoxItem.GetDistance( BOX_LINE_BOTTOM ); } - nBottomLineSize = Max( nBottomLineSize, nTmpBottomLineSize ); + nBottomLineSize = std::max( nBottomLineSize, nTmpBottomLineSize ); } return nBottomLineSize; } @@ -4098,7 +4098,7 @@ static sal_uInt16 lcl_GetBottomLineDist( const SwRowFrm& rRow ) const SvxBoxItem& rBoxItem = rSet.GetBox(); nTmpBottomLineDist = rBoxItem.GetDistance( BOX_LINE_BOTTOM ); } - nBottomLineDist = Max( nBottomLineDist, nTmpBottomLineDist ); + nBottomLineDist = std::max( nBottomLineDist, nTmpBottomLineDist ); } return nBottomLineDist; } @@ -4447,7 +4447,7 @@ SwTwips SwRowFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo ) (Frm().*fnRect->fnBottomDist)( (GetUpper()->GetUpper()->*fnRect->fnGetPrtBottom)() ); if ( bRestrictTableGrowth && nAdditionalSpace > 0 ) { - nReal = Min( nAdditionalSpace, nDist ); + nReal = std::min( nAdditionalSpace, nDist ); nDist -= nReal; if ( !bTst ) (Frm().*fnRect->fnAddBottom)( nReal ); @@ -5589,7 +5589,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const if ( 1 == pLower2->GetTabBox()->getRowSpan() ) { const SwTwips nCellHeight = lcl_CalcMinCellHeight( pLower2, sal_True ); - nMaxHeight = Max( nCellHeight, nMaxHeight ); + nMaxHeight = std::max( nCellHeight, nMaxHeight ); } pLower2 = static_cast<const SwCellFrm*>(pLower2->GetNext()); } @@ -5616,7 +5616,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const const SwTwips nMinRowHeight = rSz.GetHeightSizeType() == ATT_MIN_SIZE ? rSz.GetHeight() : 0; - nTmpHeight += Max( nHeightOfFirstContentLine, nMinRowHeight ); + nTmpHeight += std::max( nHeightOfFirstContentLine, nMinRowHeight ); if ( !bOldJoinLock ) ((SwTabFrm*)this)->UnlockJoin(); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 8f4f0bef6a7e..eee460fa5041 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -204,10 +204,10 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, // check, if we have to adjust the point if ( !Frm().IsInside( aPoint ) ) { - aPoint.X() = Max( aPoint.X(), Frm().Left() ); - aPoint.X() = Min( aPoint.X(), Frm().Right() ); - aPoint.Y() = Max( aPoint.Y(), Frm().Top() ); - aPoint.Y() = Min( aPoint.Y(), Frm().Bottom() ); + aPoint.X() = std::max( aPoint.X(), Frm().Left() ); + aPoint.X() = std::min( aPoint.X(), Frm().Right() ); + aPoint.Y() = std::max( aPoint.Y(), Frm().Top() ); + aPoint.Y() = std::min( aPoint.Y(), Frm().Bottom() ); } sal_Bool bTextRet, bBackRet = sal_False; @@ -1197,10 +1197,10 @@ sal_uLong CalcDiff( const Point &rPt1, const Point &rPt2 ) { //Jetzt die Entfernung zwischen den beiden Punkten berechnen. //'Delta' X^2 + 'Delta'Y^2 = 'Entfernung'^2 - sal_uInt32 dX = Max( rPt1.X(), rPt2.X() ) - - Min( rPt1.X(), rPt2.X() ), - dY = Max( rPt1.Y(), rPt2.Y() ) - - Min( rPt1.Y(), rPt2.Y() ); + sal_uInt32 dX = std::max( rPt1.X(), rPt2.X() ) - + std::min( rPt1.X(), rPt2.X() ), + dY = std::max( rPt1.Y(), rPt2.Y() ) - + std::min( rPt1.Y(), rPt2.Y() ); BigInt dX1( dX ), dY1( dY ); dX1 *= dX1; dY1 *= dY1; return ::SqRt( dX1 + dY1 ); diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 8c65279a6921..de45f50dad6e 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -1384,7 +1384,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst ) if ( nDiff > 0 ) { nChg = BROWSE_HEIGHT - pUp->Frm().Height(); - nChg = Min( nDiff, nChg ); + nChg = std::min( nDiff, nChg ); if ( !IsBodyFrm() ) { @@ -1396,7 +1396,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst ) const long nTmp = nChg - pBody->Prt().Height(); if ( !bTst ) { - pBody->Frm().Height(Max( 0L, pBody->Frm().Height() - nChg )); + pBody->Frm().Height(std::max( 0L, pBody->Frm().Height() - nChg )); pBody->_InvalidatePrt(); pBody->_InvalidateSize(); if ( pBody->GetNext() ) @@ -3136,7 +3136,7 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs ) pFrm = pFrm->GetNext(); } nRemaining += nBorder; - nRemaining = Max( nRemaining, nMinHeight ); + nRemaining = std::max( nRemaining, nMinHeight ); const SwTwips nDiff = nRemaining-(Frm().*fnRect->fnGetHeight)(); const long nOldLeft = (Frm().*fnRect->fnGetLeft)(); const long nOldTop = (Frm().*fnRect->fnGetTop)(); @@ -3267,7 +3267,7 @@ long SwLayoutFrm::CalcRel( const SwFmtFrmSize &rSz, sal_Bool ) const if ( nDiff > 0 ) nRel -= nDiff; } - nRel = Min( nRel, pRel->Prt().Width() ); + nRel = std::min( nRel, pRel->Prt().Width() ); nRet = nRel * nPercent / 100; } return nRet; @@ -3294,7 +3294,7 @@ static long lcl_CalcMinColDiff( SwLayoutFrm *pLayFrm ) if ( pCol == pLayFrm->Lower() ) nFirstDiff = nTmp; else - nDiff = nDiff ? Min( nDiff, nTmp ) : nTmp; + nDiff = nDiff ? std::min( nDiff, nTmp ) : nTmp; } } //Skip empty columns! @@ -3565,7 +3565,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs, nDiff = nMinDiff; // If we should grow more than by nMinDiff we split it over // the columns - if ( Abs(nDiff - nMinDiff) > nNumCols && nDiff > (long)nNumCols ) + if ( std::abs(nDiff - nMinDiff) > nNumCols && nDiff > (long)nNumCols ) nDiff /= nNumCols; if ( bMinDiff ) @@ -3576,7 +3576,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs, // nMinDiff afterwards. long nFrmHeight = (Frm().*fnRect->fnGetHeight)(); if ( nFrmHeight > nMinHeight || nPrtHeight >= nMinDiff ) - nDiff = Max( nDiff, nMinDiff ); + nDiff = std::max( nDiff, nMinDiff ); else if( nDiff < nMinDiff ) nDiff = nMinDiff - nPrtHeight + 1; } diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 0b54d93c9198..c0ef98a7e8cf 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -433,7 +433,7 @@ static void lcl_RefreshHidden( SwTabCols &rToFill, sal_uInt16 nPos ) { for ( sal_uInt16 i = 0; i < rToFill.Count(); ++i ) { - if ( Abs((long)(nPos - rToFill[i])) <= COLFUZZY ) + if ( std::abs((long)(nPos - rToFill[i])) <= COLFUZZY ) { rToFill.SetHidden( i, sal_False ); break; diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index 46a064e970b3..940c9406a4cf 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -209,8 +209,8 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, // nMaxY is an absolute value //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin SwTwips nMaxY = bVert ? - ( bVertL2R ? Min( nFrmMaxY, nUpperMaxY ) : Max( nFrmMaxY, nUpperMaxY ) ) : - Min( nFrmMaxY, nUpperMaxY ); + ( bVertL2R ? std::min( nFrmMaxY, nUpperMaxY ) : std::max( nFrmMaxY, nUpperMaxY ) ) : + std::min( nFrmMaxY, nUpperMaxY ); sal_Bool bRet = sal_False; @@ -384,8 +384,8 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const // nMaxY is in absolute value //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin SwTwips nMaxY = bVert ? - ( bVertL2R ? Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) : Max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) ) : - Min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ); + ( bVertL2R ? std::min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) : std::max( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ) ) : + std::min( (pFrm->*fnRect->fnGetPrtBottom)(), nUpperMaxY ); if ( pFrm->IsEmpty() || ! (pFrm->Prt().*fnRect->fnGetHeight)() ) { @@ -1283,7 +1283,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, { if( nFormat <= GetOfst() ) { - nFormat = Min( xub_StrLen( GetOfst() + MIN_OFFSET_STEP ), + nFormat = std::min( xub_StrLen( GetOfst() + MIN_OFFSET_STEP ), static_cast<xub_StrLen>(nTmpLen) ); if( nFormat <= GetOfst() ) break; @@ -1444,7 +1444,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const if( nLineHeight ) { const SvxULSpaceItem &rUL = pSet->GetULSpace(); - SwTwips nDist = Max( rUL.GetLower(), rUL.GetUpper() ); + SwTwips nDist = std::max( rUL.GetLower(), rUL.GetUpper() ); if( rFill.Fill().nColumnCnt ) { rFill.aFrm.Height( nLineHeight ); @@ -1455,7 +1455,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const nFirst = nFirst - (sal_uInt16)nDist; else nFirst = 0; - nDist = Max( nDist, long( GetLineSpace() ) ); + nDist = std::max( nDist, long( GetLineSpace() ) ); nDist += nLineHeight; nDiff -= nFirst; @@ -1681,8 +1681,8 @@ static sal_Char const sDoubleSpace[] = " "; rFill.SetSpace( nSpaceCnt ); if( bFill ) { - if( Abs( rFill.X() - nCenter ) <= - Abs( rFill.X() - rRect.Left() ) ) + if( std::abs( rFill.X() - nCenter ) <= + std::abs( rFill.X() - rRect.Left() ) ) { rFill.SetOrient( text::HoriOrientation::CENTER ); rFill.SetTab( 0 ); diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 1b1081651c05..4bd5c03da780 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -483,7 +483,7 @@ void SwTxtFrm::AdjustFrm( const SwTwips nChgHght, sal_Bool bHasToFit ) ( IsInSct() && !FindSctFrm()->MoveAllowed(this) ) ) { SetUndersized( sal_True ); - Shrink( Min( ( nFrmHeight - nRstHeight), nPrtHeight ) ); + Shrink( std::min( ( nFrmHeight - nRstHeight), nPrtHeight ) ); } else SetUndersized( sal_False ); @@ -1182,14 +1182,14 @@ sal_Bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const sal_Bool bPrev ) rLine.SetUnclipped( sal_False ); } } - SwTwips nRght = Max( nOldWidth, pNew->Width() + + SwTwips nRght = std::max( nOldWidth, pNew->Width() + pNew->GetHangingMargin() ); ViewShell *pSh = getRootFrm()->GetCurrShell(); const SwViewOption *pOpt = pSh ? pSh->GetViewOptions() : 0; if( pOpt && (pOpt->IsParagraph() || pOpt->IsLineBreak()) ) - nRght += ( Max( nOldAscent, pNew->GetAscent() ) ); + nRght += ( std::max( nOldAscent, pNew->GetAscent() ) ); else - nRght += ( Max( nOldAscent, pNew->GetAscent() ) / 4); + nRght += ( std::max( nOldAscent, pNew->GetAscent() ) / 4); nRght += rLine.GetLeftMargin(); if( rRepaint.GetOfst() || rRepaint.GetRightOfst() < nRght ) rRepaint.SetRightOfst( nRght ); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 489ef87d7caa..5adc1c5a1cda 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -197,7 +197,7 @@ void ChkOutDev( const SwTxtSizeInfo &rInf ) inline sal_Int32 GetMinLen( const SwTxtSizeInfo &rInf ) { const sal_Int32 nInfLen = rInf.GetIdx() + rInf.GetLen(); - return Min( rInf.GetTxt().getLength(), nInfLen ); + return std::min( rInf.GetTxt().getLength(), nInfLen ); } @@ -1263,7 +1263,7 @@ sal_Bool SwTxtFormatInfo::InitHyph( const sal_Bool bAutoHyphen ) nHyphStart = nHyphWrdStart = STRING_LEN; nHyphWrdLen = 0; - const sal_Int16 nMinimalLeading = Max(rAttr.GetMinLead(), sal_uInt8(2)); + const sal_Int16 nMinimalLeading = std::max(rAttr.GetMinLead(), sal_uInt8(2)); const sal_Int16 nMinimalTrailing = rAttr.GetMinTrail(); lcl_InitHyphValues( aHyphVals, nMinimalLeading, nMinimalTrailing); } diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index cd011028cf6f..d95ee5500f49 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -922,7 +922,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd if ( cChar == CH_BREAK ) { - nWidth = Max( nWidth, nProWidth ); + nWidth = std::max( nWidth, nProWidth ); nProWidth = 0; nIdx++; } @@ -973,7 +973,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd } // end of while } - nWidth = Max( nWidth, nProWidth ); + nWidth = std::max( nWidth, nProWidth ); // search for a text frame this node belongs to SwIterator<SwTxtFrm,SwTxtNode> aFrmIter( *this ); diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index e13bb5595bb3..b68b5ce3ea21 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -219,7 +219,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) else { nLeft = pFrm->Frm().Left() + - Max( long( rSpace.GetTxtLeft() + nLMWithNum ), + std::max( long( rSpace.GetTxtLeft() + nLMWithNum ), pFrm->Prt().Left() ); } } @@ -308,7 +308,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf ) else { nFirst = pFrm->Frm().Left() + - Max( rSpace.GetTxtLeft() + nLMWithNum+ nFirstLineOfs, + std::max( rSpace.GetTxtLeft() + nLMWithNum+ nFirstLineOfs, pFrm->Prt().Left() ); } diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index ff8332c71cb9..56dcbefea2f8 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -674,7 +674,7 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf ) ( nSumWidth - 1 ) / nGridWidth + 1 : 0; const SwTwips nTmpWidth = i * nGridWidth; - const SwTwips nKernWidth = Min( (SwTwips)(nTmpWidth - nSumWidth), + const SwTwips nKernWidth = std::min( (SwTwips)(nTmpWidth - nSumWidth), nRestWidth ); const sal_uInt16 nKernWidth_1 = (sal_uInt16)(nKernWidth / 2); @@ -916,15 +916,15 @@ SwTxtPortion *SwTxtFormatter::NewTxtPortion( SwTxtFormatInfo &rInf ) // until next attribute change: const sal_Int32 nNextAttr = GetNextAttr(); - sal_Int32 nNextChg = Min( nNextAttr, rInf.GetTxt().getLength() ); + sal_Int32 nNextChg = std::min( nNextAttr, rInf.GetTxt().getLength() ); // end of script type: const sal_Int32 nNextScript = pScriptInfo->NextScriptChg( rInf.GetIdx() ); - nNextChg = Min( nNextChg, nNextScript ); + nNextChg = std::min( nNextChg, nNextScript ); // end of direction: const sal_Int32 nNextDir = pScriptInfo->NextDirChg( rInf.GetIdx() ); - nNextChg = Min( nNextChg, nNextDir ); + nNextChg = std::min( nNextChg, nNextDir ); // Turbo boost: // We assume that a font's characters are not larger than twice @@ -943,13 +943,13 @@ SwTxtPortion *SwTxtFormatter::NewTxtPortion( SwTxtFormatInfo &rInf ) CalcAscent( rInf, pPor ); const SwFont* pTmpFnt = rInf.GetFont(); - sal_Int32 nExpect = Min( sal_Int32( ((Font *)pTmpFnt)->GetSize().Height() ), + sal_Int32 nExpect = std::min( sal_Int32( ((Font *)pTmpFnt)->GetSize().Height() ), sal_Int32( pPor->GetAscent() ) ) / 8; if ( !nExpect ) nExpect = 1; nExpect = rInf.GetIdx() + ((rInf.Width() - rInf.X()) / nExpect); if( nExpect > rInf.GetIdx() && nNextChg > nExpect ) - nNextChg = Min( nExpect, rInf.GetTxt().getLength() ); + nNextChg = std::min( nExpect, rInf.GetTxt().getLength() ); // we keep an invariant during method calls: // there are no portion ending characters like hard spaces @@ -2524,7 +2524,7 @@ SwFlyCntPortion *SwTxtFormatter::NewFlyCntPortion( SwTxtFormatInfo &rInf, pFly->GetRefPoint().Y() ); if ( bUseFlyAscent ) - nAscent = static_cast<sal_uInt16>( Abs( int( bTxtFrmVertical ? + nAscent = static_cast<sal_uInt16>( std::abs( int( bTxtFrmVertical ? pFly->GetRelPos().X() : pFly->GetRelPos().Y() ) ) ); @@ -2601,7 +2601,7 @@ namespace { // something of our text has moved to the next line return 0; - xub_StrLen nReformat = Min( txtFmtInfo.GetReformatStart(), nOldLineEnd ); + xub_StrLen nReformat = std::min( txtFmtInfo.GetReformatStart(), nOldLineEnd ); // in case we do not have any fly in our line, our repaint position // is the changed position - 1 @@ -2662,7 +2662,7 @@ namespace { rThis.GetCharRect( &aRect, nReformat ); txtFmtInfo.SetMulti( bOldMulti ); - return nFormatRepaint ? Min( aRect.Left(), nFormatRepaint ) : + return nFormatRepaint ? std::min( aRect.Left(), nFormatRepaint ) : aRect.Left(); } else diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index f8cd59f64109..185979f05c46 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -179,7 +179,7 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip, SwLinePortion *pPor = bEndPor ? pCurr->GetFirstPortion() : CalcPaintOfst( rPaint ); // Optimierung! - const SwTwips nMaxRight = Min( rPaint.Right(), Right() ); + const SwTwips nMaxRight = std::min( rPaint.Right(), Right() ); const SwTwips nTmpLeft = GetInfo().X(); if( !bEndPor && nTmpLeft >= nMaxRight ) return; diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 496b07b5ed86..37c3ce031da4 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -242,7 +242,7 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf ) ubidi_getLogicalRun( pBidi, 0, &nEnd, &nCurrDir ); ubidi_close( pBidi ); const xub_StrLen nNextDirChg = (xub_StrLen)nEnd; - nNextScriptChg = Min( nNextScriptChg, nNextDirChg ); + nNextScriptChg = std::min( nNextScriptChg, nNextDirChg ); // #i89825# change the script type also to CTL // if there is no strong LTR char in the LTR run (numbers) @@ -927,7 +927,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const return; } Point aPos( rInf.X() + GRFNUM_SECURE, rInf.Y() - GetRelPos() + GRFNUM_SECURE ); - long nTmpWidth = Max( (long)0, (long)(nFixWidth - 2 * GRFNUM_SECURE) ); + long nTmpWidth = std::max( (long)0, (long)(nFixWidth - 2 * GRFNUM_SECURE) ); Size aSize( nTmpWidth, GetGrfHeight() - 2 * GRFNUM_SECURE ); const bool bTmpLeft = mbLabelAlignmentPosAndSpaceModeActive || diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx index bc20492975f9..d6d481fa934f 100644 --- a/sw/source/core/text/porglue.cxx +++ b/sw/source/core/text/porglue.cxx @@ -132,7 +132,7 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const void SwGluePortion::MoveGlue( SwGluePortion *pTarget, const short nPrtGlue ) { - short nPrt = Min( nPrtGlue, GetPrtGlue() ); + short nPrt = std::min( nPrtGlue, GetPrtGlue() ); if( 0 < nPrt ) { pTarget->AddPrtWidth( nPrt ); diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 3cd2b6bc054c..b820b8bbb3eb 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -577,14 +577,14 @@ void SwLineLayout::MaxAscentDescent( SwTwips& _orAscent, if ( bFlyCmp ) { - _orObjAscent = Max( _orObjAscent, nPortionAsc ); - _orObjDescent = Max( _orObjDescent, nPortionDesc ); + _orObjAscent = std::max( _orObjAscent, nPortionAsc ); + _orObjDescent = std::max( _orObjDescent, nPortionDesc ); } if ( !pTmpPortion->IsFlyCntPortion() && !pTmpPortion->IsGrfNumPortion() ) { - _orAscent = Max( _orAscent, nPortionAsc ); - _orDescent = Max( _orDescent, nPortionDesc ); + _orAscent = std::max( _orAscent, nPortionAsc ); + _orDescent = std::max( _orDescent, nPortionDesc ); } } pTmpPortion = pTmpPortion->GetPortion(); @@ -883,7 +883,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) else break; } - nChg = Min( nChg, nNextCTLScriptStart ); + nChg = std::min( nChg, nNextCTLScriptStart ); } // special case for dotted circle since it can be used with complex diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index f8c41ba641b7..e5e3901d4b44 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -613,7 +613,7 @@ SwDropPortion *SwTxtFormatter::NewDropPortion( SwTxtFormatInfo &rInf ) // find next attribute change / script change const xub_StrLen nTmpIdx = nNextChg; - sal_Int32 nNextAttr = Min( static_cast<sal_Int32>(GetNextAttr()), rInf.GetTxt().getLength() ); + sal_Int32 nNextAttr = std::min( static_cast<sal_Int32>(GetNextAttr()), rInf.GetTxt().getLength() ); nNextChg = pScriptInfo->NextScriptChg( nTmpIdx ); if( nNextChg > nNextAttr ) nNextChg = nNextAttr; diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 3735e52dead9..54635d759442 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -294,7 +294,7 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt, // fnGetBottom is top + height long nTmpBottom = (rLine.*fnRect->fnGetBottom)(); - Range aRange( Min( nTmpTop, nTmpBottom ), Max( nTmpTop, nTmpBottom ) ); + Range aRange( std::min( nTmpTop, nTmpBottom ), std::max( nTmpTop, nTmpBottom ) ); LongDqPtr pTmp = pTextRanger[ 0 ]->GetTextRanges( aRange ); @@ -972,8 +972,8 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList() pAnchoredObj->GetFrmFmt().GetVertOrient(); if( text::VertOrientation::BOTTOM != rTmpFmt.GetVertOrient() ) nMinBottom = ( bVert && nMinBottom ) ? - Min( nMinBottom, aBound.Left() ) : - Max( nMinBottom, (aBound.*fnRect->fnGetBottom)() ); + std::min( nMinBottom, aBound.Left() ) : + std::max( nMinBottom, (aBound.*fnRect->fnGetBottom)() ); } bOn = sal_True; @@ -1020,7 +1020,7 @@ SwTwips SwTxtFly::CalcMinBottom() const { const SwRect aBound( pAnchoredObj->GetObjRectWithSpaces() ); if( aBound.Top() < nEndOfFrm ) - nRet = Max( nRet, aBound.Bottom() ); + nRet = std::max( nRet, aBound.Bottom() ); } } } diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index e3cb0c05a4c1..3a033366ae65 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -649,7 +649,7 @@ xub_StrLen SwTxtFrm::FindBrk( const XubString &rTxt, { // #i104291# - applying patch to avoid overflow. unsigned long nFound = nStart; - const xub_StrLen nEndLine = Min( nEnd, rTxt.Len() ); + const xub_StrLen nEndLine = std::min( nEnd, rTxt.Len() ); // Wir ueberlesen erst alle Blanks am Anfang der Zeile (vgl. Bug 2235). while( nFound <= nEndLine && @@ -1883,7 +1883,7 @@ SwTestFormat::SwTestFormat( SwTxtFrm* pTxtFrm, const SwFrm* pPre, SwTwips nMaxHe (pFrm->Prt().*fnRect->fnSetPosY)( nUpper ); } (pFrm->Prt().*fnRect->fnSetHeight)( - Max( 0L , (pFrm->Frm().*fnRect->fnGetHeight)() - + std::max( 0L , (pFrm->Frm().*fnRect->fnGetHeight)() - (pFrm->Prt().*fnRect->fnGetTop)() - nLower ) ); (pFrm->Prt().*fnRect->fnSetWidth)( (pFrm->Frm().*fnRect->fnGetWidth)() - @@ -2154,7 +2154,7 @@ SwTwips SwTxtFrm::CalcFitToContent() SwHookOut aHook( aInf ); // #i54031# - assure mininum of MINLAY twips. - const SwTwips nMax = Max( (SwTwips)MINLAY, + const SwTwips nMax = std::max( (SwTwips)MINLAY, aLine._CalcFitToContent() + 1 ); Frm().Width( nOldFrmWidth ); @@ -2518,7 +2518,7 @@ void SwTxtFrm::ChgThisLines() if ( HasPara() ) { SwRepaint *pRepaint = GetPara()->GetRepaint(); - pRepaint->Bottom( Max( pRepaint->Bottom(), + pRepaint->Bottom( std::max( pRepaint->Bottom(), Frm().Top()+Prt().Bottom())); } } diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 9d4a338f12dc..7293b43fa6af 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -268,9 +268,9 @@ static SwTwips lcl_GetFtnLower( const SwTxtFrm* pFrm, SwTwips nLower ) } if ( bVert ) - nRet = Min( nRet, nFlyLower ); + nRet = std::min( nRet, nFlyLower ); else - nRet = Max( nRet, nFlyLower ); + nRet = std::max( nRet, nFlyLower ); return nRet; } diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 4db00623b187..09cecb0dd77f 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -489,7 +489,7 @@ sal_Bool SwTabPortion::PostFormat( SwTxtFormatInfo &rInf ) const bool bTabOverMargin = rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_OVER_MARGIN); // If the tab position is larger than the right margin, it gets scaled down by default. // However, if compat mode enabled, we allow tabs to go over the margin: the rest of the paragraph is not broken into lines. - const KSHORT nRight = bTabOverMargin ? GetTabPos() : Min(GetTabPos(), rInf.Width()); + const KSHORT nRight = bTabOverMargin ? GetTabPos() : std::min(GetTabPos(), rInf.Width()); const SwLinePortion *pPor = GetPortion(); KSHORT nPorWidth = 0; diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index c5ed121de5be..ee84a791d81c 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -519,7 +519,7 @@ sal_Bool WidowsAndOrphans::WouldFit( SwTxtMargin &rLine, SwTwips &rMaxHeight, sa MSHORT nLineCnt = rLine.GetLineNr(); // First satisfy the Orphans-rule and the wish for initials ... - const MSHORT nMinLines = Max( GetOrphansLines(), rLine.GetDropLines() ); + const MSHORT nMinLines = std::max( GetOrphansLines(), rLine.GetDropLines() ); if ( nLineCnt < nMinLines ) return sal_False; diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 612d7d011709..83981599c0df 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -551,7 +551,7 @@ void SwFntObj::GuessLeading( const ViewShell& // Those who lie about their Leading, may lie about their // Ascent/Descent as well, hence the Font will be lowered a // litte without changing its height. - long nDiff = Min( rMet.GetDescent() - aWinMet.GetDescent(), + long nDiff = std::min( rMet.GetDescent() - aWinMet.GetDescent(), aWinMet.GetAscent() - rMet.GetAscent() - nTmpLeading ); if( nDiff > 0 ) { @@ -1539,7 +1539,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) nCnt = 0; else nCnt = nCnt - rInf.GetIdx(); - nCnt = Min( nCnt, rInf.GetLen() ); + nCnt = std::min( nCnt, rInf.GetLen() ); long nKernSum = rInf.GetKern(); sal_Unicode cChPrev = rInf.GetText()[ rInf.GetIdx() ]; @@ -1902,7 +1902,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) nCnt=0; else nCnt = nCnt - rInf.GetIdx(); - nCnt = Min (nCnt, nLn); + nCnt = std::min (nCnt, nLn); sal_Unicode nChPrev = rInf.GetText()[ rInf.GetIdx() ]; sal_Unicode nCh; diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index 58512953a093..e2b48e44b716 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -559,7 +559,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) Size aPartSize; long nKana = 0; const XubString aTxt( CalcCaseMap( rDo.GetInf().GetText() ) ); - xub_StrLen nMaxPos = Min( sal_uInt16(rDo.GetInf().GetText().getLength() - rDo.GetInf().GetIdx()), + xub_StrLen nMaxPos = std::min( sal_uInt16(rDo.GetInf().GetText().getLength() - rDo.GetInf().GetIdx()), rDo.GetInf().GetLen() ); rDo.GetInf().SetLen( nMaxPos ); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 248255a863ef..a02f8b3b04d1 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2307,8 +2307,8 @@ void SwTxtNode::GCAttr() && ( bAll || pHt->Which() == RES_TXTATR_INETFMT ) ) { bChanged = true; - nMin = Min( nMin, *pHt->GetStart() ); - nMax = Max( nMax, *pHt->GetEnd() ); + nMin = std::min( nMin, *pHt->GetStart() ); + nMax = std::max( nMax, *pHt->GetEnd() ); DestroyAttr( m_pSwpHints->Cut(i) ); --i; } diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 52db6ad3732c..02b5addfe2b5 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -189,7 +189,7 @@ sal_uInt16 SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent ) const const long nAscent = nOldAscent + ( (long) nOrgHeight * GetEscapement() ) / 100L; if ( nAscent>0 ) - return ( Max( sal_uInt16 (nAscent), nOrgAscent )); + return ( std::max( sal_uInt16 (nAscent), nOrgAscent )); } return nOrgAscent; } @@ -672,7 +672,7 @@ sal_uInt16 SwSubFont::CalcEscHeight( const sal_uInt16 nOldHeight, { long nDescent = nOldHeight - nOldAscent - ( (long) nOrgHeight * GetEscapement() ) / 100L; - const sal_uInt16 nDesc = ( nDescent>0 ) ? Max ( sal_uInt16(nDescent), + const sal_uInt16 nDesc = ( nDescent>0 ) ? std::max ( sal_uInt16(nDescent), sal_uInt16(nOrgHeight - nOrgAscent) ) : nOrgHeight - nOrgAscent; return ( nDesc + CalcEscAscent( nOldAscent ) ); } diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index a493996f9dce..3ae2f43408be 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -799,7 +799,7 @@ sal_Bool SwScanner::NextWord() // #i89042, as discussed with HDU: don't evaluate script changes for word count. Use whole word. if ( nWordType == i18n::WordType::WORD_COUNT ) { - nBegin = Max(aBound.startPos, nBegin); + nBegin = std::max(aBound.startPos, nBegin); nLen = 0; if (aBound.endPos > nBegin) nLen = aBound.endPos - nBegin; @@ -816,7 +816,7 @@ sal_Bool SwScanner::NextWord() OUString aTmpWord = aText.copy( nBegin, aBound.endPos - nBegin ); const sal_Int32 nScriptEnd = nBegin + g_pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript ); - const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd ); + const sal_Int32 nEnd = std::min( aBound.endPos, nScriptEnd ); // restrict word start to last script change position sal_Int32 nScriptBegin = 0; @@ -830,7 +830,7 @@ sal_Bool SwScanner::NextWord() nCurrScript ); } - nBegin = Max( aBound.startPos, nScriptBegin ); + nBegin = std::max( aBound.startPos, nScriptBegin ); nLen = nEnd - nBegin; } else @@ -840,7 +840,7 @@ sal_Bool SwScanner::NextWord() aBound.endPos - aBound.startPos ); const sal_Int32 nScriptEnd = aBound.startPos + g_pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript ); - const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd ); + const sal_Int32 nEnd = std::min( aBound.endPos, nScriptEnd ); nBegin = aBound.startPos; nLen = nEnd - nBegin; } @@ -849,8 +849,8 @@ sal_Bool SwScanner::NextWord() // optionally clip the result of getWordBoundaries: if ( bClip ) { - aBound.startPos = Max( aBound.startPos, nStartPos ); - aBound.endPos = Min( aBound.endPos, nEndPos ); + aBound.startPos = std::max( aBound.startPos, nStartPos ); + aBound.endPos = std::min( aBound.endPos, nEndPos ); nBegin = aBound.startPos; nLen = aBound.endPos - nBegin; } @@ -1388,14 +1388,14 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/ if ( pSmartTagList->GetBeginInv() != STRING_LEN ) { nBegin = pSmartTagList->GetBeginInv(); - nEnd = Min( pSmartTagList->GetEndInv(), (xub_StrLen)rText.getLength() ); + nEnd = std::min( pSmartTagList->GetEndInv(), (xub_StrLen)rText.getLength() ); if ( nBegin < nEnd ) { const LanguageType aCurrLang = pNode->GetLang( nBegin ); const com::sun::star::lang::Locale aCurrLocale = g_pBreakIt->GetLocale( aCurrLang ); nBegin = static_cast< xub_StrLen >(g_pBreakIt->GetBreakIter()->beginOfSentence( rText, nBegin, aCurrLocale )); - nEnd = static_cast< xub_StrLen >(Min( rText.getLength(), g_pBreakIt->GetBreakIter()->endOfSentence( rText, nEnd, aCurrLocale ) )); + nEnd = static_cast< xub_StrLen >(std::min( rText.getLength(), g_pBreakIt->GetBreakIter()->endOfSentence( rText, nEnd, aCurrLocale ) )); } } } @@ -1436,7 +1436,7 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/ { const LanguageType nLang = aIter.GetLanguage(); const com::sun::star::lang::Locale aLocale = g_pBreakIt->GetLocale( nLang ); - nLangEnd = Min( nEnd, aIter.GetChgPos() ); + nLangEnd = std::min( nEnd, aIter.GetChgPos() ); const sal_uInt32 nExpandBegin = aConversionMap.ConvertToViewPosition( nLangBegin ); const sal_uInt32 nExpandEnd = aConversionMap.ConvertToViewPosition( nLangEnd ); diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 395f05af840d..54a3c1aeb2fc 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -2114,7 +2114,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, aMark.SetAlternativeText(lcl_AnyToString(rValue)); break; case WID_LEVEL: - aMark.SetLevel(Min( static_cast<sal_Int8>( MAXLEVEL ), + aMark.SetLevel(std::min( static_cast<sal_Int8>( MAXLEVEL ), static_cast<sal_Int8>(lcl_AnyToInt16(rValue)+1))); break; case WID_PRIMARY_KEY : diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index e0c09aad697c..49fc1a3b6ee1 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -528,8 +528,8 @@ void sw_NormalizeRange( sw_GetCellPosition( rCell2, nCol2, nRow2 ); if (nCol2 < nCol1 || nRow2 < nRow1) { - rCell1 = sw_GetCellName( Min(nCol1, nCol2), Min(nRow1, nRow2) ); - rCell2 = sw_GetCellName( Max(nCol1, nCol2), Max(nRow1, nRow2) ); + rCell1 = sw_GetCellName( std::min(nCol1, nCol2), std::min(nRow1, nRow2) ); + rCell2 = sw_GetCellName( std::max(nCol1, nCol2), std::max(nRow1, nRow2) ); } } diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index 06cf8fe326d2..dab357dd5782 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -546,17 +546,17 @@ void SwPagePreviewLayout::_CalcDocPrevwPaintRect() Size aSize; if ( mbDoesLayoutColsFitIntoWindow ) //aSize.Width() = mnPrevwLayoutWidth; - aSize.Width() = Min( mnPrevwLayoutWidth, + aSize.Width() = std::min( mnPrevwLayoutWidth, maPreviewDocRect.GetWidth() - aTopLeftPos.X() ); else - aSize.Width() = Min( maPreviewDocRect.GetWidth() - aTopLeftPos.X(), + aSize.Width() = std::min( maPreviewDocRect.GetWidth() - aTopLeftPos.X(), maWinSize.Width() - maAdditionalPaintOffset.X() ); if ( mbDoesLayoutRowsFitIntoWindow ) //aSize.Height() = mnPrevwLayoutHeight; - aSize.Height() = Min( mnPrevwLayoutHeight, + aSize.Height() = std::min( mnPrevwLayoutHeight, maPreviewDocRect.GetHeight() - aTopLeftPos.Y() ); else - aSize.Height() = Min( maPreviewDocRect.GetHeight() - aTopLeftPos.Y(), + aSize.Height() = std::min( maPreviewDocRect.GetHeight() - aTopLeftPos.Y(), maWinSize.Height() - maAdditionalPaintOffset.Y() ); maPaintedPrevwDocRect.SetSize( aSize ); } @@ -821,7 +821,7 @@ Point SwPagePreviewLayout::GetPreviewStartPosForNewScale( // check, if new y-position is outside document preview if ( aNewPaintStartPos.Y() > maPreviewDocRect.Bottom() ) aNewPaintStartPos.Y() = - Max( 0L, maPreviewDocRect.Bottom() - mnPrevwLayoutHeight ); + std::max( 0L, maPreviewDocRect.Bottom() - mnPrevwLayoutHeight ); } } diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index e22ec0f07cb1..8acd58107c4e 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -68,8 +68,8 @@ void SwViewImp::Init( const SwViewOption *pNewOpt ) const Size &rSz = pNewOpt->GetSnapSize(); pDrawView->SetGridCoarse( rSz ); const Size aFSize - ( rSz.Width() ? rSz.Width() /Max(short(1),pNewOpt->GetDivisionX()):0, - rSz.Height()? rSz.Height()/Max(short(1),pNewOpt->GetDivisionY()):0); + ( rSz.Width() ? rSz.Width() /std::max(short(1),pNewOpt->GetDivisionX()):0, + rSz.Height()? rSz.Height()/std::max(short(1),pNewOpt->GetDivisionY()):0); pDrawView->SetGridFine( aFSize ); Fraction aSnGrWdtX(rSz.Width(), pNewOpt->GetDivisionX() + 1); Fraction aSnGrWdtY(rSz.Height(), pNewOpt->GetDivisionY() + 1); diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx index 6b2362ba11d7..12bf9ba42fca 100644 --- a/sw/source/core/view/viewpg.cxx +++ b/sw/source/core/view/viewpg.cxx @@ -176,7 +176,7 @@ void ViewShell::PrintProspect( else { nMaxColSz = aNxtPageSize.Width() + aSttPageSize.Width(); - nMaxRowSz = Max( aNxtPageSize.Height(), aSttPageSize.Height() ); + nMaxRowSz = std::max( aNxtPageSize.Height(), aSttPageSize.Height() ); } // den MapMode einstellen diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index e1917983a093..9786ba67ff8e 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -299,9 +299,9 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd ) aTmp1 = GetOut()->LogicToPixel( aTmp1 ); Rectangle aTmp2( GetOut()->PixelToLogic( aTmp1 ) ); if ( aTmp2.Left() > aRect.Left() ) - aTmp1.Left() = Max( 0L, aTmp1.Left() - 1L ); + aTmp1.Left() = std::max( 0L, aTmp1.Left() - 1L ); if ( aTmp2.Top() > aRect.Top() ) - aTmp1.Top() = Max( 0L, aTmp1.Top() - 1L ); + aTmp1.Top() = std::max( 0L, aTmp1.Top() - 1L ); aTmp1.Right() += 1; aTmp1.Bottom() += 1; aTmp1 = GetOut()->PixelToLogic( aTmp1 ); @@ -1121,7 +1121,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect) { const Rectangle &rBound = pObj->GetObjRect().SVRect(); // OD 03.03.2003 #107927# - use correct datatype - const SwTwips nL = Max( 0L, rBound.Left() - nOfst ); + const SwTwips nL = std::max( 0L, rBound.Left() - nOfst ); if ( nL < nMinLeft ) nMinLeft = nL; if( rBound.Right() + nOfst > nMaxRight ) @@ -1215,7 +1215,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe } // #i75172# isolated static conditions - const bool bOnlyYScroll(!lXDiff && Abs(lYDiff) != 0 && Abs(lYDiff) < lMax); + const bool bOnlyYScroll(!lXDiff && std::abs(lYDiff) != 0 && std::abs(lYDiff) < lMax); const bool bAllowedWithChildWindows(GetWin()->GetWindowClipRegionPixel(WINDOW_GETCLIPREGION_NOCHILDREN|WINDOW_GETCLIPREGION_NULL).IsNull()); const bool bSmoothScrollAllowed(bOnlyYScroll && mbEnableSmooth && GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows); @@ -1232,9 +1232,9 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe pVout->SetFillColor( GetWin()->GetFillColor() ); MapMode aMapMode( GetWin()->GetMapMode() ); pVout->SetMapMode( aMapMode ); - Size aSize( maVisArea.Width()+2*aPixSz.Width(), Abs(lYDiff)+(2*aPixSz.Height()) ); + Size aSize( maVisArea.Width()+2*aPixSz.Width(), std::abs(lYDiff)+(2*aPixSz.Height()) ); if ( pRect ) - aSize.Width() = Min(aSize.Width(), pRect->GetWidth()+2*aPixSz.Width()); + aSize.Width() = std::min(aSize.Width(), pRect->GetWidth()+2*aPixSz.Width()); if ( pVout->SetOutputSize( aSize ) ) { mnLockPaint++; @@ -1244,14 +1244,14 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe aRect.Height( aSize.Height() ); if ( pRect ) { - aRect.Pos().X() = Max(aRect.Left(),pRect->Left()-aPixSz.Width()); - aRect.Right( Min(aRect.Right()+2*aPixSz.Width(), pRect->Right()+aPixSz.Width())); + aRect.Pos().X() = std::max(aRect.Left(),pRect->Left()-aPixSz.Width()); + aRect.Right( std::min(aRect.Right()+2*aPixSz.Width(), pRect->Right()+aPixSz.Width())); } else aRect.SSize().Width() += 2*aPixSz.Width(); aRect.Pos().Y() = lYDiff < 0 ? aOldVis.Bottom() - aPixSz.Height() : aRect.Top() - aSize.Height() + aPixSz.Height(); - aRect.Pos().X() = Max( 0L, aRect.Left()-aPixSz.Width() ); + aRect.Pos().X() = std::max( 0L, aRect.Left()-aPixSz.Width() ); aRect.Pos() = GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.Pos())); aRect.SSize()= GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.SSize())); maVisArea = aRect; @@ -1303,7 +1303,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe // as option? // ?????????????????????? long lMaDelta = aPixSz.Height(); - if ( Abs(lYDiff) > ( maVisArea.Height() / 3 ) ) + if ( std::abs(lYDiff) > ( maVisArea.Height() / 3 ) ) lMaDelta *= 6; else lMaDelta *= 2; @@ -1317,7 +1317,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRe while ( lDiff ) { long lScroll; - if ( Imp()->bStopSmooth || Abs(lDiff) <= Abs(lMaDelta) ) + if ( Imp()->bStopSmooth || std::abs(lDiff) <= std::abs(lMaDelta) ) { lScroll = lDiff; lDiff = 0; @@ -2349,7 +2349,7 @@ sal_Int32 ViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwR // #i40059# Position out of bounds: SwRect aRect( rRect ); - aRect.Pos().X() = Max( aRect.Left(), GetLayout()->Frm().Left() ); + aRect.Pos().X() = std::max( aRect.Left(), GetLayout()->Frm().Left() ); const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aRect.Center() ); if ( pPage ) diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 05c1f84ac398..80b46e2eed00 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -1805,8 +1805,8 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc, // Seiten-Dialog war und ihn mit OK verlassen hat, bekommt man eine // neue Seitengroesse, die dann hier exportiert wuerde. Um das // vermeiden erlauben wir hier kleine Abweichungen. - if( Abs( rSz.Width() - aRefSz.Width() ) <= 2 && - Abs( rSz.Height() - aRefSz.Height() ) <= 2 ) + if( std::abs( rSz.Width() - aRefSz.Width() ) <= 2 && + std::abs( rSz.Height() - aRefSz.Height() ) <= 2 ) { if( bRefLandscape != rPageDesc.GetLandscape() ) { diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 88d3ed530530..e27f56954617 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1730,8 +1730,8 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj, aShadow.SetColor( Color( aShdColor ) ); - aShadow.SetWidth(writer_cast<sal_uInt16>((Abs( nShdDistX) + - Abs( nShdDistY )) / 2 )); + aShadow.SetWidth(writer_cast<sal_uInt16>((std::abs( nShdDistX) + + std::abs( nShdDistY )) / 2 )); SvxShadowLocation eShdPosi; if( 0 <= nShdDistX ) diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 643f334e1838..7b6b6490713c 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -634,7 +634,7 @@ static void SetBaseAnlv(SwNumFmt &rNum, WW8_ANLV &rAV, sal_uInt8 nSwLevel ) rNum.SetNumAdjust( eAdjA[SVBT8ToByte( rAV.aBits1 ) & 0x3] ); rNum.SetCharTextDistance( SVBT16ToShort( rAV.dxaSpace ) ); - sal_Int16 nIndent = Abs((sal_Int16)SVBT16ToShort( rAV.dxaIndent )); + sal_Int16 nIndent = std::abs((sal_Int16)SVBT16ToShort( rAV.dxaIndent )); if( SVBT8ToByte( rAV.aBits1 ) & 0x08 ) //fHang { rNum.SetFirstLineOffset( -nIndent ); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index e1ae0f6947df..39e865f7d096 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -555,7 +555,7 @@ void wwSectionManager::GetPageULData(const wwSection &rSection, rData.nSwHLo = sal::static_int_cast< sal_uInt32 >(cMinHdFtHeight); } else // kein Header -> Up einfach uebernehmen - rData.nSwUp = Abs(nWWUp); + rData.nSwUp = std::abs(nWWUp); rData.bHasFooter = (rSection.maSep.grpfIhdt & (WW8_FOOTER_EVEN | WW8_FOOTER_ODD | WW8_FOOTER_FIRST)) != 0; @@ -576,7 +576,7 @@ void wwSectionManager::GetPageULData(const wwSection &rSection, rData.nSwFUp = sal::static_int_cast< sal_uInt32 >(cMinHdFtHeight); } else // kein Footer -> Lo einfach uebernehmen - rData.nSwLo = Abs(nWWLo); + rData.nSwLo = std::abs(nWWLo); } void wwSectionManager::SetPageULSpaceItems(SwFrmFmt &rFmt, @@ -600,7 +600,7 @@ void wwSectionManager::SetPageULSpaceItems(SwFrmFmt &rFmt, else { // #i48832# - set correct spacing between header and body. - const SwTwips nHdLowerSpace( Abs(rSection.maSep.dyaTop) - rData.nSwUp - rData.nSwHLo ); + const SwTwips nHdLowerSpace( std::abs(rSection.maSep.dyaTop) - rData.nSwUp - rData.nSwHLo ); pHdFmt->SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE, 0, rData.nSwHLo + nHdLowerSpace)); aHdUL.SetLower( static_cast< sal_uInt16 >(nHdLowerSpace) ); pHdFmt->SetFmtAttr(SwHeaderAndFooterEatSpacingItem( @@ -627,7 +627,7 @@ void wwSectionManager::SetPageULSpaceItems(SwFrmFmt &rFmt, else { // #i48832# - set correct spacing between footer and body. - const SwTwips nFtUpperSpace( Abs(rSection.maSep.dyaBottom) - rData.nSwLo - rData.nSwFUp ); + const SwTwips nFtUpperSpace( std::abs(rSection.maSep.dyaBottom) - rData.nSwLo - rData.nSwFUp ); pFtFmt->SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE, 0, rData.nSwFUp + nFtUpperSpace)); aFtUL.SetUpper( static_cast< sal_uInt16 >(nFtUpperSpace) ); pFtFmt->SetFmtAttr(SwHeaderAndFooterEatSpacingItem( diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx index d0f64ab5dc0d..af2bda429438 100644 --- a/sw/source/ui/app/appenv.cxx +++ b/sw/source/ui/app/appenv.cxx @@ -346,19 +346,19 @@ void SwModule::InsertEnv( SfxRequest& rReq ) long lLeft = rItem.lShiftRight, lUpper = rItem.lShiftDown; - sal_uInt16 nPageW = (sal_uInt16) Max(rItem.lWidth, rItem.lHeight), - nPageH = (sal_uInt16) Min(rItem.lWidth, rItem.lHeight); + sal_uInt16 nPageW = (sal_uInt16) std::max(rItem.lWidth, rItem.lHeight), + nPageH = (sal_uInt16) std::min(rItem.lWidth, rItem.lHeight); switch (rItem.eAlign) { case ENV_HOR_LEFT: break; - case ENV_HOR_CNTR: lLeft += Max(0L, long(aPaperSize.Width() - nPageW)) / 2; + case ENV_HOR_CNTR: lLeft += std::max(0L, long(aPaperSize.Width() - nPageW)) / 2; break; - case ENV_HOR_RGHT: lLeft += Max(0L, long(aPaperSize.Width() - nPageW)); + case ENV_HOR_RGHT: lLeft += std::max(0L, long(aPaperSize.Width() - nPageW)); break; - case ENV_VER_LEFT: lUpper += Max(0L, long(aPaperSize.Width() - nPageH)); + case ENV_VER_LEFT: lUpper += std::max(0L, long(aPaperSize.Width() - nPageH)); break; - case ENV_VER_CNTR: lUpper += Max(0L, long(aPaperSize.Width() - nPageH)) / 2; + case ENV_VER_CNTR: lUpper += std::max(0L, long(aPaperSize.Width() - nPageH)) / 2; break; case ENV_VER_RGHT: break; } diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 0c7c0402252e..a2fc397e4026 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -740,7 +740,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit ) else if (pEdit == &aTextEdit) // set quantity if applicable { sal_Int32 nTmp = aTextEdit.GetText().getLength(); - aDropCapsField.SetValue(Max((sal_uInt16)1, (sal_uInt16)nTmp)); + aDropCapsField.SetValue(std::max((sal_uInt16)1, (sal_uInt16)nTmp)); sPreview = aTextEdit.GetText().copy(0, nTmp); } diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 39a946fa3cbc..e9bab71243e0 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -289,8 +289,8 @@ struct QuickHelpData inline bool IsMinMove(const Point &rStartPos, const Point &rLPt) { - return Abs(rStartPos.X() - rLPt.X()) > MIN_MOVE || - Abs(rStartPos.Y() - rLPt.Y()) > MIN_MOVE; + return std::abs(rStartPos.X() - rLPt.X()) > MIN_MOVE || + std::abs(rStartPos.Y() - rLPt.Y()) > MIN_MOVE; } /** @@ -634,10 +634,10 @@ void SwEditWin::JustifyAreaTimer() const long coMinLen = 50; #endif long nTimeout = 800, - nDiff = Max( - Max( m_aMovePos.Y() - rVisArea.Bottom(), rVisArea.Top() - m_aMovePos.Y() ), - Max( m_aMovePos.X() - rVisArea.Right(), rVisArea.Left() - m_aMovePos.X())); - m_aTimer.SetTimeout( Max( coMinLen, nTimeout - nDiff*2L) ); + nDiff = std::max( + std::max( m_aMovePos.Y() - rVisArea.Bottom(), rVisArea.Top() - m_aMovePos.Y() ), + std::max( m_aMovePos.X() - rVisArea.Right(), rVisArea.Left() - m_aMovePos.X())); + m_aTimer.SetTimeout( std::max( coMinLen, nTimeout - nDiff*2L) ); } void SwEditWin::LeaveArea(const Point &rPos) @@ -1011,10 +1011,10 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb ) aSnap = rSh.GetViewOptions()->GetSnapSize(); short nDiv = rSh.GetViewOptions()->GetDivisionX(); if ( nDiv > 0 ) - aSnap.Width() = Max( (sal_uLong)1, (sal_uLong)aSnap.Width() / nDiv ); + aSnap.Width() = std::max( (sal_uLong)1, (sal_uLong)aSnap.Width() / nDiv ); nDiv = rSh.GetViewOptions()->GetDivisionY(); if ( nDiv > 0 ) - aSnap.Height() = Max( (sal_uLong)1, (sal_uLong)aSnap.Height() / nDiv ); + aSnap.Height() = std::max( (sal_uLong)1, (sal_uLong)aSnap.Height() / nDiv ); } SwRect aBoundRect; @@ -1031,10 +1031,10 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb ) pToCharCntntPos, bFollowTextFlow, false, &aRefPoint ); } - long nLeft = Min( aTmp.Left() - aBoundRect.Left(), aSnap.Width() ); - long nRight = Min( aBoundRect.Right() - aTmp.Right(), aSnap.Width() ); - long nUp = Min( aTmp.Top() - aBoundRect.Top(), aSnap.Height() ); - long nDown = Min( aBoundRect.Bottom() - aTmp.Bottom(), aSnap.Height() ); + long nLeft = std::min( aTmp.Left() - aBoundRect.Left(), aSnap.Width() ); + long nRight = std::min( aBoundRect.Right() - aTmp.Right(), aSnap.Width() ); + long nUp = std::min( aTmp.Top() - aBoundRect.Top(), aSnap.Height() ); + long nDown = std::min( aBoundRect.Bottom() - aTmp.Bottom(), aSnap.Height() ); switch ( nDir ) { @@ -1190,10 +1190,10 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir ) Size aSnap( rSh.GetViewOptions()->GetSnapSize() ); short nDiv = rSh.GetViewOptions()->GetDivisionX(); if ( nDiv > 0 ) - aSnap.Width() = Max( (sal_uLong)1, (sal_uLong)aSnap.Width() / nDiv ); + aSnap.Width() = std::max( (sal_uLong)1, (sal_uLong)aSnap.Width() / nDiv ); nDiv = rSh.GetViewOptions()->GetDivisionY(); if ( nDiv > 0 ) - aSnap.Height() = Max( (sal_uLong)1, (sal_uLong)aSnap.Height() / nDiv ); + aSnap.Height() = std::max( (sal_uLong)1, (sal_uLong)aSnap.Height() / nDiv ); if(bOnePixel) aSnap = PixelToLogic(Size(1,1)); diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index 87b81d863908..b98334f53831 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -237,8 +237,8 @@ IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit ) long lWVal = static_cast< long >(GetFldVal(aSizeWidthField )); long lHVal = static_cast< long >(GetFldVal(aSizeHeightField)); - long lWidth = Max(lWVal, lHVal); - long lHeight = Min(lWVal, lHVal); + long lWidth = std::max(lWVal, lHVal); + long lHeight = std::min(lWVal, lHVal); if (pEdit == &aSizeWidthField || pEdit == &aSizeHeightField) { @@ -437,8 +437,8 @@ IMPL_LINK_NOARG(SwEnvFmtPage, FormatHdl) if (nPaper != (sal_uInt16)PAPER_USER) { Size aSz = SvxPaperInfo::GetPaperSize((Paper)nPaper); - lWidth = Max(aSz.Width(), aSz.Height()); - lHeight = Min(aSz.Width(), aSz.Height()); + lWidth = std::max(aSz.Width(), aSz.Height()); + lHeight = std::min(aSz.Width(), aSz.Height()); } else { @@ -471,8 +471,8 @@ void SwEnvFmtPage::SetMinMax() long lWVal = static_cast< long >(GetFldVal(aSizeWidthField )); long lHVal = static_cast< long >(GetFldVal(aSizeHeightField)); - long lWidth = Max(lWVal, lHVal), - lHeight = Min(lWVal, lHVal); + long lWidth = std::max(lWVal, lHVal), + lHeight = std::min(lWVal, lHVal); // Min and Max aAddrLeftField.SetMin((long) 100 * (GetFldVal(aSendLeftField) + 566), FUNIT_TWIP); @@ -534,15 +534,15 @@ void SwEnvFmtPage::FillItem(SwEnvItem& rItem) { long lWVal = static_cast< long >(GetFldVal(aSizeWidthField )); long lHVal = static_cast< long >(GetFldVal(aSizeHeightField)); - rItem.lWidth = Max(lWVal, lHVal); - rItem.lHeight = Min(lWVal, lHVal); + rItem.lWidth = std::max(lWVal, lHVal); + rItem.lHeight = std::min(lWVal, lHVal); } else { long lWVal = SvxPaperInfo::GetPaperSize((Paper)nPaper).Width (); long lHVal = SvxPaperInfo::GetPaperSize((Paper)nPaper).Height(); - rItem.lWidth = Max(lWVal, lHVal); - rItem.lHeight = Min(lWVal, lHVal); + rItem.lWidth = std::max(lWVal, lHVal); + rItem.lHeight = std::min(lWVal, lHVal); } } @@ -558,8 +558,8 @@ void SwEnvFmtPage::Reset(const SfxItemSet& rSet) const SwEnvItem& rItem = (const SwEnvItem&) rSet.Get(FN_ENVELOP); Paper ePaper = SvxPaperInfo::GetSvxPaper( - Size( Min(rItem.lWidth, rItem.lHeight), - Max(rItem.lWidth, rItem.lHeight)), MAP_TWIP, sal_True); + Size( std::min(rItem.lWidth, rItem.lHeight), + std::max(rItem.lWidth, rItem.lHeight)), MAP_TWIP, sal_True); for (sal_uInt16 i = 0; i < (sal_uInt16) aIDs.size(); i++) if (aIDs[i] == (sal_uInt16)ePaper) aSizeFormatBox.SelectEntryPos(i); @@ -569,8 +569,8 @@ void SwEnvFmtPage::Reset(const SfxItemSet& rSet) SetFldVal(aAddrTopField , rItem.lAddrFromTop ); SetFldVal(aSendLeftField, rItem.lSendFromLeft); SetFldVal(aSendTopField , rItem.lSendFromTop ); - SetFldVal(aSizeWidthField , Max(rItem.lWidth, rItem.lHeight)); - SetFldVal(aSizeHeightField , Min(rItem.lWidth, rItem.lHeight)); + SetFldVal(aSizeWidthField , std::max(rItem.lWidth, rItem.lHeight)); + SetFldVal(aSizeHeightField , std::min(rItem.lWidth, rItem.lHeight)); SetMinMax(); DELETEZ(GetParentSwEnvDlg()->pSenderSet); diff --git a/sw/source/ui/envelp/envimg.cxx b/sw/source/ui/envelp/envimg.cxx index 3597753d2dc0..63be8798743c 100644 --- a/sw/source/ui/envelp/envimg.cxx +++ b/sw/source/ui/envelp/envimg.cxx @@ -108,8 +108,8 @@ SwEnvItem::SwEnvItem() : lShiftRight = 0; lShiftDown = 0; - lAddrFromLeft = Max(lWidth, lHeight) / 2; - lAddrFromTop = Min(lWidth, lHeight) / 2; + lAddrFromLeft = std::max(lWidth, lHeight) / 2; + lAddrFromTop = std::min(lWidth, lHeight) / 2; } SwEnvItem::SwEnvItem(const SwEnvItem& rItem) : diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index 6a9a0b68eed4..29ab6f8bc993 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -74,8 +74,8 @@ void SwEnvPreview::Paint(const Rectangle &) const SwEnvItem& rItem = ((SwEnvDlg*) GetParentDialog())->aEnvItem; - sal_uInt16 nPageW = (sal_uInt16) Max(rItem.lWidth, rItem.lHeight), - nPageH = (sal_uInt16) Min(rItem.lWidth, rItem.lHeight); + sal_uInt16 nPageW = (sal_uInt16) std::max(rItem.lWidth, rItem.lHeight), + nPageH = (sal_uInt16) std::min(rItem.lWidth, rItem.lHeight); float fx = (float)GetOutputSizePixel().Width () / (float)nPageW, fy = (float)GetOutputSizePixel().Height() / (float)nPageH, diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 93e71b16c4d1..770ae65e3295 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -127,8 +127,8 @@ void SwLabPreview::Paint(const Rectangle &) lDispH += ROUND(aItem.lVDist / 10); // Scale factor - float fx = (float) lOutWPix23 / Max(1L, lDispW), - fy = (float) lOutHPix23 / Max(1L, lDispH), + float fx = (float) lOutWPix23 / std::max(1L, lDispW), + fy = (float) lOutHPix23 / std::max(1L, lDispH), f = fx < fy ? fx : fy; // zero point @@ -159,8 +159,8 @@ void SwLabPreview::Paint(const Rectangle &) // Labels SetClipRegion(Region(Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH)))); SetFillColor( COL_LIGHTGRAYBLUE ); - for (sal_uInt16 nRow = 0; nRow < Min((sal_uInt16) 2, (sal_uInt16) aItem.nRows); nRow++) - for (sal_uInt16 nCol = 0; nCol < Min((sal_uInt16) 2, (sal_uInt16) aItem.nCols); nCol++) + for (sal_uInt16 nRow = 0; nRow < std::min((sal_uInt16) 2, (sal_uInt16) aItem.nRows); nRow++) + for (sal_uInt16 nCol = 0; nCol < std::min((sal_uInt16) 2, (sal_uInt16) aItem.nCols); nCol++) DrawRect(Rectangle( Point(ROUND(lX0 + f * (aItem.lLeft + nCol * aItem.lHDist)), ROUND(lY0 + f * (aItem.lUpper + nRow * aItem.lVDist))), @@ -417,8 +417,8 @@ void SwLabFmtPage::ChangeMinMax() aHDistField .SetMin(nMinSize, FUNIT_CM); aVDistField .SetMin(nMinSize, FUNIT_CM); - aHDistField .SetMax((long) 100 * ((lMax - lLeft ) / Max(1L, (long) nCols)), FUNIT_TWIP); - aVDistField .SetMax((long) 100 * ((lMax - lUpper) / Max(1L, (long) nRows)), FUNIT_TWIP); + aHDistField .SetMax((long) 100 * ((lMax - lLeft ) / std::max(1L, (long) nCols)), FUNIT_TWIP); + aVDistField .SetMax((long) 100 * ((lMax - lUpper) / std::max(1L, (long) nRows)), FUNIT_TWIP); aWidthField .SetMin(nMinSize, FUNIT_CM); aHeightField.SetMin(nMinSize, FUNIT_CM); @@ -432,8 +432,8 @@ void SwLabFmtPage::ChangeMinMax() aColsField .SetMin( 1 ); aRowsField .SetMin( 1 ); - aColsField .SetMax((lMax - lLeft ) / Max(1L, lHDist)); - aRowsField .SetMax((lMax - lUpper) / Max(1L, lVDist)); + aColsField .SetMax((lMax - lLeft ) / std::max(1L, lHDist)); + aRowsField .SetMax((lMax - lUpper) / std::max(1L, lVDist)); aPWidthField .SetMin( (long) 100 * lMinPWidth, FUNIT_TWIP ); aPHeightField.SetMin( (long) 100 * lMinPHeight, FUNIT_TWIP ); diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 2750a0957788..2934718a2158 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -935,8 +935,8 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData, SwPaM *pPam ) SwChapterFieldType* pTyp = (SwChapterFieldType*)pCurShell->GetFldType(0, RES_CHAPTERFLD); pFld = new SwChapterField(pTyp, nFormatId); - nByte = Max(sal_uInt16(1), nByte); - nByte = Min(nByte, sal_uInt16(MAXLEVEL)); + nByte = std::max(sal_uInt16(1), nByte); + nByte = std::min(nByte, sal_uInt16(MAXLEVEL)); nByte -= 1; ((SwChapterField*)pFld)->SetLevel((sal_uInt8)nByte); break; @@ -1465,8 +1465,8 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat, case TYP_CHAPTERFLD: { sal_uInt16 nByte = (sal_uInt16)rPar2.ToInt32(); - nByte = Max(sal_uInt16(1), nByte); - nByte = Min(nByte, sal_uInt16(MAXLEVEL)); + nByte = std::max(sal_uInt16(1), nByte); + nByte = std::min(nByte, sal_uInt16(MAXLEVEL)); nByte -= 1; ((SwChapterField*)pTmpFld)->SetLevel((sal_uInt8)nByte); bSetPar2 = false; diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index fa6692ba268d..d889388b0e7b 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -582,8 +582,8 @@ void SwColumnPage::Reset(const SfxItemSet &rSet) delete pColMgr; pColMgr = new SwColMgr(rSet); nCols = pColMgr->GetCount() ; - m_pCLNrEdt->SetMax(Max((sal_uInt16)m_pCLNrEdt->GetMax(), (sal_uInt16)nCols)); - m_pCLNrEdt->SetLast(Max(nCols,(sal_uInt16)m_pCLNrEdt->GetMax())); + m_pCLNrEdt->SetMax(std::max((sal_uInt16)m_pCLNrEdt->GetMax(), (sal_uInt16)nCols)); + m_pCLNrEdt->SetLast(std::max(nCols,(sal_uInt16)m_pCLNrEdt->GetMax())); if(bFrm) { @@ -672,7 +672,7 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ ) sal_uInt16 i; for( i = 1; i < nCols; ++i) - nMin = Min(nMin, nColWidth[i]); + nMin = std::min(nMin, nColWidth[i]); sal_Bool bAutoWidth = m_pAutoWidthBox->IsChecked(); if(!bAutoWidth) @@ -738,8 +738,8 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ ) } //set maximum values - m_pCLNrEdt->SetMax(Max(1L, - Min(long(nMaxCols), long( pColMgr->GetActualSize() / (nGutterWidth + MINLAY)) ))); + m_pCLNrEdt->SetMax(std::max(1L, + std::min(long(nMaxCols), long( pColMgr->GetActualSize() / (nGutterWidth + MINLAY)) ))); m_pCLNrEdt->SetLast(m_pCLNrEdt->GetMax()); m_pCLNrEdt->Reformat(); @@ -820,8 +820,8 @@ void SwColumnPage::Init() // set maximum number of columns // values below 1 are not allowed - m_pCLNrEdt->SetMax(Max(1L, - Min(long(nMaxCols), long( pColMgr->GetActualSize() / nMinWidth) ))); + m_pCLNrEdt->SetMax(std::max(1L, + std::min(long(nMaxCols), long( pColMgr->GetActualSize() / nMinWidth) ))); } /*------------------------------------------------------------------------ @@ -1332,7 +1332,7 @@ void ColumnValueSet::UserDraw( const UserDrawEvent& rUDEvt ) pDev->SetFillColor(rStyleSettings.GetFieldColor()); pDev->SetLineColor(SwViewOption::GetFontColor()); - long nStep = Abs(Abs(nRectHeight * 95 /100) / 11); + long nStep = std::abs(std::abs(nRectHeight * 95 /100) / 11); long nTop = (nRectHeight - 11 * nStep ) / 2; sal_uInt16 nCols = 0; long nStarts[3]; diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx index 81420d447c4b..21ebf5502eb6 100644 --- a/sw/source/ui/frmdlg/frmmgr.cxx +++ b/sw/source/ui/frmdlg/frmmgr.cxx @@ -594,7 +594,7 @@ void SwFlyFrmAttrMgr::SetHeightSizeType( SwFrmSize eType ) void SwFlyFrmAttrMgr::SetSize( const Size& rSize ) { SwFmtFrmSize aSize( GetFrmSize() ); - aSize.SetSize(Size(Max(rSize.Width(), long(MINFLY)), Max(rSize.Height(), long(MINFLY)))); + aSize.SetSize(Size(std::max(rSize.Width(), long(MINFLY)), std::max(rSize.Height(), long(MINFLY)))); aSet.Put( aSize ); } diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 3750852f1157..01130f009590 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -1072,12 +1072,12 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) if (aRelWidthCB.IsChecked()) { - aSz.SetWidthPercent((sal_uInt8)Min( static_cast< sal_Int64 >(MAX_PERCENT_WIDTH), aWidthED.Convert(aWidthED.NormalizePercent(nNewWidth), FUNIT_TWIP, FUNIT_CUSTOM))); + aSz.SetWidthPercent((sal_uInt8)std::min( static_cast< sal_Int64 >(MAX_PERCENT_WIDTH), aWidthED.Convert(aWidthED.NormalizePercent(nNewWidth), FUNIT_TWIP, FUNIT_CUSTOM))); } else aSz.SetWidthPercent(0); if (aRelHeightCB.IsChecked()) - aSz.SetHeightPercent((sal_uInt8)Min(static_cast< sal_Int64 >(MAX_PERCENT_HEIGHT), aHeightED.Convert(aHeightED.NormalizePercent(nNewHeight), FUNIT_TWIP, FUNIT_CUSTOM))); + aSz.SetHeightPercent((sal_uInt8)std::min(static_cast< sal_Int64 >(MAX_PERCENT_HEIGHT), aHeightED.Convert(aHeightED.NormalizePercent(nNewHeight), FUNIT_TWIP, FUNIT_CUSTOM))); else aSz.SetHeightPercent(0); @@ -1756,10 +1756,10 @@ IMPL_LINK_NOARG(SwFrmPage, RangeModifyHdl) if (aVal.bAutoHeight && (nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE)) { - SwTwips nTmp = Min(nWidth * nMaxHeight / Max(nHeight, 1L), nMaxHeight); + SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max(nHeight, 1L), nMaxHeight); aWidthED.SetMax(aWidthED.NormalizePercent(nTmp), FUNIT_TWIP); - nTmp = Min(nHeight * nMaxWidth / Max(nWidth, 1L), nMaxWidth); + nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, 1L), nMaxWidth); aHeightED.SetMax(aWidthED.NormalizePercent(nTmp), FUNIT_TWIP); } else diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index cfba070c0fb8..35842327cd93 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -613,7 +613,7 @@ IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit ) { sal_Int64 nOpposite = pOpposite->GetValue(); - if (nValue + nOpposite > Max(pEdit->GetMax(), pOpposite->GetMax())) + if (nValue + nOpposite > std::max(pEdit->GetMax(), pOpposite->GetMax())) pOpposite->SetValue(pOpposite->GetMax() - nValue); } diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 073b7acd7942..c2b5a9f65a81 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -598,7 +598,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pFld ) if(nActLevel & nMask) { SwNumFmt aNumFmt(pNumRule->Get(i)); - aNumFmt.SetIncludeUpperLevels( Min( (sal_uInt8)pFld->GetValue(), + aNumFmt.SetIncludeUpperLevels( std::min( (sal_uInt8)pFld->GetValue(), (sal_uInt8)(i + 1)) ); pNumRule->Set(i, aNumFmt); } @@ -971,7 +971,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) nStart--; SwNumberTree::tNumberVector aNumVector; - sal_uInt8 nEnd = Min( (sal_uInt8)(nStart + 3), MAXLEVEL ); + sal_uInt8 nEnd = std::min( (sal_uInt8)(nStart + 3), MAXLEVEL ); for( sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel ) { const SwNumFmt &rFmt = pActNum->Get(nLevel); diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx index a961620e71ef..cf9ff24bb953 100644 --- a/sw/source/ui/misc/redlndlg.cxx +++ b/sw/source/ui/misc/redlndlg.cxx @@ -622,7 +622,7 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd) // set the cursor after the last entry because otherwise performance problem in TLB. // TLB would otherwise reset the cursor at every Remove (expensive) - sal_uInt16 nPos = Min((sal_uInt16)nCount, (sal_uInt16)aRedlineParents.size()); + sal_uInt16 nPos = std::min((sal_uInt16)nCount, (sal_uInt16)aRedlineParents.size()); SvTreeListEntry *pCurEntry = NULL; while( ( pCurEntry == NULL ) && ( nPos > 0 ) ) { @@ -689,7 +689,7 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd) String sParent; sal_uInt16 nCount = pSh->GetRedlineCount(); - nEnd = Min((sal_uInt16)nEnd, (sal_uInt16)(nCount - 1)); // also treats nEnd=USHRT_MAX (until the end) + nEnd = std::min((sal_uInt16)nEnd, (sal_uInt16)(nCount - 1)); // also treats nEnd=USHRT_MAX (until the end) if (nEnd == USHRT_MAX) return; // no redlines in the document diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index af4b5cf972b9..c3a1b07d860c 100644 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -181,7 +181,7 @@ void SwInputWindow::Resize() long nLeft = aEdit.GetPosPixel().X(); Size aEditSize = aEdit.GetSizePixel(); - aEditSize.Width() = Max( ((long)(nWidth - nLeft - 5)), (long)0 ); + aEditSize.Width() = std::max( ((long)(nWidth - nLeft - 5)), (long)0 ); aEdit.SetSizePixel( aEditSize ); aEdit.Invalidate(); } diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index 43c57935c176..aa5327fb4c14 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -228,7 +228,7 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh ) SwTwips nLeft = aLRSpace.GetLeft(); SwTwips nRight = aLRSpace.GetRight(); SwTwips nDiff = pRep->GetSpace() - nRight - nLeft - nWidth; - if(nAlign != text::HoriOrientation::FULL && Abs(nDiff) > 2) + if(nAlign != text::HoriOrientation::FULL && std::abs(nDiff) > 2) { SwTwips nLR = pRep->GetSpace() - nWidth; switch ( nAlign ) @@ -479,9 +479,9 @@ void SwTableShell::Execute(SfxRequest &rReq) { aBox = *(SvxBoxItem*)pBoxItem; if ( !rReq.IsAPI() ) - aBox.SetDistance( Max(rCoreBox.GetDistance(),sal_uInt16(55)) ); + aBox.SetDistance( std::max(rCoreBox.GetDistance(),sal_uInt16(55)) ); else if ( aBox.GetDistance() < MIN_BORDER_DIST ) - aBox.SetDistance( Max(rCoreBox.GetDistance(),(sal_uInt16)MIN_BORDER_DIST) ); + aBox.SetDistance( std::max(rCoreBox.GetDistance(),(sal_uInt16)MIN_BORDER_DIST) ); } else OSL_ENSURE( !this, "where is BoxItem?" ); diff --git a/sw/source/ui/table/swtablerep.cxx b/sw/source/ui/table/swtablerep.cxx index 88d86a8447fb..578dd6d41306 100644 --- a/sw/source/ui/table/swtablerep.cxx +++ b/sw/source/ui/table/swtablerep.cxx @@ -173,10 +173,10 @@ sal_Bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const } // intercept rounding errors - if(Abs((long)nOldLeft - (long)rTabCols.GetLeft()) < 3) + if(std::abs((long)nOldLeft - (long)rTabCols.GetLeft()) < 3) rTabCols.SetLeft(nOldLeft); - if(Abs((long)nOldRight - (long)rTabCols.GetRight()) < 3) + if(std::abs((long)nOldRight - (long)rTabCols.GetRight()) < 3) rTabCols.SetRight(nOldRight); if(GetRightSpace() >= 0 && diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index bda054f21a85..0ad320473729 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -475,7 +475,7 @@ void SwFormatTablePage::Reset( const SfxItemSet& ) pTblData->GetWidth()), FUNIT_TWIP); m_aWidthMF.SaveValue(); nSaveWidth = pTblData->GetWidth(); - nMinTableWidth = Min( nSaveWidth, nMinTableWidth ); + nMinTableWidth = std::min( nSaveWidth, nMinTableWidth ); } m_aWidthMF.SetRefValue(pTblData->GetSpace()); @@ -658,11 +658,11 @@ int SwFormatTablePage::DeactivatePage( SfxItemSet* _pSet ) } if(nColSum != pTblData->GetWidth()) { - SwTwips nMinWidth = Min( (long)MINLAY, + SwTwips nMinWidth = std::min( (long)MINLAY, (long) (pTblData->GetWidth() / pTblData->GetColCount() - 1)); SwTwips nDiff = nColSum - pTblData->GetWidth(); - while ( Abs(nDiff) > pTblData->GetColCount() + 1 ) + while ( std::abs(nDiff) > pTblData->GetColCount() + 1 ) { SwTwips nSub = nDiff / pTblData->GetColCount(); for( i = 0; i < pTblData->GetColCount(); i++) diff --git a/sw/source/ui/table/tablemgr.cxx b/sw/source/ui/table/tablemgr.cxx index 9bfe0a932464..720c5af468e6 100644 --- a/sw/source/ui/table/tablemgr.cxx +++ b/sw/source/ui/table/tablemgr.cxx @@ -147,7 +147,7 @@ void SwTableFUNC::SetColWidth(sal_uInt16 nNum, SwTwips nNewWidth ) aCols[ static_cast< sal_uInt16 >(GetRightSeparator(nNum-1)) ] -= nDiff; } else - aCols.SetRight( Min( nNewWidth, aCols.GetRightMax()) ); + aCols.SetRight( std::min( nNewWidth, aCols.GetRightMax()) ); pSh->StartAllAction(); pSh->SetTabCols( aCols, bCurrentOnly ); diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index de217bc56a49..8ce5a3220d5d 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -646,7 +646,7 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, nNewSelectedPageNum = 1; } else - nScrollAmount = - Min( aViewWin.GetOutputSize().Height(), + nScrollAmount = - std::min( aViewWin.GetOutputSize().Height(), aViewWin.GetPaintedPreviewDocRect().Top() ); } else @@ -660,7 +660,7 @@ void SwPagePreView::_ExecPgUpAndPgDown( const bool _bPgUp, nNewSelectedPageNum = mnPageCount; } else - nScrollAmount = Min( aViewWin.GetOutputSize().Height(), + nScrollAmount = std::min( aViewWin.GetOutputSize().Height(), ( pPagePrevwLay->GetPrevwDocSize().Height() - aViewWin.GetPaintedPreviewDocRect().Bottom() ) ); } @@ -1396,13 +1396,13 @@ void SwPagePreView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollba if(aLR.Top() < 0) { - aLR.Bottom() += Abs(aLR.Top()); + aLR.Bottom() += std::abs(aLR.Top()); aLR.Top() = 0; } if(aLR.Left() < 0) { - aLR.Right() += Abs(aLR.Left()); + aLR.Right() += std::abs(aLR.Left()); aLR.Left() = 0; } if(aLR.Right() < 0) aLR.Right() = 0; diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index a67e93c50bd3..3033e2afcce0 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -1354,7 +1354,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) long nFac = aWindowSize.Width() * 100 / nTmpWidth; long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height(); - nFac = Min( nFac, nVisPercent ); + nFac = std::min( nFac, nVisPercent ); aZoomSliderItem.AddSnappingPoint( nFac ); @@ -1362,7 +1362,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) { nTmpWidth += aPageSize.Width() + GAPBETWEENPAGES; nFac = aWindowSize.Width() * 100 / nTmpWidth; - nFac = Min( nFac, nVisPercent ); + nFac = std::min( nFac, nVisPercent ); aZoomSliderItem.AddSnappingPoint( nFac ); } } diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx index c10c99019fd6..b942edb0c37b 100644 --- a/sw/source/ui/uiview/viewmdi.cxx +++ b/sw/source/ui/uiview/viewmdi.cxx @@ -111,7 +111,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, if( nsUseOnPage::PD_MIRROR == rDesc.GetUseOn() ) // gespiegelte Seiten { const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace(); - aPageSize.Width() += Abs( long(rLeftLRSpace.GetLeft()) - long(rLRSpace.GetLeft()) ); + aPageSize.Width() += std::abs( long(rLeftLRSpace.GetLeft()) - long(rLRSpace.GetLeft()) ); } if( SVX_ZOOM_OPTIMAL == eZoomType ) @@ -132,7 +132,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, if ( SVX_ZOOM_WHOLEPAGE == eZoomType ) { long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height(); - nFac = Min( nFac, nVisPercent ); + nFac = std::min( nFac, nVisPercent ); } } else @@ -142,7 +142,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, } } - nFac = Max( long( MINZOOM ), nFac ); + nFac = std::max( long( MINZOOM ), nFac ); SwViewOption aOpt( *pOpt ); if ( !GetViewFrame()->GetFrame().IsInPlace() ) diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index db07ebb1f92b..a273495e7c60 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -138,14 +138,14 @@ long SwView::SetHScrollMax( long lMax ) // bei negativen Werten ist das Dokument vollstaendig sichtbar; // in diesem Fall kein Scrollen - return Max( Min( lMax, lSize ), 0L ); + return std::max( std::min( lMax, lSize ), 0L ); } long SwView::SetVScrollMax( long lMax ) { const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; long lSize = GetDocSz().Height() + lBorder - m_aVisArea.GetHeight(); - return Max( Min( lMax, lSize), 0L ); // siehe horz. + return std::max( std::min( lMax, lSize), 0L ); // siehe horz. } Point SwView::AlignToPixel(const Point &rPt) const @@ -259,8 +259,8 @@ void SwView::SetVisArea( const Rectangle &rRect, sal_Bool bUpdateScrollbar ) { m_pWrtShell->VisPortChgd( m_aVisArea ); if ( aOldSz != m_pWrtShell->VisArea().SSize() && - ( Abs(aOldSz.Width() - m_pWrtShell->VisArea().Width()) > 2 || - Abs(aOldSz.Height() - m_pWrtShell->VisArea().Height()) > 2 ) ) + ( std::abs(aOldSz.Width() - m_pWrtShell->VisArea().Width()) > 2 || + std::abs(aOldSz.Height() - m_pWrtShell->VisArea().Height()) > 2 ) ) m_pWrtShell->CheckBrowseView( sal_False ); } @@ -359,16 +359,16 @@ void SwView::CalcPt( Point *pPt, const Rectangle &rRect, long nYScroll = GetYScroll(); long nDesHeight = rRect.GetHeight(); long nCurHeight = m_aVisArea.GetHeight(); - nYScroll = Min(nYScroll, nCurHeight - nDesHeight); // wird es knapp, dann nicht zuviel scrollen + nYScroll = std::min(nYScroll, nCurHeight - nDesHeight); // wird es knapp, dann nicht zuviel scrollen if(nDesHeight > nCurHeight) // die Hoehe reicht nicht aus, dann interessiert nYScroll nicht mehr { pPt->Y() = rRect.Top(); - pPt->Y() = Max( lMin, pPt->Y() ); + pPt->Y() = std::max( lMin, pPt->Y() ); } else if ( rRect.Top() < m_aVisArea.Top() ) //Verschiebung nach oben { pPt->Y() = rRect.Top() - (nRangeY != USHRT_MAX ? nRangeY : nYScroll); - pPt->Y() = Max( lMin, pPt->Y() ); + pPt->Y() = std::max( lMin, pPt->Y() ); } else if( rRect.Bottom() > m_aVisArea.Bottom() ) //Verschiebung nach unten { @@ -388,9 +388,9 @@ void SwView::CalcPt( Point *pPt, const Rectangle &rRect, else if ( rRect.Left() < m_aVisArea.Left() ) //Verschiebung nach links { pPt->X() = rRect.Left() - (nRangeX != USHRT_MAX ? nRangeX : nXScroll); - pPt->X() = Max( ::GetLeftMargin( *this ) + nLeftOfst, pPt->X() ); - pPt->X() = Min( rRect.Left() - nScrollX, pPt->X() ); - pPt->X() = Max( 0L, pPt->X() ); + pPt->X() = std::max( ::GetLeftMargin( *this ) + nLeftOfst, pPt->X() ); + pPt->X() = std::min( rRect.Left() - nScrollX, pPt->X() ); + pPt->X() = std::max( 0L, pPt->X() ); } } @@ -462,8 +462,8 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan aSize.Height()+ GetYScroll() > aVisSize.Height() )) { Point aPt( m_aVisArea.TopLeft() ); - aSize.Width() = Min( aSize.Width(), aVisSize.Width() ); - aSize.Height()= Min( aSize.Height(),aVisSize.Height()); + aSize.Width() = std::min( aSize.Width(), aVisSize.Width() ); + aSize.Height()= std::min( aSize.Height(),aVisSize.Height()); CalcPt( &aPt, Rectangle( rRect.TopLeft(), aSize ), static_cast< sal_uInt16 >((aVisSize.Width() - aSize.Width()) / 2), @@ -472,7 +472,7 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan if( m_bTopCrsr ) { const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0; - aPt.Y() = Min( Max( nBorder, rRect.Top() ), + aPt.Y() = std::min( std::max( nBorder, rRect.Top() ), m_aDocSz.Height() + nBorder - m_aVisArea.GetHeight() ); } @@ -489,7 +489,7 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan if( m_bTopCrsr ) { const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0; - aPt.Y() = Min( Max( nBorder, rRect.Top() ), + aPt.Y() = std::min( std::max( nBorder, rRect.Top() ), m_aDocSz.Height() + nBorder - m_aVisArea.GetHeight() ); } @@ -513,7 +513,7 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan - m_aVisArea.Left() - m_aVisArea.Right() ) / 2; aPnt.X() = SetHScrollMax( aPnt.X() ); const SwTwips lMin = IsDocumentBorder() ? DOCUMENTBORDER : 0; - aPnt.X() = Max( (GetLeftMargin( *this ) - lMin) + nLeftOfst, aPnt.X() ); + aPnt.X() = std::max( (GetLeftMargin( *this ) - lMin) + nLeftOfst, aPnt.X() ); } m_aVisArea = aOldVisArea; if( pCareWn ) @@ -566,7 +566,7 @@ long SwView::PageUp() Point aPos(m_aVisArea.TopLeft()); aPos.Y() -= m_aVisArea.GetHeight() - (GetYScroll() / 2); - aPos.Y() = Max(0L, aPos.Y()); + aPos.Y() = std::max(0L, aPos.Y()); SetVisArea( aPos ); return 1; } @@ -1259,9 +1259,9 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) { long nFact = m_pWrtShell->GetViewOptions()->GetZoom(); if( 0L > pWData->GetDelta() ) - nFact = Max( (long) 20, basegfx::zoomtools::zoomOut( nFact )); + nFact = std::max( (long) 20, basegfx::zoomtools::zoomOut( nFact )); else - nFact = Min( (long) 600, basegfx::zoomtools::zoomIn( nFact )); + nFact = std::min( (long) 600, basegfx::zoomtools::zoomIn( nFact )); SetZoom( SVX_ZOOM_PERCENT, nFact ); bOk = sal_True; @@ -1269,7 +1269,7 @@ sal_Bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) else if( pWData && COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode() ) { int newZoom = 100 * (m_pWrtShell->GetViewOptions()->GetZoom() / 100.0) * (pWData->GetDelta() / 100.0); - SetZoom( SVX_ZOOM_PERCENT, Max( 20, Min( 600, newZoom ) ) ); + SetZoom( SVX_ZOOM_PERCENT, std::max( 20, std::min( 600, newZoom ) ) ); bOk = sal_True; } else diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx index b00d5ab1c1d1..d3a9942734cf 100644 --- a/sw/source/ui/uiview/viewtab.cxx +++ b/sw/source/ui/uiview/viewtab.cxx @@ -1575,7 +1575,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) &rDesc.GetMaster().GetCol(); const SwColumns& rCols = pCols->GetColumns(); sal_uInt16 nNum = rSh.GetCurOutColNum(); - sal_uInt16 nCount = Min(sal_uInt16(nNum + 1), sal_uInt16(rCols.size())); + sal_uInt16 nCount = std::min(sal_uInt16(nNum + 1), sal_uInt16(rCols.size())); const SwRect aRect( rSh.GetAnyCurRect( pFmt ? RECT_FLY_PRT_EMBEDDED : RECT_PAGE_PRT, pPt )); diff --git a/sw/source/ui/utlui/prcntfld.cxx b/sw/source/ui/utlui/prcntfld.cxx index 00aa1d71e508..100176e00796 100644 --- a/sw/source/ui/utlui/prcntfld.cxx +++ b/sw/source/ui/utlui/prcntfld.cxx @@ -103,7 +103,7 @@ void PercentField::ShowPercent(sal_Bool bPercent) // round to 0.5 percent nPercent = ((nAktWidth * 10) / nRefValue + 5) / 10; - MetricField::SetMin(Max(static_cast< sal_Int64 >(1), nPercent)); + MetricField::SetMin(std::max(static_cast< sal_Int64 >(1), nPercent)); MetricField::SetMax(100); SetSpinSize(5); MetricField::SetBaseValue(0); @@ -169,7 +169,7 @@ void PercentFieldWrap::ShowPercent(bool bPercent) // round to 0.5 percent nPercent = ((nAktWidth * 10) / nRefValue + 5) / 10; - m_pField->SetMin(Max(static_cast< sal_Int64 >(1), nPercent)); + m_pField->SetMin(std::max(static_cast< sal_Int64 >(1), nPercent)); m_pField->SetMax(100); m_pField->SetSpinSize(5); m_pField->SetBaseValue(0); @@ -311,7 +311,7 @@ void PercentField::SetMin(sal_Int64 nNewMin, FieldUnit eInUnit) nOldMin = Convert(nNewMin, eInUnit, eOldUnit); sal_Int64 nPercent = Convert(nNewMin, eInUnit, FUNIT_CUSTOM); - MetricField::SetMin(Max( static_cast< sal_Int64 >(1), nPercent)); + MetricField::SetMin(std::max( static_cast< sal_Int64 >(1), nPercent)); } } @@ -326,7 +326,7 @@ void PercentFieldWrap::SetMin(sal_Int64 nNewMin, FieldUnit eInUnit) nOldMin = Convert(nNewMin, eInUnit, eOldUnit); sal_Int64 nPercent = Convert(nNewMin, eInUnit, FUNIT_CUSTOM); - m_pField->SetMin(Max( static_cast< sal_Int64 >(1), nPercent)); + m_pField->SetMin(std::max( static_cast< sal_Int64 >(1), nPercent)); } } diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx index 59aaf3707c93..04baf9f5c4df 100644 --- a/sw/source/ui/vba/vbatablehelper.cxx +++ b/sw/source/ui/vba/vbatablehelper.cxx @@ -263,7 +263,7 @@ void SwVbaTableHelper::SetColWidth( sal_Int32 _width, sal_Int32 nCol, sal_Int32 aCols[ static_cast< sal_uInt16 >(GetRightSeparator( aCols, nCol-1)) ] -= nDiff; } else - aCols.SetRight( Min( (long)nNewWidth, aCols.GetRightMax()) ); + aCols.SetRight( std::min( (long)nNewWidth, aCols.GetRightMax()) ); pTable->SetTabCols(aCols, aOldCols, pStart, bCurRowOnly ); } diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx index 7157af61d0c1..2c1bdae37795 100644 --- a/toolkit/source/awt/vclxmenu.cxx +++ b/toolkit/source/awt/vclxmenu.cxx @@ -419,7 +419,7 @@ void VCLXMenu::removeItem( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun:: if ( mpMenu && ( nCount > 0 ) && ( nPos >= 0 ) && ( nPos < nItemCount ) && ( nItemCount > 0 )) { sal_Int16 nP = sal::static_int_cast< sal_Int16 >( - Min( (int)(nPos+nCount), (int)nItemCount )); + std::min( (int)(nPos+nCount), (int)nItemCount )); while( nP-nPos > 0 ) mpMenu->RemoveItem( --nP ); } diff --git a/tools/inc/tools/gen.hxx b/tools/inc/tools/gen.hxx index 028d5043f845..19d10bd96af5 100644 --- a/tools/inc/tools/gen.hxx +++ b/tools/inc/tools/gen.hxx @@ -498,8 +498,8 @@ inline Point Rectangle::TopCenter() const if ( IsEmpty() ) return Point( nLeft, nTop ); else - return Point( Min( nLeft, nRight ) + Abs( (nRight - nLeft)/2 ), - Min( nTop, nBottom) ); + return Point( std::min( nLeft, nRight ) + std::abs( (nRight - nLeft)/2 ), + std::min( nTop, nBottom) ); } inline Point Rectangle::BottomCenter() const @@ -507,8 +507,8 @@ inline Point Rectangle::BottomCenter() const if ( IsEmpty() ) return Point( nLeft, nTop ); else - return Point( Min( nLeft, nRight ) + Abs( (nRight - nLeft)/2 ), - Max( nTop, nBottom) ); + return Point( std::min( nLeft, nRight ) + std::abs( (nRight - nLeft)/2 ), + std::max( nTop, nBottom) ); } inline Point Rectangle::LeftCenter() const @@ -516,7 +516,7 @@ inline Point Rectangle::LeftCenter() const if ( IsEmpty() ) return Point( nLeft, nTop ); else - return Point( Min( nLeft, nRight ), nTop + (nBottom - nTop)/2 ); + return Point( std::min( nLeft, nRight ), nTop + (nBottom - nTop)/2 ); } inline Point Rectangle::RightCenter() const @@ -524,7 +524,7 @@ inline Point Rectangle::RightCenter() const if ( IsEmpty() ) return Point( nLeft, nTop ); else - return Point( Max( nLeft, nRight ), nTop + (nBottom - nTop)/2 ); + return Point( std::max( nLeft, nRight ), nTop + (nBottom - nTop)/2 ); } inline Point Rectangle::Center() const diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h index ece2f8976ddf..58d5849c5f42 100644 --- a/tools/inc/tools/solar.h +++ b/tools/inc/tools/solar.h @@ -107,21 +107,6 @@ inline void DoubleToSVBT64( double n, SVBT64 p ) { p[0] = ((sal_uInt8*)&n)[7 #endif #endif -#ifndef __cplusplus -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif -#endif - -#ifdef __cplusplus -template<typename T> inline T Min(T a, T b) { return (a<b?a:b); } -template<typename T> inline T Max(T a, T b) { return (a>b?a:b); } -template<typename T> inline T Abs(T a) { return (a>=0?a:-a); } -#endif - #ifdef __cplusplus #define EXTERN_C extern "C" #else diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index 9f1241cfd76b..8b27d1ffa72d 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -343,7 +343,7 @@ Time Time::GetUTCOffset() nTempTime += aTimeZone.StandardBias; else if ( nTimeZoneRet == TIME_ZONE_ID_DAYLIGHT ) nTempTime += aTimeZone.DaylightBias; - Time aTime( 0, (sal_uInt16)Abs( nTempTime ) ); + Time aTime( 0, (sal_uInt16)abs( nTempTime ) ); if ( nTempTime > 0 ) aTime = -aTime; return aTime; @@ -381,7 +381,7 @@ Time Time::GetUTCOffset() nCacheSecOffset = (nLocalTime-nUTC) / 60; } - nTempTime = (short)Abs( nCacheSecOffset ); + nTempTime = abs( nCacheSecOffset ); Time aTime( 0, (sal_uInt16)nTempTime ); if ( nCacheSecOffset < 0 ) aTime = -aTime; diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx index 5c805dc7dcd1..4f5ee96a4cd3 100644 --- a/tools/source/generic/fract.cxx +++ b/tools/source/generic/fract.cxx @@ -35,8 +35,8 @@ */ static long GetGGT( long nVal1, long nVal2 ) { - nVal1 = Abs( nVal1 ); - nVal2 = Abs( nVal2 ); + nVal1 = std::abs( nVal1 ); + nVal2 = std::abs( nVal2 ); if ( nVal1 <= 1 || nVal2 <= 1 ) return 1; @@ -132,7 +132,7 @@ Fraction::Fraction( double dVal ) return; } - while ( Abs( (long)dVal ) < nMAX && nDen < nMAX ) + while ( abs( (long)dVal ) < nMAX && nDen < nMAX ) { dVal *= 10; nDen *= 10; @@ -411,10 +411,10 @@ void Fraction::ReduceInaccurate( unsigned nSignificantBits ) DBG_ASSERT(nSignificantBits<65, "More than 64 bit of significance is overkill!"); // How much bits can we lose? - const int nMulBitsToLose = Max( ( impl_NumberOfBits( nMul ) - int( nSignificantBits ) ), 0 ); - const int nDivBitsToLose = Max( ( impl_NumberOfBits( nDiv ) - int( nSignificantBits ) ), 0 ); + const int nMulBitsToLose = std::max( ( impl_NumberOfBits( nMul ) - int( nSignificantBits ) ), 0 ); + const int nDivBitsToLose = std::max( ( impl_NumberOfBits( nDiv ) - int( nSignificantBits ) ), 0 ); - const int nToLose = Min( nMulBitsToLose, nDivBitsToLose ); + const int nToLose = std::min( nMulBitsToLose, nDivBitsToLose ); // Remove the bits nMul >>= nToLose; diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index e4a03a318f1f..d7d7ff0403e8 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -70,10 +70,10 @@ Rectangle& Rectangle::Union( const Rectangle& rRect ) *this = rRect; else { - nLeft = Min( Min( nLeft, rRect.nLeft ), Min( nRight, rRect.nRight ) ); - nRight = Max( Max( nLeft, rRect.nLeft ), Max( nRight, rRect.nRight ) ); - nTop = Min( Min( nTop, rRect.nTop ), Min( nBottom, rRect.nBottom ) ); - nBottom = Max( Max( nTop, rRect.nTop ), Max( nBottom, rRect.nBottom ) ); + nLeft = std::min( std::min( nLeft, rRect.nLeft ), std::min( nRight, rRect.nRight ) ); + nRight = std::max( std::max( nLeft, rRect.nLeft ), std::max( nRight, rRect.nRight ) ); + nTop = std::min( std::min( nTop, rRect.nTop ), std::min( nBottom, rRect.nBottom ) ); + nBottom = std::max( std::max( nTop, rRect.nTop ), std::max( nBottom, rRect.nBottom ) ); } return *this; @@ -95,10 +95,10 @@ Rectangle& Rectangle::Intersection( const Rectangle& rRect ) aTmpRect.Justify(); // Perform intersection - nLeft = Max( nLeft, aTmpRect.nLeft ); - nRight = Min( nRight, aTmpRect.nRight ); - nTop = Max( nTop, aTmpRect.nTop ); - nBottom= Min( nBottom, aTmpRect.nBottom ); + nLeft = std::max( nLeft, aTmpRect.nLeft ); + nRight = std::min( nRight, aTmpRect.nRight ); + nTop = std::max( nTop, aTmpRect.nTop ); + nBottom= std::min( nBottom, aTmpRect.nBottom ); // Determine if intersection is empty if ( nRight < nLeft || nBottom < nTop ) diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index dfa931a2433d..661854cd2e76 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -363,8 +363,8 @@ Polygon::Polygon( const Rectangle& rRect, sal_uIntPtr nHorzRound, sal_uIntPtr nV Rectangle aRect( rRect ); aRect.Justify(); // SJ: i9140 - nHorzRound = Min( nHorzRound, (sal_uIntPtr) labs( aRect.GetWidth() >> 1 ) ); - nVertRound = Min( nVertRound, (sal_uIntPtr) labs( aRect.GetHeight() >> 1 ) ); + nHorzRound = std::min( nHorzRound, (sal_uIntPtr) labs( aRect.GetWidth() >> 1 ) ); + nVertRound = std::min( nVertRound, (sal_uIntPtr) labs( aRect.GetHeight() >> 1 ) ); if( !nHorzRound && !nVertRound ) { @@ -500,7 +500,7 @@ Polygon::Polygon( const Rectangle& rBound, const Point& rStart, const Point& rEn fDiff = F_2PI; // Proportionally shrink number of points( fDiff / (2PI) ); - nPoints = Max( (sal_uInt16) ( ( fDiff * 0.1591549 ) * nPoints ), (sal_uInt16) 16 ); + nPoints = std::max( (sal_uInt16) ( ( fDiff * 0.1591549 ) * nPoints ), (sal_uInt16) 16 ); fStep = fDiff / ( nPoints - 1 ); if( POLY_PIE == eStyle ) @@ -1200,7 +1200,7 @@ Point ImplEdgePointFilter::EdgeSection( const Point& rPoint, int nEdge ) const long dy = nNewY - ly; if ( !md ) nNewX = lx; - else if ( (LONG_MAX / Abs(md)) >= Abs(dy) ) + else if ( (LONG_MAX / std::abs(md)) >= std::abs(dy) ) nNewX = (dy * md) / mn + lx; else { @@ -1226,7 +1226,7 @@ Point ImplEdgePointFilter::EdgeSection( const Point& rPoint, int nEdge ) const long dx = nNewX - lx; if ( !mn ) nNewY = ly; - else if ( (LONG_MAX / Abs(mn)) >= Abs(dx) ) + else if ( (LONG_MAX / std::abs(mn)) >= std::abs(dx) ) nNewY = (dx * mn) / md + ly; else { diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx index aeaf423be667..8e98e3cef63c 100644 --- a/uui/source/secmacrowarnings.cxx +++ b/uui/source/secmacrowarnings.cxx @@ -231,7 +231,7 @@ void MacroWarning::InitControls() if ( nTxtW >= nBtnW ) { // broaden the button - long nDelta = Max( nTxtW - nBtnW, nOffset/3 ); + long nDelta = std::max( nTxtW - nBtnW, nOffset/3 ); Size aNewSize = maViewSignsBtn.GetSizePixel(); aNewSize.Width() += nDelta; maViewSignsBtn.SetSizePixel( aNewSize ); @@ -253,7 +253,7 @@ void MacroWarning::InitControls() long nTxtW2 = maDisableBtn.GetTextWidth( sText2 ); if ( sText2.Search( '~' ) == STRING_NOTFOUND ) nTxtW2 += nOffset; - nTxtW = Max( nTxtW1, nTxtW2 ); + nTxtW = std::max( nTxtW1, nTxtW2 ); nBtnW = maEnableBtn.GetSizePixel().Width(); if ( nTxtW > nBtnW ) { @@ -284,10 +284,10 @@ void MacroWarning::FitControls() if ( mbShowSignatures ) { aMinSize = maSignsFI.CalcMinimumSize( maSignsFI.GetSizePixel().Width() ); - nTxtH = Max( aMinSize.Height(), maViewSignsBtn.GetSizePixel().Height() ); + nTxtH = std::max( aMinSize.Height(), maViewSignsBtn.GetSizePixel().Height() ); nTxtH += a3Size.Height() / 2; nCtrlH = maSignsFI.GetSizePixel().Height(); - nDelta = Max( nCtrlH - nTxtH, static_cast< long >( -100 ) ); // not too large + nDelta = std::max( nCtrlH - nTxtH, static_cast< long >( -100 ) ); // not too large aNewSize = maSignsFI.GetSizePixel(); aNewSize.Height() -= nDelta; maSignsFI.SetSizePixel( aNewSize ); diff --git a/vcl/inc/vcl/salbtype.hxx b/vcl/inc/vcl/salbtype.hxx index 31f9f02a6be4..85a00a197f96 100644 --- a/vcl/inc/vcl/salbtype.hxx +++ b/vcl/inc/vcl/salbtype.hxx @@ -641,7 +641,7 @@ inline void BitmapPalette::SetEntryCount( sal_uInt16 nCount ) else if( nCount != mnCount ) { const sal_uLong nNewSize = nCount * sizeof( BitmapColor ); - const sal_uLong nMinSize = Min( mnCount, nCount ) * sizeof( BitmapColor ); + const sal_uLong nMinSize = std::min( mnCount, nCount ) * sizeof( BitmapColor ); sal_uInt8* pNewColor = new sal_uInt8[ nNewSize ]; if ( nMinSize && mpBitmapColor ) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index ce26c501ad61..db4406019e3c 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1348,10 +1348,10 @@ xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const if( nIndex == STRING_LEN ) { nIndex = 0; - long nDiff = Abs( pDX[0]-nX ); + long nDiff = std::abs( pDX[0]-nX ); for( int i = 1; i < aText.getLength(); i++ ) { - long nNewDiff = Abs( pDX[2*i]-nX ); + long nNewDiff = std::abs( pDX[2*i]-nX ); if( nNewDiff < nDiff ) { @@ -1359,7 +1359,7 @@ xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const nDiff = nNewDiff; } } - if( nIndex == aText.getLength()-1 && Abs( pDX[2*nIndex+1] - nX ) < nDiff ) + if( nIndex == aText.getLength()-1 && std::abs( pDX[2*nIndex+1] - nX ) < nDiff ) nIndex = STRING_LEN; } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index aeeef95c77f9..d09d97c9feb8 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -408,7 +408,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit, { // adjust selection such that it remains at the end if it was there before Selection aSel = pEdit->GetSelection(); - sal_Int64 nMaxSel = Max( aSel.Min(), aSel.Max() ); + sal_Int64 nMaxSel = std::max( aSel.Min(), aSel.Max() ); if ( nMaxSel >= aText.getLength() ) { sal_Int32 nMaxPos = aNewText.getLength(); diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index 7abe06b06ec9..4be1c118131e 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -723,16 +723,16 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry ) if( aMetrics.nImgHeight > mnMaxImgHeight ) mnMaxImgHeight = aMetrics.nImgHeight; - mnMaxImgTxtWidth = Max( mnMaxImgTxtWidth, aMetrics.nTextWidth ); - aMetrics.nEntryHeight = Max( aMetrics.nImgHeight, aMetrics.nEntryHeight ); + mnMaxImgTxtWidth = std::max( mnMaxImgTxtWidth, aMetrics.nTextWidth ); + aMetrics.nEntryHeight = std::max( aMetrics.nImgHeight, aMetrics.nEntryHeight ); } if ( IsUserDrawEnabled() || aMetrics.bImage ) { - aMetrics.nEntryWidth = Max( aMetrics.nImgWidth, maUserItemSize.Width() ); + aMetrics.nEntryWidth = std::max( aMetrics.nImgWidth, maUserItemSize.Width() ); if ( aMetrics.bText ) aMetrics.nEntryWidth += aMetrics.nTextWidth + IMG_TXT_DISTANCE; - aMetrics.nEntryHeight = Max( Max( mnMaxImgHeight, maUserItemSize.Height() ) + 2, + aMetrics.nEntryHeight = std::max( std::max( mnMaxImgHeight, maUserItemSize.Height() ) + 2, aMetrics.nEntryHeight ); } @@ -983,8 +983,8 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt ) sal_uInt16 nSelect = GetEntryPosForPoint( rMEvt.GetPosPixel() ); if( nSelect == LISTBOX_ENTRY_NOTFOUND ) nSelect = mpEntryList->GetEntryCount() - 1; - nSelect = Min( nSelect, GetLastVisibleEntry() ); - nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); + nSelect = std::min( nSelect, GetLastVisibleEntry() ); + nSelect = std::min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); // Select only visible Entries with MouseMove, otherwise Tracking... if ( IsVisible( nSelect ) && mpEntryList->IsEntrySelectable( nSelect ) && @@ -1167,8 +1167,8 @@ sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLE if( nAnchor != LISTBOX_ENTRY_NOTFOUND ) { // All entries from achor to nSelect have to be selected - sal_uInt16 nStart = Min( nSelect, nAnchor ); - sal_uInt16 nEnd = Max( nSelect, nAnchor ); + sal_uInt16 nStart = std::min( nSelect, nAnchor ); + sal_uInt16 nEnd = std::max( nSelect, nAnchor ); for ( sal_uInt16 n = nStart; n <= nEnd; n++ ) { if ( !mpEntryList->IsEntryPosSelected( n ) ) @@ -1314,7 +1314,7 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt ) { if ( mnCurrentPos != LISTBOX_ENTRY_NOTFOUND ) { - nSelect = Min( (sal_uInt16)(mnCurrentPos+1), (sal_uInt16)(mpEntryList->GetEntryCount()-1) ); + nSelect = std::min( (sal_uInt16)(mnCurrentPos+1), (sal_uInt16)(mpEntryList->GetEntryCount()-1) ); if( nSelect >= GetLastVisibleEntry() ) SetTopEntry( mnTop+1 ); } @@ -1322,8 +1322,8 @@ void ImplListBoxWindow::Tracking( const TrackingEvent& rTEvt ) else { nSelect = (sal_uInt16) ( ( aPt.Y() + mnBorder ) / mnMaxHeight ) + (sal_uInt16) mnTop; - nSelect = Min( nSelect, GetLastVisibleEntry() ); - nSelect = Min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); + nSelect = std::min( nSelect, GetLastVisibleEntry() ); + nSelect = std::min( nSelect, (sal_uInt16) ( mpEntryList->GetEntryCount() - 1 ) ); } if ( bInside ) @@ -1534,12 +1534,12 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt ) { sal_uInt16 nCount = mpEntryList->GetEntryCount(); sal_uInt16 nCurVis = GetLastVisibleEntry() - mnTop; - sal_uInt16 nTmp = Min( nCurVis, nCount ); + sal_uInt16 nTmp = std::min( nCurVis, nCount ); nTmp += mnTop - 1; if( mnCurrentPos == nTmp && mnCurrentPos != nCount - 1 ) { - long nTmp2 = Min( (long)(nCount-nCurVis), (long)((long)mnTop+(long)nCurVis-1) ); - nTmp2 = Max( (long)0 , nTmp2 ); + long nTmp2 = std::min( (long)(nCount-nCurVis), (long)((long)mnTop+(long)nCurVis-1) ); + nTmp2 = std::max( (long)0 , nTmp2 ); nTmp = (sal_uInt16)(nTmp2+(nCurVis-1) ); SetTopEntry( (sal_uInt16)nTmp2 ); } @@ -1875,7 +1875,7 @@ void ImplListBoxWindow::DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Boo XubString aStr( mpEntryList->GetEntryText( nPos ) ); if ( aStr.Len() ) { - long nMaxWidth = Max( static_cast< long >( mnMaxWidth ), + long nMaxWidth = std::max( static_cast< long >( mnMaxWidth ), GetOutputSizePixel().Width() - 2*mnBorder ); // a multiline entry should only be as wide a the window if( (pEntry->mnFlags & LISTBOX_ENTRY_FLAG_MULTILINE) ) @@ -1886,7 +1886,7 @@ void ImplListBoxWindow::DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Boo if( !bDrawTextAtImagePos && ( mpEntryList->HasEntryImage(nPos) || IsUserDrawEnabled() ) ) { - long nImageWidth = Max( mnMaxImgWidth, maUserItemSize.Width() ); + long nImageWidth = std::max( mnMaxImgWidth, maUserItemSize.Width() ); aTextRect.Left() += nImageWidth + IMG_TXT_DISTANCE; } @@ -2942,7 +2942,7 @@ void ImplWin::DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDraw if ( !bDrawTextAtImagePos && ( bImage || IsUserDrawEnabled() ) ) { - long nMaxWidth = Max( maImage.GetSizePixel().Width(), maUserItemSize.Width() ); + long nMaxWidth = std::max( maImage.GetSizePixel().Width(), maUserItemSize.Width() ); aTextRect.Left() += nMaxWidth + IMG_TXT_DISTANCE; } diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index 16dea7e8d30c..dd1f60951304 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -254,7 +254,7 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, // calculate Symbol size long nTempSize1 = aUpRect.GetWidth(); long nTempSize2 = aLowRect.GetWidth(); - if ( Abs( nTempSize1-nTempSize2 ) == 1 ) + if ( std::abs( nTempSize1-nTempSize2 ) == 1 ) { if ( nTempSize1 > nTempSize2 ) aUpRect.Left()++; @@ -263,7 +263,7 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, } nTempSize1 = aUpRect.GetHeight(); nTempSize2 = aLowRect.GetHeight(); - if ( Abs( nTempSize1-nTempSize2 ) == 1 ) + if ( std::abs( nTempSize1-nTempSize2 ) == 1 ) { if ( nTempSize1 > nTempSize2 ) aUpRect.Top()++; diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx index bfc601f7c1cf..10353c721116 100644 --- a/vcl/source/edit/textdata.cxx +++ b/vcl/source/edit/textdata.cxx @@ -132,7 +132,7 @@ void TEParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff ) else { DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" ); - mnInvalidPosStart = Min( mnInvalidPosStart, (sal_uInt16) ( (nDiff < 0) ? nStart+nDiff : nDiff ) ); + mnInvalidPosStart = std::min( mnInvalidPosStart, (sal_uInt16) ( (nDiff < 0) ? nStart+nDiff : nDiff ) ); mnInvalidDiff = 0; mbSimple = sal_False; } @@ -152,7 +152,7 @@ void TEParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /*nEnd*/ } else { - mnInvalidPosStart = Min( mnInvalidPosStart, nStart ); + mnInvalidPosStart = std::min( mnInvalidPosStart, nStart ); // nInvalidPosEnd = pNode->Len(); } diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index db76523cb0df..ce41bfb753e2 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -228,7 +228,7 @@ void TextEngine::SetMaxTextWidth( sal_uLong nMaxWidth ) { if ( nMaxWidth != mnMaxTextWidth ) { - mnMaxTextWidth = Min( nMaxWidth, (sal_uLong)0x7FFFFFFF ); + mnMaxTextWidth = std::min( nMaxWidth, (sal_uLong)0x7FFFFFFF ); FormatFullDoc(); UpdateViews(); } @@ -1620,7 +1620,7 @@ void TextEngine::FormatDoc() long nDiff = nNewHeight - mnCurTextHeight; if ( nNewHeight < mnCurTextHeight ) { - maInvalidRect.Bottom() = (long)Max( nNewHeight, mnCurTextHeight ); + maInvalidRect.Bottom() = (long)std::max( nNewHeight, mnCurTextHeight ); if ( maInvalidRect.IsEmpty() ) { maInvalidRect.Top() = 0; @@ -2188,7 +2188,7 @@ sal_Bool TextEngine::CreateLines( sal_uLong nPara ) const short nInvalidDiff = pTEParaPortion->GetInvalidDiff(); const sal_uInt16 nInvalidStart = pTEParaPortion->GetInvalidPosStart(); - const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff ); + const sal_uInt16 nInvalidEnd = nInvalidStart + std::abs( nInvalidDiff ); sal_Bool bQuickFormat = sal_False; if ( pTEParaPortion->GetWritingDirectionInfos().empty() ) @@ -2602,7 +2602,7 @@ sal_Bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, sal_Bo if ( pAttr ) { - nTmpEnd = Min( pAttr->GetEnd(), nEndPos ); + nTmpEnd = std::min( pAttr->GetEnd(), nEndPos ); // e.g. <A HREF="http://www.mopo.de/">Morgenpost</A> aText.AppendAscii( "<A HREF=\"" ); diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index c13fc5529e05..f4993d0ff1d3 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -579,7 +579,7 @@ void ImpVclMEdit::SetSelection( const Selection& rSelection ) else if ( aNewSelection.Max() > aText.Len() ) aNewSelection.Max() = aText.Len(); - long nEnd = Max( aNewSelection.Min(), aNewSelection.Max() ); + long nEnd = std::max( aNewSelection.Min(), aNewSelection.Max() ); TextSelection aTextSel; sal_uLong nPara = 0; sal_uInt16 nChar = 0; diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index fc875f7886e5..15d68f8b9b47 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -863,7 +863,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r MapMode aMap( MAP_100TH_INCH ); sal_Int32 nDPI = rConfigItem.ReadInt32( "Resolution", 75 ); - Fraction aFrac( 1, Min( Max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) ); + Fraction aFrac( 1, std::min( std::max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) ); aMap.SetScaleX( aFrac ); aMap.SetScaleY( aFrac ); diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index baba25d5facd..fa165d68c9df 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -437,8 +437,8 @@ void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount ) // falls Interlaced, werden die Zeilen kopiert if( nLastInterCount ) { - long nMinY = Min( (long) nLastImageY + 1, (long) nImageHeight - 1 ); - long nMaxY = Min( (long) nLastImageY + nLastInterCount, (long) nImageHeight - 1 ); + long nMinY = std::min( (long) nLastImageY + 1, (long) nImageHeight - 1 ); + long nMaxY = std::min( (long) nLastImageY + nLastInterCount, (long) nImageHeight - 1 ); // letzte gelesene Zeile kopieren, wenn Zeilen // nicht zusanmmenfallen ( kommt vorm wenn wir am Ende des Bildes sind ) diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx index c4024137c6ff..8a58bb1a8e65 100644 --- a/vcl/source/gdi/alpha.cxx +++ b/vcl/source/gdi/alpha.cxx @@ -106,8 +106,8 @@ sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRect if( pWriteAcc ) { - const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); - const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); + const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); + const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); const long nSrcEndX = aRectSrc.Left() + nWidth; const long nSrcEndY = aRectSrc.Top() + nHeight; long nDstY = aRectDst.Top(); @@ -136,8 +136,8 @@ sal_Bool AlphaMask::CopyPixel( const Rectangle& rRectDst, const Rectangle& rRect if( pWriteAcc ) { - const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); - const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); + const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); + const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); const long nSrcX = aRectSrc.Left(); const long nSrcY = aRectSrc.Top(); const long nSrcEndX1 = nSrcX + nWidth - 1L; @@ -197,8 +197,8 @@ sal_Bool AlphaMask::Replace( const Bitmap& rMask, sal_uInt8 cReplaceTransparency if( pMaskAcc && pAcc ) { const BitmapColor aReplace( cReplaceTransparency ); - const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() ); - const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() ); + const long nWidth = std::min( pMaskAcc->Width(), pAcc->Width() ); + const long nHeight = std::min( pMaskAcc->Height(), pAcc->Height() ); const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); for( long nY = 0L; nY < nHeight; nY++ ) diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 22f82249ef43..ecac87e3d013 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -332,7 +332,7 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDes if( nCount ) { - AnimationBitmap* pObj = maList[ Min( mnPos, nCount - 1 ) ]; + AnimationBitmap* pObj = maList[ std::min( mnPos, nCount - 1 ) ]; if( pOut->GetConnectMetaFile() || ( pOut->GetOutDevType() == OUTDEV_PRINTER ) @@ -352,7 +352,7 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDes void Animation::ImplRestartTimer( sal_uLong nTimeout ) { - maTimer.SetTimeout( Max( nTimeout, (sal_uLong)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L ); + maTimer.SetTimeout( std::max( nTimeout, (sal_uLong)(MIN_TIMEOUT + ( mnAnimCount - 1 ) * INC_TIMEOUT) ) * 10L ); maTimer.Start(); } diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index 030bed8d75e1..c78131be8c3b 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -922,8 +922,8 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst, if( pWriteAcc ) { - const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); - const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); + const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); + const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); const long nSrcEndX = aRectSrc.Left() + nWidth; const long nSrcEndY = aRectSrc.Top() + nHeight; long nDstY = aRectDst.Top(); @@ -975,8 +975,8 @@ sal_Bool Bitmap::CopyPixel( const Rectangle& rRectDst, if( pWriteAcc ) { - const long nWidth = Min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); - const long nHeight = Min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); + const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() ); + const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() ); const long nSrcX = aRectSrc.Left(); const long nSrcY = aRectSrc.Top(); const long nSrcEndX1 = nSrcX + nWidth - 1L; @@ -1329,8 +1329,8 @@ sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor ) if( pMaskAcc && pAcc ) { - const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() ); - const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() ); + const long nWidth = std::min( pMaskAcc->Width(), pAcc->Width() ); + const long nHeight = std::min( pMaskAcc->Height(), pAcc->Height() ); const BitmapColor aMaskWhite( pMaskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) ); BitmapColor aReplace; @@ -1406,8 +1406,8 @@ sal_Bool Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor ) if( pAcc && pAlphaAcc && pNewAcc ) { BitmapColor aCol; - const long nWidth = Min( pAlphaAcc->Width(), pAcc->Width() ); - const long nHeight = Min( pAlphaAcc->Height(), pAcc->Height() ); + const long nWidth = std::min( pAlphaAcc->Width(), pAcc->Width() ); + const long nHeight = std::min( pAlphaAcc->Height(), pAcc->Height() ); for( long nY = 0L; nY < nHeight; nY++ ) { @@ -1632,8 +1632,8 @@ sal_Bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine ) if( pMaskAcc && pAcc ) { - const long nWidth = Min( pMaskAcc->Width(), pAcc->Width() ); - const long nHeight = Min( pMaskAcc->Height(), pAcc->Height() ); + const long nWidth = std::min( pMaskAcc->Width(), pAcc->Width() ); + const long nHeight = std::min( pMaskAcc->Height(), pAcc->Height() ); const Color aColBlack( COL_BLACK ); BitmapColor aPixel; BitmapColor aMaskPixel; @@ -1776,8 +1776,8 @@ sal_Bool Bitmap::Blend( const AlphaMask& rAlpha, const Color& rBackgroundColor ) if( pAlphaAcc && pAcc ) { - const long nWidth = Min( pAlphaAcc->Width(), pAcc->Width() ); - const long nHeight = Min( pAlphaAcc->Height(), pAcc->Height() ); + const long nWidth = std::min( pAlphaAcc->Width(), pAcc->Width() ); + const long nHeight = std::min( pAlphaAcc->Height(), pAcc->Height() ); for( long nY = 0L; nY < nHeight; ++nY ) for( long nX = 0L; nX < nWidth; ++nX ) diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 99b7d7d7db01..b92d9fe7987b 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -224,7 +224,7 @@ void ImplCreateDitherMatrix( sal_uInt8 (*pDitherMatrix)[16][16] ) for ( j = 0; j < 4; j++ ) for ( k = 0; k < 4; k++ ) for ( l = 0; l < 4; l++ ) - nMax = Max ( pMtx[ (k<<2) + i][(l<<2 ) + j] = + nMax = std::max ( pMtx[ (k<<2) + i][(l<<2 ) + j] = (sal_uInt16) ( 0.5 + pMagic[i][j]*fVal + pMagic[k][l]*fVal16 ), nMax ); // Scale to interval [0;254] @@ -700,7 +700,7 @@ sal_Bool Bitmap::ImplConvertDown( sal_uInt16 nBitCount, Color* pExtColor ) pWriteAcc->SetPalette( aPal ); - for( nY = 0L; nY < Min( nHeight, 2L ); nY++, nYTmp++ ) + for( nY = 0L; nY < std::min( nHeight, 2L ); nY++, nYTmp++ ) { for( nX = 0L, pQLine2 = !nY ? pErrQuad1 : pErrQuad2; nX < nWidth; nX++ ) { @@ -1463,7 +1463,7 @@ sal_Bool Bitmap::ImplDitherFloyd16() long nYTmp = 0L; sal_Bool bQ1 = sal_True; - for( nY = 0L; nY < Min( nHeight, 2L ); nY++, nYTmp++ ) + for( nY = 0L; nY < std::min( nHeight, 2L ); nY++, nYTmp++ ) for( nX = 0L, pQLine2 = !nY ? pErrQuad1 : pErrQuad2; nX < nWidth; nX++ ) pQLine2[ nX ] = pReadAcc->GetPixel( nYTmp, nX ); @@ -1554,7 +1554,7 @@ sal_Bool Bitmap::ImplReduceSimple( sal_uInt16 nColorCount ) { Bitmap aNewBmp; BitmapReadAccess* pRAcc = AcquireReadAccess(); - const sal_uInt16 nColCount = Min( nColorCount, (sal_uInt16) 256 ); + const sal_uInt16 nColCount = std::min( nColorCount, (sal_uInt16) 256 ); sal_uInt16 nBitCount; sal_Bool bRet = sal_False; diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx index af2d0686defd..2851c4b32071 100644 --- a/vcl/source/gdi/bmpacc.cxx +++ b/vcl/source/gdi/bmpacc.cxx @@ -303,7 +303,7 @@ void BitmapWriteAccess::CopyScanline( long nY, const BitmapReadAccess& rReadAcc } else // TODO: use fastbmp infrastructure - for( long nX = 0L, nWidth = Min( mpBuffer->mnWidth, rReadAcc.Width() ); nX < nWidth; nX++ ) + for( long nX = 0L, nWidth = std::min( mpBuffer->mnWidth, rReadAcc.Width() ); nX < nWidth; nX++ ) SetPixel( nY, nX, rReadAcc.GetPixel( nY, nX ) ); } @@ -318,7 +318,7 @@ void BitmapWriteAccess::CopyScanline( long nY, ConstScanline aSrcScanline, ( !HasPalette() && nFormat > BMP_FORMAT_8BIT_PAL ), "No copying possible between palette and non palette scanlines!" ); - const sal_uLong nCount = Min( GetScanlineSize(), nSrcScanlineSize ); + const sal_uLong nCount = std::min( GetScanlineSize(), nSrcScanlineSize ); if( nCount ) { @@ -376,13 +376,13 @@ void BitmapWriteAccess::CopyBuffer( const BitmapReadAccess& rReadAcc ) if( ( GetScanlineFormat() == rReadAcc.GetScanlineFormat() ) && ( GetScanlineSize() == rReadAcc.GetScanlineSize() ) ) { - const long nHeight = Min( mpBuffer->mnHeight, rReadAcc.Height() ); + const long nHeight = std::min( mpBuffer->mnHeight, rReadAcc.Height() ); const sal_uLong nCount = nHeight * mpBuffer->mnScanlineSize; memcpy( mpBuffer->mpBits, rReadAcc.GetBuffer(), nCount ); } else - for( long nY = 0L, nHeight = Min( mpBuffer->mnHeight, rReadAcc.Height() ); nY < nHeight; nY++ ) + for( long nY = 0L, nHeight = std::min( mpBuffer->mnHeight, rReadAcc.Height() ); nY < nHeight; nY++ ) CopyScanline( nY, rReadAcc ); } diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index bdc23db0293a..63134b496917 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -860,7 +860,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { sal_Int32 nStrLen( aStr.getLength() ); - pDXAry = new sal_Int32[ Max( nAryLen, nStrLen ) ]; + pDXAry = new sal_Int32[ std::max( nAryLen, nStrLen ) ]; for( long j = 0L; j < nAryLen; j++ ) rIStm >> nTmp, pDXAry[ j ] = nTmp; diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index da38c34e68fc..14051a604e48 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2300,16 +2300,16 @@ void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pRepla long nVal; nVal = pSearchColors[ i ].GetRed(); - aColParam.pMinR[ i ] = (sal_uLong) Max( nVal - nTol, 0L ); - aColParam.pMaxR[ i ] = (sal_uLong) Min( nVal + nTol, 255L ); + aColParam.pMinR[ i ] = (sal_uLong) std::max( nVal - nTol, 0L ); + aColParam.pMaxR[ i ] = (sal_uLong) std::min( nVal + nTol, 255L ); nVal = pSearchColors[ i ].GetGreen(); - aColParam.pMinG[ i ] = (sal_uLong) Max( nVal - nTol, 0L ); - aColParam.pMaxG[ i ] = (sal_uLong) Min( nVal + nTol, 255L ); + aColParam.pMinG[ i ] = (sal_uLong) std::max( nVal - nTol, 0L ); + aColParam.pMaxG[ i ] = (sal_uLong) std::min( nVal + nTol, 255L ); nVal = pSearchColors[ i ].GetBlue(); - aColParam.pMinB[ i ] = (sal_uLong) Max( nVal - nTol, 0L ); - aColParam.pMaxB[ i ] = (sal_uLong) Min( nVal + nTol, 255L ); + aColParam.pMinB[ i ] = (sal_uLong) std::max( nVal - nTol, 0L ); + aColParam.pMaxB[ i ] = (sal_uLong) std::min( nVal + nTol, 255L ); } aColParam.pDstCols = pReplaceColors; diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx index 5ee810a969b3..40b86b4fb91f 100644 --- a/vcl/source/gdi/impanmvw.cxx +++ b/vcl/source/gdi/impanmvw.cxx @@ -158,7 +158,7 @@ void ImplAnimView::ImplDrawToPos( sal_uLong nPos ) Region* pOldClip = !maClip.IsNull() ? new Region( mpOut->GetClipRegion() ) : NULL; aVDev.SetOutputSizePixel( maSzPix, sal_False ); - nPos = Min( nPos, (sal_uLong) mpParent->Count() - 1UL ); + nPos = std::min( nPos, (sal_uLong) mpParent->Count() - 1UL ); for( sal_uLong i = 0UL; i <= nPos; i++ ) ImplDraw( i, &aVDev ); @@ -195,7 +195,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev ) Size aSizePix; Size aBmpSizePix; const sal_uLong nLastPos = mpParent->Count() - 1; - const AnimationBitmap& rAnm = mpParent->Get( (sal_uInt16) ( mnActPos = Min( nPos, nLastPos ) ) ); + const AnimationBitmap& rAnm = mpParent->Get( (sal_uInt16) ( mnActPos = std::min( nPos, nLastPos ) ) ); ImplGetPosSize( rAnm, aPosPix, aSizePix ); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index be5663754b6a..2bef0db497fe 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1091,7 +1091,7 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap ) if( pOStm ) { sal_uLong nFullLen = nHeaderLen + nLen; - sal_uLong nPartLen = Min( nFullLen, (sal_uLong) GRAPHIC_MAXPARTLEN ); + sal_uLong nPartLen = std::min( nFullLen, (sal_uLong) GRAPHIC_MAXPARTLEN ); sal_uInt8* pBuffer = (sal_uInt8*) rtl_allocateMemory( nPartLen ); pOStm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 093d94fdbcf7..9e011a4a2b05 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -883,8 +883,8 @@ ImplVectMap* ImplVectorizer::ImplExpand( BitmapReadAccess* pRAcc, const Color& r const long nNewWidth = ( nOldWidth << 2L ) + 4L; const long nNewHeight = ( nOldHeight << 2L ) + 4L; const BitmapColor aTest( pRAcc->GetBestMatchingColor( rColor ) ); - long* pMapIn = new long[ Max( nOldWidth, nOldHeight ) ]; - long* pMapOut = new long[ Max( nOldWidth, nOldHeight ) ]; + long* pMapIn = new long[ std::max( nOldWidth, nOldHeight ) ]; + long* pMapOut = new long[ std::max( nOldWidth, nOldHeight ) ]; long nX, nY, nTmpX, nTmpY; pMap = new ImplVectMap( nNewWidth, nNewHeight ); diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 1c5f8199cd01..c1ee2f0421ec 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -6317,7 +6317,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) ); Point aTempPos = rTargetDevice.LogicToPixel( aPos ); - nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( Min( lc_x1, lc_x2 ) ); + nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( std::min( lc_x1, lc_x2 ) ); nMnemonicY = rTargetDevice.GetOutOffYPixel() + aTempPos.Y() + rTargetDevice.ImplLogicWidthToDevicePixel( rTargetDevice.GetFontMetric().GetAscent() ); rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth ); } @@ -6386,7 +6386,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) ); Point aTempPos = rTargetDevice.LogicToPixel( aPos ); - nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( Min(lc_x1, lc_x2) ); + nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( std::min(lc_x1, lc_x2) ); nMnemonicY = rTargetDevice.GetOutOffYPixel() + aTempPos.Y() + rTargetDevice.ImplLogicWidthToDevicePixel( rTargetDevice.GetFontMetric().GetAscent() ); } @@ -6843,9 +6843,9 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr, long lc_x2 = pCaretXArray[ 2*(nMnemonicPos - nIndex)+1 ]; nMnemonicWidth = ::abs((int)(lc_x1 - lc_x2)); - Point aTempPos( Min(lc_x1,lc_x2), GetFontMetric().GetAscent() ); + Point aTempPos( std::min(lc_x1,lc_x2), GetFontMetric().GetAscent() ); if( bInvalidPos ) // #106952#, place behind the (last) character - aTempPos = Point( Max(lc_x1,lc_x2), GetFontMetric().GetAscent() ); + aTempPos = Point( std::max(lc_x1,lc_x2), GetFontMetric().GetAscent() ); aTempPos += rPos; aTempPos = LogicToPixel( aTempPos ); @@ -7296,8 +7296,8 @@ sal_Bool OutputDevice::GetTextBoundRect( Rectangle& rRect, long nXOffset = 0; if( nBase != nIndex ) { - xub_StrLen nStart = Min( nBase, nIndex ); - xub_StrLen nOfsLen = Max( nBase, nIndex ) - nStart; + xub_StrLen nStart = std::min( nBase, nIndex ); + xub_StrLen nOfsLen = std::max( nBase, nIndex ) - nStart; pSalLayout = ImplLayout( rStr, nStart, nOfsLen, aPoint, nLayoutWidth, pDXAry ); if( pSalLayout ) { @@ -7489,8 +7489,8 @@ sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector long nXOffset = 0; if( nBase != nIndex ) { - xub_StrLen nStart = Min( nBase, nIndex ); - xub_StrLen nOfsLen = Max( nBase, nIndex ) - nStart; + xub_StrLen nStart = std::min( nBase, nIndex ); + xub_StrLen nOfsLen = std::max( nBase, nIndex ) - nStart; pSalLayout = ImplLayout( rStr, nStart, nOfsLen, Point(0,0), nTWidth, pDXArray ); if( pSalLayout ) { diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx index db6488c050ab..dba20d33f504 100644 --- a/vcl/source/gdi/outdev4.cxx +++ b/vcl/source/gdi/outdev4.cxx @@ -173,7 +173,7 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect, } // Top darf nicht groesser als Bottom sein - aRect.Top() = Min( aRect.Top(), (long)(aRect.Bottom() - 1) ); + aRect.Top() = std::min( aRect.Top(), (long)(aRect.Bottom() - 1) ); long nMinRect = aRect.GetHeight(); @@ -228,12 +228,12 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect, nStepCount = nMinRect / nInc; } // minimal drei Schritte und maximal die Anzahl der Farbunterschiede - long nSteps = Max( nStepCount, 2L ); - long nCalcSteps = Abs( nRedSteps ); - long nTempSteps = Abs( nGreenSteps ); + long nSteps = std::max( nStepCount, 2L ); + long nCalcSteps = std::abs( nRedSteps ); + long nTempSteps = std::abs( nGreenSteps ); if ( nTempSteps > nCalcSteps ) nCalcSteps = nTempSteps; - nTempSteps = Abs( nBlueSteps ); + nTempSteps = std::abs( nBlueSteps ); if ( nTempSteps > nCalcSteps ) nCalcSteps = nTempSteps; if ( nCalcSteps < nSteps ) @@ -415,7 +415,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect, else pPolyPoly = NULL; - long nMinRect = Min( aRect.GetWidth(), aRect.GetHeight() ); + long nMinRect = std::min( aRect.GetWidth(), aRect.GetHeight() ); // Anzahl der Schritte berechnen, falls nichts uebergeben wurde if( !nStepCount ) @@ -436,12 +436,12 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect, } // minimal drei Schritte und maximal die Anzahl der Farbunterschiede - long nSteps = Max( nStepCount, 2L ); - long nCalcSteps = Abs( nRedSteps ); - long nTempSteps = Abs( nGreenSteps ); + long nSteps = std::max( nStepCount, 2L ); + long nCalcSteps = std::abs( nRedSteps ); + long nTempSteps = std::abs( nGreenSteps ); if ( nTempSteps > nCalcSteps ) nCalcSteps = nTempSteps; - nTempSteps = Abs( nBlueSteps ); + nTempSteps = std::abs( nBlueSteps ); if ( nTempSteps > nCalcSteps ) nCalcSteps = nTempSteps; if ( nCalcSteps < nSteps ) @@ -1079,7 +1079,7 @@ void OutputDevice::ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHa { Rectangle aRect( rPolyPoly.GetBoundRect() ); const long nLogPixelWidth = ImplDevicePixelToLogicWidth( 1 ); - const long nWidth = ImplDevicePixelToLogicWidth( Max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), 3L ) ); + const long nWidth = ImplDevicePixelToLogicWidth( std::max( ImplLogicWidthToDevicePixel( rHatch.GetDistance() ), 3L ) ); Point* pPtBuffer = new Point[ HATCH_MAXPOINTS ]; Point aPt1, aPt2, aEndPt1; Size aInc; diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index 8e9535bece34..4297e483bce8 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -67,8 +67,8 @@ void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLon if( mbOutputClipped ) return; - const long nDistX = Max( rDist.Width(), 1L ); - const long nDistY = Max( rDist.Height(), 1L ); + const long nDistX = std::max( rDist.Width(), 1L ); + const long nDistY = std::max( rDist.Height(), 1L ); long nX = ( rRect.Left() >= aDstRect.Left() ) ? rRect.Left() : ( rRect.Left() + ( ( aDstRect.Left() - rRect.Left() ) / nDistX ) * nDistX ); long nY = ( rRect.Top() >= aDstRect.Top() ) ? rRect.Top() : ( rRect.Top() + ( ( aDstRect.Top() - rRect.Top() ) / nDistY ) * nDistY ); const long nRight = aDstRect.Right(); @@ -327,7 +327,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly, Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() ); const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) ); - const long nBaseExtent = Max( FRound( aDPISize.Width() / 300. ), 1L ); + const long nBaseExtent = std::max( FRound( aDPISize.Width() / 300. ), 1L ); long nMove; const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 : ( nTransparencePercent < 38 ) ? 25 : diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx index 6b28d77e542f..ed02ae063460 100644 --- a/vcl/source/gdi/outmap.cxx +++ b/vcl/source/gdi/outmap.cxx @@ -114,7 +114,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY, const ImplMapRes& rMapRes, ImplThresholdRes& rThresRes ) { - if ( nDPIX && (LONG_MAX / nDPIX < Abs( rMapRes.mnMapScNumX ) ) ) // #111139# avoid div by zero + if ( nDPIX && (LONG_MAX / nDPIX < std::abs( rMapRes.mnMapScNumX ) ) ) // #111139# avoid div by zero { rThresRes.mnThresLogToPixX = 0; rThresRes.mnThresPixToLogX = 0; @@ -129,7 +129,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY, if ( !nProductX ) rThresRes.mnThresLogToPixX = LONG_MAX; else - rThresRes.mnThresLogToPixX = Abs( (LONG_MAX - nDenomHalfX) / nProductX ); + rThresRes.mnThresLogToPixX = std::abs( (LONG_MAX - nDenomHalfX) / nProductX ); if ( !nDenomX ) rThresRes.mnThresPixToLogX = LONG_MAX; @@ -139,7 +139,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY, rThresRes.mnThresPixToLogX = (long)(((sal_uLong)LONG_MAX + (sal_uLong)(-nProductX/2)) / nDenomX); } - if ( nDPIY && (LONG_MAX / nDPIY < Abs( rMapRes.mnMapScNumY ) ) ) // #111139# avoid div by zero + if ( nDPIY && (LONG_MAX / nDPIY < std::abs( rMapRes.mnMapScNumY ) ) ) // #111139# avoid div by zero { rThresRes.mnThresLogToPixY = 0; rThresRes.mnThresPixToLogY = 0; @@ -154,7 +154,7 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY, if ( !nProductY ) rThresRes.mnThresLogToPixY = LONG_MAX; else - rThresRes.mnThresLogToPixY = Abs( (LONG_MAX - nDenomHalfY) / nProductY ); + rThresRes.mnThresLogToPixY = std::abs( (LONG_MAX - nDenomHalfY) / nProductY ); if ( !nDenomY ) rThresRes.mnThresPixToLogY = LONG_MAX; @@ -628,12 +628,12 @@ LineInfo OutputDevice::ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const if( aInfo.GetStyle() == LINE_DASH ) { if( aInfo.GetDotCount() && aInfo.GetDotLen() ) - aInfo.SetDotLen( Max( ImplLogicWidthToDevicePixel( aInfo.GetDotLen() ), 1L ) ); + aInfo.SetDotLen( std::max( ImplLogicWidthToDevicePixel( aInfo.GetDotLen() ), 1L ) ); else aInfo.SetDotCount( 0 ); if( aInfo.GetDashCount() && aInfo.GetDashLen() ) - aInfo.SetDashLen( Max( ImplLogicWidthToDevicePixel( aInfo.GetDashLen() ), 1L ) ); + aInfo.SetDashLen( std::max( ImplLogicWidthToDevicePixel( aInfo.GetDashLen() ), 1L ) ); else aInfo.SetDashCount( 0 ); @@ -1701,14 +1701,14 @@ static long fn5( const long n1, { if ( n1 == 0 || n2 == 0 || n3 == 0 || n4 == 0 || n5 == 0 ) return 0; - if ( LONG_MAX / Abs(n2) < Abs(n3) ) + if ( LONG_MAX / std::abs(n2) < std::abs(n3) ) { // a6 wird "ubersprungen BigInt a7 = n2; a7 *= n3; a7 *= n1; - if ( LONG_MAX / Abs(n4) < Abs(n5) ) + if ( LONG_MAX / std::abs(n4) < std::abs(n5) ) { BigInt a8 = n4; a8 *= n5; @@ -1739,12 +1739,12 @@ static long fn5( const long n1, { long n6 = n2 * n3; - if ( LONG_MAX / Abs(n1) < Abs(n6) ) + if ( LONG_MAX / std::abs(n1) < std::abs(n6) ) { BigInt a7 = n1; a7 *= n6; - if ( LONG_MAX / Abs(n4) < Abs(n5) ) + if ( LONG_MAX / std::abs(n4) < std::abs(n5) ) { BigInt a8 = n4; a8 *= n5; @@ -1775,7 +1775,7 @@ static long fn5( const long n1, { long n7 = n1 * n6; - if ( LONG_MAX / Abs(n4) < Abs(n5) ) + if ( LONG_MAX / std::abs(n4) < std::abs(n5) ) { BigInt a7 = n7; BigInt a8 = n4; @@ -1817,7 +1817,7 @@ static long fn3( const long n1, const long n2, const long n3 ) { if ( n1 == 0 || n2 == 0 || n3 == 0 ) return 0; - if ( LONG_MAX / Abs(n1) < Abs(n2) ) + if ( LONG_MAX / std::abs(n1) < std::abs(n2) ) { BigInt a4 = n1; a4 *= n2; diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index e359f59a1678..5b149a061a47 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -1142,10 +1142,10 @@ void Region::ImplCreateRectRegion( const Rectangle& rRect ) else { // get justified rectangle - long nTop = Min( rRect.Top(), rRect.Bottom() ); - long nBottom = Max( rRect.Top(), rRect.Bottom() ); - long nLeft = Min( rRect.Left(), rRect.Right() ); - long nRight = Max( rRect.Left(), rRect.Right() ); + long nTop = std::min( rRect.Top(), rRect.Bottom() ); + long nBottom = std::max( rRect.Top(), rRect.Bottom() ); + long nLeft = std::min( rRect.Left(), rRect.Right() ); + long nRight = std::max( rRect.Left(), rRect.Right() ); // create instance of implementation class mpImplRegion = new ImplRegion(); @@ -1378,10 +1378,10 @@ void Region::Union( const Rectangle& rRect ) ImplCopyData(); // get justified rectangle - long nLeft = Min( rRect.Left(), rRect.Right() ); - long nTop = Min( rRect.Top(), rRect.Bottom() ); - long nRight = Max( rRect.Left(), rRect.Right() ); - long nBottom = Max( rRect.Top(), rRect.Bottom() ); + long nLeft = std::min( rRect.Left(), rRect.Right() ); + long nTop = std::min( rRect.Top(), rRect.Bottom() ); + long nRight = std::max( rRect.Left(), rRect.Right() ); + long nBottom = std::max( rRect.Top(), rRect.Bottom() ); // insert bands if the boundaries are not already in the list mpImplRegion->InsertBands( nTop, nBottom ); @@ -1480,10 +1480,10 @@ void Region::Intersect( const Rectangle& rRect ) return; // get justified rectangle - long nLeft = Min( rRect.Left(), rRect.Right() ); - long nTop = Min( rRect.Top(), rRect.Bottom() ); - long nRight = Max( rRect.Left(), rRect.Right() ); - long nBottom = Max( rRect.Top(), rRect.Bottom() ); + long nLeft = std::min( rRect.Left(), rRect.Right() ); + long nTop = std::min( rRect.Top(), rRect.Bottom() ); + long nRight = std::max( rRect.Left(), rRect.Right() ); + long nBottom = std::max( rRect.Top(), rRect.Bottom() ); // is own region NULL-region? -> copy data! if ( mpImplRegion == &aImplNullRegion ) @@ -1583,10 +1583,10 @@ void Region::Exclude( const Rectangle& rRect ) ImplCopyData(); // get justified rectangle - long nLeft = Min( rRect.Left(), rRect.Right() ); - long nTop = Min( rRect.Top(), rRect.Bottom() ); - long nRight = Max( rRect.Left(), rRect.Right() ); - long nBottom = Max( rRect.Top(), rRect.Bottom() ); + long nLeft = std::min( rRect.Left(), rRect.Right() ); + long nTop = std::min( rRect.Top(), rRect.Bottom() ); + long nRight = std::max( rRect.Left(), rRect.Right() ); + long nBottom = std::max( rRect.Top(), rRect.Bottom() ); // insert bands if the boundaries are not already in the list mpImplRegion->InsertBands( nTop, nBottom ); @@ -1645,10 +1645,10 @@ void Region::XOr( const Rectangle& rRect ) ImplCopyData(); // get justified rectangle - long nLeft = Min( rRect.Left(), rRect.Right() ); - long nTop = Min( rRect.Top(), rRect.Bottom() ); - long nRight = Max( rRect.Left(), rRect.Right() ); - long nBottom = Max( rRect.Top(), rRect.Bottom() ); + long nLeft = std::min( rRect.Left(), rRect.Right() ); + long nTop = std::min( rRect.Top(), rRect.Bottom() ); + long nRight = std::max( rRect.Left(), rRect.Right() ); + long nBottom = std::max( rRect.Top(), rRect.Bottom() ); // insert bands if the boundaries are not already in the list mpImplRegion->InsertBands( nTop, nBottom ); @@ -2091,8 +2091,8 @@ Rectangle Region::GetBoundRect() const while ( pBand ) { nYBottom = pBand->mnYBottom; - nXLeft = Min( nXLeft, pBand->GetXLeftBoundary() ); - nXRight = Max( nXRight, pBand->GetXRightBoundary() ); + nXLeft = std::min( nXLeft, pBand->GetXLeftBoundary() ); + nXRight = std::max( nXRight, pBand->GetXRightBoundary() ); pBand = pBand->mpNextBand; } diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 1f7de7a612f6..1c5c42dde8bd 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -38,7 +38,7 @@ long AdjustRectToSquare( Rectangle &rRect ) { const long nWidth = rRect.GetWidth(); const long nHeight = rRect.GetHeight(); - long nSide = Min( nWidth, nHeight ); + long nSide = std::min( nWidth, nHeight ); if ( nSide && !(nSide & 1) ) { diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index f0e7cf315031..d9d84384eacb 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2295,7 +2295,7 @@ Size Menu::ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lon } } } - return Size(Max(nCheckWidth, nRadioWidth), Max(rCheckHeight, rRadioHeight)); + return Size(std::max(nCheckWidth, nRadioWidth), std::max(rCheckHeight, rRadioHeight)); } sal_Bool Menu::ImplGetNativeSubmenuArrowSize( Window* pWin, Size& rArrowSize, long& rArrowSpacing ) const @@ -2464,7 +2464,7 @@ Size Menu::ImplCalcSize( Window* pWin ) aSz.Width() += pData->aSz.Width(); } else - pData->aSz.Height() = Max( Max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ); + pData->aSz.Height() = std::max( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ); nWidth += nTextWidth; } @@ -2484,7 +2484,7 @@ Size Menu::ImplCalcSize( Window* pWin ) if ( nFontHeight > nWidth ) nWidth += nFontHeight; - pData->aSz.Height() = Max( Max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ); + pData->aSz.Height() = std::max( std::max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ); } pData->aSz.Height() += EXTRAITEMHEIGHT; // little bit more distance @@ -2510,14 +2510,14 @@ Size Menu::ImplCalcSize( Window* pWin ) if( nMaxWidth > nScreenWidth/2 ) nMaxWidth = nScreenWidth/2; - sal_uInt16 gfxExtra = (sal_uInt16) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text + sal_uInt16 gfxExtra = (sal_uInt16) std::max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text nImgOrChkPos = (sal_uInt16)nExtra; long nImgOrChkWidth = 0; if( aMaxSize.Height() > 0 ) // NWF case nImgOrChkWidth = aMaxSize.Height() + nExtra; else // non NWF case nImgOrChkWidth = nFontHeight/2 + gfxExtra; - nImgOrChkWidth = Max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra ); + nImgOrChkWidth = std::max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra ); nTextPos = (sal_uInt16)(nImgOrChkPos + nImgOrChkWidth); nTextPos = nTextPos + gfxExtra; diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx index 627f2041fbe6..61744e1fe8aa 100644 --- a/vcl/source/window/scrwnd.cxx +++ b/vcl/source/window/scrwnd.cxx @@ -356,7 +356,7 @@ IMPL_LINK_NOARG(ImplWheelWindow, ImplScrollHdl) pWindow->Command( aCEvt ); if( aDel.IsDead() ) return 0; - mnRepaintTime = Max( Time::GetSystemTicks() - nTime, (sal_uLong)1 ); + mnRepaintTime = std::max( Time::GetSystemTicks() - nTime, (sal_uLong)1 ); ImplRecalcScrollValues(); } } diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 9805e5ae12d0..a0967ce33378 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -555,7 +555,7 @@ static void ImplCalcSet( ImplSplitSet* pSet, } } // Rundungsfehler werden hier nicht ausgelichen - if ( (nAbsItems < (sal_uInt16)(Abs( nSizeDelta ))) && nSizeWinSize ) + if ( (nAbsItems < (sal_uInt16)(std::abs( nSizeDelta ))) && nSizeWinSize ) { for ( i = 0; i < nItems; i++ ) { diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 505177d9836b..cb82af669cde 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -372,7 +372,7 @@ void StatusBar::ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth ) if ( bOffScreen ) { - long nMaxWidth = Max( nOldTextWidth, GetTextWidth( aStr ) ); + long nMaxWidth = std::max( nOldTextWidth, GetTextWidth( aStr ) ); Size aVirDevSize( nMaxWidth, aTextRect.GetHeight() ); mpImplData->mpVirDev->SetOutputSizePixel( aVirDevSize ); Rectangle aTempRect = aTextRect; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 53b349f48a1b..bc59719e026c 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -555,7 +555,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl // generate readable fonts enforce a minimum font size of 9 points bool bBrokenLangFontHeight = MsLangId::isCJK(Application::GetSettings().GetUILanguageTag().getLanguageType()); if (bBrokenLangFontHeight) - defFontheight = Max(9, defFontheight); + defFontheight = std::max(9, defFontheight); // i22098, toolfont will be scaled differently to avoid bloated rulers and status bars for big fonts int toolfontheight = defFontheight; diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 1cac7b351ea8..838809530cd6 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -886,7 +886,7 @@ void Window::SetZoomedPointFont( const Font& rFont ) // Use another font if the representation is to be scaled, // and the actual font is not scalable FontMetric aMetric = GetFontMetric(); - long nFontDiff = Abs( GetFont().GetSize().Height()-aMetric.GetSize().Height() ); + long nFontDiff = std::abs( GetFont().GetSize().Height()-aMetric.GetSize().Height() ); if ( (aMetric.GetType() == TYPE_RASTER) && (nFontDiff >= 2) ) { sal_uInt16 nType; diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 98c856b3701f..2a296ca8309d 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1278,7 +1278,7 @@ static long ImplHandleExtTextInput( Window* pWindow, // Test for changes sal_Bool bOnlyCursor = sal_False; - xub_StrLen nMinLen = Min( pWinData->mpExtOldText->getLength(), sal_Int32(rText.Len()) ); + xub_StrLen nMinLen = std::min( pWinData->mpExtOldText->getLength(), sal_Int32(rText.Len()) ); xub_StrLen nDeltaStart = 0; while ( nDeltaStart < nMinLen ) { diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 9c9bdd164fb2..9c7a798ed274 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -360,7 +360,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( else if( aSrcBuf.mnBitCount <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed() + const sal_uInt16 nCols = std::min( (sal_uLong)rColMap.GetUsed() , (sal_uLong)(1 << nDrawableDepth) ); @@ -520,7 +520,7 @@ XImage* X11SalBitmap::ImplCreateXImage( else if( pImage->depth <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed() + const sal_uInt16 nCols = std::min( (sal_uLong)rColMap.GetUsed() , (sal_uLong)(1 << pImage->depth) ); diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx index 1840aee0ad94..7b5f7bbf3790 100644 --- a/vcl/win/source/gdi/salbmp.cxx +++ b/vcl/win/source/gdi/salbmp.cxx @@ -355,7 +355,7 @@ HGLOBAL WinSalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBits, const if ( nColors ) { - const sal_uInt16 nMinCount = Min( nColors, rPal.GetEntryCount() ); + const sal_uInt16 nMinCount = std::min( nColors, rPal.GetEntryCount() ); if( nMinCount ) memcpy( pBI->bmiColors, rPal.ImplGetColorBuffer(), nMinCount * sizeof( RGBQUAD ) ); @@ -526,7 +526,7 @@ void WinSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) PBITMAPINFO pBI = (PBITMAPINFO) GlobalLock( mhDIB ); const sal_uInt16 nCount = pBuffer->maPalette.GetEntryCount(); const sal_uInt16 nDIBColorCount = ImplGetDIBColorCount( mhDIB ); - memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), Min( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) ); + memcpy( pBI->bmiColors, pBuffer->maPalette.ImplGetColorBuffer(), std::min( nDIBColorCount, nCount ) * sizeof( RGBQUAD ) ); GlobalUnlock( mhDIB ); } diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx index 51c8a5b8d831..7bba68e43354 100644 --- a/vcl/win/source/gdi/salgdi.cxx +++ b/vcl/win/source/gdi/salgdi.cxx @@ -225,7 +225,7 @@ void ImplInitSalGDI() pSalData->mpDitherLow[ n ] = (BYTE) ( n & 248 ); for( n = 0; n < 256L; n++ ) - pSalData->mpDitherHigh[ n ] = (BYTE) Min( pSalData->mpDitherLow[ n ] + 8L, 255L ); + pSalData->mpDitherHigh[ n ] = (BYTE) std::min( pSalData->mpDitherLow[ n ] + 8L, 255L ); } } else if ( (nRasterCaps & RC_PALETTE) && (nBitCount == 8) ) @@ -303,7 +303,7 @@ void ImplInitSalGDI() pSalData->mpDitherLow[ n ] = (BYTE) ( n / 51L ); for( n = 0; n < 256L; n++ ) - pSalData->mpDitherHigh[ n ] = (BYTE)Min( pSalData->mpDitherLow[ n ] + 1, 5 ); + pSalData->mpDitherHigh[ n ] = (BYTE)std::min( pSalData->mpDitherLow[ n ] + 1, 5 ); } // get system color entries diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 1d08d50585bf..59fb0e641777 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -2037,7 +2037,7 @@ static bool ImplGetFontAttrFromFile( const String& rFontFileURL, char aResourceName[512]; int nMaxLen = sizeof(aResourceName)/sizeof(*aResourceName) - 16; int nLen = ::GetTempPathA( nMaxLen, aResourceName ); - ::strncpy( aResourceName + nLen, aFileName, Max( 0, nMaxLen - nLen )); + ::strncpy( aResourceName + nLen, aFileName, std::max( 0, nMaxLen - nLen )); ::DeleteFileA( aResourceName ); // Create font resource file (typically with a .fot file name extension). diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index e9a28031d54c..41271b02c954 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2534,7 +2534,7 @@ bool UniscribeLayout::KashidaWordFix ( int nMinGlyphPos, int nEndGlyphPos, int* { if( i == nKashPos ) continue; - nSteal = Min( mnMinKashidaWidth - nSpaceAdded, nSteal ); + nSteal = std::min( mnMinKashidaWidth - nSpaceAdded, nSteal ); if ( nSteal > 0 ) { mpJustifications [ i ] -= nSteal; diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index ce35e02f03d6..05ecefdb44d1 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -4650,7 +4650,7 @@ static int ImplMeasureItem( HWND hWnd, WPARAM wParam, LPARAM lParam ) Size checkSize( GetSystemMetrics( SM_CXMENUCHECK ), GetSystemMetrics( SM_CYMENUCHECK ) ); pMI->itemWidth = checkSize.Width() + 3 + bmpSize.Width() + 3 + strSize.cx; - pMI->itemHeight = Max( Max( checkSize.Height(), bmpSize.Height() ), strSize.cy ); + pMI->itemHeight = std::max( std::max( checkSize.Height(), bmpSize.Height() ), strSize.cy ); pMI->itemHeight += 4; DeleteObject( SelectObject(hdc, hfntOld) ); diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx index 58b895e24f4e..f55e05f72ee4 100644 --- a/xmloff/source/draw/shapeexport4.cxx +++ b/xmloff/source/draw/shapeexport4.cxx @@ -343,7 +343,7 @@ void ImpExportEnhancedPath( SvXMLExport& rExport, break; case 1 : { - aSegment.Count = (sal_Int16)Min( nCoords - 1, (sal_Int32)32767 ); + aSegment.Count = (sal_Int16)std::min( nCoords - 1, (sal_Int32)32767 ); aSegment.Command = com::sun::star::drawing::EnhancedCustomShapeSegmentCommand::LINETO; } break; diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 36461fe48922..a667cad7ef77 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -147,7 +147,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif // dynamic length because of the different languages long nWidth1 = maIssuedToLabelFI.GetTextWidth( maIssuedToLabelFI.GetText() ); long nWidth2 = maIssuedByLabelFI.GetTextWidth( maIssuedByLabelFI.GetText() ); - long nNewWidth = Max( nWidth1, nWidth2 ) + 5; + long nNewWidth = std::max( nWidth1, nWidth2 ) + 5; Size aNewSize = maIssuedToLabelFI.GetSizePixel(); aNewSize.Width() = nNewWidth; maIssuedToLabelFI.SetSizePixel( aNewSize ); |