Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 4479cd7
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/core/composer/qgscomposerlegend.cpp
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 4479cd7

Please sign in to comment.