diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-04-11 00:21:40 -0300 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-04-20 11:09:54 +0000 |
commit | 0f200cc30ea75fdce59f7bb6ae87ebc85729e2a4 (patch) | |
tree | 2e2c28f9500f81825cdadcbabd131da767ddbb49 /sd | |
parent | 5414a3eecdb09be928313477792acfe1d3534645 (diff) |
fdo#63154: Change Min/Max/Abs for std::min/max/abs
Now all these usages were removed from LO.
Change-Id: I8a7233db20abdcdbb18428ad4004c78cc516a0e6
Reviewed-on: https://gerrit.libreoffice.org/3326
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sd')
26 files changed, 85 insertions, 85 deletions
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 ); |