Skip to content
Permalink
Browse files

qMin/qMax -> std::min/max

  • Loading branch information
nyalldawson committed Aug 25, 2017
1 parent 641d78b commit 2d192791c29980429104babca34f3e82a051a861
Showing with 452 additions and 452 deletions.
  1. +1 −1 src/analysis/interpolation/DualEdgeTriangulation.cc
  2. +2 −2 src/analysis/interpolation/MathUtils.cc
  3. +1 −1 src/analysis/raster/qgshillshadefilter.cpp
  4. +2 −2 src/analysis/raster/qgskde.cpp
  5. +4 −4 src/analysis/vector/qgsgeometrysnapper.cpp
  6. +2 −2 src/analysis/vector/qgszonalstatistics.h
  7. +1 −1 src/app/nodetool/qgsnodetool.cpp
  8. +1 −1 src/app/qgsaddattrdialog.cpp
  9. +1 −1 src/app/qgsattributetabledialog.cpp
  10. +2 −2 src/app/qgsdiagramproperties.cpp
  11. +1 −1 src/app/qgsfieldcalculator.cpp
  12. +2 −2 src/app/qgsidentifyresultsdialog.cpp
  13. +1 −1 src/app/qgsmeasuredialog.cpp
  14. +3 −3 src/app/qgsrasterlayerproperties.cpp
  15. +2 −2 src/app/qgsrulebasedlabelingwidget.cpp
  16. +4 −4 src/app/qgsvariantdelegate.cpp
  17. +1 −1 src/app/qgswelcomepageitemsmodel.cpp
  18. +5 −5 src/core/composer/qgscomposerarrow.cpp
  19. +2 −2 src/core/composer/qgscomposerattributetablemodelv2.cpp
  20. +2 −2 src/core/composer/qgscomposerframe.cpp
  21. +2 −2 src/core/composer/qgscomposerhtml.cpp
  22. +1 −1 src/core/composer/qgscomposerlabel.cpp
  23. +4 −4 src/core/composer/qgscomposermap.cpp
  24. +19 −19 src/core/composer/qgscomposermapgrid.cpp
  25. +7 −7 src/core/composer/qgscomposertablev2.cpp
  26. +6 −6 src/core/composer/qgscomposition.cpp
  27. +3 −3 src/core/diagram/qgshistogramdiagram.cpp
  28. +1 −1 src/core/diagram/qgspiediagram.cpp
  29. +1 −1 src/core/diagram/qgstextdiagram.cpp
  30. +16 −16 src/core/effects/qgsimageoperation.cpp
  31. +1 −1 src/core/expression/qgsexpressionfunction.cpp
  32. +6 −6 src/core/geometry/qgsbox3d.cpp
  33. +2 −2 src/core/geometry/qgscircularstring.cpp
  34. +1 −1 src/core/geometry/qgsgeos.cpp
  35. +3 −3 src/core/geometry/qgsinternalgeometryengine.cpp
  36. +1 −1 src/core/geometry/qgslinestring.cpp
  37. +1 −1 src/core/geometry/qgspolygon.cpp
  38. +1 −1 src/core/geometry/qgsrectangle.cpp
  39. +1 −1 src/core/layertree/qgslayertreemodel.cpp
  40. +5 −5 src/core/layertree/qgslayertreemodellegendnode.cpp
  41. +2 −2 src/core/layout/qgslayoutitempage.cpp
  42. +1 −1 src/core/layout/qgslayoutpagecollection.cpp
  43. +7 −7 src/core/pal/feature.cpp
  44. +5 −5 src/core/pal/labelposition.cpp
  45. +1 −1 src/core/pal/pointset.cpp
  46. +2 −2 src/core/pal/rtree.hpp
  47. +2 −2 src/core/qgis.cpp
  48. +8 −8 src/core/qgscolorramp.cpp
  49. +1 −1 src/core/qgsdatadefinedsizelegend.cpp
  50. +2 −2 src/core/qgsdatetimestatisticalsummary.cpp
  51. +1 −1 src/core/qgsdiagramrenderer.cpp
  52. +19 −19 src/core/qgslegendrenderer.cpp
  53. +1 −1 src/core/qgsmaptopixelgeometrysimplifier.cpp
  54. +2 −2 src/core/qgsmapunitscale.cpp
  55. +2 −2 src/core/qgspallabeling.cpp
  56. +4 −4 src/core/qgspointxy.cpp
  57. +4 −4 src/core/qgsrenderchecker.cpp
  58. +6 −6 src/core/qgsrendercontext.cpp
  59. +1 −1 src/core/qgssnappingutils.cpp
  60. +2 −2 src/core/qgsstatisticalsummary.cpp
  61. +4 −4 src/core/qgsstringstatisticalsummary.cpp
  62. +1 −1 src/core/qgsstringutils.cpp
  63. +2 −2 src/core/qgstextrenderer.cpp
  64. +1 −1 src/core/qgsvectorfilewriter.cpp
  65. +1 −1 src/core/qgsvectorlayereditbuffer.cpp
  66. +2 −2 src/core/qgsvectorlayerlabeling.cpp
  67. +2 −2 src/core/raster/qgscolorrampshader.cpp
  68. +1 −1 src/core/raster/qgshillshaderenderer.cpp
  69. +2 −2 src/core/raster/qgshuesaturationfilter.cpp
  70. +6 −6 src/core/raster/qgsrasterblock.cpp
  71. +2 −2 src/core/raster/qgsrasterdataprovider.cpp
  72. +5 −5 src/core/raster/qgsrasterinterface.cpp
  73. +2 −2 src/core/raster/qgsrasteriterator.cpp
  74. +4 −4 src/core/raster/qgsrasterpipe.cpp
  75. +1 −1 src/core/simplify/effectivearea.h
  76. +10 −10 src/core/symbology/qgsfillsymbollayer.cpp
  77. +5 −5 src/core/symbology/qgsgraduatedsymbolrenderer.cpp
  78. +3 −3 src/core/symbology/qgsheatmaprenderer.cpp
  79. +1 −1 src/core/symbology/qgslinesymbollayer.cpp
  80. +6 −6 src/core/symbology/qgspointdisplacementrenderer.cpp
  81. +4 −4 src/core/symbology/qgssymbollayerutils.cpp
  82. +1 −1 src/gui/attributetable/qgsattributetablefiltermodel.cpp
  83. +1 −1 src/gui/attributetable/qgsattributetablemodel.cpp
  84. +2 −2 src/gui/attributetable/qgsattributetableview.cpp
  85. +2 −2 src/gui/attributetable/qgsfeaturelistview.cpp
  86. +1 −1 src/gui/attributetable/qgsfeaturelistviewdelegate.cpp
  87. +2 −2 src/gui/editorwidgets/qgsdatetimeedit.cpp
  88. +2 −2 src/gui/editorwidgets/qgsdoublespinbox.cpp
  89. +2 −2 src/gui/editorwidgets/qgsspinbox.cpp
  90. +1 −1 src/gui/effects/qgseffectstackpropertieswidget.cpp
  91. +2 −2 src/gui/locator/qgslocatorwidget.cpp
  92. +1 −1 src/gui/qgscolorbutton.cpp
  93. +3 −3 src/gui/qgscolorswatchgrid.cpp
  94. +12 −12 src/gui/qgscolorwidgets.cpp
  95. +2 −2 src/gui/qgscomposerview.cpp
  96. +1 −1 src/gui/qgscompoundcolorwidget.cpp
  97. +2 −2 src/gui/qgscurveeditorwidget.cpp
  98. +8 −8 src/gui/qgsfontbutton.cpp
  99. +1 −1 src/gui/qgshighlight.cpp
  100. +2 −2 src/gui/qgshistogramwidget.cpp
  101. +2 −2 src/gui/qgsmapcanvas.cpp
  102. +4 −4 src/gui/qgsmapcanvasannotationitem.cpp
  103. +1 −1 src/gui/qgsmaptoolzoom.cpp
  104. +3 −3 src/gui/qgsprevieweffect.cpp
  105. +3 −3 src/gui/qgspropertyassistantwidget.cpp
  106. +2 −2 src/gui/qgsrasterlayersaveasdialog.cpp
  107. +1 −1 src/gui/qgssymbolbutton.cpp
  108. +3 −3 src/gui/qgstextpreview.cpp
  109. +2 −2 src/gui/raster/qgspalettedrendererwidget.cpp
  110. +2 −2 src/gui/raster/qgsrastertransparencywidget.cpp
  111. +3 −3 src/gui/symbology/characterwidget.cpp
  112. +1 −1 src/gui/symbology/qgsellipsesymbollayerwidget.cpp
  113. +1 −1 src/gui/symbology/qgspointdisplacementrendererwidget.cpp
  114. +2 −2 src/gui/symbology/qgsrulebasedrendererwidget.cpp
  115. +1 −1 src/gui/symbology/qgssvgselectorwidget.cpp
  116. +2 −2 src/gui/symbology/qgssymbollayerwidget.cpp
  117. +1 −1 src/plugins/geometry_checker/checks/qgsgeometrysliverpolygoncheck.h
  118. +1 −1 src/plugins/geometry_checker/ui/qgsgeometrycheckerfixsummarydialog.cpp
  119. +2 −2 src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.cpp
  120. +1 −1 src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.cpp
  121. +3 −3 src/plugins/geometry_checker/utils/qgsgeometrycheckerutils.cpp
  122. +4 −4 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  123. +1 −1 src/plugins/georeferencer/qgsgeoreftransform.cpp
  124. +1 −1 src/plugins/georeferencer/qgsimagewarper.cpp
  125. +1 −1 src/plugins/georeferencer/qgsleastsquares.cpp
  126. +2 −2 src/plugins/grass/qtermwidget/ColorScheme.cpp
  127. +2 −2 src/plugins/grass/qtermwidget/History.cpp
  128. +1 −1 src/plugins/grass/qtermwidget/HistorySearch.cpp
  129. +23 −23 src/plugins/grass/qtermwidget/Screen.cpp
  130. +7 −7 src/plugins/grass/qtermwidget/ScreenWindow.cpp
  131. +2 −2 src/plugins/grass/qtermwidget/Session.cpp
  132. +1 −1 src/plugins/grass/qtermwidget/TerminalCharacterDecoder.cpp
  133. +20 −20 src/plugins/grass/qtermwidget/TerminalDisplay.cpp
  134. +2 −2 src/plugins/grass/qtermwidget/Vt102Emulation.cpp
  135. +1 −1 src/plugins/grass/qtermwidget/kpty.cpp
  136. +2 −2 src/plugins/grass/qtermwidget/kptydevice.cpp
  137. +5 −5 src/plugins/grass/qtermwidget/kptydevice.h
  138. +1 −1 src/providers/arcgisrest/qgsafsshareddata.cpp
  139. +3 −3 src/providers/arcgisrest/qgsamsprovider.cpp
  140. +1 −1 src/providers/grass/qgsgrassfeatureiterator.cpp
  141. +1 −1 src/providers/grass/qgsgrassvector.cpp
  142. +4 −4 src/providers/grass/qgsgrassvectormaplayer.cpp
  143. +4 −4 src/providers/ogr/qgsogrprovider.cpp
  144. +2 −2 src/providers/wcs/qgswcsprovider.cpp
  145. +1 −1 src/providers/wfs/qgswfsfeatureiterator.cpp
  146. +5 −5 src/providers/wms/qgswmsprovider.cpp
  147. +2 −2 src/server/qgsmslayercache.cpp
  148. +1 −1 src/server/qgsserverprojectutils.cpp
  149. +1 −1 src/server/qgswmsconfigparser.cpp
  150. +1 −1 src/server/qgswmsprojectparser.cpp
  151. +1 −1 src/server/services/wms/qgswmsparameters.cpp
@@ -387,7 +387,7 @@ int DualEdgeTriangulation::addPoint( QgsPoint *p )
//Take the higher z-Value in case of two equal points
QgsPoint *newPoint = mPointVector[mPointVector.count() - 1];
QgsPoint *existingPoint = mPointVector[mTwiceInsPoint];
existingPoint->setZ( qMax( newPoint->z(), existingPoint->z() ) );
existingPoint->setZ( std::max( newPoint->z(), existingPoint->z() ) );

mPointVector.remove( mPointVector.count() - 1 );
delete newPoint;
@@ -253,8 +253,8 @@ bool MathUtils::inCircle( QgsPoint *testp, QgsPoint *p1, QgsPoint *p2, QgsPoint
double px = testp->x();
double py = testp->y();

double xmin = qMin( qMin( ax, px ), qMin( bx, cx ) );
double ymin = qMin( qMin( ay, py ), qMin( by, cy ) );
double xmin = std::min( std::min( ax, px ), std::min( bx, cx ) );
double ymin = std::min( std::min( ay, py ), std::min( by, cy ) );
ax -= xmin;
bx -= xmin;
cx -= xmin;
@@ -49,5 +49,5 @@ float QgsHillshadeFilter::processNineCellWindow( float *x11, float *x21, float *
{
aspect_rad = M_PI + std::atan2( derX, derY );
}
return qMax( 0.0, 255.0 * ( ( std::cos( zenith_rad ) * std::cos( slope_rad ) ) + ( std::sin( zenith_rad ) * std::sin( slope_rad ) * std::cos( azimuth_rad - aspect_rad ) ) ) );
return std::max( 0.0, 255.0 * ( ( std::cos( zenith_rad ) * std::cos( slope_rad ) ) + ( std::sin( zenith_rad ) * std::sin( slope_rad ) * std::cos( azimuth_rad - aspect_rad ) ) ) );
}
@@ -87,8 +87,8 @@ QgsKernelDensityEstimation::Result QgsKernelDensityEstimation::prepare()
if ( mBounds.isNull() )
return InvalidParameters;

int rows = qMax( std::ceil( mBounds.height() / mPixelSize ) + 1, 1.0 );
int cols = qMax( std::ceil( mBounds.width() / mPixelSize ) + 1, 1.0 );
int rows = std::max( std::ceil( mBounds.height() / mPixelSize ) + 1, 1.0 );
int cols = std::max( std::ceil( mBounds.width() / mPixelSize ) + 1, 1.0 );

if ( !createEmptyLayer( driver, mBounds, rows, cols ) )
return FileCreationError;
@@ -233,8 +233,8 @@ const QgsSnapIndex::Cell *QgsSnapIndex::GridRow::getCell( int col ) const

QList<QgsSnapIndex::SnapItem *> QgsSnapIndex::GridRow::getSnapItems( int colStart, int colEnd ) const
{
colStart = qMax( colStart, mColStartIdx );
colEnd = qMin( colEnd, mColStartIdx + mCells.size() - 1 );
colStart = std::max( colStart, mColStartIdx );
colEnd = std::min( colEnd, mColStartIdx + mCells.size() - 1 );

QList<SnapItem *> items;

@@ -403,8 +403,8 @@ QgsSnapIndex::SnapItem *QgsSnapIndex::getSnapItem( const QgsPoint &pos, double t
int colEnd = std::floor( ( pos.x() + tol - mOrigin.x() ) / mCellSize );
int rowEnd = std::floor( ( pos.y() + tol - mOrigin.y() ) / mCellSize );

rowStart = qMax( rowStart, mRowsStartIdx );
rowEnd = qMin( rowEnd, mRowsStartIdx + mGridRows.size() - 1 );
rowStart = std::max( rowStart, mRowsStartIdx );
rowEnd = std::min( rowEnd, mRowsStartIdx + mGridRows.size() - 1 );

QList<SnapItem *> items;
for ( int row = rowStart; row <= rowEnd; ++row )
@@ -98,8 +98,8 @@ class ANALYSIS_EXPORT QgsZonalStatistics
sum += value;
++count;
}
min = qMin( min, value );
max = qMax( max, value );
min = std::min( min, value );
max = std::max( max, value );
if ( mStoreValueCounts )
valueCount.insert( value, valueCount.value( value, 0 ) + 1 );
if ( mStoreValues )
@@ -976,7 +976,7 @@ void QgsNodeTool::deleteNodeEditorSelection()
if ( mSelectedFeature->geometry()->type() == QgsWkbTypes::LineGeometry )
{
// for lines we don't wrap around vertex selection when deleting nodes from end of line
nextVertexToSelect = qMin( nextVertexToSelect, mSelectedFeature->geometry()->geometry()->nCoordinates() - 1 );
nextVertexToSelect = std::min( nextVertexToSelect, mSelectedFeature->geometry()->geometry()->nCoordinates() - 1 );
}

_safeSelectVertex( *mSelectedFeature, nextVertexToSelect );
@@ -86,7 +86,7 @@ void QgsAddAttrDialog::setPrecisionMinMax()
mPrec->setVisible( minPrecType < maxPrecType );
mPrecLabel->setVisible( minPrecType < maxPrecType );
mPrec->setMinimum( minPrecType );
mPrec->setMaximum( qMax( minPrecType, qMin( maxPrecType, mLength->value() ) ) );
mPrec->setMaximum( std::max( minPrecType, std::min( maxPrecType, mLength->value() ) ) );
}

void QgsAddAttrDialog::accept()
@@ -344,7 +344,7 @@ void QgsAttributeTableDialog::updateTitle()
QWidget *w = mDock ? qobject_cast<QWidget *>( mDock ) : qobject_cast<QWidget *>( this );
w->setWindowTitle( tr( " %1 :: Features Total: %2, Filtered: %3, Selected: %4" )
.arg( mLayer->name() )
.arg( qMax( static_cast< long >( mMainView->featureCount() ), mLayer->featureCount() ) ) // layer count may be estimated, so use larger of the two
.arg( std::max( static_cast< long >( mMainView->featureCount() ), mLayer->featureCount() ) ) // layer count may be estimated, so use larger of the two
.arg( mMainView->filteredFeatureCount() )
.arg( mLayer->selectedFeatureCount() )
);
@@ -593,7 +593,7 @@ void QgsDiagramProperties::on_mFindMaximumValueButton_clicked()
while ( features.nextFeature( *&feature ) )
{
context.setFeature( feature );
maxValue = qMax( maxValue, exp.evaluate( &context ).toFloat() );
maxValue = std::max( maxValue, exp.evaluate( &context ).toFloat() );
}
}
else
@@ -689,7 +689,7 @@ void QgsDiagramProperties::apply()
bool ok = false;
double val = provider->maximumValue( fld ).toDouble( &ok );
if ( ok )
maxVal = qMax( maxVal, val );
maxVal = std::max( maxVal, val );
}
}
}
@@ -481,7 +481,7 @@ void QgsFieldCalculator::setPrecisionMinMax()
int maxPrecType = mOutputFieldTypeComboBox->itemData( idx, Qt::UserRole + 5 ).toInt();
mOutputFieldPrecisionSpinBox->setEnabled( minPrecType < maxPrecType );
mOutputFieldPrecisionSpinBox->setMinimum( minPrecType );
mOutputFieldPrecisionSpinBox->setMaximum( qMax( minPrecType, qMin( maxPrecType, mOutputFieldWidthSpinBox->value() ) ) );
mOutputFieldPrecisionSpinBox->setMaximum( std::max( minPrecType, std::min( maxPrecType, mOutputFieldWidthSpinBox->value() ) ) );
}

void QgsFieldCalculator::showHelp()
@@ -234,7 +234,7 @@ QSize QgsIdentifyResultsWebView::sizeHint() const
// correct size, see #9377.
int max = widget->size().height() * 0.9;
QgsDebugMsg( QString( "parent widget height = %1 max height = %2" ).arg( widget->size().height() ).arg( max ) );
height = qMin( height, max );
height = std::min( height, max );
}
else
{
@@ -243,7 +243,7 @@ QSize QgsIdentifyResultsWebView::sizeHint() const

// Always keep some minimum size, e.g. if page is not yet loaded
// or parent has wrong size
height = qMax( height, 100 );
height = std::max( height, 100 );

s = QSize( size().width(), height );
QgsDebugMsg( QString( "size: %1 x %2" ).arg( s.width() ).arg( s.height() ) );
@@ -281,7 +281,7 @@ QString QgsMeasureDialog::formatDistance( double distance, bool convertUnits ) c
// special handling for degrees - because we can't use smaller units (eg m->mm), we need to make sure there's
// enough decimal places to show a usable measurement value
int minPlaces = std::round( std::log10( 1.0 / distance ) ) + 1;
decimals = qMax( decimals, minPlaces );
decimals = std::max( decimals, minPlaces );
}
return QgsDistanceArea::formatDistance( distance, decimals, mDistanceUnits, baseUnit );
}
@@ -1281,8 +1281,8 @@ void QgsRasterLayerProperties::adjustTransparencyCellWidth( int row, int column
QLineEdit *lineEdit = dynamic_cast<QLineEdit *>( tableTransparency->cellWidget( row, column ) );
if ( !lineEdit ) return;

int width = qMax( lineEdit->fontMetrics().width( lineEdit->text() ) + 10, 100 );
width = qMax( width, tableTransparency->columnWidth( column ) );
int width = std::max( lineEdit->fontMetrics().width( lineEdit->text() ) + 10, 100 );
width = std::max( width, tableTransparency->columnWidth( column ) );

lineEdit->setFixedWidth( width );
}
@@ -1850,4 +1850,4 @@ void QgsRasterLayerProperties::onCancel()
void QgsRasterLayerProperties::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_raster/raster_properties.html" ) );
}
}
@@ -587,8 +587,8 @@ QgsLabelingRulePropsWidget::QgsLabelingRulePropsWidget( QgsRuleBasedLabeling::Ru
{
groupScale->setChecked( true );
// caution: rule uses scale denom, scale widget uses true scales
mScaleRangeWidget->setMaximumScale( qMax( rule->maximumScale(), 0.0 ) );
mScaleRangeWidget->setMinimumScale( qMax( rule->minimumScale(), 0.0 ) );
mScaleRangeWidget->setMaximumScale( std::max( rule->maximumScale(), 0.0 ) );
mScaleRangeWidget->setMinimumScale( std::max( rule->minimumScale(), 0.0 ) );
}
mScaleRangeWidget->setMapCanvas( mMapCanvas );

@@ -190,10 +190,10 @@ void QgsVariantDelegate::setModelData( QWidget *editor, QAbstractItemModel *mode
break;
case QVariant::Color:
( void )mColorExp.exactMatch( text );
value = QColor( qMin( mColorExp.cap( 1 ).toInt(), 255 ),
qMin( mColorExp.cap( 2 ).toInt(), 255 ),
qMin( mColorExp.cap( 3 ).toInt(), 255 ),
qMin( mColorExp.cap( 4 ).toInt(), 255 ) );
value = QColor( std::min( mColorExp.cap( 1 ).toInt(), 255 ),
std::min( mColorExp.cap( 2 ).toInt(), 255 ),
std::min( mColorExp.cap( 3 ).toInt(), 255 ),
std::min( mColorExp.cap( 4 ).toInt(), 255 ) );
break;
case QVariant::Date:
{
@@ -117,7 +117,7 @@ QSize QgsWelcomePageItemDelegate::sizeHint( const QStyleOptionViewItem &option,
index.data( QgsWelcomePageItemsModel::CrsRole ).toString() ) );
doc.setTextWidth( width - ( !icon.isNull() ? icon.width() + 35 : 35 ) );

return QSize( width, qMax( ( double ) doc.size().height() + 10, ( double )icon.height() ) + 20 );
return QSize( width, std::max( ( double ) doc.size().height() + 10, ( double )icon.height() ) + 20 );
}

QgsWelcomePageItemsModel::QgsWelcomePageItemsModel( QObject *parent )
@@ -380,8 +380,8 @@ double QgsComposerArrow::computeMarkerMargin() const
}
else if ( mMarkerMode == SVGMarker )
{
double maxArrowHeight = qMax( mStartArrowHeadHeight, mStopArrowHeadHeight );
margin = mPen.widthF() / 2 + qMax( mArrowHeadWidth / 2.0, maxArrowHeight / 2.0 );
double maxArrowHeight = std::max( mStartArrowHeadHeight, mStopArrowHeadHeight );
margin = mPen.widthF() / 2 + std::max( mArrowHeadWidth / 2.0, maxArrowHeight / 2.0 );
}
}
else
@@ -398,8 +398,8 @@ double QgsComposerArrow::computeMarkerMargin() const
{
double startMarkerMargin = std::sqrt( 0.25 * ( mStartArrowHeadHeight * mStartArrowHeadHeight + mArrowHeadWidth * mArrowHeadWidth ) );
double stopMarkerMargin = std::sqrt( 0.25 * ( mStopArrowHeadHeight * mStopArrowHeadHeight + mArrowHeadWidth * mArrowHeadWidth ) );
double markerMargin = qMax( startMarkerMargin, stopMarkerMargin );
margin = qMax( mPen.widthF() / std::sqrt( 2.0 ), markerMargin );
double markerMargin = std::max( startMarkerMargin, stopMarkerMargin );
margin = std::max( mPen.widthF() / std::sqrt( 2.0 ), markerMargin );
}
}
return margin;
@@ -408,7 +408,7 @@ double QgsComposerArrow::computeMarkerMargin() const
void QgsComposerArrow::adaptItemSceneRect()
{
//rectangle containing start and end point
QRectF rect = QRectF( qMin( mStartPoint.x(), mStopPoint.x() ), qMin( mStartPoint.y(), mStopPoint.y() ),
QRectF rect = QRectF( std::min( mStartPoint.x(), mStopPoint.x() ), std::min( mStartPoint.y(), mStopPoint.y() ),
std::fabs( mStopPoint.x() - mStartPoint.x() ), std::fabs( mStopPoint.y() - mStartPoint.y() ) );
double enlarge = computeMarkerMargin();
rect.adjust( -enlarge, -enlarge, enlarge, enlarge );
@@ -263,7 +263,7 @@ bool QgsComposerAttributeTableColumnModelV2::removeRows( int row, int count, con
{
Q_UNUSED( parent );

int maxRow = qMin( row + count - 1, mComposerTable->columns()->length() - 1 );
int maxRow = std::min( row + count - 1, mComposerTable->columns()->length() - 1 );
beginRemoveRows( QModelIndex(), row, maxRow );
//move backwards through rows, removing each corresponding QgsComposerTableColumn
for ( int i = maxRow; i >= row; --i )
@@ -357,7 +357,7 @@ void QgsComposerAttributeTableColumnModelV2::setColumnAsSorted( QgsComposerTable
QList<QgsComposerTableColumn *>::const_iterator columnIt = mComposerTable->columns()->constBegin();
for ( ; columnIt != mComposerTable->columns()->constEnd(); ++columnIt )
{
highestRank = qMax( highestRank, ( *columnIt )->sortByRank() );
highestRank = std::max( highestRank, ( *columnIt )->sortByRank() );
}

column->setSortByRank( highestRank + 1 );
@@ -160,8 +160,8 @@ void QgsComposerFrame::setSceneRect( const QRectF &rectangle )

//check minimum size
QSizeF minSize = mMultiFrame->minFrameSize( frameIndex );
fixedRect.setWidth( qMax( minSize.width(), fixedRect.width() ) );
fixedRect.setHeight( qMax( minSize.height(), fixedRect.height() ) );
fixedRect.setWidth( std::max( minSize.width(), fixedRect.width() ) );
fixedRect.setHeight( std::max( minSize.height(), fixedRect.height() ) );
}

QgsComposerItem::setSceneRect( fixedRect );
@@ -231,7 +231,7 @@ double QgsComposerHtml::maxFrameWidth() const
QList<QgsComposerFrame *>::const_iterator frameIt = mFrameItems.constBegin();
for ( ; frameIt != mFrameItems.constEnd(); ++frameIt )
{
maxWidth = qMax( maxWidth, static_cast< double >( ( *frameIt )->boundingRect().width() ) );
maxWidth = std::max( maxWidth, static_cast< double >( ( *frameIt )->boundingRect().width() ) );
}

return maxWidth;
@@ -379,7 +379,7 @@ double QgsComposerHtml::findNearbyPageBreak( double yPos )
bool previousPixelTransparent = false;
QRgb pixelColor;
QList< QPair<int, int> > candidates;
int minRow = qMax( idealPos - maxSearchDistance, 0 );
int minRow = std::max( idealPos - maxSearchDistance, 0 );
for ( int candidateRow = idealPos; candidateRow >= minRow; --candidateRow )
{
changes = 0;
@@ -609,7 +609,7 @@ void QgsComposerLabel::itemShiftAdjustSize( double newWidth, double newHeight, d
QUrl QgsComposerLabel::createStylesheetUrl() const
{
QString stylesheet;
stylesheet += QStringLiteral( "body { margin: %1 %2;" ).arg( qMax( mMarginY * mHtmlUnitsToMM, 0.0 ) ).arg( qMax( mMarginX * mHtmlUnitsToMM, 0.0 ) );
stylesheet += QStringLiteral( "body { margin: %1 %2;" ).arg( std::max( mMarginY * mHtmlUnitsToMM, 0.0 ) ).arg( std::max( mMarginX * mHtmlUnitsToMM, 0.0 ) );
stylesheet += QgsFontUtils::asCSS( mFont, 0.352778 * mHtmlUnitsToMM );
stylesheet += QStringLiteral( "color: %1;" ).arg( mFontColor.name() );
stylesheet += QStringLiteral( "text-align: %1; }" ).arg( mHAlignment == Qt::AlignLeft ? "left" : mHAlignment == Qt::AlignRight ? "right" : "center" );
@@ -1584,10 +1584,10 @@ void QgsComposerMap::updateBoundingRect()
if ( mGridStack )
mGridStack->calculateMaxGridExtension( topExtension, rightExtension, bottomExtension, leftExtension );

topExtension = qMax( topExtension, frameExtension );
rightExtension = qMax( rightExtension, frameExtension );
bottomExtension = qMax( bottomExtension, frameExtension );
leftExtension = qMax( leftExtension, frameExtension );
topExtension = std::max( topExtension, frameExtension );
rightExtension = std::max( rightExtension, frameExtension );
bottomExtension = std::max( bottomExtension, frameExtension );
leftExtension = std::max( leftExtension, frameExtension );

rectangle.setLeft( rectangle.left() - leftExtension );
rectangle.setRight( rectangle.right() + rightExtension );

0 comments on commit 2d19279

Please sign in to comment.
You can’t perform that action at this time.