Skip to content
Permalink
Browse files

Try to fix astyle errors

  • Loading branch information
nyalldawson committed Feb 12, 2019
1 parent 493185c commit 76b7bcef96fd037a3096725cdaf09396c85d499f
Showing with 17 additions and 16 deletions.
  1. +3 −2 src/app/qgsfieldcalculator.cpp
  2. +14 −14 src/core/raster/qgsmultibandcolorrenderer.cpp
@@ -351,7 +351,8 @@ void QgsFieldCalculator::populateOutputFieldTypes()
mOutputFieldTypeComboBox->blockSignals( true );

// Standard subset of fields in case of virtual
const QList< QgsVectorDataProvider::NativeType > &typelist { mCreateVirtualFieldCheckbox->isChecked() ? ( QList< QgsVectorDataProvider::NativeType >()
const QList< QgsVectorDataProvider::NativeType > &typelist = mCreateVirtualFieldCheckbox->isChecked() ?
( QList< QgsVectorDataProvider::NativeType >()
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer)" ), QStringLiteral( "integer" ), QVariant::Int, 0, 10 )
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (double)" ), QStringLiteral( "double precision" ), QVariant::Double, -1, -1, -1, -1 )
<< QgsVectorDataProvider::NativeType( tr( "Text (string)" ), QStringLiteral( "string" ), QVariant::String )
@@ -365,7 +366,7 @@ void QgsFieldCalculator::populateOutputFieldTypes()
<< QgsVectorDataProvider::NativeType( tr( "Boolean" ), QStringLiteral( "bool" ), QVariant::Bool )
// blob
<< QgsVectorDataProvider::NativeType( tr( "Binary object (BLOB)" ), QStringLiteral( "binary" ), QVariant::ByteArray ) ) :
provider->nativeTypes() };
provider->nativeTypes();

mOutputFieldTypeComboBox->clear();
for ( int i = 0; i < typelist.size(); i++ )
@@ -469,24 +469,24 @@ void QgsMultiBandColorRenderer::toSld( QDomDocument &doc, QDomElement &element,
mBlueContrastEnhancement->maximumValue() == statBlue.maximumValue )
);
}
if ( isDefaultCombination ):
return
if ( isDefaultCombination )
return;
#endif

// look for RasterSymbolizer tag
QDomNodeList elements = element.elementsByTagName( QStringLiteral( "sld:RasterSymbolizer" ) );
if ( elements.size() == 0 )
return;
// look for RasterSymbolizer tag
QDomNodeList elements = element.elementsByTagName( QStringLiteral( "sld:RasterSymbolizer" ) );
if ( elements.size() == 0 )
return;

// there SHOULD be only one
QDomElement rasterSymbolizerElem = elements.at( 0 ).toElement();
// there SHOULD be only one
QDomElement rasterSymbolizerElem = elements.at( 0 ).toElement();

// add Channel Selection tags
// Need to insert channelSelection in the correct sequence as in SLD standard e.g.
// after opacity or geometry or as first element after sld:RasterSymbolizer
QDomElement channelSelectionElem = doc.createElement( QStringLiteral( "sld:ChannelSelection" ) );
elements = rasterSymbolizerElem.elementsByTagName( QStringLiteral( "sld:Opacity" ) );
if ( elements.size() != 0 )
// add Channel Selection tags
// Need to insert channelSelection in the correct sequence as in SLD standard e.g.
// after opacity or geometry or as first element after sld:RasterSymbolizer
QDomElement channelSelectionElem = doc.createElement( QStringLiteral( "sld:ChannelSelection" ) );
elements = rasterSymbolizerElem.elementsByTagName( QStringLiteral( "sld:Opacity" ) );
if ( elements.size() != 0 )
{
rasterSymbolizerElem.insertAfter( channelSelectionElem, elements.at( 0 ) );
}

0 comments on commit 76b7bce

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