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 9ad530d commit 282f90ed7973736e414accb91cdb8c6a167907bc
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/core/qgsxmlutils.cpp
@@ -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() );

0 comments on commit 282f90e

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