Skip to content
Permalink
Browse files

Save symbol levels state - fix for #2161

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12361 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Dec 7, 2009
1 parent 93a2670 commit 9764839c04bc3a41b566ed0a34976a69caf5e189
@@ -291,6 +291,7 @@ QDomElement QgsCategorizedSymbolRendererV2::save( QDomDocument& doc )
{
QDomElement rendererElem = doc.createElement( RENDERER_TAG_NAME );
rendererElem.setAttribute( "type", "categorizedSymbol" );
rendererElem.setAttribute( "symbollevels", ( mUsingSymbolLevels ? "1" : "0" ) );
rendererElem.setAttribute( "attr", mAttrName );

// categories
@@ -400,6 +400,7 @@ QDomElement QgsGraduatedSymbolRendererV2::save( QDomDocument& doc )
{
QDomElement rendererElem = doc.createElement( RENDERER_TAG_NAME );
rendererElem.setAttribute( "type", "graduatedSymbol" );
rendererElem.setAttribute( "symbollevels", ( mUsingSymbolLevels ? "1" : "0" ) );
rendererElem.setAttribute( "attr", mAttrName );

// ranges
@@ -290,7 +290,11 @@ QgsFeatureRendererV2* QgsFeatureRendererV2::load( QDomElement& element )
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 )
@@ -92,6 +92,7 @@ QDomElement QgsSingleSymbolRendererV2::save( QDomDocument& doc )
{
QDomElement rendererElem = doc.createElement( RENDERER_TAG_NAME );
rendererElem.setAttribute( "type", "singleSymbol" );
rendererElem.setAttribute( "symbollevels", ( mUsingSymbolLevels ? "1" : "0" ) );

QgsSymbolV2Map symbols;
symbols["0"] = mSymbol;
@@ -356,6 +356,7 @@ QgsSymbolLayerV2* QgsSymbolLayerV2Utils::loadSymbolLayer( QDomElement& element )
{
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 @@ QgsSymbolLayerV2* QgsSymbolLayerV2Utils::loadSymbolLayer( QDomElement& element )
if ( layer )
{
layer->setLocked( locked );
layer->setRenderingPass( pass );
return layer;
}
else
@@ -399,6 +401,7 @@ QDomElement QgsSymbolLayerV2Utils::saveSymbol( QString name, QgsSymbolV2* symbol
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 )
{

0 comments on commit 9764839

Please sign in to comment.
You can’t perform that action at this time.