Skip to content
Permalink
Browse files

Coverity fixes (uninitialized members)

  • Loading branch information
nyalldawson committed Feb 7, 2015
1 parent 76b0bcf commit b60221a37562b952a22a5068c317ecbf063ac1e6
Showing with 212 additions and 64 deletions.
  1. +5 −0 src/analysis/vector/qgstransectsample.cpp
  2. +1 −0 src/app/composer/qgsattributeselectiondialog.cpp
  3. +14 −1 src/app/nodetool/qgsmaptoolnodetool.cpp
  4. +24 −0 src/app/qgisapp.cpp
  5. +0 −2 src/app/qgisapp.h
  6. +3 −0 src/app/qgsmergeattributesdialog.cpp
  7. +2 −0 src/app/qgssnappingdialog.cpp
  8. +52 −45 src/core/composer/qgscomposermapgrid.cpp
  9. +4 −0 src/core/composer/qgscomposermapgrid.h
  10. +13 −0 src/core/pal/pointset.cpp
  11. +4 −1 src/core/pal/problem.cpp
  12. +1 −1 src/core/pal/problem.h
  13. +7 −3 src/core/qgshttptransaction.cpp
  14. +18 −0 src/core/raster/qgsrasterprojector.cpp
  15. +0 −1 src/gui/attributetable/qgsdualview.h
  16. +4 −1 src/gui/editorwidgets/qgsfilenamewidgetwrapper.cpp
  17. +2 −1 src/gui/editorwidgets/qgsvaluemapwidgetwrapper.cpp
  18. +4 −1 src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp
  19. +4 −1 src/gui/editorwidgets/qgswebviewwidgetwrapper.cpp
  20. +2 −0 src/gui/qgsactionmenu.h
  21. +6 −0 src/gui/qgsoptionsdialogbase.cpp
  22. +3 −1 src/gui/raster/qgsmultibandcolorrendererwidget.cpp
  23. +4 −2 src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
  24. +3 −1 src/gui/symbology-ng/qgsellipsesymbollayerv2widget.cpp
  25. +3 −1 src/gui/symbology-ng/qgspointdisplacementrendererwidget.cpp
  26. +7 −0 src/plugins/spatialquery/qgsgeometrycoordinatetransform.cpp
  27. +1 −1 src/plugins/spatialquery/qgsgeometrycoordinatetransform.h
  28. +1 −0 src/plugins/spit/qgspgutil.cpp
  29. +15 −0 src/providers/mssql/qgsmssqlgeometryparser.cpp
  30. +2 −0 src/providers/wfs/qgswfsdataitems.cpp
  31. +3 −0 src/providers/wms/qgswmsprovider.cpp
@@ -22,6 +22,11 @@ QgsTransectSample::QgsTransectSample( QgsVectorLayer* strataLayer, QString strat
}

QgsTransectSample::QgsTransectSample()
: mStrataLayer( NULL )
, mBaselineLayer( NULL )
, mShareBaseline( false )
, mMinDistanceUnits( Meters )
, mMinTransectLength( 0.0 )
{
}

@@ -336,6 +336,7 @@ QgsAttributeSelectionDialog::QgsAttributeSelectionDialog( QgsComposerAttributeTa
, mAvailableSortProxyModel( NULL )
, mAvailableSortProxyModelV1( NULL )
, mColumnAlignmentDelegate( NULL )
, mColumnSourceDelegate( NULL )
, mColumnSortOrderDelegate( NULL )
, mColumnWidthDelegate( NULL )
{
@@ -49,11 +49,14 @@ struct QgsFeatureIdFilter : public QgsPointLocator::MatchFilter
QgsMapToolNodeTool::QgsMapToolNodeTool( QgsMapCanvas* canvas )
: QgsMapToolEdit( canvas )
, mSelectedFeature( 0 )
, mSelectionRectangle( false )
, mMoving( true )
, mClicked( false )
, mCtrl( false )
, mSelectAnother( false )
, mAnother( 0 )
, mSelectionRubberBand( 0 )
, mRect( NULL )
, mIsPoint( false )
, mDeselectOnRelease( -1 )
{
@@ -63,6 +66,8 @@ QgsMapToolNodeTool::QgsMapToolNodeTool( QgsMapCanvas* canvas )
QgsMapToolNodeTool::~QgsMapToolNodeTool()
{
cleanTool();
delete mRect;
delete mSelectionRubberBand;
}

void QgsMapToolNodeTool::createMovingRubberBands()
@@ -513,6 +518,12 @@ void QgsMapToolNodeTool::canvasReleaseEvent( QMouseEvent * e )
mSelectionRubberBand = 0;
}

if ( mRect )
{
delete mRect;
mRect = 0;
}

if ( mPressCoordinates == e->pos() )
{
if ( mSelectAnother )
@@ -605,7 +616,9 @@ void QgsMapToolNodeTool::canvasReleaseEvent( QMouseEvent * e )
void QgsMapToolNodeTool::deactivate()
{
cleanTool();

delete mRect;
mRect = 0;
delete mSelectionRubberBand;
mSelectionRubberBand = 0;
mSelectAnother = false;
mCtrl = false;
@@ -820,13 +820,37 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,

QgisApp::QgisApp()
: QMainWindow( 0, 0 )
, mMapLayerOrder( 0 )
, mOverviewMapCursor( 0 )
, mMapWindow( 0 )
, mQgisInterface( 0 )
, mSplash( 0 )
, mMousePrecisionDecimalPlaces( 0 )
, mInternalClipboard( 0 )
, mShowProjectionTab( false )
, mpMapTipsTimer( 0 )
, mDizzyTimer( 0 )
, mpMaptip( 0 )
, mMapTipsVisible( false )
, mFullScreenMode( false )
, mPrevScreenModeMaximized( false )
, mSaveRollbackInProgress( false )
, mPythonUtils( 0 )
, mBrowserWidget( 0 )
, mBrowserWidget2( 0 )
, mAdvancedDigitizingDockWidget( 0 )
, mSnappingDialog( 0 )
, mPluginManager( 0 )
, mComposerManager( 0 )
, mpTileScaleWidget( 0 )
, mLastComposerId( 0 )
, mpGpsWidget( 0 )
, mLastMapToolMessage( 0 )
, mLogViewer( 0 )
, mTrustedMacros( false )
, mMacrosWarn( 0 )
, mVectorLayerTools( 0 )
, mBtnFilterLegend( 0 )
, mSnappingUtils( 0 )
{
smInstance = this;
@@ -1494,8 +1494,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QgsCustomLayerOrderWidget* mMapLayerOrder;
//! Cursor for the overview map
QCursor *mOverviewMapCursor;
//! scale factor
double mScaleFactor;
//! Current map window extent in real-world coordinates
QRect *mMapWindow;
//! The previously selected non zoom map tool.
@@ -57,6 +57,9 @@ QgsMergeAttributesDialog::QgsMergeAttributesDialog( const QgsFeatureList &featur

QgsMergeAttributesDialog::QgsMergeAttributesDialog()
: QDialog()
, mVectorLayer( NULL )
, mMapCanvas( NULL )
, mSelectionRubberBand( NULL )
{
setupUi( this );

@@ -107,6 +107,8 @@ QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas )
}

QgsSnappingDialog::QgsSnappingDialog()
: mMapCanvas( NULL )
, mDock( NULL )
{
}

@@ -145,47 +145,59 @@ double QgsComposerMapGridStack::maxGridExtension() const

QgsComposerMapGrid::QgsComposerMapGrid( const QString& name, QgsComposerMap* map )
: QgsComposerMapItem( name, map )
, mTransformDirty( true )
, mGridStyle( QgsComposerMapGrid::Solid )
, mGridIntervalX( 0.0 )
, mGridIntervalY( 0.0 )
, mGridOffsetX( 0.0 )
, mGridOffsetY( 0.0 )
, mGridAnnotationFontColor( Qt::black )
, mGridAnnotationPrecision( 3 )
, mShowGridAnnotation( false )
, mLeftGridAnnotationDisplay( QgsComposerMapGrid::ShowAll )
, mRightGridAnnotationDisplay( QgsComposerMapGrid::ShowAll )
, mTopGridAnnotationDisplay( QgsComposerMapGrid::ShowAll )
, mBottomGridAnnotationDisplay( QgsComposerMapGrid::ShowAll )
, mLeftGridAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame )
, mRightGridAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame )
, mTopGridAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame )
, mBottomGridAnnotationPosition( QgsComposerMapGrid::OutsideMapFrame )
, mAnnotationFrameDistance( 1.0 )
, mLeftGridAnnotationDirection( QgsComposerMapGrid::Horizontal )
, mRightGridAnnotationDirection( QgsComposerMapGrid::Horizontal )
, mTopGridAnnotationDirection( QgsComposerMapGrid::Horizontal )
, mBottomGridAnnotationDirection( QgsComposerMapGrid::Horizontal )
, mGridAnnotationFormat( QgsComposerMapGrid::Decimal )
, mGridFrameStyle( QgsComposerMapGrid::NoFrame )
, mGridFrameSides( QgsComposerMapGrid::FrameLeft | QgsComposerMapGrid::FrameRight |
QgsComposerMapGrid::FrameTop | QgsComposerMapGrid::FrameBottom )
, mGridFrameWidth( 2.0 )
, mGridFramePenThickness( 0.3 )
, mGridFramePenColor( QColor( 0, 0, 0 ) )
, mGridFrameFillColor1( Qt::white )
, mGridFrameFillColor2( Qt::black )
, mCrossLength( 3 )
, mLeftFrameDivisions( QgsComposerMapGrid::ShowAll )
, mRightFrameDivisions( QgsComposerMapGrid::ShowAll )
, mTopFrameDivisions( QgsComposerMapGrid::ShowAll )
, mBottomFrameDivisions( QgsComposerMapGrid::ShowAll )
, mGridLineSymbol( 0 )
, mGridMarkerSymbol( 0 )
, mGridUnit( MapUnit )
, mBlendMode( QPainter::CompositionMode_SourceOver )
{
init();
}

QgsComposerMapGrid::QgsComposerMapGrid()
: QgsComposerMapItem( QString(), 0 )
{
init();
}

void QgsComposerMapGrid::init()
{
mTransformDirty = true;
mGridStyle = QgsComposerMapGrid::Solid;
mGridIntervalX = 0.0;
mGridIntervalY = 0.0;
mGridOffsetX = 0.0;
mGridOffsetY = 0.0;
mGridAnnotationFontColor = Qt::black;
mGridAnnotationPrecision = 3;
mShowGridAnnotation = false;
mLeftGridAnnotationDisplay = QgsComposerMapGrid::ShowAll;
mRightGridAnnotationDisplay = QgsComposerMapGrid::ShowAll;
mTopGridAnnotationDisplay = QgsComposerMapGrid::ShowAll;
mBottomGridAnnotationDisplay = QgsComposerMapGrid::ShowAll;
mLeftGridAnnotationPosition = QgsComposerMapGrid::OutsideMapFrame;
mRightGridAnnotationPosition = QgsComposerMapGrid::OutsideMapFrame;
mTopGridAnnotationPosition = QgsComposerMapGrid::OutsideMapFrame;
mBottomGridAnnotationPosition = QgsComposerMapGrid::OutsideMapFrame;
mAnnotationFrameDistance = 1.0;
mLeftGridAnnotationDirection = QgsComposerMapGrid::Horizontal;
mRightGridAnnotationDirection = QgsComposerMapGrid::Horizontal;
mTopGridAnnotationDirection = QgsComposerMapGrid::Horizontal;
mBottomGridAnnotationDirection = QgsComposerMapGrid::Horizontal;
mGridAnnotationFormat = QgsComposerMapGrid::Decimal;
mGridFrameStyle = QgsComposerMapGrid::NoFrame;
mGridFrameSides = QgsComposerMapGrid::FrameLeft | QgsComposerMapGrid::FrameRight |
QgsComposerMapGrid::FrameTop | QgsComposerMapGrid::FrameBottom;
mGridFrameWidth = 2.0;
mGridFramePenThickness = 0.3;
mGridFramePenColor = QColor( 0, 0, 0 );
mGridFrameFillColor1 = Qt::white;
mGridFrameFillColor2 = Qt::black;
mCrossLength = 3;
mLeftFrameDivisions = QgsComposerMapGrid::ShowAll;
mRightFrameDivisions = QgsComposerMapGrid::ShowAll;
mTopFrameDivisions = QgsComposerMapGrid::ShowAll;
mBottomFrameDivisions = QgsComposerMapGrid::ShowAll;
mGridLineSymbol = 0;
mGridMarkerSymbol = 0;
mGridUnit = MapUnit;
mBlendMode = QPainter::CompositionMode_SourceOver;

//get default composer font from settings
QSettings settings;
QString defaultFontString = settings.value( "/Composer/defaultFont" ).toString();
@@ -198,11 +210,6 @@ QgsComposerMapGrid::QgsComposerMapGrid( const QString& name, QgsComposerMap* map
createDefaultGridMarkerSymbol();
}

QgsComposerMapGrid::QgsComposerMapGrid()
: QgsComposerMapItem( QString(), 0 )
{
}

QgsComposerMapGrid::~QgsComposerMapGrid()
{
delete mGridLineSymbol;
@@ -881,6 +881,8 @@ class CORE_EXPORT QgsComposerMapGrid : public QgsComposerMapItem
QgsComposerMapGrid::AnnotationCoordinate coordinateType;
};

void init();

/**Draws the map grid*/
void drawGridFrame( QPainter* p, const QList< QPair< double, QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines ) const;

@@ -962,4 +964,6 @@ class CORE_EXPORT QgsComposerMapGrid : public QgsComposerMapItem
friend class TestQgsComposerMapGrid;
};

Q_DECLARE_OPERATORS_FOR_FLAGS( QgsComposerMapGrid::FrameSideFlags )

#endif // QGSCOMPOSERMAPGRID_H
@@ -53,6 +53,12 @@ namespace pal


PointSet::PointSet()
: holeOf( NULL )
, parent( NULL )
, xmin( DBL_MAX )
, xmax( -DBL_MAX )
, ymin( DBL_MAX )
, ymax( -DBL_MAX )
{
nbPoints = cHullSize = 0;
x = NULL;
@@ -62,6 +68,13 @@ namespace pal
}

PointSet::PointSet( int nbPoints, double *x, double *y )
: cHullSize( 0 )
, holeOf( NULL )
, parent( NULL )
, xmin( DBL_MAX )
, xmax( -DBL_MAX )
, ymin( DBL_MAX )
, ymax( -DBL_MAX )
{
this->nbPoints = nbPoints;
this->x = new double[nbPoints];
@@ -73,7 +73,10 @@ namespace pal
}
}

Problem::Problem() : nblp( 0 ), all_nblp( 0 ), nbft( 0 ), displayAll( 0 ), labelpositions( NULL ), featStartId( NULL ), featNbLp( NULL ), inactiveCost( NULL ), sol( NULL )
Problem::Problem() : nbLabelledLayers( 0 ), labelledLayersName( NULL ), nblp( 0 ), all_nblp( 0 ), nbft( 0 ), displayAll( false ),
scale( 0 ), labelPositionCost( NULL ), nbOlap( NULL ),
labelpositions( NULL ), featStartId( NULL ), featNbLp( NULL ), inactiveCost( NULL ), sol( NULL ), nbActive( 0 ), nbOverlap( 0.0 ),
pal( NULL )
{
bbox[0] = 0;
bbox[1] = 0;
@@ -101,7 +101,7 @@ namespace pal
private:

/**
* How many layers are lebelled ?
* How many layers are labelled ?
*/
int nbLabelledLayers;

@@ -46,12 +46,10 @@ QgsHttpTransaction::QgsHttpTransaction( QString uri,
: http( NULL )
, httpid( 0 )
, httpactive( false )
, httpresponsecontenttype( "" )
, httpurl( uri )
, httphost( proxyHost )
, httpredirections( 0 )
, mWatchdogTimer( NULL )
, mError( "" )
{
Q_UNUSED( proxyPort );
Q_UNUSED( proxyUser );
@@ -64,8 +62,14 @@ QgsHttpTransaction::QgsHttpTransaction( QString uri,
}

QgsHttpTransaction::QgsHttpTransaction()
: http( NULL )
, httpid( 0 )
, httpactive( false )
, httpredirections( 0 )
, mWatchdogTimer( NULL )
{

QSettings s;
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt();
}

QgsHttpTransaction::~QgsHttpTransaction()
@@ -96,6 +96,13 @@ QgsRasterProjector::QgsRasterProjector()

QgsRasterProjector::QgsRasterProjector( const QgsRasterProjector &projector )
: QgsRasterInterface( 0 )
, pHelperTop( NULL )
, pHelperBottom( NULL )
, mHelperTopRow( 0 )
, mCPCols( 0 )
, mCPRows( 0 )
, mSqrTolerance( 0 )
, mApproximate( false )
{
mSrcCRS = projector.mSrcCRS;
mDestCRS = projector.mDestCRS;
@@ -104,6 +111,17 @@ QgsRasterProjector::QgsRasterProjector( const QgsRasterProjector &projector )
mMaxSrcXRes = projector.mMaxSrcXRes;
mMaxSrcYRes = projector.mMaxSrcYRes;
mExtent = projector.mExtent;
mDestRows = projector.mDestRows;
mDestCols = projector.mDestCols;
mDestXRes = projector.mDestXRes;
mDestYRes = projector.mDestYRes;
mSrcRows = projector.mSrcRows;
mSrcCols = projector.mSrcCols;
mSrcXRes = projector.mSrcXRes;
mSrcYRes = projector.mSrcYRes;
mDestRowsPerMatrixRow = projector.mDestRowsPerMatrixRow;
mDestColsPerMatrixCol = projector.mDestColsPerMatrixCol;

}

QgsRasterProjector & QgsRasterProjector::operator=( const QgsRasterProjector & projector )
@@ -223,7 +223,6 @@ class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBas
QgsAttributeTableFilterModel* mFilterModel;
QgsFeatureListModel* mFeatureListModel;
QgsAttributeForm* mAttributeForm;
QgsCachedFeatureIterator* mFeatureCache;
QSignalMapper* mPreviewActionMapper;
QMenu* mPreviewColumnsMenu;
QgsVectorLayerCache* mLayerCache;
@@ -22,7 +22,10 @@
#include <QGridLayout>

QgsFileNameWidgetWrapper::QgsFileNameWidgetWrapper( QgsVectorLayer* vl, int fieldIdx, QWidget* editor, QWidget* parent )
: QgsEditorWidgetWrapper( vl, fieldIdx, editor, parent )
: QgsEditorWidgetWrapper( vl, fieldIdx, editor, parent )
, mLineEdit( NULL )
, mPushButton( NULL )
, mLabel( NULL )
{
}

0 comments on commit b60221a

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