Skip to content

Commit 04972ac

Browse files
author
jef
committed
fix #2869
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13893 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6e71a1c commit 04972ac

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

src/core/qgsvectorlayer.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/***************************************************************************
22
qgsvectorlayer.cpp
3+
--------------------
4+
begin : Oct 29, 2003
5+
copyright : (C) 2003 by Gary E.Sherman
6+
email : sherman at mrcc.com
7+
38
This class implements a generic means to display vector layers. The features
49
and attributes are read from the data store using a "data provider" plugin.
510
QgsVectorLayer can be used with any data store for which an appropriate
611
plugin is available.
7-
-------------------
8-
begin : Oct 29, 2003
9-
copyright : (C) 2003 by Gary E.Sherman
10-
email : sherman at mrcc.com
1112
1213
***************************************************************************/
1314

src/core/qgsvectoroverlay.h

+9-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,21 @@ class QgsOverlayObject;
2525
class QgsRect;
2626
class QgsRenderContext;
2727

28-
/**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
29-
* \note This class has been added in version 1.1
30-
*/
28+
/**Base class for vector layer overlays (e.g. diagrams, labels, etc.). For each
29+
* object, the position of the bounding box is stored in a QgsOverlayObject.
30+
* The vector overlays are drawn on top of all layers.
31+
* \note This class has been added in version 1.1
32+
*/
3133
class CORE_EXPORT QgsVectorOverlay
3234
{
3335
public:
3436
QgsVectorOverlay( QgsVectorLayer* vl );
3537
virtual ~QgsVectorOverlay();
3638

37-
/**Create the overlay objects contained in a view extent. Subclasses need to implement this method and assign width/height information to the overlay ovbjects*/
39+
/**Create the overlay objects contained in a view extent. Subclasses need
40+
* to implement this method and assign width/height information to the
41+
* overlay objects
42+
*/
3843

3944
virtual void createOverlayObjects( const QgsRenderContext& renderContext ) = 0;
4045

src/plugins/diagram_overlay/qgswkndiagramfactorywidget.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,13 @@ void QgsWKNDiagramFactoryWidget::setExistingFactory( const QgsDiagramFactory* f
121121

122122
void QgsWKNDiagramFactoryWidget::addAttribute()
123123
{
124-
QTreeWidgetItem* newItem = new QTreeWidgetItem( mAttributesTreeWidget );
124+
QString currentText = mAttributesComboBox->currentText();
125+
if ( currentText.isEmpty() )
126+
return;
127+
128+
QTreeWidgetItem *newItem = new QTreeWidgetItem( mAttributesTreeWidget );
125129

126130
//text
127-
QString currentText = mAttributesComboBox->currentText();
128131
newItem->setText( 0, currentText );
129132

130133
//and icon
@@ -134,10 +137,7 @@ void QgsWKNDiagramFactoryWidget::addAttribute()
134137
QColor randomColor( red, green, blue );
135138
newItem->setBackground( 1, QBrush( randomColor ) );
136139

137-
if ( !currentText.isNull() && !currentText.isEmpty() )
138-
{
139-
mAttributesTreeWidget->addTopLevelItem( newItem );
140-
}
140+
mAttributesTreeWidget->addTopLevelItem( newItem );
141141
}
142142

143143
void QgsWKNDiagramFactoryWidget::removeAttribute()

0 commit comments

Comments
 (0)