[QGIS Commit] r10190 -
branches/vector_overlay_branch/src/plugins/diagram_overlay
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Tue Feb 17 11:21:41 EST 2009
Author: mhugent
Date: 2009-02-17 11:21:40 -0500 (Tue, 17 Feb 2009)
New Revision: 10190
Modified:
branches/vector_overlay_branch/src/plugins/diagram_overlay/qgsdiagramdialog.cpp
branches/vector_overlay_branch/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp
Log:
fix a bug if the scaling attribute is not one of the category attributes
Modified: branches/vector_overlay_branch/src/plugins/diagram_overlay/qgsdiagramdialog.cpp
===================================================================
--- branches/vector_overlay_branch/src/plugins/diagram_overlay/qgsdiagramdialog.cpp 2009-02-17 15:05:06 UTC (rev 10189)
+++ branches/vector_overlay_branch/src/plugins/diagram_overlay/qgsdiagramdialog.cpp 2009-02-17 16:21:40 UTC (rev 10190)
@@ -172,9 +172,15 @@
return;
}
- //attList comes from the diagram factory widget
+ //attList contains the category attributes
QgsAttributeList attList;
+ QgsWKNDiagramFactory* wknDiagramFactory = dynamic_cast<QgsWKNDiagramFactory*>(diagramFactory);
+ if(wknDiagramFactory)
+ {
+ attList += wknDiagramFactory->categoryAttributes();
+ }
+
QgsDiagramRenderer* diagramRenderer = 0;
QgsDiagramFactory::SizeUnit diagramSizeUnit = QgsDiagramFactory::MM; //mm on output medium is default
@@ -201,7 +207,7 @@
//also set units to the diagram factory
diagramFactory->setSizeUnit(diagramSizeUnit);
- //the overlay may need a different attribute list than the renderer
+ //the overlay needs to fetch scaling attributes and category attributes
if(!attList.contains(classAttr))
{
attList.push_back(classAttr);
Modified: branches/vector_overlay_branch/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp
===================================================================
--- branches/vector_overlay_branch/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp 2009-02-17 15:05:06 UTC (rev 10189)
+++ branches/vector_overlay_branch/src/plugins/diagram_overlay/qgsdiagramoverlay.cpp 2009-02-17 16:21:40 UTC (rev 10190)
@@ -69,8 +69,8 @@
QgsVectorDataProvider* theProvider = mVectorLayer->dataProvider();
if(theProvider)
{
- //set spatial filter on data provider
- theProvider->select(mAttributes, renderContext.extent());
+ //set spatial filter on data provider
+ theProvider->select(mAttributes, renderContext.extent());
QgsFeature currentFeature;
int width, height;
More information about the QGIS-commit
mailing list