Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make QgsTextFormat::readXml more forgiving to input element
  • Loading branch information
nyalldawson committed Jun 1, 2017
1 parent 8152a00 commit 09110ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/qgstextrenderer.cpp
Expand Up @@ -1423,7 +1423,11 @@ void QgsTextFormat::readFromLayer( QgsVectorLayer *layer )

void QgsTextFormat::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
{
QDomElement textStyleElem = elem.firstChildElement( QStringLiteral( "text-style" ) );
QDomElement textStyleElem;
if ( elem.nodeName() == QStringLiteral( "text-style" ) )
textStyleElem = elem;
else
textStyleElem = elem.firstChildElement( QStringLiteral( "text-style" ) );
QFont appFont = QApplication::font();
mTextFontFamily = textStyleElem.attribute( QStringLiteral( "fontFamily" ), appFont.family() );
QString fontFamily = mTextFontFamily;
Expand Down

0 comments on commit 09110ea

Please sign in to comment.