Commit d3f602c 1 parent 81974f9 commit d3f602c Copy full SHA for d3f602c
File tree 2 files changed +5
-7
lines changed
2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 31
31
32
32
QgsMapToolReverseLine::QgsMapToolReverseLine ( QgsMapCanvas *canvas )
33
33
: QgsMapToolEdit( canvas )
34
- , mPressedFid( 0 )
35
- , mPressedPartNum( 0 )
36
34
{
37
35
mToolName = tr ( " Reverse line geometry" );
38
36
}
@@ -103,7 +101,7 @@ void QgsMapToolReverseLine::canvasReleaseEvent( QgsMapMouseEvent *e )
103
101
vlayer->getFeatures ( QgsFeatureRequest ().setFilterFid ( mPressedFid ) ).nextFeature ( f );
104
102
QgsGeometry geom;
105
103
106
- if ( f.geometry (). constGet () )
104
+ if ( f.hasGeometry () )
107
105
{
108
106
if ( f.geometry ().isMultipart () )
109
107
{
@@ -119,8 +117,8 @@ void QgsMapToolReverseLine::canvasReleaseEvent( QgsMapMouseEvent *e )
119
117
else
120
118
{
121
119
122
- std::unique_ptr<QgsCurve> line ( static_cast <QgsCurve *>( f.geometry ().constGet ()-> clone () ) );
123
- geom = QgsGeometry ( line-> reversed () );
120
+ geom = QgsGeometry ( static_cast < const QgsCurve * >( f.geometry ().constGet () )-> reversed ( ) );
121
+
124
122
}
125
123
126
124
if ( geom )
Original file line number Diff line number Diff line change @@ -49,8 +49,8 @@ class APP_EXPORT QgsMapToolReverseLine: public QgsMapToolEdit
49
49
50
50
// The feature and part where the mouse cursor was pressed
51
51
// This is used to check whether we are still in the same part at cursor release
52
- QgsFeatureId mPressedFid ;
53
- int mPressedPartNum ;
52
+ QgsFeatureId mPressedFid = 0 ;
53
+ int mPressedPartNum = 0 ;
54
54
};
55
55
56
56
#endif // QGSMAPTOOLREVERSELINE_H
You can’t perform that action at this time.
0 commit comments