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@12831 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 24, 2010
1 parent 553e4d2 commit 66c51e6
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 Original file line Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void QgisAppInterface::refreshLegend( QgsMapLayer *l )


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


int pixelHeight = rasterPartRect.height() / 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.setWritingEnabled( false ); //only draw to redImageBuffer
blueImageBuffer.reset(); blueImageBuffer.reset();


while ( redImageBuffer.nextScanLine( &redImageScanLine, &redRasterScanLine ) && greenImageBuffer.nextScanLine( &greenImageScanLine, &greenRasterScanLine ) \ while ( redImageBuffer.nextScanLine( &redImageScanLine, &redRasterScanLine )
&& greenImageBuffer.nextScanLine( &greenImageScanLine, &greenRasterScanLine )
&& blueImageBuffer.nextScanLine( &blueImageScanLine, &blueRasterScanLine ) ) && blueImageBuffer.nextScanLine( &blueImageScanLine, &blueRasterScanLine ) )
{ {
for ( int i = 0; i < theRasterViewPort->drawableAreaXDim; ++i ) 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 ); myGreenValue = readValue( greenRasterScanLine, ( GDALDataType )myGreenType, i );
myBlueValue = readValue( blueRasterScanLine, ( GDALDataType )myBlueType, 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; redImageScanLine[ i ] = myDefaultColor;
continue; continue;
} }


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


QgsRasterImageBuffer::QgsRasterImageBuffer( GDALRasterBandH rasterBand, QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* mapToPixel, double* geoTransform ): \ 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 ) 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; mNumCurrentImageRows = ySize;
mCurrentGDALData = VSIMalloc( size * xSize * ySize ); mCurrentGDALData = VSIMalloc( size * xSize * ySize );
CPLErr myErr = GDALRasterIO( mRasterBand, GF_Read, mViewPort->rectXOffset, \ CPLErr myErr = GDALRasterIO( mRasterBand, GF_Read, mViewPort->rectXOffset,
mViewPort->rectYOffset + mCurrentRow, mViewPort->clippedWidth, rasterYSize, \ mViewPort->rectYOffset + mCurrentRow, mViewPort->clippedWidth, rasterYSize,
mCurrentGDALData, xSize, ySize, type, 0, 0 ); mCurrentGDALData, xSize, ySize, type, 0, 0 );


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

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


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


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


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


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


QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QString& svgFilePath, double width ): mPatternWidth( width ), mOutline( 0 ) 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() ); 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(); storeViewBox();
mOutlineWidth = 0.3; mOutlineWidth = 0.3;
Expand Down Expand Up @@ -280,14 +279,12 @@ void QgsSVGFillSymbolLayer::storeViewBox()


bool QgsSVGFillSymbolLayer::setSubSymbol( QgsSymbolV2* symbol ) bool QgsSVGFillSymbolLayer::setSubSymbol( QgsSymbolV2* symbol )
{ {

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



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


class QgisApp;
class QgisInterface; class QgisInterface;
class QgsApplyDialog; class QgsApplyDialog;


Expand Down

0 comments on commit 66c51e6

Please sign in to comment.