Skip to content
Permalink
Browse files

reindent qgsvectorlayer.cpp - PLEASE run scripts/prepare-commit.sh be…

…fore commit

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10993 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jul 1, 2009
1 parent b2d1d0d commit c5f5e7f8ffe493cd75fa13bec3cdcd64a26fa9df
Showing with 26 additions and 26 deletions.
  1. +26 −26 src/core/qgsvectorlayer.cpp
@@ -2402,20 +2402,20 @@ bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage
}

mAttributeAliasMap.clear();
QDomNode aliasesNode = node.namedItem("aliases");
if(!aliasesNode.isNull())
QDomNode aliasesNode = node.namedItem( "aliases" );
if ( !aliasesNode.isNull() )
{
QDomElement aliasElem;
int index;
QString name;

QDomNodeList aliasNodeList = aliasesNode.toElement().elementsByTagName("alias");
for(int i = 0; i < aliasNodeList.size(); ++i)
QDomNodeList aliasNodeList = aliasesNode.toElement().elementsByTagName( "alias" );
for ( int i = 0; i < aliasNodeList.size(); ++i )
{
aliasElem = aliasNodeList.at(i).toElement();
index = aliasElem.attribute("index").toInt();
name = aliasElem.attribute("name");
mAttributeAliasMap.insert(index, name);
aliasElem = aliasNodeList.at( i ).toElement();
index = aliasElem.attribute( "index" ).toInt();
name = aliasElem.attribute( "name" );
mAttributeAliasMap.insert( index, name );
}
}

@@ -2553,18 +2553,18 @@ bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString&
}

//attribute aliases
if(mAttributeAliasMap.size() > 0)
if ( mAttributeAliasMap.size() > 0 )
{
QDomElement aliasElem = doc.createElement("aliases");
QDomElement aliasElem = doc.createElement( "aliases" );
QMap<int, QString>::const_iterator a_it = mAttributeAliasMap.constBegin();
for(; a_it != mAttributeAliasMap.constEnd(); ++a_it)
for ( ; a_it != mAttributeAliasMap.constEnd(); ++a_it )
{
QDomElement aliasEntryElem = doc.createElement("alias");
aliasEntryElem.setAttribute("index", QString::number(a_it.key()));
aliasEntryElem.setAttribute("name", a_it.value());
aliasElem.appendChild(aliasEntryElem);
QDomElement aliasEntryElem = doc.createElement( "alias" );
aliasEntryElem.setAttribute( "index", QString::number( a_it.key() ) );
aliasEntryElem.setAttribute( "name", a_it.value() );
aliasElem.appendChild( aliasEntryElem );
}
node.appendChild(aliasElem);
node.appendChild( aliasElem );
}

// add the display field
@@ -2713,16 +2713,16 @@ bool QgsVectorLayer::addAttribute( QString name, QString type )
return addAttribute( QgsField( name, map[ type ], type ) );
}

void QgsVectorLayer::addAttributeAlias(int attIndex, QString aliasString)
void QgsVectorLayer::addAttributeAlias( int attIndex, QString aliasString )
{
mAttributeAliasMap.insert(attIndex, aliasString);
emit layerModified(false);
mAttributeAliasMap.insert( attIndex, aliasString );
emit layerModified( false );
}

QString QgsVectorLayer::attributeAlias(int attributeIndex) const
QString QgsVectorLayer::attributeAlias( int attributeIndex ) const
{
QMap<int, QString>::const_iterator alias_it = mAttributeAliasMap.find(attributeIndex);
if(alias_it != mAttributeAliasMap.constEnd())
QMap<int, QString>::const_iterator alias_it = mAttributeAliasMap.find( attributeIndex );
if ( alias_it != mAttributeAliasMap.constEnd() )
{
return alias_it.value();
}
@@ -2732,10 +2732,10 @@ QString QgsVectorLayer::attributeAlias(int attributeIndex) const
}
}

QString QgsVectorLayer::attributeDisplayName(int attributeIndex) const
QString QgsVectorLayer::attributeDisplayName( int attributeIndex ) const
{
QString displayName = attributeAlias(attributeIndex);
if(displayName.isEmpty())
QString displayName = attributeAlias( attributeIndex );
if ( displayName.isEmpty() )
{
const QgsFieldMap& fields = pendingFields();
QgsFieldMap::const_iterator fieldIt = fields.find( attributeIndex );
@@ -2767,7 +2767,7 @@ bool QgsVectorLayer::deleteAttribute( int index )
mDeletedAttributeIds.insert( index );
mAddedAttributeIds.remove( index );
mUpdatedFields.remove( index );
mAttributeAliasMap.remove(index);
mAttributeAliasMap.remove( index );

setModified( true, false );

0 comments on commit c5f5e7f

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