Skip to content
Permalink
Browse files

Make QgsTextFormat::readXml more forgiving to input element

  • Loading branch information
nyalldawson committed Jun 1, 2017
1 parent 8152a00 commit 09110ea875a7b74d7d7c452e4deee9012ba56c39
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/qgstextrenderer.cpp
@@ -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;

0 comments on commit 09110ea

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