Skip to content

Commit

Permalink
Try to fix astyle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 12, 2019
1 parent 493185c commit 76b7bce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
5 changes: 3 additions & 2 deletions src/app/qgsfieldcalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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++ )
Expand Down
28 changes: 14 additions & 14 deletions src/core/raster/qgsmultibandcolorrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
}
Expand Down

0 comments on commit 76b7bce

Please sign in to comment.