[QGIS Commit] r9282 - in trunk/qgis: src/app src/app/composer
src/core src/core/composer src/core/raster src/core/renderer
src/providers/grass tests/src/core tools/mapserver_export
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Mon Sep 8 04:18:14 EDT 2008
Author: jef
Date: 2008-09-08 04:18:14 -0400 (Mon, 08 Sep 2008)
New Revision: 9282
Modified:
trunk/qgis/src/app/composer/qgscomposer.cpp
trunk/qgis/src/app/composer/qgscomposerlegendwidget.cpp
trunk/qgis/src/app/composer/qgscompositionwidget.cpp
trunk/qgis/src/app/qgsattributedialog.cpp
trunk/qgis/src/app/qgsattributetable.cpp
trunk/qgis/src/app/qgscustomprojectiondialog.cpp
trunk/qgis/src/app/qgspluginregistry.cpp
trunk/qgis/src/app/qgsrasterlayerproperties.cpp
trunk/qgis/src/core/composer/qgscomposeritem.cpp
trunk/qgis/src/core/composer/qgscomposeritem.h
trunk/qgis/src/core/composer/qgscomposerlabel.cpp
trunk/qgis/src/core/composer/qgscomposerlegend.cpp
trunk/qgis/src/core/composer/qgscomposermap.cpp
trunk/qgis/src/core/composer/qgscomposerscalebar.cpp
trunk/qgis/src/core/composer/qgscomposerscalebar.h
trunk/qgis/src/core/composer/qgscomposition.cpp
trunk/qgis/src/core/composer/qgsdoubleboxscalebarstyle.cpp
trunk/qgis/src/core/composer/qgslegendmodel.cpp
trunk/qgis/src/core/composer/qgslegendmodel.h
trunk/qgis/src/core/composer/qgsnumericscalebarstyle.cpp
trunk/qgis/src/core/composer/qgsscalebarstyle.cpp
trunk/qgis/src/core/composer/qgssingleboxscalebarstyle.cpp
trunk/qgis/src/core/composer/qgsticksscalebarstyle.cpp
trunk/qgis/src/core/qgsrect.cpp
trunk/qgis/src/core/raster/qgscolorrampshader.cpp
trunk/qgis/src/core/raster/qgscolorrampshader.h
trunk/qgis/src/core/raster/qgsrasterlayer.cpp
trunk/qgis/src/core/raster/qgsrasterlayer.h
trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp
trunk/qgis/src/core/renderer/qgsrenderer.cpp
trunk/qgis/src/core/renderer/qgsrenderer.h
trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp
trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp
trunk/qgis/src/providers/grass/qgsgrass.cpp
trunk/qgis/tests/src/core/testcontrastenhancements.cpp
trunk/qgis/tools/mapserver_export/qgsmapserverexport.cpp
Log:
automatic indentation update (r9220-r9281)
Modified: trunk/qgis/src/app/composer/qgscomposer.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposer.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/app/composer/qgscomposer.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -888,7 +888,7 @@
//find out the last used filter
QSettings myQSettings; // where we keep last used filter in persistant state
QString myLastUsedFormat = myQSettings.value( "/UI/lastSaveAsImageFormat", "png" ).toString();
- QString myLastUsedFile = myQSettings.value( "/UI/lastSaveAsImageFile", "qgis.png").toString();
+ QString myLastUsedFile = myQSettings.value( "/UI/lastSaveAsImageFile", "qgis.png" ).toString();
QFileInfo file( myLastUsedFile );
// get a list of supported output image types
@@ -944,9 +944,9 @@
//raise();
if ( result != QDialog::Accepted )
- {
- return;
- }
+ {
+ return;
+ }
myOutputFileNameQString = myQFileDialog->selectedFiles().first();
QString myFilterString = myQFileDialog->selectedFilter();
@@ -959,21 +959,21 @@
if ( myOutputFileNameQString == "" ) return;
mComposition->setPlotStyle( QgsComposition::Print );
- mView->setScene(0);
+ mView->setScene( 0 );
- QImage image( QSize(width, height), QImage::Format_ARGB32 );
- image.setDotsPerMeterX(mComposition->printoutResolution() / 25.4 * 1000);
- image.setDotsPerMeterY(mComposition->printoutResolution() / 25.4 * 1000);
- image.fill(0);
+ QImage image( QSize( width, height ), QImage::Format_ARGB32 );
+ image.setDotsPerMeterX( mComposition->printoutResolution() / 25.4 * 1000 );
+ image.setDotsPerMeterY( mComposition->printoutResolution() / 25.4 * 1000 );
+ image.fill( 0 );
QPainter p( &image );
- QRectF sourceArea( 0, 0, mComposition->paperWidth(), mComposition->paperHeight());
- QRectF targetArea(0, 0, width, height);
- mComposition->render( &p, targetArea, sourceArea);
+ QRectF sourceArea( 0, 0, mComposition->paperWidth(), mComposition->paperHeight() );
+ QRectF targetArea( 0, 0, width, height );
+ mComposition->render( &p, targetArea, sourceArea );
p.end();
mComposition->setPlotStyle( QgsComposition::Preview );
image.save( myOutputFileNameQString, myFilterMap[myFilterString].toLocal8Bit().data() );
- mView->setScene(mComposition);
+ mView->setScene( mComposition );
}
@@ -1420,8 +1420,8 @@
mComposition->addItem( newLabel );
mComposition->update();
mComposition->clearSelection();
- newLabel->setSelected(true);
- showItemOptions(newLabel);
+ newLabel->setSelected( true );
+ showItemOptions( newLabel );
}
//composer maps
@@ -1435,8 +1435,8 @@
mComposition->addItem( newMap );
mComposition->update();
mComposition->clearSelection();
- newMap->setSelected(true);
- showItemOptions(newMap);
+ newMap->setSelected( true );
+ showItemOptions( newMap );
}
//composer scalebars
@@ -1450,8 +1450,8 @@
mComposition->addItem( newScaleBar );
mComposition->update();
mComposition->clearSelection();
- newScaleBar->setSelected(true);
- showItemOptions(newScaleBar);
+ newScaleBar->setSelected( true );
+ showItemOptions( newScaleBar );
}
//composer legends
@@ -1465,8 +1465,8 @@
mComposition->addItem( newLegend );
mComposition->update();
mComposition->clearSelection();
- newLegend->setSelected(true);
- showItemOptions(newLegend);
+ newLegend->setSelected( true );
+ showItemOptions( newLegend );
}
//composer pictures
@@ -1480,8 +1480,8 @@
mComposition->addItem( newPicture );
mComposition->update();
mComposition->clearSelection();
- newPicture->setSelected(true);
- showItemOptions(newPicture);
+ newPicture->setSelected( true );
+ showItemOptions( newPicture );
}
mComposition->sortZList();
Modified: trunk/qgis/src/app/composer/qgscomposerlegendwidget.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposerlegendwidget.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/app/composer/qgscomposerlegendwidget.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -363,10 +363,10 @@
return;
}
- if(mLegend->model())
- {
- mLegend->model()->updateItem(currentItem);
- }
+ if ( mLegend->model() )
+ {
+ mLegend->model()->updateItem( currentItem );
+ }
mLegend->update();
mLegend->adjustBoxSize();
}
Modified: trunk/qgis/src/app/composer/qgscompositionwidget.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscompositionwidget.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/app/composer/qgscompositionwidget.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -25,8 +25,8 @@
createPaperEntries();
//unit (only mm at the moment, therefore disabled)
- mPaperUnitsComboBox->addItem("mm");
- mPaperUnitsComboBox->setEnabled(false);
+ mPaperUnitsComboBox->addItem( "mm" );
+ mPaperUnitsComboBox->setEnabled( false );
//orientation
mPaperOrientationComboBox->blockSignals( true );
Modified: trunk/qgis/src/app/qgsattributedialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsattributedialog.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/app/qgsattributedialog.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -253,15 +253,15 @@
{
QLineEdit *le = new QLineEdit( myFieldValue.toString() );
- QPushButton *pb = new QPushButton( tr("...") );
- connect(pb, SIGNAL(clicked()), this, SLOT(selectFileName()));
+ QPushButton *pb = new QPushButton( tr( "..." ) );
+ connect( pb, SIGNAL( clicked() ), this, SLOT( selectFileName() ) );
QHBoxLayout *hbl = new QHBoxLayout();
- hbl->addWidget(le);
- hbl->addWidget(pb);
+ hbl->addWidget( le );
+ hbl->addWidget( pb );
myWidget = new QWidget;
- myWidget->setLayout(hbl);
+ myWidget->setLayout( hbl );
}
break;
}
@@ -296,22 +296,22 @@
void QgsAttributeDialog::selectFileName()
{
QPushButton *pb = dynamic_cast<QPushButton *>( sender() );
- if(!pb)
+ if ( !pb )
return;
QWidget *hbox = dynamic_cast<QWidget *>( pb->parent() );
- if(!hbox)
+ if ( !hbox )
return;
QLineEdit *le = hbox->findChild<QLineEdit *>();
- if(!le)
+ if ( !le )
return;
- QString fileName = QFileDialog::getOpenFileName(0 , tr("Select a file"));
- if(fileName.isNull())
+ QString fileName = QFileDialog::getOpenFileName( 0 , tr( "Select a file" ) );
+ if ( fileName.isNull() )
return;
- le->setText(fileName);
+ le->setText( fileName );
}
void QgsAttributeDialog::accept()
@@ -368,8 +368,8 @@
myFieldValue = QString::number( dsb->value() );
}
- le = mpWidgets.value( myIndex )->findChild<QLineEdit *>("lineEdit");
- if(le)
+ le = mpWidgets.value( myIndex )->findChild<QLineEdit *>( "lineEdit" );
+ if ( le )
{
myFieldValue = le->text();
}
Modified: trunk/qgis/src/app/qgsattributetable.cpp
===================================================================
--- trunk/qgis/src/app/qgsattributetable.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/app/qgsattributetable.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -103,7 +103,7 @@
void QgsAttributeTable::setReadOnly( bool b )
{
- blockSignals(true);
+ blockSignals( true );
setEditTriggers( b ? QAbstractItemView::NoEditTriggers :
QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed );
@@ -112,7 +112,7 @@
setColumnReadOnly( 0, true );
}
- blockSignals(false);
+ blockSignals( false );
}
void QgsAttributeTable::setColumnReadOnly( int col, bool ro )
@@ -439,7 +439,7 @@
void QgsAttributeTable::fillTable( QgsVectorLayer *layer )
{
- blockSignals(true);
+ blockSignals( true );
const QgsFieldMap &fields = layer->pendingFields();
@@ -489,7 +489,7 @@
for ( int i = 0; i < columnCount(); i++ )
resizeColumnToContents( i );
- blockSignals(false);
+ blockSignals( false );
}
void QgsAttributeTable::putFeatureInTable( int row, const QgsFeature& fet )
Modified: trunk/qgis/src/app/qgscustomprojectiondialog.cpp
===================================================================
--- trunk/qgis/src/app/qgscustomprojectiondialog.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/app/qgscustomprojectiondialog.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -855,7 +855,7 @@
sqlite3_finalize( myPreparedStatement );
sqlite3_close( myDatabase );
- pbnDelete->setEnabled( true );
+ pbnDelete->setEnabled( true );
}
void QgsCustomProjectionDialog::on_pbnCalculate_clicked()
Modified: trunk/qgis/src/app/qgspluginregistry.cpp
===================================================================
--- trunk/qgis/src/app/qgspluginregistry.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/app/qgspluginregistry.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -89,9 +89,9 @@
void QgsPluginRegistry::unloadAll()
{
- for(std::map<QString, QgsPluginMetadata*>::iterator it=plugins.begin();
- it!=plugins.end();
- it++)
- if( it->second->plugin() )
+ for ( std::map<QString, QgsPluginMetadata*>::iterator it = plugins.begin();
+ it != plugins.end();
+ it++ )
+ if ( it->second->plugin() )
it->second->plugin()->unload();
}
Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -822,7 +822,7 @@
pixmapLegend->repaint();
//set the palette pixmap
- pixmapPalette->setPixmap( mRasterLayer->getPaletteAsPixmap(mRasterLayer->getRasterBandNumber(mRasterLayer->getGrayBandName())));
+ pixmapPalette->setPixmap( mRasterLayer->getPaletteAsPixmap( mRasterLayer->getRasterBandNumber( mRasterLayer->getGrayBandName() ) ) );
pixmapPalette->setScaledContents( true );
pixmapPalette->repaint();
@@ -1988,7 +1988,7 @@
QgsDebugMsg( QString( "myMiddle = %1" ).arg( myMiddle ) );
- if ( myRasterShaderFunction->generateShadedValue(myMiddle, &c1, &c2, &c3))
+ if ( myRasterShaderFunction->generateShadedValue( myMiddle, &c1, &c2, &c3 ) )
{
QgsDebugMsg( "Color not found" );
c1 = c2 = c3 = 180; // grey
Modified: trunk/qgis/src/core/composer/qgscomposeritem.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposeritem.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgscomposeritem.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -525,58 +525,58 @@
}
}
-void QgsComposerItem::drawText(QPainter* p, int x, int y, const QString& text, const QFont& font) const
+void QgsComposerItem::drawText( QPainter* p, int x, int y, const QString& text, const QFont& font ) const
{
- QFont textFont = scaledFontPixelSize(font);
-
+ QFont textFont = scaledFontPixelSize( font );
+
p->save();
- p->setFont(textFont);
- p->setPen(QColor(0, 0, 0)); //draw text always in black
+ p->setFont( textFont );
+ p->setPen( QColor( 0, 0, 0 ) ); //draw text always in black
double scaleFactor = 1.0 / FONT_WORKAROUND_SCALE;
- p->scale(scaleFactor, scaleFactor);
- p->drawText(x * FONT_WORKAROUND_SCALE, y * FONT_WORKAROUND_SCALE, text);
+ p->scale( scaleFactor, scaleFactor );
+ p->drawText( x * FONT_WORKAROUND_SCALE, y * FONT_WORKAROUND_SCALE, text );
p->restore();
}
-void QgsComposerItem::drawText(QPainter* p, const QRectF& rect, const QString& text, const QFont& font) const
+void QgsComposerItem::drawText( QPainter* p, const QRectF& rect, const QString& text, const QFont& font ) const
{
- QFont textFont = scaledFontPixelSize(font);
+ QFont textFont = scaledFontPixelSize( font );
- QRectF scaledRect(rect.x() * FONT_WORKAROUND_SCALE, rect.y() * FONT_WORKAROUND_SCALE,
- rect.width() * FONT_WORKAROUND_SCALE, rect.height() * FONT_WORKAROUND_SCALE);
+ QRectF scaledRect( rect.x() * FONT_WORKAROUND_SCALE, rect.y() * FONT_WORKAROUND_SCALE,
+ rect.width() * FONT_WORKAROUND_SCALE, rect.height() * FONT_WORKAROUND_SCALE );
p->save();
- p->setFont(textFont);
- p->setPen(QColor(0, 0, 0)); //draw text always in black
+ p->setFont( textFont );
+ p->setPen( QColor( 0, 0, 0 ) ); //draw text always in black
double scaleFactor = 1.0 / FONT_WORKAROUND_SCALE;
- p->scale(scaleFactor, scaleFactor);
- p->drawText(scaledRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, text);
+ p->scale( scaleFactor, scaleFactor );
+ p->drawText( scaledRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, text );
p->restore();
}
-double QgsComposerItem::textWidthMM(const QFont& font, const QString& text) const
+double QgsComposerItem::textWidthMM( const QFont& font, const QString& text ) const
{
- QFont metricsFont = scaledFontPixelSize(font);
- QFontMetrics fontMetrics(metricsFont);
- return (fontMetrics.width(text) / FONT_WORKAROUND_SCALE);
+ QFont metricsFont = scaledFontPixelSize( font );
+ QFontMetrics fontMetrics( metricsFont );
+ return ( fontMetrics.width( text ) / FONT_WORKAROUND_SCALE );
}
-double QgsComposerItem::fontAscentMM(const QFont& font) const
+double QgsComposerItem::fontAscentMM( const QFont& font ) const
{
- QFont metricsFont = scaledFontPixelSize(font);
- QFontMetrics fontMetrics(metricsFont);
- return (fontMetrics.ascent() / FONT_WORKAROUND_SCALE);
+ QFont metricsFont = scaledFontPixelSize( font );
+ QFontMetrics fontMetrics( metricsFont );
+ return ( fontMetrics.ascent() / FONT_WORKAROUND_SCALE );
}
-double QgsComposerItem::pixelFontSize(double pointSize) const
+double QgsComposerItem::pixelFontSize( double pointSize ) const
{
- return (pointSize * 0.3527);
+ return ( pointSize * 0.3527 );
}
-QFont QgsComposerItem::scaledFontPixelSize(const QFont& font) const
+QFont QgsComposerItem::scaledFontPixelSize( const QFont& font ) const
{
QFont scaledFont = font;
- double pixelSize = pixelFontSize(font.pointSizeF()) * FONT_WORKAROUND_SCALE + 0.5;
- scaledFont.setPixelSize(pixelSize);
+ double pixelSize = pixelFontSize( font.pointSizeF() ) * FONT_WORKAROUND_SCALE + 0.5;
+ scaledFont.setPixelSize( pixelSize );
return scaledFont;
}
Modified: trunk/qgis/src/core/composer/qgscomposeritem.h
===================================================================
--- trunk/qgis/src/core/composer/qgscomposeritem.h 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgscomposeritem.h 2008-09-08 08:18:14 UTC (rev 9282)
@@ -105,27 +105,27 @@
const QgsComposition* composition() const {return mComposition;}
- //functions that encapsulate the workaround for the Qt font bug (that is to scale the font size up and then scale the
+ //functions that encapsulate the workaround for the Qt font bug (that is to scale the font size up and then scale the
//painter down by the same factor for drawing
/**Draws Text. Takes care about all the composer specific issues (calculation to pixel, scaling of font and painter
to work arount the Qt font bug)*/
- void drawText(QPainter* p, int x, int y, const QString& text, const QFont& font) const;
+ void drawText( QPainter* p, int x, int y, const QString& text, const QFont& font ) const;
/**Like the above, but with a rectangle for multiline text*/
- void drawText(QPainter* p, const QRectF& rect, const QString& text, const QFont& font) const;
+ void drawText( QPainter* p, const QRectF& rect, const QString& text, const QFont& font ) const;
/**Returns the font width in MM (considers upscaling and downscaling with FONT_WORKAROUND_SCALE*/
- double textWidthMM(const QFont& font, const QString& text) const;
+ double textWidthMM( const QFont& font, const QString& text ) const;
/**Returns the font ascent in MM (considers upscaling and downscaling with FONT_WORKAROUND_SCALE*/
- double fontAscentMM(const QFont& font) const;
+ double fontAscentMM( const QFont& font ) const;
/**Calculates font to from point size to pixel size*/
- double pixelFontSize(double pointSize) const;
+ double pixelFontSize( double pointSize ) const;
/**Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE*/
- QFont scaledFontPixelSize(const QFont& font) const;
+ QFont scaledFontPixelSize( const QFont& font ) const;
protected:
Modified: trunk/qgis/src/core/composer/qgscomposerlabel.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposerlabel.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgscomposerlabel.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -22,7 +22,7 @@
QgsComposerLabel::QgsComposerLabel( QgsComposition *composition ): QgsComposerItem( composition ), mMargin( 1.0 )
{
//default font size is 10 point
- mFont.setPointSizeF(10);
+ mFont.setPointSizeF( 10 );
}
QgsComposerLabel::~QgsComposerLabel()
@@ -45,9 +45,9 @@
//support multiline labels
double penWidth = pen().widthF();
QRectF painterRect( penWidth + mMargin, penWidth + mMargin, rect().width() - 2 * penWidth - 2 * mMargin,
- rect().height() - 2 * penWidth - 2 * mMargin);
+ rect().height() - 2 * penWidth - 2 * mMargin );
//painter->drawText( painterRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, mText );
- drawText(painter, painterRect, mText, mFont);
+ drawText( painter, painterRect, mText, mFont );
drawFrame( painter );
if ( isSelected() )
@@ -68,11 +68,11 @@
void QgsComposerLabel::adjustSizeToText()
{
- double textWidth = textWidthMM(mFont, mText);
- double fontAscent = fontAscentMM(mFont);
+ double textWidth = textWidthMM( mFont, mText );
+ double fontAscent = fontAscentMM( mFont );
setSceneRect( QRectF( transform().dx(), transform().dy(), textWidth + 2 * mMargin + 2 * pen().widthF() + 1, \
- fontAscent + 2 * mMargin + 2 * pen().widthF() + 1) );
+ fontAscent + 2 * mMargin + 2 * pen().widthF() + 1 ) );
}
QFont QgsComposerLabel::font() const
Modified: trunk/qgis/src/core/composer/qgscomposerlegend.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposerlegend.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgscomposerlegend.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -28,9 +28,9 @@
QStringList idList = layerIdList();
mLegendModel.setLayerSet( idList );
- mTitleFont.setPointSizeF(14.0);
- mLayerFont.setPointSizeF(12.0);
- mItemFont.setPointSizeF(12.0);
+ mTitleFont.setPointSizeF( 14.0 );
+ mLayerFont.setPointSizeF( 12.0 );
+ mItemFont.setPointSizeF( 12.0 );
mSymbolWidth = 7;
mSymbolHeight = 4;
@@ -83,13 +83,13 @@
//font metrics
//draw title
- currentYCoordinate += fontAscentMM(mTitleFont);
+ currentYCoordinate += fontAscentMM( mTitleFont );
if ( painter )
{
- drawText(painter, mBoxSpace, currentYCoordinate, mTitle, mTitleFont);
+ drawText( painter, mBoxSpace, currentYCoordinate, mTitle, mTitleFont );
}
- maxXCoord = 2 * mBoxSpace + textWidthMM(mTitleFont, mTitle);
+ maxXCoord = 2 * mBoxSpace + textWidthMM( mTitleFont, mTitle );
//draw layer items
for ( int i = 0; i < numLayerItems; ++i )
@@ -98,15 +98,15 @@
if ( currentLayerItem )
{
currentYCoordinate += mLayerSpace;
- currentYCoordinate += fontAscentMM(mLayerFont);
+ currentYCoordinate += fontAscentMM( mLayerFont );
//draw layer Item
if ( painter )
{
- drawText(painter, mBoxSpace, currentYCoordinate, currentLayerItem->text(), mLayerFont);
+ drawText( painter, mBoxSpace, currentYCoordinate, currentLayerItem->text(), mLayerFont );
}
- maxXCoord = std::max( maxXCoord, 2 * mBoxSpace + textWidthMM(mLayerFont, currentLayerItem->text()));
+ maxXCoord = std::max( maxXCoord, 2 * mBoxSpace + textWidthMM( mLayerFont, currentLayerItem->text() ) );
//and child items
drawLayerChildItems( painter, currentLayerItem, currentYCoordinate, maxXCoord );
@@ -149,7 +149,7 @@
}
//standerd item height
- double itemHeight = std::max( mSymbolHeight, fontAscentMM(mItemFont));
+ double itemHeight = std::max( mSymbolHeight, fontAscentMM( mItemFont ) );
QStandardItem* currentItem;
@@ -201,10 +201,10 @@
//finally draw text
if ( p )
{
- drawText(p, currentXCoord, currentYCoord + fontAscentMM(mItemFont) + ( realItemHeight - fontAscentMM(mItemFont)) / 2, currentItem->text(), mItemFont);
+ drawText( p, currentXCoord, currentYCoord + fontAscentMM( mItemFont ) + ( realItemHeight - fontAscentMM( mItemFont ) ) / 2, currentItem->text(), mItemFont );
}
- maxXCoord = std::max( maxXCoord, currentXCoord + textWidthMM(mItemFont, currentItem->text()) + mBoxSpace );
+ maxXCoord = std::max( maxXCoord, currentXCoord + textWidthMM( mItemFont, currentItem->text() ) + mBoxSpace );
currentYCoord += realItemHeight;
}
Modified: trunk/qgis/src/core/composer/qgscomposermap.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposermap.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgscomposermap.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -182,14 +182,14 @@
double currentScaleFactorX = horizontalViewScaleFactor();
if ( mComposition->plotStyle() == QgsComposition::Preview && mPreviewMode == Rectangle )
- {
- QFont messageFont("", 12);
- painter->setFont(messageFont);
- painter->setPen(QColor(0, 0, 0));
- painter->drawText(thisPaintRect, tr("Map will be printed here"));
- }
- else if ( mComposition->plotStyle() == QgsComposition::Preview)
{
+ QFont messageFont( "", 12 );
+ painter->setFont( messageFont );
+ painter->setPen( QColor( 0, 0, 0 ) );
+ painter->drawText( thisPaintRect, tr( "Map will be printed here" ) );
+ }
+ else if ( mComposition->plotStyle() == QgsComposition::Preview )
+ {
//draw cached pixmap. This function does not call cache() any more because
//Qt 4.4.0 and 4.4.1 have problems with recursive paintings
//QgsComposerMap::cache() and QgsComposerMap::update() need to be called by
Modified: trunk/qgis/src/core/composer/qgscomposerscalebar.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposerscalebar.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgscomposerscalebar.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -50,7 +50,7 @@
//x-offset is half of first label width because labels are drawn centered
QString firstLabel = firstLabelString();
- double firstLabelWidth = textWidthMM(mFont, firstLabel);
+ double firstLabelWidth = textWidthMM( mFont, firstLabel );
mStyle->draw( painter, firstLabelWidth / 2 );
@@ -126,7 +126,7 @@
mBrush.setColor( QColor( 0, 0, 0 ) );
mBrush.setStyle( Qt::SolidPattern );
- mFont.setPointSizeF(12.0);
+ mFont.setPointSizeF( 12.0 );
mLabelBarSpace = 3.0;
mBoxContentSpace = 1.0;
@@ -321,7 +321,7 @@
mNumSegments = itemElem.attribute( "numSegments", "2" ).toInt();
mNumSegmentsLeft = itemElem.attribute( "numSegmentsLeft", "0" ).toInt();
mNumUnitsPerSegment = itemElem.attribute( "numUnitsPerSegment", "1.0" ).toDouble();
- mSegmentMM = itemElem.attribute("segmentMM", "0.0").toDouble();
+ mSegmentMM = itemElem.attribute( "segmentMM", "0.0" ).toDouble();
mNumMapUnitsPerScaleBarUnit = itemElem.attribute( "numMapUnitsPerScaleBarUnit", "1.0" ).toDouble();
mPen.setWidthF( itemElem.attribute( "outlineWidth", "1.0" ).toDouble() );
mUnitLabeling = itemElem.attribute( "unitLabel" );
Modified: trunk/qgis/src/core/composer/qgscomposerscalebar.h
===================================================================
--- trunk/qgis/src/core/composer/qgscomposerscalebar.h 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgscomposerscalebar.h 2008-09-08 08:18:14 UTC (rev 9282)
@@ -56,7 +56,7 @@
void setUnitLabeling( const QString& label ) {mUnitLabeling = label;}
QFont font() const;
-
+
void setFont( const QFont& font );
QPen pen() const {return mPen;}
Modified: trunk/qgis/src/core/composer/qgscomposition.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposition.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgscomposition.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -139,7 +139,7 @@
{
//in QgsComposition, one unit = one mm
double sizeMM = pointSize * 0.3527;
- return (sizeMM + 0.5); //round to nearest mm
+ return ( sizeMM + 0.5 ); //round to nearest mm
}
double QgsComposition::pointFontSize( int pixelSize ) const
Modified: trunk/qgis/src/core/composer/qgsdoubleboxscalebarstyle.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgsdoubleboxscalebarstyle.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgsdoubleboxscalebarstyle.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -45,7 +45,7 @@
{
return;
}
- double barTopPosition = mScaleBar->fontAscentMM(mScaleBar->font()) + mScaleBar->labelBarSpace() + mScaleBar->boxContentSpace();
+ double barTopPosition = mScaleBar->fontAscentMM( mScaleBar->font() ) + mScaleBar->labelBarSpace() + mScaleBar->boxContentSpace();
double segmentHeight = mScaleBar->height() / 2;
p->save();
Modified: trunk/qgis/src/core/composer/qgslegendmodel.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgslegendmodel.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgslegendmodel.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -174,11 +174,11 @@
currentSymbolItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
#endif //0
- QStandardItem* currentSymbolItem = itemFromSymbol(*symbolIt);
- if(!currentSymbolItem)
- {
- continue;
- }
+ QStandardItem* currentSymbolItem = itemFromSymbol( *symbolIt );
+ if ( !currentSymbolItem )
+ {
+ continue;
+ }
layerItem->setChild( layerItem->rowCount(), 0, currentSymbolItem );
@@ -233,74 +233,74 @@
mSymbols.clear();
}
-void QgsLegendModel::updateItem(QStandardItem* item)
+void QgsLegendModel::updateItem( QStandardItem* item )
{
- if(!item)
- {
- return;
- }
+ if ( !item )
+ {
+ return;
+ }
//is it a toplevel layer item?
- QModelIndex itemIndex = indexFromItem(item);
+ QModelIndex itemIndex = indexFromItem( item );
QModelIndex parentIndex = itemIndex.parent();
if ( !parentIndex.isValid() ) // a layer item?
- {
- updateLayer(item);
- }
+ {
+ updateLayer( item );
+ }
//take QgsSymbol* from user data
QVariant symbolVariant = item->data();
QgsSymbol* symbol = 0;
if ( symbolVariant.canConvert<void*>() )
- {
- void* symbolData = symbolVariant.value<void*>();
- symbol = ( QgsSymbol* )( symbolData );
- }
+ {
+ void* symbolData = symbolVariant.value<void*>();
+ symbol = ( QgsSymbol* )( symbolData );
+ }
- if ( symbol ) //vector classification item
- {
- updateVectorClassificationItem(item, symbol, item->text());
- }
- else if(!item->icon().isNull()) //raster classification item
- {
- updateRasterClassificationItem(item);
- }
+ if ( symbol ) //vector classification item
+ {
+ updateVectorClassificationItem( item, symbol, item->text() );
+ }
+ else if ( !item->icon().isNull() ) //raster classification item
+ {
+ updateRasterClassificationItem( item );
+ }
}
-void QgsLegendModel::updateLayer(QStandardItem* layerItem)
+void QgsLegendModel::updateLayer( QStandardItem* layerItem )
{
- if(!layerItem)
+ if ( !layerItem )
+ {
+ return;
+ }
+
+ QString layerId = layerItem->data().toString();
+ QgsMapLayer* mapLayer = QgsMapLayerRegistry::instance()->mapLayer( layerId );
+ if ( mapLayer )
+ {
+ //delete all the entries under layer item
+ int currentRowCount = layerItem->rowCount();
+ for ( int i = currentRowCount - 1; i >= 0; --i )
{
- return;
+ layerItem->removeRow( i );
}
- QString layerId = layerItem->data().toString();
- QgsMapLayer* mapLayer = QgsMapLayerRegistry::instance()->mapLayer(layerId);
- if(mapLayer)
+ //and add the new ones...
+ switch ( mapLayer->type() )
{
- //delete all the entries under layer item
- int currentRowCount = layerItem->rowCount();
- for(int i = currentRowCount - 1; i >= 0; --i)
- {
- layerItem->removeRow(i);
- }
-
- //and add the new ones...
- switch(mapLayer->type())
- {
- case QgsMapLayer::VECTOR:
- addVectorLayerItems(layerItem, mapLayer);
- break;
- case QgsMapLayer::RASTER:
- addRasterLayerItem(layerItem, mapLayer);
- break;
- default:
- break;
- }
+ case QgsMapLayer::VECTOR:
+ addVectorLayerItems( layerItem, mapLayer );
+ break;
+ case QgsMapLayer::RASTER:
+ addRasterLayerItem( layerItem, mapLayer );
+ break;
+ default:
+ break;
}
+ }
}
-void QgsLegendModel::updateVectorClassificationItem(QStandardItem* classificationItem, QgsSymbol* symbol, QString itemText)
+void QgsLegendModel::updateVectorClassificationItem( QStandardItem* classificationItem, QgsSymbol* symbol, QString itemText )
{
//this function uses the following logic to find a classification match:
//first test if there is a symbol where lowerbound - upperbound equels itemText
@@ -309,28 +309,28 @@
//get parent item
QStandardItem* parentItem = classificationItem->parent();
- if(!parentItem)
+ if ( !parentItem )
{
- return;
- }
+ return;
+ }
//get maplayer object from parent item
- QgsMapLayer* ml = QgsMapLayerRegistry::instance()->mapLayer(parentItem->data().toString());
- if(!ml)
- {
- return;
- }
- QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>(ml);
- if(!vl)
- {
- return;
- }
-
+ QgsMapLayer* ml = QgsMapLayerRegistry::instance()->mapLayer( parentItem->data().toString() );
+ if ( !ml )
+ {
+ return;
+ }
+ QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( ml );
+ if ( !vl )
+ {
+ return;
+ }
+
const QgsRenderer* layerRenderer = vl->renderer();
- if(!layerRenderer)
- {
- return;
- }
+ if ( !layerRenderer )
+ {
+ return;
+ }
QList<QgsSymbol*> symbolList = layerRenderer->symbols();
QList<QgsSymbol*>::iterator symbolIt;
@@ -338,76 +338,76 @@
//try to find a symbol where lowerbound - upperbound matches item text
symbolIt = symbolList.begin();
- for(; symbolIt != symbolList.end(); ++symbolIt)
+ for ( ; symbolIt != symbolList.end(); ++symbolIt )
+ {
+ currentSymbol = *symbolIt;
+ if ( currentSymbol->lowerValue() + " - " + currentSymbol->upperValue() == itemText )
{
- currentSymbol = *symbolIt;
- if(currentSymbol->lowerValue() + " - " + currentSymbol->upperValue() == itemText)
- {
- removeSymbol(symbol);
- parentItem->insertRow(classificationItem->row(), itemFromSymbol(currentSymbol));
- parentItem->removeRow(classificationItem->row());
- return;
- }
+ removeSymbol( symbol );
+ parentItem->insertRow( classificationItem->row(), itemFromSymbol( currentSymbol ) );
+ parentItem->removeRow( classificationItem->row() );
+ return;
}
+ }
//try to find a symbol where lower value matches item text (non-numeric classifications)
symbolIt = symbolList.begin();
- for(; symbolIt != symbolList.end(); ++symbolIt)
+ for ( ; symbolIt != symbolList.end(); ++symbolIt )
+ {
+ currentSymbol = *symbolIt;
+ if ( currentSymbol->lowerValue() == itemText )
{
- currentSymbol = *symbolIt;
- if(currentSymbol->lowerValue() == itemText)
- {
- removeSymbol(symbol);
- parentItem->insertRow(classificationItem->row(), itemFromSymbol(currentSymbol));
- parentItem->removeRow(classificationItem->row());
- return;
- }
+ removeSymbol( symbol );
+ parentItem->insertRow( classificationItem->row(), itemFromSymbol( currentSymbol ) );
+ parentItem->removeRow( classificationItem->row() );
+ return;
}
+ }
//try to find a symbol where label matches item text
symbolIt = symbolList.begin();
- for(; symbolIt != symbolList.end(); ++symbolIt)
+ for ( ; symbolIt != symbolList.end(); ++symbolIt )
+ {
+ currentSymbol = *symbolIt;
+ if ( currentSymbol->label() == itemText )
{
- currentSymbol = *symbolIt;
- if(currentSymbol->label() == itemText)
- {
- removeSymbol(symbol);
- parentItem->insertRow(classificationItem->row(), itemFromSymbol(currentSymbol));
- parentItem->removeRow(classificationItem->row());
- return;
- }
+ removeSymbol( symbol );
+ parentItem->insertRow( classificationItem->row(), itemFromSymbol( currentSymbol ) );
+ parentItem->removeRow( classificationItem->row() );
+ return;
}
-}
-
+ }
+}
-void QgsLegendModel::updateRasterClassificationItem(QStandardItem* classificationItem)
+
+void QgsLegendModel::updateRasterClassificationItem( QStandardItem* classificationItem )
{
- if(!classificationItem)
- {
- return;
- }
+ if ( !classificationItem )
+ {
+ return;
+ }
QStandardItem* parentItem = classificationItem->parent();
- if(!parentItem)
- {
- return;
- }
+ if ( !parentItem )
+ {
+ return;
+ }
- QgsMapLayer* ml = QgsMapLayerRegistry::instance()->mapLayer(parentItem->data().toString());
- if(!ml)
- {
- return;
- }
+ QgsMapLayer* ml = QgsMapLayerRegistry::instance()->mapLayer( parentItem->data().toString() );
+ if ( !ml )
+ {
+ return;
+ }
- QgsRasterLayer* rl = dynamic_cast<QgsRasterLayer*>(ml);
- if(!rl)
- {
- return;
- }
+ QgsRasterLayer* rl = dynamic_cast<QgsRasterLayer*>( ml );
+ if ( !rl )
+ {
+ return;
+ }
QStandardItem* currentSymbolItem = new QStandardItem( QIcon( rl->getLegendQPixmap( true ) ), "" );
- parentItem->insertRow(0, currentSymbolItem);
- parentItem->removeRow(1);
+ parentItem->insertRow( 0, currentSymbolItem );
+ parentItem->removeRow( 1 );
}
void QgsLegendModel::removeLayer( const QString& layerId )
@@ -461,8 +461,8 @@
}
emit layersChanged();
}
-
-QStandardItem* QgsLegendModel::itemFromSymbol(QgsSymbol* s)
+
+QStandardItem* QgsLegendModel::itemFromSymbol( QgsSymbol* s )
{
QStandardItem* currentSymbolItem = 0;
@@ -470,43 +470,43 @@
QString label;
QString lowerValue = s->lowerValue();
QString upperValue = s->upperValue();
-
+
if ( lowerValue == upperValue || upperValue.isEmpty() )
- {
- label = lowerValue;
- }
+ {
+ label = lowerValue;
+ }
else
- {
- label = lowerValue + " - " + upperValue;
- }
-
+ {
+ label = lowerValue + " - " + upperValue;
+ }
+
//icon item
- switch (s->type())
- {
+ switch ( s->type() )
+ {
case QGis::Point:
- currentSymbolItem = new QStandardItem( QIcon( QPixmap::fromImage(s->getPointSymbolAsImage() ) ), label );
+ currentSymbolItem = new QStandardItem( QIcon( QPixmap::fromImage( s->getPointSymbolAsImage() ) ), label );
break;
case QGis::Line:
- currentSymbolItem = new QStandardItem( QIcon( QPixmap::fromImage(s->getLineSymbolAsImage() ) ), label );
+ currentSymbolItem = new QStandardItem( QIcon( QPixmap::fromImage( s->getLineSymbolAsImage() ) ), label );
break;
case QGis::Polygon:
- currentSymbolItem = new QStandardItem( QIcon( QPixmap::fromImage(s->getPolygonSymbolAsImage() ) ), label );
+ currentSymbolItem = new QStandardItem( QIcon( QPixmap::fromImage( s->getPolygonSymbolAsImage() ) ), label );
break;
default:
currentSymbolItem = 0;
break;
- }
-
- if(!currentSymbolItem)
- {
- return 0;
- }
-
+ }
+
+ if ( !currentSymbolItem )
+ {
+ return 0;
+ }
+
//Pass deep copy of QgsSymbol as user data. Cast to void* necessary such that QMetaType handles it
- QgsSymbol* symbolCopy = new QgsSymbol(*s);
+ QgsSymbol* symbolCopy = new QgsSymbol( *s );
currentSymbolItem->setData( QVariant::fromValue(( void* )symbolCopy ) );
insertSymbol( symbolCopy );
-
+
currentSymbolItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
return currentSymbolItem;
}
Modified: trunk/qgis/src/core/composer/qgslegendmodel.h
===================================================================
--- trunk/qgis/src/core/composer/qgslegendmodel.h 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgslegendmodel.h 2008-09-08 08:18:14 UTC (rev 9282)
@@ -42,12 +42,12 @@
void setLayerSet( const QStringList& layerIds );
/**Tries to automatically update a model entry (e.g. a whole layer or only a single item)*/
- void updateItem(QStandardItem* item);
+ void updateItem( QStandardItem* item );
/**Updates the whole symbology of a layer*/
- void updateLayer(QStandardItem* layerItem);
+ void updateLayer( QStandardItem* layerItem );
/**Tries to update a single classification item*/
- void updateVectorClassificationItem(QStandardItem* classificationItem, QgsSymbol* symbol, QString itemText);
- void updateRasterClassificationItem(QStandardItem* classificationItem);
+ void updateVectorClassificationItem( QStandardItem* classificationItem, QgsSymbol* symbol, QString itemText );
+ void updateRasterClassificationItem( QStandardItem* classificationItem );
bool writeXML( QDomElement& composerLegendElem, QDomDocument& doc );
bool readXML( const QDomElement& legendModelElem, const QDomDocument& doc );
@@ -76,7 +76,7 @@
void removeAllSymbols();
/**Creates a model item for a vector symbol. The calling function takes ownership*/
- QStandardItem* itemFromSymbol(QgsSymbol* s);
+ QStandardItem* itemFromSymbol( QgsSymbol* s );
/**Keep track of copied symbols to delete them if not used anymore*/
QSet<QgsSymbol*> mSymbols;
Modified: trunk/qgis/src/core/composer/qgsnumericscalebarstyle.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgsnumericscalebarstyle.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgsnumericscalebarstyle.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -50,7 +50,7 @@
p->save();
p->setFont( mScaleBar->font() );
- mScaleBar->drawText(p, mScaleBar->pen().widthF() + mScaleBar->boxContentSpace(), mScaleBar->boxContentSpace() + mScaleBar->fontAscentMM(mScaleBar->font()), scaleText(), mScaleBar->font());
+ mScaleBar->drawText( p, mScaleBar->pen().widthF() + mScaleBar->boxContentSpace(), mScaleBar->boxContentSpace() + mScaleBar->fontAscentMM( mScaleBar->font() ), scaleText(), mScaleBar->font() );
p->restore();
}
@@ -63,8 +63,8 @@
return rect;
}
- double textWidth = mScaleBar->textWidthMM(mScaleBar->font(), scaleText());
- double textHeight = mScaleBar->fontAscentMM(mScaleBar->font());
+ double textWidth = mScaleBar->textWidthMM( mScaleBar->font(), scaleText() );
+ double textHeight = mScaleBar->fontAscentMM( mScaleBar->font() );
return QRectF( mScaleBar->transform().dx(), mScaleBar->transform().dy(), 2 * mScaleBar->boxContentSpace()
+ 2 * mScaleBar->pen().width() + textWidth,
Modified: trunk/qgis/src/core/composer/qgsscalebarstyle.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgsscalebarstyle.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgsscalebarstyle.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -43,10 +43,10 @@
p->save();
- p->setFont(mScaleBar->font());
+ p->setFont( mScaleBar->font() );
QString firstLabel = mScaleBar->firstLabelString();
- double xOffset = mScaleBar->textWidthMM(mScaleBar->font(), firstLabel) / 2;
+ double xOffset = mScaleBar->textWidthMM( mScaleBar->font(), firstLabel ) / 2;
//double mCurrentXCoord = mScaleBar->pen().widthF() + mScaleBar->boxContentSpace();
QList<QPair<double, double> > segmentInfo;
@@ -78,7 +78,7 @@
if ( segmentCounter == 0 || segmentCounter >= nSegmentsLeft ) //don't draw label for intermediate left segments
{
- mScaleBar->drawText(p, segmentIt->first - mScaleBar->textWidthMM(mScaleBar->font(), currentNumericLabel) / 2 + xOffset, mScaleBar->fontAscentMM(mScaleBar->font()) + mScaleBar->boxContentSpace(), currentNumericLabel, mScaleBar->font());
+ mScaleBar->drawText( p, segmentIt->first - mScaleBar->textWidthMM( mScaleBar->font(), currentNumericLabel ) / 2 + xOffset, mScaleBar->fontAscentMM( mScaleBar->font() ) + mScaleBar->boxContentSpace(), currentNumericLabel, mScaleBar->font() );
}
if ( segmentCounter >= nSegmentsLeft )
@@ -92,7 +92,7 @@
if ( !segmentInfo.isEmpty() )
{
currentNumericLabel = QString::number( currentLabelNumber / mScaleBar->numMapUnitsPerScaleBarUnit() );
- mScaleBar->drawText(p, segmentInfo.last().first + mScaleBar->segmentMM() - mScaleBar->textWidthMM(mScaleBar->font(), currentNumericLabel) / 2 + xOffset, mScaleBar->fontAscentMM(mScaleBar->font()) + mScaleBar->boxContentSpace(), currentNumericLabel + " " + mScaleBar->unitLabeling(), mScaleBar->font());
+ mScaleBar->drawText( p, segmentInfo.last().first + mScaleBar->segmentMM() - mScaleBar->textWidthMM( mScaleBar->font(), currentNumericLabel ) / 2 + xOffset, mScaleBar->fontAscentMM( mScaleBar->font() ) + mScaleBar->boxContentSpace(), currentNumericLabel + " " + mScaleBar->unitLabeling(), mScaleBar->font() );
}
p->restore();
@@ -106,14 +106,14 @@
}
//consider centered first label
- double firstLabelLeft = mScaleBar->textWidthMM(mScaleBar->font(), mScaleBar->firstLabelString()) / 2;
+ double firstLabelLeft = mScaleBar->textWidthMM( mScaleBar->font(), mScaleBar->firstLabelString() ) / 2;
//consider last number and label
double largestLabelNumber = mScaleBar->numSegments() * mScaleBar->numUnitsPerSegment() / mScaleBar->numMapUnitsPerScaleBarUnit();
QString largestNumberLabel = QString::number( largestLabelNumber );
QString largestLabel = QString::number( largestLabelNumber ) + " " + mScaleBar->unitLabeling();
- double largestLabelWidth = mScaleBar->textWidthMM(mScaleBar->font(), largestLabel) - mScaleBar->textWidthMM(mScaleBar->font(), largestNumberLabel) / 2;
+ double largestLabelWidth = mScaleBar->textWidthMM( mScaleBar->font(), largestLabel ) - mScaleBar->textWidthMM( mScaleBar->font(), largestNumberLabel ) / 2;
double totalBarLength = 0.0;
@@ -127,7 +127,7 @@
}
double width = firstLabelLeft + totalBarLength + 2 * mScaleBar->pen().widthF() + largestLabelWidth + 2 * mScaleBar->boxContentSpace();
- double height = mScaleBar->height() + mScaleBar->labelBarSpace() + 2 * mScaleBar->boxContentSpace() + mScaleBar->fontAscentMM(mScaleBar->font());
+ double height = mScaleBar->height() + mScaleBar->labelBarSpace() + 2 * mScaleBar->boxContentSpace() + mScaleBar->fontAscentMM( mScaleBar->font() );
return QRectF( mScaleBar->transform().dx(), mScaleBar->transform().dy(), width, height );
}
Modified: trunk/qgis/src/core/composer/qgssingleboxscalebarstyle.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgssingleboxscalebarstyle.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgssingleboxscalebarstyle.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -40,7 +40,7 @@
{
return;
}
- double barTopPosition = mScaleBar->fontAscentMM(mScaleBar->font()) + mScaleBar->labelBarSpace() + mScaleBar->boxContentSpace();
+ double barTopPosition = mScaleBar->fontAscentMM( mScaleBar->font() ) + mScaleBar->labelBarSpace() + mScaleBar->boxContentSpace();
p->save();
p->setPen( p->pen() );
Modified: trunk/qgis/src/core/composer/qgsticksscalebarstyle.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgsticksscalebarstyle.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/composer/qgsticksscalebarstyle.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -53,7 +53,7 @@
{
return;
}
- double barTopPosition = mScaleBar->fontAscentMM(mScaleBar->font()) + mScaleBar->labelBarSpace() + mScaleBar->boxContentSpace();
+ double barTopPosition = mScaleBar->fontAscentMM( mScaleBar->font() ) + mScaleBar->labelBarSpace() + mScaleBar->boxContentSpace();
double middlePosition = barTopPosition + mScaleBar->height() / 2.0;
double bottomPosition = barTopPosition + mScaleBar->height();
Modified: trunk/qgis/src/core/qgsrect.cpp
===================================================================
--- trunk/qgis/src/core/qgsrect.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/qgsrect.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -137,7 +137,7 @@
{
return intersection;
}
-
+
intersection.setXMinimum( xmin > rect->xMin() ? xmin : rect->xMin() );
intersection.setXMaximum( xmax < rect->xMax() ? xmax : rect->xMax() );
intersection.setYMinimum( ymin > rect->yMin() ? ymin : rect->yMin() );
Modified: trunk/qgis/src/core/raster/qgscolorrampshader.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgscolorrampshader.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/raster/qgscolorrampshader.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -31,9 +31,9 @@
bool QgsColorRampShader::generateShadedValue( double theValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue )
{
-
+
//Get the shaded value from the cache if it exists already
- QColor myColor = mColorCache.value(theValue);
+ QColor myColor = mColorCache.value( theValue );
if ( myColor.isValid() )
{
*theReturnRedValue = myColor.red();
@@ -41,9 +41,9 @@
*theReturnBlueValue = myColor.blue();
return true;
}
-
+
//pixel value not in cache so generate new value
-
+
//Check to be sure mCurrentColorRampItemIndex is within the valid range.
if ( mCurrentColorRampItemIndex < 0 )
{
@@ -53,7 +53,7 @@
{
mCurrentColorRampItemIndex = mColorRampItemList.size() - 1;
}
-
+
if ( QgsColorRampShader::EXACT == mColorRampType )
{
return getExactColor( theValue, theReturnRedValue, theReturnGreenValue, theReturnBlueValue );
@@ -62,7 +62,7 @@
{
return getInterpolatedColor( theValue, theReturnRedValue, theReturnGreenValue, theReturnBlueValue );
}
-
+
return getDiscreteColor( theValue, theReturnRedValue, theReturnGreenValue, theReturnBlueValue );
}
@@ -99,7 +99,7 @@
{
return false;
}
-
+
QgsColorRampShader::ColorRampItem myColorRampItem;
while ( mCurrentColorRampItemIndex >= 0 && mCurrentColorRampItemIndex < myColorRampItemCount )
{
@@ -123,12 +123,12 @@
return true;
}
//Search deeper into the color ramp list
- else
+ else
{
mCurrentColorRampItemIndex++;
}
}
-
+
return false; // value not found
}
@@ -139,7 +139,7 @@
{
return false;
}
-
+
QgsColorRampShader::ColorRampItem myColorRampItem;
while ( mCurrentColorRampItemIndex >= 0 && mCurrentColorRampItemIndex < myColorRampItemCount )
{
@@ -170,7 +170,7 @@
//Search back toward the begining of the list
else
{
- mCurrentColorRampItemIndex--;
+ mCurrentColorRampItemIndex--;
}
}
@@ -185,7 +185,7 @@
{
return false;
}
-
+
double myCurrentRampRange; //difference between two consecutive entry values
double myOffsetInRange; //difference between the previous entry value and value
QgsColorRampShader::ColorRampItem myColorRampItem;
@@ -204,9 +204,9 @@
myCurrentRampRange = myColorRampItem.value - myPreviousColorRampItem.value;
myOffsetInRange = theValue - myPreviousColorRampItem.value;
- *theReturnRedValue = ( int )(( double ) myPreviousColorRampItem.color.red() + ((( double ) (myColorRampItem.color.red() - myPreviousColorRampItem.color.red()) / myCurrentRampRange ) * myOffsetInRange ));
- *theReturnGreenValue = ( int )(( double ) myPreviousColorRampItem.color.green() + ((( double ) (myColorRampItem.color.green() - myPreviousColorRampItem.color.green()) / myCurrentRampRange) * myOffsetInRange ));
- *theReturnBlueValue = ( int )(( double ) myPreviousColorRampItem.color.blue() + ((( double ) (myColorRampItem.color.blue() - myPreviousColorRampItem.color.blue()) / myCurrentRampRange ) * myOffsetInRange));
+ *theReturnRedValue = ( int )(( double ) myPreviousColorRampItem.color.red() + ((( double )( myColorRampItem.color.red() - myPreviousColorRampItem.color.red() ) / myCurrentRampRange ) * myOffsetInRange ) );
+ *theReturnGreenValue = ( int )(( double ) myPreviousColorRampItem.color.green() + ((( double )( myColorRampItem.color.green() - myPreviousColorRampItem.color.green() ) / myCurrentRampRange ) * myOffsetInRange ) );
+ *theReturnBlueValue = ( int )(( double ) myPreviousColorRampItem.color.blue() + ((( double )( myColorRampItem.color.blue() - myPreviousColorRampItem.color.blue() ) / myCurrentRampRange ) * myOffsetInRange ) );
if ( mMaximumColorCacheSize >= mColorCache.size() )
{
QColor myNewColor( *theReturnRedValue, *theReturnGreenValue, *theReturnBlueValue );
@@ -244,7 +244,7 @@
return false;
}
-void QgsColorRampShader::setColorRampType( QgsColorRampShader::COLOR_RAMP_TYPE theColorRampType )
+void QgsColorRampShader::setColorRampType( QgsColorRampShader::COLOR_RAMP_TYPE theColorRampType )
{
//When the ramp type changes we need to clear out the cache
mColorCache.clear();
Modified: trunk/qgis/src/core/raster/qgscolorrampshader.h
===================================================================
--- trunk/qgis/src/core/raster/qgscolorrampshader.h 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/raster/qgscolorrampshader.h 2008-09-08 08:18:14 UTC (rev 9282)
@@ -74,9 +74,9 @@
/**Set the color ramp type*/
void setColorRampType( QString );
-
+
/**Set the maximum size the color cache can be */
- void setMaximumColorCacheSize(int theSize) { mMaximumColorCacheSize = theSize; }
+ void setMaximumColorCacheSize( int theSize ) { mMaximumColorCacheSize = theSize; }
@@ -93,7 +93,7 @@
QgsColorRampShader::COLOR_RAMP_TYPE mColorRampType;
QMap<double, QColor> mColorCache;
-
+
/** Maximum size of the color cache. The color cache could eat a ton of memory if you have 32-bit data */
int mMaximumColorCacheSize;
/** Current index to start searching the color table*/
Modified: trunk/qgis/src/core/raster/qgsrasterlayer.cpp
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -522,8 +522,8 @@
myRasterBandStats.statsGatheredFlag = false;
myRasterBandStats.histogramVector = new QgsRasterBandStats::HistogramVector();
//Store the default color table
- readColorTable(i, &myRasterBandStats.colorTable);
-
+ readColorTable( i, &myRasterBandStats.colorTable );
+
mRasterStatsList.push_back( myRasterBandStats );
//Build a new contrast enhancement for the band and store in list
@@ -566,7 +566,7 @@
setColorShadingAlgorithm( COLOR_RAMP );
QgsColorRampShader* myColorRampShader = ( QgsColorRampShader* ) mRasterShader->getRasterShaderFunction();
myColorRampShader->setColorRampType( QgsColorRampShader::INTERPOLATED );
- myColorRampShader->setColorRampItemList( *getColorTable(1) );
+ myColorRampShader->setColorRampItemList( *getColorTable( 1 ) );
}
else if ( rasterLayerType == MULTIBAND )
{
@@ -883,23 +883,23 @@
-QPixmap QgsRasterLayer::getPaletteAsPixmap(int theBandNumber)
+QPixmap QgsRasterLayer::getPaletteAsPixmap( int theBandNumber )
{
QgsDebugMsg( "entered." );
// Only do this for the non-provider (hard-coded GDAL) scenario...
// Maybe WMS can do this differently using QImage::numColors and QImage::color()
- if (mProviderKey.isEmpty() && hasBand( "Palette" ) && theBandNumber > 0) //dont tr() this its a gdal word!
+ if ( mProviderKey.isEmpty() && hasBand( "Palette" ) && theBandNumber > 0 ) //dont tr() this its a gdal word!
{
QgsDebugMsg( "....found paletted image" );
QgsColorRampShader myShader;
QList<QgsColorRampShader::ColorRampItem> myColorRampItemList = myShader.getColorRampItemList();
-
- if(readColorTable(1, &myColorRampItemList))
+
+ if ( readColorTable( 1, &myColorRampItemList ) )
{
QgsDebugMsg( "....got color ramp item list" );
- myShader.setColorRampItemList(myColorRampItemList);
- myShader.setColorRampType(QgsColorRampShader::DISCRETE);
+ myShader.setColorRampItemList( myColorRampItemList );
+ myShader.setColorRampType( QgsColorRampShader::DISCRETE );
// Draw image
int mySize = 100;
QPixmap myPalettePixmap( mySize, mySize );
@@ -909,14 +909,14 @@
myQImage.fill( 0 );
myPalettePixmap.fill();
- double myStep = ( (double)myColorRampItemList.size() - 1 ) / (double)( mySize * mySize );
+ double myStep = (( double )myColorRampItemList.size() - 1 ) / ( double )( mySize * mySize );
double myValue = 0.0;
for ( int myRow = 0; myRow < mySize; myRow++ )
{
for ( int myCol = 0; myCol < mySize; myCol++ )
{
- myValue = myStep * (double)( myCol + myRow * mySize );
+ myValue = myStep * ( double )( myCol + myRow * mySize );
int c1, c2, c3;
myShader.generateShadedValue( myValue, &c1, &c2, &c3 );
myQImage.setPixel( myCol, myRow, qRgb( c1, c2, c3 ) );
@@ -1247,7 +1247,7 @@
int myBandNo = 1;
drawPalettedSingleBandGray( theQPainter, theRasterViewPort,
- theQgsMapToPixel, myBandNo);
+ theQgsMapToPixel, myBandNo );
break;
}
@@ -1572,7 +1572,7 @@
int myGreenValue = 0;
int myBlueValue = 0;
int myAlphaValue = 0;
-
+
QgsDebugMsg( "Starting main render loop" );
for ( int myColumn = 0; myColumn < theRasterViewPort->drawableAreaYDim; ++myColumn )
{
@@ -1629,7 +1629,7 @@
* @param theColorQString - QString containing either 'Red' 'Green' or 'Blue' indicating which part of the rgb triplet will be used to render gray.
*/
void QgsRasterLayer::drawPalettedSingleBandGray( QPainter * theQPainter, QgsRasterViewPort * theRasterViewPort,
- const QgsMapToPixel* theQgsMapToPixel, int theBandNo)
+ const QgsMapToPixel* theQgsMapToPixel, int theBandNo )
{
QgsDebugMsg( "entered." );
//Invalid band number, segfault prevention
@@ -1692,14 +1692,14 @@
if ( mInvertPixelsFlag )
{
//Invert flag, flip blue and read
- double myGrayValue = (0.3 * (double)myRedValue) + (0.59 * (double)myGreenValue) + (0.11 * (double)myBlueValue);
- myQImage.setPixel( myRow, myColumn, qRgba( (int)myGrayValue, (int)myGrayValue, (int)myGrayValue, myAlphaValue ) );
+ double myGrayValue = ( 0.3 * ( double )myRedValue ) + ( 0.59 * ( double )myGreenValue ) + ( 0.11 * ( double )myBlueValue );
+ myQImage.setPixel( myRow, myColumn, qRgba(( int )myGrayValue, ( int )myGrayValue, ( int )myGrayValue, myAlphaValue ) );
}
else
{
//Normal
- double myGrayValue = (0.3 * (double)myBlueValue) + (0.59 * (double)myGreenValue) + (0.11 * (double)myRedValue);
- myQImage.setPixel( myRow, myColumn, qRgba( (int)myGrayValue, (int)myGrayValue, (int)myGrayValue, myAlphaValue ) );
+ double myGrayValue = ( 0.3 * ( double )myBlueValue ) + ( 0.59 * ( double )myGreenValue ) + ( 0.11 * ( double )myRedValue );
+ myQImage.setPixel( myRow, myColumn, qRgba(( int )myGrayValue, ( int )myGrayValue, ( int )myGrayValue, myAlphaValue ) );
}
}
}
@@ -1950,7 +1950,7 @@
QgsContrastEnhancement* myRedContrastEnhancement = getContrastEnhancement( myRedBandNo );
QgsContrastEnhancement* myGreenContrastEnhancement = getContrastEnhancement( myGreenBandNo );
QgsContrastEnhancement* myBlueContrastEnhancement = getContrastEnhancement( myBlueBandNo );
-
+
QgsDebugMsg( "Starting main render loop" );
for ( int myColumn = 0; myColumn < theRasterViewPort->drawableAreaYDim; ++myColumn )
{
Modified: trunk/qgis/src/core/raster/qgsrasterlayer.h
===================================================================
--- trunk/qgis/src/core/raster/qgsrasterlayer.h 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/raster/qgsrasterlayer.h 2008-09-08 08:18:14 UTC (rev 9282)
@@ -275,7 +275,7 @@
void drawThumbnail( QPixmap * theQPixmap );
/** \brief Get an 8x8 pixmap of the color palette. If the layer has no palette a white pixmap will be returned. */
- QPixmap getPaletteAsPixmap(int theBand=1);
+ QPixmap getPaletteAsPixmap( int theBand = 1 );
/** \brief This is called when the view on the raster layer needs to be refreshed (redrawn).
*/
@@ -946,7 +946,7 @@
void drawPalettedSingleBandGray( QPainter * theQPainter,
QgsRasterViewPort * theRasterViewPort,
const QgsMapToPixel* theQgsMapToPixel,
- int theBandNoInt);
+ int theBandNoInt );
/** \brief Drawing routine for paletted image, rendered as a single band image in pseudocolor. */
void drawPalettedSingleBandPseudoColor( QPainter * theQPainter,
Modified: trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/renderer/qgsgraduatedsymbolrenderer.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -142,12 +142,12 @@
pen.setWidthF( widthScale * pen.widthF() );
p->setPen( pen );
- if(mVectorType == QGis::Polygon)
- {
- QBrush brush = theSymbol->brush();
- scaleBrush(brush, rasterScaleFactor); //scale brush content for printout
- p->setBrush(brush);
- }
+ if ( mVectorType == QGis::Polygon )
+ {
+ QBrush brush = theSymbol->brush();
+ scaleBrush( brush, rasterScaleFactor ); //scale brush content for printout
+ p->setBrush( brush );
+ }
}
else
{
@@ -156,13 +156,13 @@
pen.setWidthF( widthScale * pen.widthF() );
p->setPen( pen );
- if(mVectorType == QGis::Polygon)
- {
- QBrush brush = theSymbol->brush();
- scaleBrush(brush, rasterScaleFactor); //scale brush content for printout
- brush.setColor( mSelectionColor );
- p->setBrush( brush );
- }
+ if ( mVectorType == QGis::Polygon )
+ {
+ QBrush brush = theSymbol->brush();
+ scaleBrush( brush, rasterScaleFactor ); //scale brush content for printout
+ brush.setColor( mSelectionColor );
+ p->setBrush( brush );
+ }
}
}
}
Modified: trunk/qgis/src/core/renderer/qgsrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsrenderer.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/renderer/qgsrenderer.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -51,12 +51,12 @@
}
}
-void QgsRenderer::scaleBrush(QBrush& b, double rasterScaleFactor) const
+void QgsRenderer::scaleBrush( QBrush& b, double rasterScaleFactor ) const
{
- if(rasterScaleFactor != 1.0)
- {
- QMatrix m;
- m.scale(1.0 / rasterScaleFactor, 1.0 / rasterScaleFactor);
- b.setMatrix(m);
- }
+ if ( rasterScaleFactor != 1.0 )
+ {
+ QMatrix m;
+ m.scale( 1.0 / rasterScaleFactor, 1.0 / rasterScaleFactor );
+ b.setMatrix( m );
+ }
}
Modified: trunk/qgis/src/core/renderer/qgsrenderer.h
===================================================================
--- trunk/qgis/src/core/renderer/qgsrenderer.h 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/renderer/qgsrenderer.h 2008-09-08 08:18:14 UTC (rev 9282)
@@ -96,7 +96,7 @@
QGis::VectorType mVectorType;
/**Scales a brush to a given raster scale factor (e.g. for printing)*/
- void scaleBrush(QBrush& b, double rasterScaleFactor) const;
+ void scaleBrush( QBrush& b, double rasterScaleFactor ) const;
};
#endif // QGSRENDERER_H
Modified: trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/renderer/qgssinglesymbolrenderer.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -126,12 +126,12 @@
pen.setWidthF( widthScale * pen.widthF() );
p->setPen( pen );
- if(mVectorType == QGis::Polygon)
- {
- QBrush brush = mSymbol->brush();
- scaleBrush(brush, rasterScaleFactor); //scale brush content for printout
- p->setBrush(brush);
- }
+ if ( mVectorType == QGis::Polygon )
+ {
+ QBrush brush = mSymbol->brush();
+ scaleBrush( brush, rasterScaleFactor ); //scale brush content for printout
+ p->setBrush( brush );
+ }
}
else
{
@@ -142,13 +142,13 @@
pen.setColor( mSelectionColor );
p->setPen( pen );
- if(mVectorType == QGis::Polygon)
- {
- QBrush brush = mSymbol->brush();
- scaleBrush(brush, rasterScaleFactor); //scale brush content for printout
- brush.setColor( mSelectionColor );
- p->setBrush( brush );
- }
+ if ( mVectorType == QGis::Polygon )
+ {
+ QBrush brush = mSymbol->brush();
+ scaleBrush( brush, rasterScaleFactor ); //scale brush content for printout
+ brush.setColor( mSelectionColor );
+ p->setBrush( brush );
+ }
}
}
}
Modified: trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp
===================================================================
--- trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/core/renderer/qgsuniquevaluerenderer.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -150,12 +150,12 @@
QPen pen = symbol->pen();
pen.setWidthF( widthScale * pen.widthF() );
p->setPen( pen );
- if(mVectorType == QGis::Polygon)
- {
- QBrush brush = symbol->brush();
- scaleBrush(brush, rasterScaleFactor); //scale brush content for printout
- p->setBrush(brush);
- }
+ if ( mVectorType == QGis::Polygon )
+ {
+ QBrush brush = symbol->brush();
+ scaleBrush( brush, rasterScaleFactor ); //scale brush content for printout
+ p->setBrush( brush );
+ }
}
else
{
@@ -163,13 +163,13 @@
pen.setWidthF( widthScale * pen.widthF() );
pen.setColor( mSelectionColor );
p->setPen( pen );
- if(mVectorType == QGis::Polygon)
- {
- QBrush brush = symbol->brush();
- scaleBrush(brush, rasterScaleFactor); //scale brush content for printout
- brush.setColor( mSelectionColor );
- p->setBrush( brush );
- }
+ if ( mVectorType == QGis::Polygon )
+ {
+ QBrush brush = symbol->brush();
+ scaleBrush( brush, rasterScaleFactor ); //scale brush content for printout
+ brush.setColor( mSelectionColor );
+ p->setBrush( brush );
+ }
}
}
}
Modified: trunk/qgis/src/providers/grass/qgsgrass.cpp
===================================================================
--- trunk/qgis/src/providers/grass/qgsgrass.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/src/providers/grass/qgsgrass.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -454,16 +454,16 @@
QFile lockFile( lock );
#if WIN32
// lock on Windows doesn't support locking (see #808)
- if( lockFile.exists() )
+ if ( lockFile.exists() )
return QObject::tr( "Mapset is already in use." );
- lockFile.open(QIODevice::WriteOnly);
+ lockFile.open( QIODevice::WriteOnly );
#ifndef _MSC_VER
int pid = getpid();
#else
int pid = GetCurrentProcessId();
#endif
- lockFile.write( QString("%1").arg( pid ).toLocal8Bit() );
+ lockFile.write( QString( "%1" ).arg( pid ).toLocal8Bit() );
lockFile.close();
#else
Q3Process *process = new Q3Process();
Modified: trunk/qgis/tests/src/core/testcontrastenhancements.cpp
===================================================================
--- trunk/qgis/tests/src/core/testcontrastenhancements.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/tests/src/core/testcontrastenhancements.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -69,38 +69,38 @@
{
//Clips 0 < x < 10, 240 < X < 256
//Stretch no stretch is applied
- QgsClipToMinMaxEnhancement myEnhancement(QgsContrastEnhancement::QGS_Byte, 10.0, 240.0);
+ QgsClipToMinMaxEnhancement myEnhancement( QgsContrastEnhancement::QGS_Byte, 10.0, 240.0 );
// Original pixel value 0.0 Should be out of range thus clipped
- QVERIFY(!myEnhancement.isValueInDisplayableRange(0.0));
+ QVERIFY( !myEnhancement.isValueInDisplayableRange( 0.0 ) );
//Original pixel value of 10.0 should be scaled to 10.0
- QVERIFY(10.0 == myEnhancement.enhanceValue(10.0)) ;
- //Original pixel value of 240 should be scaled to 240
- QVERIFY(240.0 == myEnhancement.enhanceValue(240.0)) ;
+ QVERIFY( 10.0 == myEnhancement.enhanceValue( 10.0 ) ) ;
+ //Original pixel value of 240 should be scaled to 240
+ QVERIFY( 240.0 == myEnhancement.enhanceValue( 240.0 ) ) ;
}
void TestContrastEnhancements::linearMinMaxEnhancementWithClipTest()
{
//First clips 0 < x < 10, 240 < X < 256
//Then stretch 10 = 0, 240 = 255 linearly distribute values 10 -> 240 between 0 -> 255
- QgsLinearMinMaxEnhancementWithClip myEnhancement(QgsContrastEnhancement::QGS_Byte, 10.0, 240.0);
+ QgsLinearMinMaxEnhancementWithClip myEnhancement( QgsContrastEnhancement::QGS_Byte, 10.0, 240.0 );
// Original pixel value 0.0 Should be out of range thus clipped
- QVERIFY(!myEnhancement.isValueInDisplayableRange(0.0));
+ QVERIFY( !myEnhancement.isValueInDisplayableRange( 0.0 ) );
//Original pixel value of 10.0 should be scaled to 0.0
- QVERIFY(0.0 == myEnhancement.enhanceValue(10.0)) ;
- //Original pixel value of 240 should be scaled to 255
- QVERIFY(255.0 == myEnhancement.enhanceValue(240.0)) ;
+ QVERIFY( 0.0 == myEnhancement.enhanceValue( 10.0 ) ) ;
+ //Original pixel value of 240 should be scaled to 255
+ QVERIFY( 255.0 == myEnhancement.enhanceValue( 240.0 ) ) ;
}
void TestContrastEnhancements::linearMinMaxEnhancementTest()
{
//Stretch 10 = 0, 240 = 255 linearly distribute values 10 -> 240 between 0 -> 255
- QgsLinearMinMaxEnhancement myEnhancement(QgsContrastEnhancement::QGS_Byte, 10.0, 240.0);
+ QgsLinearMinMaxEnhancement myEnhancement( QgsContrastEnhancement::QGS_Byte, 10.0, 240.0 );
//0 should be scaled to 10 and not clipped
- QVERIFY(myEnhancement.isValueInDisplayableRange(0.0));
+ QVERIFY( myEnhancement.isValueInDisplayableRange( 0.0 ) );
//Original pixel value of 10.0 should be scaled to 0.0
- QVERIFY(0.0 == myEnhancement.enhanceValue(10.0)) ;
- //Original pixel value of 240 should be scaled to 255
- QVERIFY(255.0 == myEnhancement.enhanceValue(240.0)) ;
+ QVERIFY( 0.0 == myEnhancement.enhanceValue( 10.0 ) ) ;
+ //Original pixel value of 240 should be scaled to 255
+ QVERIFY( 255.0 == myEnhancement.enhanceValue( 240.0 ) ) ;
}
QTEST_MAIN( TestContrastEnhancements )
#include "moc_testcontrastenhancements.cxx"
Modified: trunk/qgis/tools/mapserver_export/qgsmapserverexport.cpp
===================================================================
--- trunk/qgis/tools/mapserver_export/qgsmapserverexport.cpp 2008-09-07 15:20:14 UTC (rev 9281)
+++ trunk/qgis/tools/mapserver_export/qgsmapserverexport.cpp 2008-09-08 08:18:14 UTC (rev 9282)
@@ -37,19 +37,19 @@
// constructor
-QgsMapserverExport::QgsMapserverExport(QWidget * parent, Qt::WFlags fl)
-: QDialog(parent, fl)
+QgsMapserverExport::QgsMapserverExport( QWidget * parent, Qt::WFlags fl )
+ : QDialog( parent, fl )
{
- setupUi(this);
- connect(this, SIGNAL(accepted()), this, SLOT(apply()));
+ setupUi( this );
+ connect( this, SIGNAL( accepted() ), this, SLOT( apply() ) );
// drag and drop filter
- txtQgisFilePath->setSuffixFilter("qgs");
+ txtQgisFilePath->setSuffixFilter( "qgs" );
// initialize python
initPy();
- qDebug("Reading settings");
+ qDebug( "Reading settings" );
QSettings mySettings;
- txtMapFilePath->setText(mySettings.value("mapserverExport/lastMapFile","").toString());
- txtQgisFilePath->setText(mySettings.value("mapserverExport/lastQgsFile","").toString());
+ txtMapFilePath->setText( mySettings.value( "mapserverExport/lastMapFile", "" ).toString() );
+ txtQgisFilePath->setText( mySettings.value( "mapserverExport/lastQgsFile", "" ).toString() );
}
@@ -65,122 +65,126 @@
// Get the base name for the map file
QString QgsMapserverExport::baseName()
{
- QFileInfo fi(txtMapFilePath->text());
- return fi.baseName(true);
+ QFileInfo fi( txtMapFilePath->text() );
+ return fi.baseName( true );
}
/** Auto-connected slots are here **/
// Choose the map file to create
void QgsMapserverExport::on_btnChooseFile_clicked()
{
- mapFile = QFileDialog::getSaveFileName(this, tr("Name for the map file"),
- ".", tr("MapServer map files (*.map);;All files (*.*)","Filter list for selecting files from a dialog box"));
- txtMapFilePath->setText(mapFile);
+ mapFile = QFileDialog::getSaveFileName( this, tr( "Name for the map file" ),
+ ".", tr( "MapServer map files (*.map);;All files (*.*)", "Filter list for selecting files from a dialog box" ) );
+ txtMapFilePath->setText( mapFile );
}
// Chooose the project file to process
void QgsMapserverExport::on_btnChooseProjectFile_clicked()
{
- qgisProjectFile = QFileDialog::getOpenFileName(this, tr("Choose the QGIS project file"),
- ".", tr("QGIS Project Files (*.qgs);;All files (*.*)", "Filter list for selecting files from a dialog box"));
- txtQgisFilePath->setText(qgisProjectFile);
+ qgisProjectFile = QFileDialog::getOpenFileName( this, tr( "Choose the QGIS project file" ),
+ ".", tr( "QGIS Project Files (*.qgs);;All files (*.*)", "Filter list for selecting files from a dialog box" ) );
+ txtQgisFilePath->setText( qgisProjectFile );
}
// Toggle controls based on the "layer only" checkbox
-void QgsMapserverExport::on_chkExpLayersOnly_clicked(bool isChecked)
+void QgsMapserverExport::on_chkExpLayersOnly_clicked( bool isChecked )
{
// disable other sections if only layer export is desired
- txtMapName->setEnabled(!isChecked);
- txtMapWidth->setEnabled(!isChecked);
- txtMapHeight->setEnabled(!isChecked);
- cmbMapUnits->setEnabled(!isChecked);
- cmbMapImageType->setEnabled(!isChecked);
- //txtMinScale->setEnabled(!isChecked);
- //txtMaxScale->setEnabled(!isChecked);
- txtWebTemplate->setEnabled(!isChecked);
- txtWebHeader->setEnabled(!isChecked);
- txtWebFooter->setEnabled(!isChecked);
- btnChooseFooterFile->setEnabled(!isChecked);
- btnChooseHeaderFile->setEnabled(!isChecked);
- btnChooseTemplateFile->setEnabled(!isChecked);
+ txtMapName->setEnabled( !isChecked );
+ txtMapWidth->setEnabled( !isChecked );
+ txtMapHeight->setEnabled( !isChecked );
+ cmbMapUnits->setEnabled( !isChecked );
+ cmbMapImageType->setEnabled( !isChecked );
+ //txtMinScale->setEnabled(!isChecked);
+ //txtMaxScale->setEnabled(!isChecked);
+ txtWebTemplate->setEnabled( !isChecked );
+ txtWebHeader->setEnabled( !isChecked );
+ txtWebFooter->setEnabled( !isChecked );
+ btnChooseFooterFile->setEnabled( !isChecked );
+ btnChooseHeaderFile->setEnabled( !isChecked );
+ btnChooseTemplateFile->setEnabled( !isChecked );
}
void QgsMapserverExport::apply()
{
- qDebug("Writing settings");
+ qDebug( "Writing settings" );
QSettings mySettings;
- mySettings.setValue("mapserverExport/lastMapFile",txtMapFilePath->text());
- mySettings.setValue("mapserverExport/lastQgsFile",txtQgisFilePath->text());
-
+ mySettings.setValue( "mapserverExport/lastMapFile", txtMapFilePath->text() );
+ mySettings.setValue( "mapserverExport/lastQgsFile", txtQgisFilePath->text() );
+
char *cstr;
PyObject *pstr, *pmod, *pclass, *pinst, *pmeth, *pargs;
//TODO Need to append the path to the qgis python files using the path to the
// Python files in the QGIS install directory
- PyRun_SimpleString("import sys");
+ PyRun_SimpleString( "import sys" );
// Setup up path to the python script directory
QString scriptDir = QgsApplication::pkgDataPath() + QDir::separator() + "python";
- qDebug("Python scripts directory: " + scriptDir.toLocal8Bit());
+ qDebug( "Python scripts directory: " + scriptDir.toLocal8Bit() );
//QString curdir = "/home/gsherman/development/qgis_qt_port/tools/mapserver_export";
- QString sysCmd = QString("sys.path.append('%1')").arg(scriptDir);
- PyRun_SimpleString(sysCmd.ascii());
+ QString sysCmd = QString( "sys.path.append('%1')" ).arg( scriptDir );
+ PyRun_SimpleString( sysCmd.ascii() );
// Import the module
- std::cout << "Importing module" << std::endl;
- pmod = PyImport_ImportModule("ms_export");
- if(!pmod) {
- QMessageBox::warning(this, "Map Export Error", "ms_export python module not found");
- return;
+ std::cout << "Importing module" << std::endl;
+ pmod = PyImport_ImportModule( "ms_export" );
+ if ( !pmod )
+ {
+ QMessageBox::warning( this, "Map Export Error", "ms_export python module not found" );
+ return;
}
- std::cout << "Getting Qgis2Map constructor as python obj" << std::endl;
- pclass = PyObject_GetAttrString(pmod, "Qgis2Map");
- Py_DECREF(pmod);
- std::cout << "Creating args to pass to the constructor" << std::endl;
- pargs = Py_BuildValue("(ss)", txtQgisFilePath->text().ascii(),txtMapFilePath->text().ascii());
+ std::cout << "Getting Qgis2Map constructor as python obj" << std::endl;
+ pclass = PyObject_GetAttrString( pmod, "Qgis2Map" );
+ Py_DECREF( pmod );
+ std::cout << "Creating args to pass to the constructor" << std::endl;
+ pargs = Py_BuildValue( "(ss)", txtQgisFilePath->text().ascii(), txtMapFilePath->text().ascii() );
//XXX for testing: pargs = Py_BuildValue("(ss)", "foo", "bar");
- pinst = PyEval_CallObject(pclass, pargs);
+ pinst = PyEval_CallObject( pclass, pargs );
- Py_DECREF(pclass);
- Py_DECREF(pargs);
+ Py_DECREF( pclass );
+ Py_DECREF( pargs );
- // Set the various options for the conversion only if we are doing a full
+ // Set the various options for the conversion only if we are doing a full
// export (ie more than just layer info)
- if(!chkExpLayersOnly->isChecked())
+ if ( !chkExpLayersOnly->isChecked() )
{
- std::cout << "Initializing all options" << std::endl;
- pmeth = PyObject_GetAttrString(pinst, "setOptions");
- pargs = Py_BuildValue("(ssssssss)",
- cmbMapUnits->currentText().ascii(), cmbMapImageType->currentText().ascii(),
- txtMapName->text().ascii(), txtMapWidth->text().ascii(), txtMapHeight->text().ascii(),
- txtWebTemplate->text().ascii(), txtWebFooter->text().ascii(),txtWebHeader->text().ascii());
- pstr = PyEval_CallObject(pmeth, pargs);
+ std::cout << "Initializing all options" << std::endl;
+ pmeth = PyObject_GetAttrString( pinst, "setOptions" );
+ pargs = Py_BuildValue( "(ssssssss)",
+ cmbMapUnits->currentText().ascii(), cmbMapImageType->currentText().ascii(),
+ txtMapName->text().ascii(), txtMapWidth->text().ascii(), txtMapHeight->text().ascii(),
+ txtWebTemplate->text().ascii(), txtWebFooter->text().ascii(), txtWebHeader->text().ascii() );
+ pstr = PyEval_CallObject( pmeth, pargs );
- Py_DECREF(pargs);
- Py_DECREF(pmeth);
+ Py_DECREF( pargs );
+ Py_DECREF( pmeth );
}
// Get the writeMapFile method from the Qgis2Map class
- pmeth = PyObject_GetAttrString(pinst, "writeMapFile");
- pargs = Py_BuildValue("()");
+ pmeth = PyObject_GetAttrString( pinst, "writeMapFile" );
+ pargs = Py_BuildValue( "()" );
// Execute the writeMapFile method to parse the QGIS project file and create the .map file
- pstr = PyEval_CallObject(pmeth, pargs);
- if(pstr) {
+ pstr = PyEval_CallObject( pmeth, pargs );
+ if ( pstr )
+ {
// Show the return value
- PyArg_Parse(pstr, "s", &cstr);
+ PyArg_Parse( pstr, "s", &cstr );
std::cout << "Result: " << std::endl << cstr << std::endl;
// Show the results to the user
- QMessageBox::information(this, "Results of Export", QString(cstr));
- Py_DECREF(pstr);
- } else {
- QMessageBox::warning(this, "Mapfile Export Error", "method call failed");
+ QMessageBox::information( this, "Results of Export", QString( cstr ) );
+ Py_DECREF( pstr );
}
+ else
+ {
+ QMessageBox::warning( this, "Mapfile Export Error", "method call failed" );
+ }
}
void QgsMapserverExport::on_buttonBox_helpRequested()
{
- QgsContextHelp::run(context_id);
+ QgsContextHelp::run( context_id );
}
/** End of Auto-connected Slots **/
@@ -192,26 +196,27 @@
//QMessageBox::information(0,"Full Path",fullPath);
QMessageBox::StandardButton okToSave = QMessageBox::Ok;
// Check for file and prompt for overwrite if it exists
- if (QFile::exists(txtMapFilePath->text()))
+ if ( QFile::exists( txtMapFilePath->text() ) )
{
- okToSave = QMessageBox::warning(0, tr("Overwrite File?"), txtMapFilePath->text() +
- tr(" exists. \nDo you want to overwrite it?",
- "a fileName is prepended to this text, and appears in a dialog box"),
- QMessageBox::Ok | QMessageBox::Cancel);
+ okToSave = QMessageBox::warning( 0, tr( "Overwrite File?" ), txtMapFilePath->text() +
+ tr( " exists. \nDo you want to overwrite it?",
+ "a fileName is prepended to this text, and appears in a dialog box" ),
+ QMessageBox::Ok | QMessageBox::Cancel );
}
- if (okToSave == QMessageBox::Ok)
+ if ( okToSave == QMessageBox::Ok )
{
// write the project information to the selected file
writeMapFile();
return true;
- } else
+ }
+ else
{
return false;
}
}
-void QgsMapserverExport::setFileName(QString fn)
+void QgsMapserverExport::setFileName( QString fn )
{
//fullPath = fn;
}
@@ -226,9 +231,9 @@
{
/*
// write the map file, making massive assumptions about default values
-#ifdef QGISDEBUG
+ #ifdef QGISDEBUG
std::cout << "Opening map file " << txtMapFilePath->text().toLocal8Bit().data() << std::endl;
-#endif
+ #endif
std::ofstream mapFile(txtMapFilePath->text().toLocal8Bit().data());
if (!mapFile.fail())
{
@@ -283,9 +288,9 @@
// write comments about the imagepath and image url
mapFile << "# Set IMAGEPATH to the path where mapserver should\n" <<
"# write its output\n" <<
- " IMAGEPATH '/tmp/'" << std::endl;
- mapFile << "# Set IMAGEURL to the url that points to IMAGEPATH" << std::endl;
- mapFile << " #IMAGEURL '/map_output/'" << std::endl;
+ " IMAGEPATH '/tmp/'" << std::endl;
+ mapFile << "# Set IMAGEURL to the url that points to IMAGEPATH" << std::endl;
+ mapFile << " #IMAGEURL '/map_output/'" << std::endl;
// end of web section
mapFile << "END" << std::endl;
@@ -312,15 +317,15 @@
mapFile << " # Mapserver map file." << std::endl;
}
- // write layer definitions
+ // write layer definitions
for (int i = 0; i < map->layerCount(); i++)
{
bool isPolygon = false;
bool isLine = false;
QgsMapLayer *lyr = map->getZpos(i);
-#ifdef QGISDEBUG
+ #ifdef QGISDEBUG
std::cout << "Mapsrver Export Processing Layer" << std::endl;
-#endif
+ #endif
mapFile << "LAYER" << std::endl;
QString name = lyr->name().lower();
// MapServer NAME must be < 20 char and unique
@@ -330,9 +335,9 @@
name.replace(QRegExp("\\)"), "_");
mapFile << " NAME " << name.toLocal8Bit().data() << std::endl;
// feature type
-#ifdef QGISDEBUG
+ #ifdef QGISDEBUG
std::cout << "\tMapsrver Export checking feature type" << std::endl;
-#endif
+ #endif
mapFile << " TYPE ";
switch (lyr->featureType())
{
@@ -350,7 +355,7 @@
mapFile << "POLYGON";
isPolygon = true;
break;
-
+
}
if(lyr->type() == QgsMapLayer::RASTER)
{
@@ -358,9 +363,9 @@
}
mapFile << std::endl;
-#ifdef QGISDEBUG
+ #ifdef QGISDEBUG
std::cout << "\tMapsrver Export checking visibility" << std::endl;
-#endif
+ #endif
// set visibility (STATUS)
mapFile << " STATUS ";
if (lyr->isVisible())
@@ -374,70 +379,70 @@
// data source (DATA)
// Data source spec depends on layer type
-#ifdef QGISDEBUG
+ #ifdef QGISDEBUG
std::cout << "\tMapsrver Export checking layer type" << std::endl;
-#endif
+ #endif
switch (lyr->type())
{
case QgsMapLayer::VECTOR:
// get the provider type
{
- QString providerType =
+ QString providerType =
dynamic_cast<QgsVectorLayer*>(lyr)->providerType();
if(providerType == "postgres")
{
- QgsDataSourceURI *dUri =
+ QgsDataSourceURI *dUri =
dynamic_cast<QgsVectorLayer *>(lyr)->dataProvider()->getURI();
mapFile << "CONNECTION \"user=" << dUri->username.toLocal8Bit().data();
if(dUri->password.length() > 0)
{
mapFile << " password="<< dUri->password.toLocal8Bit().data();
}
- mapFile << " dbname=" << dUri->database.toLocal8Bit().data()
+ mapFile << " dbname=" << dUri->database.toLocal8Bit().data()
<< " host=" << dUri->host.toLocal8Bit().data()
<< " port=" << dUri->port.toLocal8Bit().data()
- << "\"" << std::endl;
- mapFile << "CONNECTIONTYPE postgis" << std::endl;
- mapFile << "DATA \"" << dUri->geometryColumn.toLocal8Bit().data() << " from "
- << dUri->table.toLocal8Bit().data() << "\"" << std::endl;
+ << "\"" << std::endl;
+ mapFile << "CONNECTIONTYPE postgis" << std::endl;
+ mapFile << "DATA \"" << dUri->geometryColumn.toLocal8Bit().data() << " from "
+ << dUri->table.toLocal8Bit().data() << "\"" << std::endl;
if(dUri->sql.length() > 0)
{
- mapFile << "FILTER \"" << dUri->sql.toLocal8Bit().data() << "\"" << std::endl;
+ mapFile << "FILTER \"" << dUri->sql.toLocal8Bit().data() << "\"" << std::endl;
}
}
else
{
- // must be an ogr
+ // must be an ogr
mapFile << " DATA " << lyr->source().toLocal8Bit().data() << std::endl;
}
}
break;
case QgsMapLayer::RASTER:
- mapFile << " DATA " << lyr->source().toLocal8Bit().data() << std::endl;
-
+ mapFile << " DATA " << lyr->source().toLocal8Bit().data() << std::endl;
+
break;
}
-#ifdef QGISDEBUG
+ #ifdef QGISDEBUG
std::cout << "\tMapsrver Export creating symbol entries" << std::endl;
-#endif
+ #endif
// create a simple class entry based on red fill color and black outline color
//TODO: adapt the following section to the new symbology
mapFile << " CLASS" << std::endl;
//QListViewItem *li = map->getLegend()->currentItem();
// return li->text(0);
-#ifdef QGISDEBUG
+ #ifdef QGISDEBUG
std::cout << "\tMapsrver Export symbol name" << std::endl;
-#endif
+ #endif
mapFile << " NAME \"" << lyr->name().toLocal8Bit().data() << "\"" << std::endl;
mapFile << " # TEMPLATE" << std::endl;
if (isPolygon)
{
-#ifdef QGISDEBUG
+ #ifdef QGISDEBUG
std::cout << "\tMapsrver Export symbol fill color" << std::endl;
-#endif
+ #endif
// use random fill colors
// TODO Get fill color from the renderer
// TODO Figure out what to do for layers that are
@@ -449,9 +454,9 @@
mapFile << " COLOR " << red << " " << green << " " << blue << std::endl;
}
-#ifdef QGISDEBUG
+ #ifdef QGISDEBUG
std::cout << "\tMapsrver Export checking for line symbol " << std::endl;
-#endif
+ #endif
if (isPolygon || isLine)
{
// use line color
@@ -464,9 +469,9 @@
}
mapFile << " END" << std::endl;
mapFile << "END" << std::endl;
-#ifdef QGISDEBUG
+ #ifdef QGISDEBUG
std::cout << "\tMapsrver Export layer definition done..." << std::endl;
-#endif
+ #endif
}
if (!chkExpLayersOnly->isChecked())
{
@@ -477,7 +482,7 @@
} else
{
}
-*/
+ */
}
void QgsMapserverExport::showHelp()
{
@@ -494,6 +499,6 @@
// init the python interpreter
Py_Initialize();
// spit something to stdout
- PyRun_SimpleString("print '>>>>>>>>>>>>>>>>>>> Python initialized <<<<<<<<<<<<<<<<<<<'");
+ PyRun_SimpleString( "print '>>>>>>>>>>>>>>>>>>> Python initialized <<<<<<<<<<<<<<<<<<<'" );
}
More information about the QGIS-commit
mailing list