[QGIS Commit] r14253 - trunk/qgis/src/core/symbology-ng

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Sep 19 11:29:01 EDT 2010


Author: jef
Date: 2010-09-19 15:29:01 +0000 (Sun, 19 Sep 2010)
New Revision: 14253

Modified:
   trunk/qgis/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
   trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp
Log:
add symbol ASSERTions

Modified: trunk/qgis/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp	2010-09-19 15:25:48 UTC (rev 14252)
+++ trunk/qgis/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp	2010-09-19 15:29:01 UTC (rev 14253)
@@ -12,9 +12,10 @@
 #include <QDomElement>
 
 QgsSingleSymbolRendererV2::QgsSingleSymbolRendererV2( QgsSymbolV2* symbol )
-    : QgsFeatureRendererV2( "singleSymbol" ),
-    mTempSymbol( NULL )
+    : QgsFeatureRendererV2( "singleSymbol" )
+    , mTempSymbol( NULL )
 {
+  Q_ASSERT( symbol );
   mSymbol = symbol;
 }
 
@@ -59,8 +60,8 @@
 
 void QgsSingleSymbolRendererV2::startRender( QgsRenderContext& context, const QgsVectorLayer *vlayer )
 {
-  mRotationFieldIdx  = ( mRotationField.isEmpty()  ? -1 : vlayer->fieldNameIndex( mRotationField ) );
-  mSizeScaleFieldIdx = ( mSizeScaleField.isEmpty() ? -1 : vlayer->fieldNameIndex( mSizeScaleField ) );
+  mRotationFieldIdx  = mRotationField.isEmpty()  ? -1 : vlayer->fieldNameIndex( mRotationField );
+  mSizeScaleFieldIdx = mSizeScaleField.isEmpty() ? -1 : vlayer->fieldNameIndex( mSizeScaleField );
 
   mSymbol->startRender( context );
 
@@ -121,6 +122,7 @@
 
 void QgsSingleSymbolRendererV2::setSymbol( QgsSymbolV2* s )
 {
+  Q_ASSERT( s );
   delete mSymbol;
   mSymbol = s;
 }

Modified: trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp	2010-09-19 15:25:48 UTC (rev 14252)
+++ trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp	2010-09-19 15:29:01 UTC (rev 14253)
@@ -223,6 +223,8 @@
 
 QPixmap QgsSymbolLayerV2Utils::symbolPreviewPixmap( QgsSymbolV2* symbol, QSize size )
 {
+  Q_ASSERT( symbol );
+
   QPixmap pixmap( size );
   QPainter painter;
   painter.begin( &pixmap );
@@ -472,6 +474,8 @@
 
 QDomElement QgsSymbolLayerV2Utils::saveSymbol( QString name, QgsSymbolV2* symbol, QDomDocument& doc, QgsSymbolV2Map* subSymbols )
 {
+  Q_ASSERT( symbol );
+
   QDomElement symEl = doc.createElement( "symbol" );
   symEl.setAttribute( "type", _nameForSymbolType( symbol->type() ) );
   symEl.setAttribute( "name", name );



More information about the QGIS-commit mailing list