diff --git a/app/BarcodeStyle.cpp b/app/BarcodeStyle.cpp index 2de085a..9a8e960 100644 --- a/app/BarcodeStyle.cpp +++ b/app/BarcodeStyle.cpp @@ -20,6 +20,8 @@ #include "BarcodeStyle.h" +#include + namespace glabels { @@ -152,9 +154,11 @@ namespace glabels /// QString BarcodeStyle::exampleDigits( int n ) const { + using std::max; + if ( mCanFreeform ) { - return QString( std::max( n, 1 ), QChar('0') ); + return QString( max( n, 1 ), QChar('0') ); } else { diff --git a/app/BarcodeStyle.h b/app/BarcodeStyle.h index 941e057..48e4077 100644 --- a/app/BarcodeStyle.h +++ b/app/BarcodeStyle.h @@ -22,7 +22,7 @@ #define glabels_BarcodeStyle_h #include -#include + namespace glabels { diff --git a/app/LabelModel.cpp b/app/LabelModel.cpp index cb3e708..d01f565 100644 --- a/app/LabelModel.cpp +++ b/app/LabelModel.cpp @@ -20,6 +20,7 @@ #include "LabelModel.h" +#include #include #include "LabelModelObject.h" @@ -151,10 +152,13 @@ namespace glabels /// void LabelModel::selectRegion( const LabelRegion ®ion ) { - double rX1 = std::min( region.x1(), region.x2() ); - double rY1 = std::min( region.y1(), region.y2() ); - double rX2 = std::max( region.x1(), region.x2() ); - double rY2 = std::max( region.y1(), region.y2() ); + using std::min; + using std::max; + + double rX1 = min( region.x1(), region.x2() ); + double rY1 = min( region.y1(), region.y2() ); + double rX2 = max( region.x1(), region.x2() ); + double rY2 = max( region.y1(), region.y2() ); foreach ( LabelModelObject* object, mObjectList ) { diff --git a/app/LabelModelObject.cpp b/app/LabelModelObject.cpp index 085857a..a3db08b 100644 --- a/app/LabelModelObject.cpp +++ b/app/LabelModelObject.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "ColorNode.h" #include "TextNode.h" @@ -836,6 +837,9 @@ namespace glabels /// LabelRegion LabelModelObject::getExtent() { + using std::min; + using std::max; + QPointF a1( - lineWidth()/2, - lineWidth()/2 ); QPointF a2( mW + lineWidth()/2, - lineWidth()/2 ); QPointF a3( mW + lineWidth()/2, mH + lineWidth()/2 ); @@ -847,10 +851,10 @@ namespace glabels a4 = mMatrix.map( a4 ); LabelRegion region; - region.setX1( std::min( a1.x(), std::min( a2.x(), std::min( a3.x(), a4.x() ) ) ) + mX0 ); - region.setY1( std::min( a1.y(), std::min( a2.y(), std::min( a3.y(), a4.y() ) ) ) + mY0 ); - region.setX2( std::max( a1.x(), std::max( a2.x(), std::max( a3.x(), a4.x() ) ) ) + mX0 ); - region.setY2( std::max( a1.y(), std::max( a2.y(), std::max( a3.y(), a4.y() ) ) ) + mY0 ); + region.setX1( min( a1.x(), min( a2.x(), min( a3.x(), a4.x() ) ) ) + mX0 ); + region.setY1( min( a1.y(), min( a2.y(), min( a3.y(), a4.y() ) ) ) + mY0 ); + region.setX2( max( a1.x(), max( a2.x(), max( a3.x(), a4.x() ) ) ) + mX0 ); + region.setY2( max( a1.y(), max( a2.y(), max( a3.y(), a4.y() ) ) ) + mY0 ); return region; } diff --git a/app/View.cpp b/app/View.cpp index 62d7a87..7c6188a 100644 --- a/app/View.cpp +++ b/app/View.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -194,13 +195,16 @@ namespace glabels /// void View::zoomToFit() { + using std::min; + using std::max; + double x_scale = (72.0/physicalDpiX()) * ( width() - ZOOM_TO_FIT_PAD ) / mModel->w(); double y_scale = (72.0/physicalDpiY()) * ( height() - ZOOM_TO_FIT_PAD ) / mModel->h(); - double newZoom = std::min( x_scale, y_scale ); + double newZoom = min( x_scale, y_scale ); // Limits - newZoom = std::min( newZoom, zoomLevels[0] ); - newZoom = std::max( newZoom, zoomLevels[nZoomLevels-1] ); + newZoom = min( newZoom, zoomLevels[0] ); + newZoom = max( newZoom, zoomLevels[nZoomLevels-1] ); setZoomReal( newZoom, true ); }