Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix clazy 'pass small and trivially-copyable type by value' warnings
  • Loading branch information
nyalldawson committed Feb 2, 2016
1 parent f3c7ab6 commit c3a5743
Show file tree
Hide file tree
Showing 327 changed files with 702 additions and 702 deletions.
4 changes: 2 additions & 2 deletions python/analysis/raster/qgsalignraster.sip
Expand Up @@ -100,13 +100,13 @@ class QgsAlignRaster
//! Get list of rasters that will be aligned
List rasters() const;

void setGridOffset( const QPointF& offset );
void setGridOffset( QPointF offset );
QPointF gridOffset() const;

//! Set output cell size
void setCellSize( double x, double y );
//! Set output cell size
void setCellSize( const QSizeF& size );
void setCellSize( QSizeF size );
//! Get output cell size
QSizeF cellSize() const;

Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposerarrow.sip
Expand Up @@ -22,7 +22,7 @@ class QgsComposerArrow: QgsComposerItem
* @param stopPoint end point for line
* @param c parent composition
*/
QgsComposerArrow( const QPointF& startPoint, const QPointF& stopPoint, QgsComposition* c /TransferThis/ );
QgsComposerArrow( QPointF startPoint, QPointF stopPoint, QgsComposition* c /TransferThis/ );

~QgsComposerArrow();

Expand Down
4 changes: 2 additions & 2 deletions python/core/composer/qgscomposeritem.sip
Expand Up @@ -487,7 +487,7 @@ class QgsComposerItem : QgsComposerObject, QGraphicsRectItem
/** Returns the font height of a character in millimeters
* @deprecated use QgsComposerUtils::fontHeightCharacterMM instead
*/
double fontHeightCharacterMM( const QFont& font, const QChar& c ) const /Deprecated/;
double fontHeightCharacterMM( const QFont& font, QChar c ) const /Deprecated/;

/** Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCALE
* @deprecated use QgsComposerUtils::fontAscentMM instead
Expand Down Expand Up @@ -691,7 +691,7 @@ class QgsComposerItem : QgsComposerObject, QGraphicsRectItem
/** Returns angle of the line from p1 to p2 (clockwise, starting at N)
* @deprecated will be removed in QGIS 3.0
*/
double angle( const QPointF& p1, const QPointF& p2 ) const /Deprecated/;
double angle( QPointF p1, QPointF p2 ) const /Deprecated/;

/** Returns the current (zoom level dependent) tolerance to decide if mouse position is close enough to the
item border for resizing*/
Expand Down
6 changes: 3 additions & 3 deletions python/core/composer/qgscomposermap.sip
Expand Up @@ -105,7 +105,7 @@ class QgsComposerMap : QgsComposerItem
@param dpi scene dpi
@param forceWidthScale force wysiwyg line widths / marker sizes
*/
void draw( QPainter *painter, const QgsRectangle& extent, const QSizeF& size, double dpi, double* forceWidthScale = 0 );
void draw( QPainter *painter, const QgsRectangle& extent, QSizeF size, double dpi, double* forceWidthScale = 0 );

/** \brief Reimplementation of QCanvasItem::paint - draw on canvas */
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
Expand All @@ -115,7 +115,7 @@ class QgsComposerMap : QgsComposerItem

/** Return map settings that would be used for drawing of the map
* @note added in 2.6 */
QgsMapSettings mapSettings( const QgsRectangle& extent, const QSizeF& size, int dpi ) const;
QgsMapSettings mapSettings( const QgsRectangle& extent, QSizeF size, int dpi ) const;

/** \brief Get identification number*/
int id() const;
Expand Down Expand Up @@ -738,7 +738,7 @@ class QgsComposerMap : QgsComposerItem
QPolygonF transformedMapPolygon() const;

/** Transforms map coordinates to item coordinates (considering rotation and move offset)*/
QPointF mapToItemCoords( const QPointF& mapCoords ) const;
QPointF mapToItemCoords( QPointF mapCoords ) const;

//! @deprecated will be removed in QGIS 3.0
void connectMapOverviewSignals() /Deprecated/;
Expand Down
6 changes: 3 additions & 3 deletions python/core/composer/qgscomposerutils.sip
Expand Up @@ -25,7 +25,7 @@ class QgsComposerUtils
* @param p2 end point of line
* @returns angle in degrees, clockwise from south
*/
static double angle( const QPointF& p1, const QPointF& p2 );
static double angle( QPointF p1, QPointF p2 );

/** Rotates a point / vector around the origin.
* @param angle rotation angle in degrees, counterclockwise
Expand Down Expand Up @@ -190,7 +190,7 @@ class QgsComposerUtils
* @see fontHeightMM
* @see textWidthMM
*/
static double fontHeightCharacterMM( const QFont& font, const QChar& character );
static double fontHeightCharacterMM( const QFont& font, QChar character );

/** Calculate font width in millimeters for a string, including workarounds for QT font
* rendering issues
Expand Down Expand Up @@ -227,7 +227,7 @@ class QgsComposerUtils
* @param color color to draw text
* @note added in version 2.5
*/
static void drawText( QPainter* painter, const QPointF& pos, const QString& text, const QFont& font, const QColor& color = QColor() );
static void drawText( QPainter* painter, QPointF pos, const QString& text, const QFont& font, const QColor& color = QColor() );

/** Draws text on a painter within a rectangle, taking care of composer specific issues (calculation to pixel,
* scaling of font and painter to work around Qt font bugs)
Expand Down
16 changes: 8 additions & 8 deletions python/core/composer/qgscomposition.sip
Expand Up @@ -166,12 +166,12 @@ class QgsComposition : QGraphicsScene
/** Returns the position within a page of a point in the composition
@note Added in QGIS 2.1
*/
QPointF positionOnPage( const QPointF & position ) const;
QPointF positionOnPage( QPointF position ) const;

/** Returns the page number corresponding to a point in the composition
@note Added in QGIS 2.1
*/
int pageNumberForPoint( const QPointF & position ) const;
int pageNumberForPoint( QPointF position ) const;

/** Sets the status bar message for the composer window
@note Added in QGIS 2.1
Expand Down Expand Up @@ -304,18 +304,18 @@ class QgsComposition : QGraphicsScene
* @param ignoreLocked set to true to ignore locked items
* @returns composer item at position
*/
QgsComposerItem* composerItemAt( const QPointF & position, const bool ignoreLocked = false ) const;
QgsComposerItem* composerItemAt( QPointF position, const bool ignoreLocked = false ) const;

/** Returns the topmost composer item at a specified position which is below a specified item. Ignores paper items.
* @param position point to search for item at
* @param belowItem item to search below
* @param ignoreLocked set to true to ignore locked items
* @returns composer item at position which is below specified item
*/
QgsComposerItem* composerItemAt( const QPointF & position, const QgsComposerItem* belowItem, const bool ignoreLocked = false ) const;
QgsComposerItem* composerItemAt( QPointF position, const QgsComposerItem* belowItem, const bool ignoreLocked = false ) const;

/** Returns the page number (0-based) given a coordinate */
int pageNumberAt( const QPointF& position ) const;
int pageNumberAt( QPointF position ) const;

/** Returns on which page number (0-based) is displayed an item */
int itemPageNumber( const QgsComposerItem* ) const;
Expand Down Expand Up @@ -506,7 +506,7 @@ class QgsComposition : QGraphicsScene
void refreshZList();

/** Snaps a scene coordinate point to grid*/
QPointF snapPointToGrid( const QPointF& scenePoint ) const;
QPointF snapPointToGrid( QPointF scenePoint ) const;

/** Returns pointer to snap lines collection*/
QList< QGraphicsLineItem* >* snapLines();
Expand Down Expand Up @@ -613,7 +613,7 @@ class QgsComposition : QGraphicsScene
* @see renderRectAsRaster()
* @see renderPage()
*/
QImage printPageAsRaster( int page, const QSize& imageSize = QSize(), int dpi = 0 );
QImage printPageAsRaster( int page, QSize imageSize = QSize(), int dpi = 0 );

/** Renders a portion of the composition to an image. This method can be used to render
* sections of pages rather than full pages.
Expand All @@ -628,7 +628,7 @@ class QgsComposition : QGraphicsScene
* @see printPageAsRaster()
* @see renderRect()
*/
QImage renderRectAsRaster( const QRectF& rect, const QSize& imageSize = QSize(), int dpi = 0 );
QImage renderRectAsRaster( const QRectF& rect, QSize imageSize = QSize(), int dpi = 0 );

/** Renders a full page to a paint device.
* @param p destination painter
Expand Down
6 changes: 3 additions & 3 deletions python/core/diagram/qgsdiagram.sip
Expand Up @@ -22,9 +22,9 @@ class QgsDiagram
QgsExpression* getExpression( const QString& expression, const QgsExpressionContext& context );

/** @deprecated `void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position )` should be used instead */
virtual void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ) /Deprecated/;
virtual void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, const QgsDiagramSettings& s, QPointF position ) /Deprecated/;
/** Draws the diagram at the given position (in pixel coordinates)*/
virtual void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ) = 0;
virtual void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, QPointF position ) = 0;
virtual QString diagramName() const = 0;
/** Returns the size in map units the diagram will use to render.*/
virtual QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s ) = 0;
Expand All @@ -51,7 +51,7 @@ class QgsDiagram
*
* @return The converted size for rendering
*/
QSizeF sizePainterUnits( const QSizeF& size, const QgsDiagramSettings& s, const QgsRenderContext& c );
QSizeF sizePainterUnits( QSizeF size, const QgsDiagramSettings& s, const QgsRenderContext& c );

/** Calculates a length to match the current settings and rendering context
* @param l The length to convert
Expand Down
2 changes: 1 addition & 1 deletion python/core/diagram/qgshistogramdiagram.sip
Expand Up @@ -9,7 +9,7 @@ class QgsHistogramDiagram: QgsDiagram

virtual QgsHistogramDiagram* clone() const /Factory/;

void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position );
void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, QPointF position );

QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s );
QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is );
Expand Down
2 changes: 1 addition & 1 deletion python/core/diagram/qgspiediagram.sip
Expand Up @@ -9,7 +9,7 @@ class QgsPieDiagram: QgsDiagram

virtual QgsPieDiagram* clone() const /Factory/;

void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position );
void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, QPointF position );

QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s );
QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is );
Expand Down
2 changes: 1 addition & 1 deletion python/core/diagram/qgstextdiagram.sip
Expand Up @@ -22,7 +22,7 @@ class QgsTextDiagram: QgsDiagram
~QgsTextDiagram();
virtual QgsTextDiagram* clone() const /Factory/;

void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position );
void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, const QgsDiagramSettings& s, QPointF position );

QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s );
QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is );
Expand Down
4 changes: 2 additions & 2 deletions python/core/effects/qgsimageoperation.sip
Expand Up @@ -140,7 +140,7 @@ class QgsImageOperation
* @note added in QGIS 2.9
* @see cropTransparent
*/
static QRect nonTransparentImageRect( const QImage & image, const QSize& minSize = QSize(), bool center = false );
static QRect nonTransparentImageRect( const QImage & image, QSize minSize = QSize(), bool center = false );

/** Crop any transparent border from around an image.
* @param image source image
Expand All @@ -150,6 +150,6 @@ class QgsImageOperation
* @param center cropped image will be centered on the center of the original image if set to true
* @note added in QGIS 2.9
*/
static QImage cropTransparent( const QImage & image, const QSize& minSize = QSize(), bool center = false );
static QImage cropTransparent( const QImage & image, QSize minSize = QSize(), bool center = false );

};
20 changes: 10 additions & 10 deletions python/core/geometry/qgsabstractgeometryv2.sip
Expand Up @@ -14,11 +14,11 @@ struct QgsVertexId
QgsVertexId( int _part, int _ring, int _vertex, VertexType _type);

bool isValid() const;
bool operator==( const QgsVertexId& other ) const;
bool operator!=( const QgsVertexId& other ) const;
bool partEqual( const QgsVertexId& o ) const;
bool ringEqual( const QgsVertexId& o ) const;
bool vertexEqual( const QgsVertexId& o ) const;
bool operator==( QgsVertexId other ) const;
bool operator!=( QgsVertexId other ) const;
bool partEqual( QgsVertexId o ) const;
bool ringEqual( QgsVertexId o ) const;
bool vertexEqual( QgsVertexId o ) const;
bool isValid(const QgsAbstractGeometryV2* geom) const;

int part;
Expand Down Expand Up @@ -231,7 +231,7 @@ class QgsAbstractGeometryV2

/** Returns the point corresponding to a specified vertex id
*/
virtual QgsPointV2 vertexAt( const QgsVertexId& id ) const = 0;
virtual QgsPointV2 vertexAt( QgsVertexId id ) const = 0;

/** Searches for the closest segment of the geometry to a given point.
* @param pt specifies the point to find closest segment to
Expand All @@ -253,7 +253,7 @@ class QgsAbstractGeometryV2
* @see moveVertex
* @see deleteVertex
*/
virtual bool insertVertex( const QgsVertexId& position, const QgsPointV2& vertex ) = 0;
virtual bool insertVertex( QgsVertexId position, const QgsPointV2& vertex ) = 0;

/** Moves a vertex within the geometry
* @param position vertex id for vertex to move
Expand All @@ -262,15 +262,15 @@ class QgsAbstractGeometryV2
* @see insertVertex
* @see deleteVertex
*/
virtual bool moveVertex( const QgsVertexId& position, const QgsPointV2& newPos ) = 0;
virtual bool moveVertex( QgsVertexId position, const QgsPointV2& newPos ) = 0;

/** Deletes a vertex within the geometry
* @param position vertex id for vertex to delete
* @returns true if delete was successful
* @see insertVertex
* @see moveVertex
*/
virtual bool deleteVertex( const QgsVertexId& position ) = 0;
virtual bool deleteVertex( QgsVertexId position ) = 0;

/** Returns the length of the geometry.
* @see area()
Expand Down Expand Up @@ -312,7 +312,7 @@ class QgsAbstractGeometryV2
* @param vertex the vertex id
* @return rotation in radians, clockwise from north
*/
virtual double vertexAngle( const QgsVertexId& vertex ) const = 0;
virtual double vertexAngle( QgsVertexId vertex ) const = 0;

virtual int vertexCount( int part = 0, int ring = 0 ) const = 0;
virtual int ringCount( int part = 0 ) const = 0;
Expand Down
8 changes: 4 additions & 4 deletions python/core/geometry/qgscircularstringv2.sip
Expand Up @@ -76,9 +76,9 @@ class QgsCircularStringV2: public QgsCurveV2
*/
void drawAsPolygon( QPainter& p ) const;

virtual bool insertVertex( const QgsVertexId& position, const QgsPointV2& vertex );
virtual bool moveVertex( const QgsVertexId& position, const QgsPointV2& newPos );
virtual bool deleteVertex( const QgsVertexId& position );
virtual bool insertVertex( QgsVertexId position, const QgsPointV2& vertex );
virtual bool moveVertex( QgsVertexId position, const QgsPointV2& newPos );
virtual bool deleteVertex( QgsVertexId position );

double closestSegment( const QgsPointV2& pt, QgsPointV2& segmentPt, QgsVertexId& vertexAfter, bool* leftOf, double epsilon ) const;
/**
Expand All @@ -99,7 +99,7 @@ class QgsCircularStringV2: public QgsCurveV2
/** Returns approximate rotation angle for a vertex. Usually average angle between adjacent segments.
@param vertex the vertex id
@return rotation in radians, clockwise from north*/
double vertexAngle( const QgsVertexId& vertex ) const;
double vertexAngle( QgsVertexId vertex ) const;

virtual QgsCircularStringV2* reversed() const /Factory/;

Expand Down
8 changes: 4 additions & 4 deletions python/core/geometry/qgscompoundcurvev2.sip
Expand Up @@ -69,9 +69,9 @@ class QgsCompoundCurveV2: public QgsCurveV2
void addToPainterPath( QPainterPath& path ) const;
void drawAsPolygon( QPainter& p ) const;

virtual bool insertVertex( const QgsVertexId& position, const QgsPointV2& vertex );
virtual bool moveVertex( const QgsVertexId& position, const QgsPointV2& newPos );
virtual bool deleteVertex( const QgsVertexId& position );
virtual bool insertVertex( QgsVertexId position, const QgsPointV2& vertex );
virtual bool moveVertex( QgsVertexId position, const QgsPointV2& newPos );
virtual bool deleteVertex( QgsVertexId position );

virtual double closestSegment( const QgsPointV2& pt, QgsPointV2& segmentPt, QgsVertexId& vertexAfter, bool* leftOf, double epsilon ) const;
bool pointAt( int node, QgsPointV2& point, QgsVertexId::VertexType& type ) const;
Expand All @@ -86,7 +86,7 @@ class QgsCompoundCurveV2: public QgsCurveV2
/** Returns approximate rotation angle for a vertex. Usually average angle between adjacent segments.
@param vertex the vertex id
@return rotation in radians, clockwise from north*/
double vertexAngle( const QgsVertexId& vertex ) const;
double vertexAngle( QgsVertexId vertex ) const;

virtual QgsCompoundCurveV2* reversed() const /Factory/;

Expand Down
10 changes: 5 additions & 5 deletions python/core/geometry/qgscurvepolygonv2.sip
Expand Up @@ -62,9 +62,9 @@ class QgsCurvePolygonV2: public QgsSurfaceV2
void transform( const QgsCoordinateTransform& ct, QgsCoordinateTransform::TransformDirection d = QgsCoordinateTransform::ForwardTransform );
void transform( const QTransform& t );

virtual bool insertVertex( const QgsVertexId& position, const QgsPointV2& vertex );
virtual bool moveVertex( const QgsVertexId& position, const QgsPointV2& newPos );
virtual bool deleteVertex( const QgsVertexId& position );
virtual bool insertVertex( QgsVertexId position, const QgsPointV2& vertex );
virtual bool moveVertex( QgsVertexId position, const QgsPointV2& newPos );
virtual bool deleteVertex( QgsVertexId position );

virtual void coordinateSequence( QList< QList< QList< QgsPointV2 > > >& coord /Out/ ) const;
double closestSegment( const QgsPointV2& pt, QgsPointV2& segmentPt, QgsVertexId& vertexAfter, bool* leftOf, double epsilon ) const;
Expand All @@ -76,12 +76,12 @@ class QgsCurvePolygonV2: public QgsSurfaceV2
/** Returns approximate rotation angle for a vertex. Usually average angle between adjacent segments.
@param vertex the vertex id
@return rotation in radians, clockwise from north*/
double vertexAngle( const QgsVertexId& vertex ) const;
double vertexAngle( QgsVertexId vertex ) const;

virtual int vertexCount( int /*part*/ = 0, int ring = 0) const;
virtual int ringCount( int /*part*/ = 0 ) const;
virtual int partCount() const;
virtual QgsPointV2 vertexAt( const QgsVertexId& id ) const;
virtual QgsPointV2 vertexAt( QgsVertexId id ) const;

virtual bool addZValue( double zValue = 0 );
virtual bool addMValue( double mValue = 0 );
Expand Down
2 changes: 1 addition & 1 deletion python/core/geometry/qgscurvev2.sip
Expand Up @@ -40,7 +40,7 @@ class QgsCurveV2: public QgsAbstractGeometryV2
virtual int vertexCount(int part = 0, int ring = 0) const;
virtual int ringCount(int part = 0) const;
virtual int partCount() const;
virtual QgsPointV2 vertexAt( const QgsVertexId& id ) const;
virtual QgsPointV2 vertexAt( QgsVertexId id ) const;

/** Drops any Z dimensions which exist in the geometry.
* @returns true if Z values were present and have been removed
Expand Down

0 comments on commit c3a5743

Please sign in to comment.