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 /sc/source/ui/view | |
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 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/cellsh3.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/hdrcont.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/hintwin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/olinewin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 22 | ||||
-rw-r--r-- | sc/source/ui/view/tabcont.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/tabview4.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewutil.cxx | 24 |
15 files changed, 47 insertions, 47 deletions
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 ); } } |