Skip to content

Commit

Permalink
Do not insert 0x0 in XML
Browse files Browse the repository at this point in the history
Fixes #34218
  • Loading branch information
elpaso authored and nyalldawson committed Feb 5, 2020
1 parent 9ad530d commit 282f90e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/qgsxmlutils.cpp
Expand Up @@ -165,6 +165,11 @@ QDomElement QgsXmlUtils::writeVariant( const QVariant &value, QDomDocument &doc
element.setAttribute( QStringLiteral( "value" ), value.toString() );
break;

case QVariant::Char:
element.setAttribute( QStringLiteral( "type" ), QVariant::typeToName( value.type() ) );
element.setAttribute( QStringLiteral( "value" ), value.isNull() ? QString() : value.toString() );
break;

case QVariant::Color:
element.setAttribute( QStringLiteral( "type" ), QStringLiteral( "color" ) );
element.setAttribute( QStringLiteral( "value" ), value.value< QColor >().isValid() ? QgsSymbolLayerUtils::encodeColor( value.value< QColor >() ) : QString() );
Expand Down

0 comments on commit 282f90e

Please sign in to comment.