Skip to content
Permalink
Browse files

[composer] Correctly save/restore legend title alignment

  • Loading branch information
nyalldawson committed Apr 13, 2014
1 parent ad66af2 commit e87a7b84fd98b49d6215838a2a4cfaaa8c7e4696
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/core/composer/qgscomposerlegend.cpp
@@ -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 ) );
@@ -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;

0 comments on commit e87a7b8

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