Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12831 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 24, 2010
1 parent f1b1598 commit e4054dc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/app/qgisappinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void QgisAppInterface::refreshLegend( QgsMapLayer *l )

void QgisAppInterface::showLayerProperties( QgsMapLayer *l )
{
if( l && qgis )
if ( l && qgis )
{
qgis->showLayerProperties( l );
}
Expand Down
25 changes: 17 additions & 8 deletions src/core/raster/qgsrasterlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ bool QgsRasterLayer::draw( QgsRenderContext& rendererContext )
for ( int i = 0; i < numParts; ++i )
{
//fetch a small overlap of 2 pixels between two adjacent tiles to avoid white stripes
QgsRectangle rasterPartRect( myRasterExtent.xMinimum(), myRasterExtent.yMaximum() - ( currentPixelOffsetY + numRowsPerPart + 2 ) * theQgsMapToPixel.mapUnitsPerPixel(), \
QgsRectangle rasterPartRect( myRasterExtent.xMinimum(), myRasterExtent.yMaximum() - ( currentPixelOffsetY + numRowsPerPart + 2 ) * theQgsMapToPixel.mapUnitsPerPixel(),
myRasterExtent.xMaximum(), myRasterExtent.yMaximum() - currentPixelOffsetY * theQgsMapToPixel.mapUnitsPerPixel() );

int pixelHeight = rasterPartRect.height() / theQgsMapToPixel.mapUnitsPerPixel();
Expand Down Expand Up @@ -4410,7 +4410,8 @@ void QgsRasterLayer::drawMultiBandColor( QPainter * theQPainter, QgsRasterViewPo
blueImageBuffer.setWritingEnabled( false ); //only draw to redImageBuffer
blueImageBuffer.reset();

while ( redImageBuffer.nextScanLine( &redImageScanLine, &redRasterScanLine ) && greenImageBuffer.nextScanLine( &greenImageScanLine, &greenRasterScanLine ) \
while ( redImageBuffer.nextScanLine( &redImageScanLine, &redRasterScanLine )
&& greenImageBuffer.nextScanLine( &greenImageScanLine, &greenRasterScanLine )
&& blueImageBuffer.nextScanLine( &blueImageScanLine, &blueRasterScanLine ) )
{
for ( int i = 0; i < theRasterViewPort->drawableAreaXDim; ++i )
Expand All @@ -4419,13 +4420,21 @@ void QgsRasterLayer::drawMultiBandColor( QPainter * theQPainter, QgsRasterViewPo
myGreenValue = readValue( greenRasterScanLine, ( GDALDataType )myGreenType, i );
myBlueValue = readValue( blueRasterScanLine, ( GDALDataType )myBlueType, i );

if ( mValidNoDataValue && (( fabs( myRedValue - mNoDataValue ) <= TINY_VALUE || myRedValue != myRedValue ) || ( fabs( myGreenValue - mNoDataValue ) <= TINY_VALUE || myGreenValue != myGreenValue ) || ( fabs( myBlueValue - mNoDataValue ) <= TINY_VALUE || myBlueValue != myBlueValue ) ) )
if ( mValidNoDataValue &&
(
( fabs( myRedValue - mNoDataValue ) <= TINY_VALUE || myRedValue != myRedValue ) ||
( fabs( myGreenValue - mNoDataValue ) <= TINY_VALUE || myGreenValue != myGreenValue ) ||
( fabs( myBlueValue - mNoDataValue ) <= TINY_VALUE || myBlueValue != myBlueValue )
)
)
{
redImageScanLine[ i ] = myDefaultColor;
continue;
}

if ( !myRedContrastEnhancement->isValueInDisplayableRange( myRedValue ) || !myGreenContrastEnhancement->isValueInDisplayableRange( myGreenValue ) || !myBlueContrastEnhancement->isValueInDisplayableRange( myBlueValue ) )
if ( !myRedContrastEnhancement->isValueInDisplayableRange( myRedValue ) ||
!myGreenContrastEnhancement->isValueInDisplayableRange( myGreenValue ) ||
!myBlueContrastEnhancement->isValueInDisplayableRange( myBlueValue ) )
{
redImageScanLine[ i ] = myDefaultColor;
continue;
Expand Down Expand Up @@ -5531,8 +5540,8 @@ QString QgsRasterLayer::validateBandName( QString const & theBandName )
return TRSTRING_NOT_SET;
}

QgsRasterImageBuffer::QgsRasterImageBuffer( GDALRasterBandH rasterBand, QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* mapToPixel, double* geoTransform ): \
mRasterBand( rasterBand ), mPainter( p ), mViewPort( viewPort ), mMapToPixel( mapToPixel ), mValid( false ), mWritingEnabled( true ), mDrawPixelRect( false ), mCurrentImage( 0 ), mCurrentGDALData( 0 ), mGeoTransform( geoTransform )
QgsRasterImageBuffer::QgsRasterImageBuffer( GDALRasterBandH rasterBand, QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* mapToPixel, double* geoTransform ):
mRasterBand( rasterBand ), mPainter( p ), mViewPort( viewPort ), mMapToPixel( mapToPixel ), mGeoTransform( geoTransform ), mValid( false ), mWritingEnabled( true ), mDrawPixelRect( false ), mCurrentImage( 0 ), mCurrentGDALData( 0 )
{

}
Expand Down Expand Up @@ -5679,8 +5688,8 @@ bool QgsRasterImageBuffer::createNextPartImage()
}
mNumCurrentImageRows = ySize;
mCurrentGDALData = VSIMalloc( size * xSize * ySize );
CPLErr myErr = GDALRasterIO( mRasterBand, GF_Read, mViewPort->rectXOffset, \
mViewPort->rectYOffset + mCurrentRow, mViewPort->clippedWidth, rasterYSize, \
CPLErr myErr = GDALRasterIO( mRasterBand, GF_Read, mViewPort->rectXOffset,
mViewPort->rectYOffset + mCurrentRow, mViewPort->clippedWidth, rasterYSize,
mCurrentGDALData, xSize, ySize, type, 0, 0 );

if ( myErr != CPLE_None )
Expand Down
11 changes: 4 additions & 7 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

#include "qgsfillsymbollayerv2.h"
#include "qgssymbollayerv2utils.h"

#include "qgsrendercontext.h"
#include "qgsproject.h"

#include <QPainter>
#include <QFile>
#include <QSvgRenderer>

QgsSimpleFillSymbolLayerV2::QgsSimpleFillSymbolLayerV2( QColor color, Qt::BrushStyle style, QColor borderColor, Qt::PenStyle borderStyle, double borderWidth )
: mBrushStyle( style ), mBorderColor( borderColor ), mBorderStyle( borderStyle ), mBorderWidth( borderWidth )
Expand Down Expand Up @@ -86,9 +88,6 @@ QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2::clone() const
}

//QgsSVGFillSymbolLayer
#include <QFile>
#include <QSvgRenderer>
#include "qgsproject.h" //for absolute/relative file paths

QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QString& svgFilePath, double width ): mPatternWidth( width ), mOutline( 0 )
{
Expand All @@ -97,7 +96,7 @@ QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QString& svgFilePath, double
setSubSymbol( new QgsLineSymbolV2() );
}

QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QByteArray& svgData, double width ): mSvgData( svgData ), mPatternWidth( width ), mOutline( 0 )
QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QByteArray& svgData, double width ): mPatternWidth( width ), mSvgData( svgData ), mOutline( 0 )
{
storeViewBox();
mOutlineWidth = 0.3;
Expand Down Expand Up @@ -280,14 +279,12 @@ void QgsSVGFillSymbolLayer::storeViewBox()

bool QgsSVGFillSymbolLayer::setSubSymbol( QgsSymbolV2* symbol )
{

if ( !symbol || symbol->type() != QgsSymbolV2::Line )
{
delete symbol;
return false;
}


QgsLineSymbolV2* lineSymbol = dynamic_cast<QgsLineSymbolV2*>( symbol );
if ( lineSymbol )
{
Expand Down
1 change: 0 additions & 1 deletion src/plugins/diagram_overlay/qgsdiagramoverlayplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "qgsvectoroverlayplugin.h"
#include <QObject>

class QgisApp;
class QgisInterface;
class QgsApplyDialog;

Expand Down

0 comments on commit e4054dc

Please sign in to comment.