Skip to content
Permalink
Browse files

Do not insert 0x0 in XML

Fixes #34218
  • Loading branch information
elpaso authored and nyalldawson committed Feb 3, 2020
1 parent dd19eb8 commit d06f2d818817820bbd8d6c1cb2d2b09ea507802f
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/qgsxmlutils.cpp
@@ -161,11 +161,15 @@ QDomElement QgsXmlUtils::writeVariant( const QVariant &value, QDomDocument &doc
case QVariant::LongLong:
case QVariant::ULongLong:
case QVariant::String:
case QVariant::Char:
element.setAttribute( QStringLiteral( "type" ), QVariant::typeToName( value.type() ) );
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() );

0 comments on commit d06f2d8

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