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

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Dec 7 16:37:56 EST 2009


Author: wonder
Date: 2009-12-07 16:37:56 -0500 (Mon, 07 Dec 2009)
New Revision: 12361

Modified:
   trunk/qgis/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
   trunk/qgis/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
   trunk/qgis/src/core/symbology-ng/qgsrendererv2.cpp
   trunk/qgis/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
   trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp
Log:
Save symbol levels state - fix for #2161


Modified: trunk/qgis/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp	2009-12-07 21:19:00 UTC (rev 12360)
+++ trunk/qgis/src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp	2009-12-07 21:37:56 UTC (rev 12361)
@@ -291,6 +291,7 @@
 {
   QDomElement rendererElem = doc.createElement( RENDERER_TAG_NAME );
   rendererElem.setAttribute( "type", "categorizedSymbol" );
+  rendererElem.setAttribute( "symbollevels", ( mUsingSymbolLevels ? "1" : "0" ) );
   rendererElem.setAttribute( "attr", mAttrName );
 
   // categories

Modified: trunk/qgis/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp	2009-12-07 21:19:00 UTC (rev 12360)
+++ trunk/qgis/src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp	2009-12-07 21:37:56 UTC (rev 12361)
@@ -400,6 +400,7 @@
 {
   QDomElement rendererElem = doc.createElement( RENDERER_TAG_NAME );
   rendererElem.setAttribute( "type", "graduatedSymbol" );
+  rendererElem.setAttribute( "symbollevels", ( mUsingSymbolLevels ? "1" : "0" ) );
   rendererElem.setAttribute( "attr", mAttrName );
 
   // ranges

Modified: trunk/qgis/src/core/symbology-ng/qgsrendererv2.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgsrendererv2.cpp	2009-12-07 21:19:00 UTC (rev 12360)
+++ trunk/qgis/src/core/symbology-ng/qgsrendererv2.cpp	2009-12-07 21:37:56 UTC (rev 12361)
@@ -290,7 +290,11 @@
   if ( pfCreate == NULL )
     return NULL;
 
-  return pfCreate( element );
+  QgsFeatureRendererV2* r = pfCreate( element );
+  if ( r )
+    r->setUsingSymbolLevels( element.attribute( "symbollevels", "0" ).toInt() );
+
+  return r;
 }
 
 QDomElement QgsFeatureRendererV2::save( QDomDocument& doc )

Modified: trunk/qgis/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp	2009-12-07 21:19:00 UTC (rev 12360)
+++ trunk/qgis/src/core/symbology-ng/qgssinglesymbolrendererv2.cpp	2009-12-07 21:37:56 UTC (rev 12361)
@@ -92,6 +92,7 @@
 {
   QDomElement rendererElem = doc.createElement( RENDERER_TAG_NAME );
   rendererElem.setAttribute( "type", "singleSymbol" );
+  rendererElem.setAttribute( "symbollevels", ( mUsingSymbolLevels ? "1" : "0" ) );
 
   QgsSymbolV2Map symbols;
   symbols["0"] = mSymbol;

Modified: trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp	2009-12-07 21:19:00 UTC (rev 12360)
+++ trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp	2009-12-07 21:37:56 UTC (rev 12361)
@@ -356,6 +356,7 @@
 {
   QString layerClass = element.attribute( "class" );
   bool locked = element.attribute( "locked" ).toInt();
+  int pass = element.attribute( "pass" ).toInt();
 
   // parse properties
   QgsStringMap props = parseProperties( element );
@@ -365,6 +366,7 @@
   if ( layer )
   {
     layer->setLocked( locked );
+    layer->setRenderingPass( pass );
     return layer;
   }
   else
@@ -399,6 +401,7 @@
     QDomElement layerEl = doc.createElement( "layer" );
     layerEl.setAttribute( "class", layer->layerType() );
     layerEl.setAttribute( "locked", layer->isLocked() );
+    layerEl.setAttribute( "pass", layer->renderingPass() );
 
     if ( subSymbols != NULL && layer->subSymbol() != NULL )
     {



More information about the QGIS-commit mailing list