Skip to content
Permalink
Browse files
[Feature: Add more color options. Provided by olivierdalang]. Modific…
…ations for xml reading / writing
  • Loading branch information
mhugent committed Jan 22, 2013
1 parent fadaaeb commit 4479cd70b2eead083f1a2e28edb499b82af91a59
Showing with 2 additions and 15 deletions.
  1. +2 −15 src/core/composer/qgscomposerlegend.cpp
@@ -728,12 +728,7 @@ bool QgsComposerLegend::writeXML( QDomElement& elem, QDomDocument & doc ) const
composerLegendElem.setAttribute( "symbolWidth", QString::number( mSymbolWidth ) );
composerLegendElem.setAttribute( "symbolHeight", QString::number( mSymbolHeight ) );
composerLegendElem.setAttribute( "wrapChar", mWrapChar );
//font color
QDomElement colorElem = doc.createElement( "fontColor" );
colorElem.setAttribute( "red", mFontColor.red() );
colorElem.setAttribute( "green", mFontColor.green() );
colorElem.setAttribute( "blue", mFontColor.blue() );
composerLegendElem.appendChild( colorElem );
composerLegendElem.setAttribute( "fontColor", mFontColor.name() );

if ( mComposerMap )
{
@@ -787,15 +782,7 @@ bool QgsComposerLegend::readXML( const QDomElement& itemElem, const QDomDocument
}

//font color
QDomNodeList fontColorList = itemElem.elementsByTagName( "fontColor" );
if ( fontColorList.size() > 0 )
{
QDomElement fontColorElem = fontColorList.at( 0 ).toElement();
int red = fontColorElem.attribute( "red", "0" ).toInt();
int green = fontColorElem.attribute( "green", "0" ).toInt();
int blue = fontColorElem.attribute( "blue", "0" ).toInt();
mFontColor = QColor( red, green, blue );
}
mFontColor.setNamedColor( itemElem.attribute( "fontColor", "#000000" ) );

//spaces
mBoxSpace = itemElem.attribute( "boxSpace", "2.0" ).toDouble();

0 comments on commit 4479cd7

Please sign in to comment.