Skip to content

Commit 09110ea

Browse files
committedJun 1, 2017
Make QgsTextFormat::readXml more forgiving to input element
1 parent 8152a00 commit 09110ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/core/qgstextrenderer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,11 @@ void QgsTextFormat::readFromLayer( QgsVectorLayer *layer )
14231423

14241424
void QgsTextFormat::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
14251425
{
1426-
QDomElement textStyleElem = elem.firstChildElement( QStringLiteral( "text-style" ) );
1426+
QDomElement textStyleElem;
1427+
if ( elem.nodeName() == QStringLiteral( "text-style" ) )
1428+
textStyleElem = elem;
1429+
else
1430+
textStyleElem = elem.firstChildElement( QStringLiteral( "text-style" ) );
14271431
QFont appFont = QApplication::font();
14281432
mTextFontFamily = textStyleElem.attribute( QStringLiteral( "fontFamily" ), appFont.family() );
14291433
QString fontFamily = mTextFontFamily;

0 commit comments

Comments
 (0)
Please sign in to comment.