Skip to content

Commit

Permalink
reindent qgsvectorlayer.cpp - PLEASE run scripts/prepare-commit.sh be…
Browse files Browse the repository at this point in the history
…fore commit

git-svn-id: http://svn.osgeo.org/qgis/trunk@10993 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jul 1, 2009
1 parent 294d7f3 commit fb09248
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
Expand All @@ -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 );
Expand Down Expand Up @@ -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 );

Expand Down

0 comments on commit fb09248

Please sign in to comment.