Skip to content

Commit

Permalink
[composer] Correctly save/restore legend title alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 13, 2014
1 parent ad66af2 commit e87a7b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/composer/qgscomposerlegend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ bool QgsComposerLegend::writeXML( QDomElement& elem, QDomDocument & doc ) const

//write general properties
composerLegendElem.setAttribute( "title", mTitle );
composerLegendElem.setAttribute( "titleAlignment", QString::number(( int )mTitleAlignment ) );
composerLegendElem.setAttribute( "columnCount", QString::number( mColumnCount ) );
composerLegendElem.setAttribute( "splitLayer", QString::number( mSplitLayer ) );
composerLegendElem.setAttribute( "equalColumnWidth", QString::number( mEqualColumnWidth ) );
Expand Down Expand Up @@ -648,6 +649,10 @@ bool QgsComposerLegend::readXML( const QDomElement& itemElem, const QDomDocument

//read general properties
mTitle = itemElem.attribute( "title" );
if ( !itemElem.attribute( "titleAlignment" ).isEmpty() )
{
mTitleAlignment = ( Qt::AlignmentFlag )itemElem.attribute( "titleAlignment" ).toInt();
}
mColumnCount = itemElem.attribute( "columnCount", "1" ).toInt();
if ( mColumnCount < 1 ) mColumnCount = 1;
mSplitLayer = itemElem.attribute( "splitLayer", "0" ).toInt() == 1;
Expand Down

0 comments on commit e87a7b8

Please sign in to comment.