Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix scalebar alignment in composer (ticket #6317)
  • Loading branch information
mhugent committed Sep 15, 2012
1 parent d0800fb commit c0ee7f0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/core/composer/qgscomposerscalebar.cpp
Expand Up @@ -465,6 +465,9 @@ bool QgsComposerScaleBar::readXML( const QDomElement& itemElem, const QDomDocume
QString styleString = itemElem.attribute( "style", "" );
setStyle( tr( styleString.toLocal8Bit().data() ) );

mUnits = ( ScaleBarUnits )itemElem.attribute( "units" ).toInt();
mAlignment = ( Alignment )( itemElem.attribute( "alignment", "0" ).toInt() );

//map
int mapId = itemElem.attribute( "mapId", "-1" ).toInt();
if ( mapId >= 0 )
Expand All @@ -478,12 +481,7 @@ bool QgsComposerScaleBar::readXML( const QDomElement& itemElem, const QDomDocume
}
}

mUnits = ( ScaleBarUnits )itemElem.attribute( "units" ).toInt();

refreshSegmentMillimeters();

//alignment
mAlignment = ( Alignment )( itemElem.attribute( "alignment", "0" ).toInt() );
updateSegmentSize();

//restore general composer item properties
QDomNodeList composerItemList = itemElem.elementsByTagName( "ComposerItem" );
Expand Down

0 comments on commit c0ee7f0

Please sign in to comment.