patch_fix.txt

Two small fixes. - Charles Timko -, 2010-07-06 09:56 AM

Download (2.37 KB)

 
1
Index: src/plugins/diagram_overlay/qgswkndiagramfactorywidget.cpp
2
===================================================================
3
--- src/plugins/diagram_overlay/qgswkndiagramfactorywidget.cpp	(revision 13891)
4
+++ src/plugins/diagram_overlay/qgswkndiagramfactorywidget.cpp	(working copy)
5
@@ -125,6 +125,14 @@
6
 
7
   //text
8
   QString currentText = mAttributesComboBox->currentText();
9
+
10
+  // Check for null and empty string, and then skip the rest of this stuff.
11
+  if( currentText.isNull() || currentText.isEmpty() )
12
+  {
13
+    delete newItem;
14
+    return;
15
+  }
16
+
17
   newItem->setText( 0, currentText );
18
 
19
   //and icon
20
@@ -134,10 +142,7 @@
21
   QColor randomColor( red, green, blue );
22
   newItem->setBackground( 1, QBrush( randomColor ) );
23
 
24
-  if ( !currentText.isNull() && !currentText.isEmpty() )
25
-  {
26
-    mAttributesTreeWidget->addTopLevelItem( newItem );
27
-  }
28
+  mAttributesTreeWidget->addTopLevelItem( newItem );
29
 }
30
 
31
 void QgsWKNDiagramFactoryWidget::removeAttribute()
32
Index: src/core/qgsvectorlayer.cpp
33
===================================================================
34
--- src/core/qgsvectorlayer.cpp	(revision 13891)
35
+++ src/core/qgsvectorlayer.cpp	(working copy)
36
@@ -1,6 +1,6 @@
37
 /***************************************************************************
38
+  This class implements a generic means to display vector layers. The features
39
                                qgsvectorlayer.cpp
40
-  This class implements a generic means to display vector layers. The features
41
   and attributes are read from the data store using a "data provider" plugin.
42
   QgsVectorLayer can be used with any data store for which an appropriate
43
   plugin is available.
44
Index: src/core/qgsvectoroverlay.h
45
===================================================================
46
--- src/core/qgsvectoroverlay.h	(revision 13891)
47
+++ src/core/qgsvectoroverlay.h	(working copy)
48
@@ -25,7 +25,7 @@
49
 class QgsRect;
50
 class QgsRenderContext;
51
 
52
-/**Base class for vector layer overlays (e.g. Diagrams, labels, etc.). For each object, the position of the bounding box is *stored in a QgsOberlayObject. The vector overlays are drawn on top of all layers
53
+/**Base class for vector layer overlays (e.g. Diagrams, labels, etc.). For each object, the position of the bounding box is *stored in a QgsOverlayObject. The vector overlays are drawn on top of all layers
54
 * \note This class has been added in version 1.1
55
 */
56
 class CORE_EXPORT QgsVectorOverlay