Skip to content
Permalink
Browse files

Don't use invalid xml values as attribute names

Fixes #14136
  • Loading branch information
m-kuhn committed Feb 23, 2016
1 parent 50aa805 commit 58751b5063a5538ca2ce476dc812fcb396c6cf8b
Showing with 13 additions and 2 deletions.
  1. +13 −2 src/core/qgseditformconfig.cpp
@@ -242,7 +242,15 @@ void QgsEditFormConfig::readXml( const QDomNode& node )
for ( int j = 0; j < cfgElem.attributes().size(); ++j )
{
QDomAttr attr = cfgElem.attributes().item( j ).toAttr();
cfg[attr.name()] = attr.value();
cfg.insert( attr.name(), attr.value() );
}

QDomNodeList optionElements = cfgElem.elementsByTagName( "option" );
for ( int j = 0; j < optionElements.size(); ++j )
{
QString key = optionElements.at( j ).toElement().attribute( "key" );
QString value = optionElements.at( j ).toElement().attribute( "value" );
cfg.insert( key, value );
}

setWidgetConfig( wdgElem.attribute( "name" ), cfg );
@@ -337,7 +345,10 @@ void QgsEditFormConfig::writeXml( QDomNode& node ) const

while ( cfgIt != configIt.value().constEnd() )
{
configElem.setAttribute( cfgIt.key(), cfgIt.value().toString() );
QDomElement optionElem = doc.createElement( "option" );
optionElem.setAttribute( "key", cfgIt.key() );
optionElem.setAttribute( "value", cfgIt.value().toString() );
configElem.appendChild( optionElem );
++cfgIt;
}

0 comments on commit 58751b5

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