Skip to content
Permalink
Browse files

fix warnings

git-svn-id: http://svn.osgeo.org/qgis/trunk@12831 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jan 24, 2010
1 parent 553e4d2 commit 66c51e65a3efaa6c87fdb980930c95d2151f5d6d
@@ -200,7 +200,7 @@ void QgisAppInterface::refreshLegend( QgsMapLayer *l )

void QgisAppInterface::showLayerProperties( QgsMapLayer *l )
{
if( l && qgis )
if ( l && qgis )
{
qgis->showLayerProperties( l );
}
@@ -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();
@@ -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 )
@@ -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;
@@ -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 )
{

}
@@ -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 )
@@ -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 )
@@ -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 )
{
@@ -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;
@@ -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 )
{
@@ -21,7 +21,6 @@
#include "qgsvectoroverlayplugin.h"
#include <QObject>

class QgisApp;
class QgisInterface;
class QgsApplyDialog;

0 comments on commit 66c51e6

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