Use std::min and std::max, not the misc versions.

This commit is contained in:
2025-08-10 17:08:42 -04:00
parent 6c3bf19bbd
commit 640ccd02d3
26 changed files with 216 additions and 226 deletions

View File

@ -447,7 +447,7 @@ int OOFFloatsMgr::calcFloatX (Float *vloat)
// it is corrected (but not left of the container). This way, we save
// space and, especially within tables, avoid some problems.
if (x + vloat->size.width > container->getMaxGeneratorWidth ())
x = max (0, container->getMaxGeneratorWidth () - vloat->size.width);
x = std::max (0, container->getMaxGeneratorWidth () - vloat->size.width);
break;
case FLOAT_RIGHT:
@ -475,10 +475,10 @@ int OOFFloatsMgr::calcFloatX (Float *vloat)
// (ii) If there is more than one line, the line break will already be
// exceeded, and so be smaller that GB width + float width.
effGeneratorWidth =
min (vloat->generator->getGeneratorWidth () + vloat->size.width,
std::min (vloat->generator->getGeneratorWidth () + vloat->size.width,
vloat->generator->getMaxGeneratorWidth ());
x = max (generator->getGeneratorX (oofmIndex) + effGeneratorWidth
x = std::max (generator->getGeneratorX (oofmIndex) + effGeneratorWidth
- vloat->size.width - generator->getStyle()->boxRestWidth(),
// Do not exceed container allocation:
0);
@ -959,9 +959,9 @@ void OOFFloatsMgr::getSize (Requisition *cbReq, int *oofWidth, int *oofHeight)
// boxRestHeight() are added here.
*oofWidth =
max (oofWidthtLeft, oofWidthRight) + container->boxRestWidth ();
std::max (oofWidthtLeft, oofWidthRight) + container->boxRestWidth ();
*oofHeight =
max (oofHeightLeft, oofHeightRight) + container->boxRestHeight ();
std::max (oofHeightLeft, oofHeightRight) + container->boxRestHeight ();
SizeChanged = true;
@ -994,8 +994,8 @@ void OOFFloatsMgr::getFloatsSize (Requisition *cbReq, Side side, int *width,
ensureFloatSize (vloat);
*width = max (*width, calcFloatX (vloat) + vloat->size.width);
*height = max (*height,
*width = std::max (*width, calcFloatX (vloat) + vloat->size.width);
*height = std::max (*height,
vloat->yReal + vloat->size.ascent + vloat->size.descent);
}
@ -1017,8 +1017,8 @@ void OOFFloatsMgr::getExtremes (Extremes *cbExtr, int *oofMinWidth,
getFloatsExtremes (cbExtr, LEFT, &oofMinWidthtLeft, &oofMaxWidthLeft);
getFloatsExtremes (cbExtr, RIGHT, &oofMinWidthRight, &oofMaxWidthRight);
*oofMinWidth = max (oofMinWidthtLeft, oofMinWidthRight);
*oofMaxWidth = max (oofMaxWidthLeft, oofMaxWidthRight);
*oofMinWidth = std::max (oofMinWidthtLeft, oofMinWidthRight);
*oofMaxWidth = std::max (oofMaxWidthLeft, oofMaxWidthRight);
DBG_OBJ_MSGF ("resize.oofm", 1,
"=> (l: %d, r: %d => %d) / (l: %d, r: %d => %d)",
@ -1059,13 +1059,13 @@ void OOFFloatsMgr::getFloatsExtremes (Extremes *cbExtr, Side side,
// - This is also the case for the left border, as seen in calcFloatX()
// ("... but when the float exceeds the line break width" ...).
*minWidth = max (*minWidth, extr.minWidth);
*minWidth = std::max (*minWidth, extr.minWidth);
// For the maximal width, borders must be considered.
*maxWidth = max (*maxWidth,
*maxWidth = std::max ( std::max(*maxWidth,
extr.maxWidth
+ vloat->generator->getStyle()->boxDiffWidth(),
+ max (container->getGeneratorWidth ()
+ vloat->generator->getStyle()->boxDiffWidth() ) ,
+ std::max (container->getGeneratorWidth ()
- vloat->generator->getGeneratorWidth (),
0));
@ -1171,7 +1171,7 @@ int OOFFloatsMgr::getBorder (Side side, int y, int h, OOFAwareWidget *lastGB,
DBG_OBJ_MSGF ("border", 1, "thisBorder = %d + %d = %d",
vloat->size.width, d, thisBorder);
border = max (border, thisBorder);
border = std::max (border, thisBorder);
}
}
}
@ -1265,7 +1265,7 @@ int OOFFloatsMgr::getClearPosition (OOFAwareWidget *widget)
default: assertNotReached ();
}
pos = max (left ? getClearPosition (widget, LEFT) : 0,
pos = std::max (left ? getClearPosition (widget, LEFT) : 0,
right ? getClearPosition (widget, RIGHT) : 0);
} else
pos = 0;
@ -1306,7 +1306,7 @@ int OOFFloatsMgr::getClearPosition (OOFAwareWidget *widget, Side side)
assert (vloat->generator != widget);
ensureFloatSize (vloat);
int yRel = widget->getGeneratorY (oofmIndex);
pos = max (vloat->yReal + vloat->size.ascent + vloat->size.descent - yRel,
pos = std::max (vloat->yReal + vloat->size.ascent + vloat->size.descent - yRel,
0);
DBG_OBJ_MSGF ("resize.oofm", 1, "pos = max (%d + %d + %d - %d, 0)",
vloat->yReal, vloat->size.ascent, vloat->size.descent,