Skip to content

Commit 17d69a1

Browse files
author
jef
committedSep 8, 2008
automatic indentation update (r9220-r9281)
git-svn-id: http://svn.osgeo.org/qgis/trunk@9282 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 911038b commit 17d69a1

36 files changed

+509
-504
lines changed
 

‎src/app/composer/qgscomposer.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
888888
//find out the last used filter
889889
QSettings myQSettings; // where we keep last used filter in persistant state
890890
QString myLastUsedFormat = myQSettings.value( "/UI/lastSaveAsImageFormat", "png" ).toString();
891-
QString myLastUsedFile = myQSettings.value( "/UI/lastSaveAsImageFile", "qgis.png").toString();
891+
QString myLastUsedFile = myQSettings.value( "/UI/lastSaveAsImageFile", "qgis.png" ).toString();
892892
QFileInfo file( myLastUsedFile );
893893

894894
// get a list of supported output image types
@@ -944,9 +944,9 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
944944
//raise();
945945

946946
if ( result != QDialog::Accepted )
947-
{
948-
return;
949-
}
947+
{
948+
return;
949+
}
950950

951951
myOutputFileNameQString = myQFileDialog->selectedFiles().first();
952952
QString myFilterString = myQFileDialog->selectedFilter();
@@ -959,21 +959,21 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
959959
if ( myOutputFileNameQString == "" ) return;
960960

961961
mComposition->setPlotStyle( QgsComposition::Print );
962-
mView->setScene(0);
962+
mView->setScene( 0 );
963963

964-
QImage image( QSize(width, height), QImage::Format_ARGB32 );
965-
image.setDotsPerMeterX(mComposition->printoutResolution() / 25.4 * 1000);
966-
image.setDotsPerMeterY(mComposition->printoutResolution() / 25.4 * 1000);
967-
image.fill(0);
964+
QImage image( QSize( width, height ), QImage::Format_ARGB32 );
965+
image.setDotsPerMeterX( mComposition->printoutResolution() / 25.4 * 1000 );
966+
image.setDotsPerMeterY( mComposition->printoutResolution() / 25.4 * 1000 );
967+
image.fill( 0 );
968968
QPainter p( &image );
969-
QRectF sourceArea( 0, 0, mComposition->paperWidth(), mComposition->paperHeight());
970-
QRectF targetArea(0, 0, width, height);
971-
mComposition->render( &p, targetArea, sourceArea);
969+
QRectF sourceArea( 0, 0, mComposition->paperWidth(), mComposition->paperHeight() );
970+
QRectF targetArea( 0, 0, width, height );
971+
mComposition->render( &p, targetArea, sourceArea );
972972
p.end();
973973

974974
mComposition->setPlotStyle( QgsComposition::Preview );
975975
image.save( myOutputFileNameQString, myFilterMap[myFilterString].toLocal8Bit().data() );
976-
mView->setScene(mComposition);
976+
mView->setScene( mComposition );
977977
}
978978

979979

@@ -1420,8 +1420,8 @@ void QgsComposer::readXML( const QDomDocument& doc )
14201420
mComposition->addItem( newLabel );
14211421
mComposition->update();
14221422
mComposition->clearSelection();
1423-
newLabel->setSelected(true);
1424-
showItemOptions(newLabel);
1423+
newLabel->setSelected( true );
1424+
showItemOptions( newLabel );
14251425
}
14261426

14271427
//composer maps
@@ -1435,8 +1435,8 @@ void QgsComposer::readXML( const QDomDocument& doc )
14351435
mComposition->addItem( newMap );
14361436
mComposition->update();
14371437
mComposition->clearSelection();
1438-
newMap->setSelected(true);
1439-
showItemOptions(newMap);
1438+
newMap->setSelected( true );
1439+
showItemOptions( newMap );
14401440
}
14411441

14421442
//composer scalebars
@@ -1450,8 +1450,8 @@ void QgsComposer::readXML( const QDomDocument& doc )
14501450
mComposition->addItem( newScaleBar );
14511451
mComposition->update();
14521452
mComposition->clearSelection();
1453-
newScaleBar->setSelected(true);
1454-
showItemOptions(newScaleBar);
1453+
newScaleBar->setSelected( true );
1454+
showItemOptions( newScaleBar );
14551455
}
14561456

14571457
//composer legends
@@ -1465,8 +1465,8 @@ void QgsComposer::readXML( const QDomDocument& doc )
14651465
mComposition->addItem( newLegend );
14661466
mComposition->update();
14671467
mComposition->clearSelection();
1468-
newLegend->setSelected(true);
1469-
showItemOptions(newLegend);
1468+
newLegend->setSelected( true );
1469+
showItemOptions( newLegend );
14701470
}
14711471

14721472
//composer pictures
@@ -1480,8 +1480,8 @@ void QgsComposer::readXML( const QDomDocument& doc )
14801480
mComposition->addItem( newPicture );
14811481
mComposition->update();
14821482
mComposition->clearSelection();
1483-
newPicture->setSelected(true);
1484-
showItemOptions(newPicture);
1483+
newPicture->setSelected( true );
1484+
showItemOptions( newPicture );
14851485
}
14861486

14871487
mComposition->sortZList();

‎src/app/composer/qgscomposerlegendwidget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,10 @@ void QgsComposerLegendWidget::on_mUpdatePushButton_clicked()
363363
return;
364364
}
365365

366-
if(mLegend->model())
367-
{
368-
mLegend->model()->updateItem(currentItem);
369-
}
366+
if ( mLegend->model() )
367+
{
368+
mLegend->model()->updateItem( currentItem );
369+
}
370370
mLegend->update();
371371
mLegend->adjustBoxSize();
372372
}

‎src/app/composer/qgscompositionwidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget* parent, QgsComposition* c )
2525
createPaperEntries();
2626

2727
//unit (only mm at the moment, therefore disabled)
28-
mPaperUnitsComboBox->addItem("mm");
29-
mPaperUnitsComboBox->setEnabled(false);
28+
mPaperUnitsComboBox->addItem( "mm" );
29+
mPaperUnitsComboBox->setEnabled( false );
3030

3131
//orientation
3232
mPaperOrientationComboBox->blockSignals( true );

‎src/app/qgsattributedialog.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,15 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
253253
{
254254
QLineEdit *le = new QLineEdit( myFieldValue.toString() );
255255

256-
QPushButton *pb = new QPushButton( tr("...") );
257-
connect(pb, SIGNAL(clicked()), this, SLOT(selectFileName()));
256+
QPushButton *pb = new QPushButton( tr( "..." ) );
257+
connect( pb, SIGNAL( clicked() ), this, SLOT( selectFileName() ) );
258258

259259
QHBoxLayout *hbl = new QHBoxLayout();
260-
hbl->addWidget(le);
261-
hbl->addWidget(pb);
260+
hbl->addWidget( le );
261+
hbl->addWidget( pb );
262262

263263
myWidget = new QWidget;
264-
myWidget->setLayout(hbl);
264+
myWidget->setLayout( hbl );
265265
}
266266
break;
267267
}
@@ -296,22 +296,22 @@ QgsAttributeDialog::~QgsAttributeDialog()
296296
void QgsAttributeDialog::selectFileName()
297297
{
298298
QPushButton *pb = dynamic_cast<QPushButton *>( sender() );
299-
if(!pb)
299+
if ( !pb )
300300
return;
301301

302302
QWidget *hbox = dynamic_cast<QWidget *>( pb->parent() );
303-
if(!hbox)
303+
if ( !hbox )
304304
return;
305305

306306
QLineEdit *le = hbox->findChild<QLineEdit *>();
307-
if(!le)
307+
if ( !le )
308308
return;
309309

310-
QString fileName = QFileDialog::getOpenFileName(0 , tr("Select a file"));
311-
if(fileName.isNull())
310+
QString fileName = QFileDialog::getOpenFileName( 0 , tr( "Select a file" ) );
311+
if ( fileName.isNull() )
312312
return;
313313

314-
le->setText(fileName);
314+
le->setText( fileName );
315315
}
316316

317317
void QgsAttributeDialog::accept()
@@ -368,8 +368,8 @@ void QgsAttributeDialog::accept()
368368
myFieldValue = QString::number( dsb->value() );
369369
}
370370

371-
le = mpWidgets.value( myIndex )->findChild<QLineEdit *>("lineEdit");
372-
if(le)
371+
le = mpWidgets.value( myIndex )->findChild<QLineEdit *>( "lineEdit" );
372+
if ( le )
373373
{
374374
myFieldValue = le->text();
375375
}

‎src/app/qgsattributetable.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ QgsAttributeTable::~QgsAttributeTable()
103103

104104
void QgsAttributeTable::setReadOnly( bool b )
105105
{
106-
blockSignals(true);
106+
blockSignals( true );
107107

108108
setEditTriggers( b ? QAbstractItemView::NoEditTriggers :
109109
QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed );
@@ -112,7 +112,7 @@ void QgsAttributeTable::setReadOnly( bool b )
112112
setColumnReadOnly( 0, true );
113113
}
114114

115-
blockSignals(false);
115+
blockSignals( false );
116116
}
117117

118118
void QgsAttributeTable::setColumnReadOnly( int col, bool ro )
@@ -439,7 +439,7 @@ void QgsAttributeTable::copySelectedRows()
439439

440440
void QgsAttributeTable::fillTable( QgsVectorLayer *layer )
441441
{
442-
blockSignals(true);
442+
blockSignals( true );
443443

444444
const QgsFieldMap &fields = layer->pendingFields();
445445

@@ -489,7 +489,7 @@ void QgsAttributeTable::fillTable( QgsVectorLayer *layer )
489489
for ( int i = 0; i < columnCount(); i++ )
490490
resizeColumnToContents( i );
491491

492-
blockSignals(false);
492+
blockSignals( false );
493493
}
494494

495495
void QgsAttributeTable::putFeatureInTable( int row, const QgsFeature& fet )

‎src/app/qgscustomprojectiondialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ void QgsCustomProjectionDialog::on_pbnSave_clicked()
855855

856856
sqlite3_finalize( myPreparedStatement );
857857
sqlite3_close( myDatabase );
858-
pbnDelete->setEnabled( true );
858+
pbnDelete->setEnabled( true );
859859
}
860860

861861
void QgsCustomProjectionDialog::on_pbnCalculate_clicked()

‎src/app/qgspluginregistry.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ void QgsPluginRegistry::removePlugin( QString name )
8989

9090
void QgsPluginRegistry::unloadAll()
9191
{
92-
for(std::map<QString, QgsPluginMetadata*>::iterator it=plugins.begin();
93-
it!=plugins.end();
94-
it++)
95-
if( it->second->plugin() )
92+
for ( std::map<QString, QgsPluginMetadata*>::iterator it = plugins.begin();
93+
it != plugins.end();
94+
it++ )
95+
if ( it->second->plugin() )
9696
it->second->plugin()->unload();
9797
}

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ void QgsRasterLayerProperties::sync()
822822
pixmapLegend->repaint();
823823

824824
//set the palette pixmap
825-
pixmapPalette->setPixmap( mRasterLayer->getPaletteAsPixmap(mRasterLayer->getRasterBandNumber(mRasterLayer->getGrayBandName())));
825+
pixmapPalette->setPixmap( mRasterLayer->getPaletteAsPixmap( mRasterLayer->getRasterBandNumber( mRasterLayer->getGrayBandName() ) ) );
826826
pixmapPalette->setScaledContents( true );
827827
pixmapPalette->repaint();
828828

@@ -1988,7 +1988,7 @@ void QgsRasterLayerProperties::on_pbnHistRefresh_clicked()
19881988

19891989
QgsDebugMsg( QString( "myMiddle = %1" ).arg( myMiddle ) );
19901990

1991-
if ( myRasterShaderFunction->generateShadedValue(myMiddle, &c1, &c2, &c3))
1991+
if ( myRasterShaderFunction->generateShadedValue( myMiddle, &c1, &c2, &c3 ) )
19921992
{
19931993
QgsDebugMsg( "Color not found" );
19941994
c1 = c2 = c3 = 180; // grey

‎src/core/composer/qgscomposeritem.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -525,58 +525,58 @@ void QgsComposerItem::hoverMoveEvent( QGraphicsSceneHoverEvent * event )
525525
}
526526
}
527527

528-
void QgsComposerItem::drawText(QPainter* p, int x, int y, const QString& text, const QFont& font) const
528+
void QgsComposerItem::drawText( QPainter* p, int x, int y, const QString& text, const QFont& font ) const
529529
{
530-
QFont textFont = scaledFontPixelSize(font);
531-
530+
QFont textFont = scaledFontPixelSize( font );
531+
532532
p->save();
533-
p->setFont(textFont);
534-
p->setPen(QColor(0, 0, 0)); //draw text always in black
533+
p->setFont( textFont );
534+
p->setPen( QColor( 0, 0, 0 ) ); //draw text always in black
535535
double scaleFactor = 1.0 / FONT_WORKAROUND_SCALE;
536-
p->scale(scaleFactor, scaleFactor);
537-
p->drawText(x * FONT_WORKAROUND_SCALE, y * FONT_WORKAROUND_SCALE, text);
536+
p->scale( scaleFactor, scaleFactor );
537+
p->drawText( x * FONT_WORKAROUND_SCALE, y * FONT_WORKAROUND_SCALE, text );
538538
p->restore();
539539
}
540540

541-
void QgsComposerItem::drawText(QPainter* p, const QRectF& rect, const QString& text, const QFont& font) const
541+
void QgsComposerItem::drawText( QPainter* p, const QRectF& rect, const QString& text, const QFont& font ) const
542542
{
543-
QFont textFont = scaledFontPixelSize(font);
543+
QFont textFont = scaledFontPixelSize( font );
544544

545-
QRectF scaledRect(rect.x() * FONT_WORKAROUND_SCALE, rect.y() * FONT_WORKAROUND_SCALE,
546-
rect.width() * FONT_WORKAROUND_SCALE, rect.height() * FONT_WORKAROUND_SCALE);
545+
QRectF scaledRect( rect.x() * FONT_WORKAROUND_SCALE, rect.y() * FONT_WORKAROUND_SCALE,
546+
rect.width() * FONT_WORKAROUND_SCALE, rect.height() * FONT_WORKAROUND_SCALE );
547547

548548
p->save();
549-
p->setFont(textFont);
550-
p->setPen(QColor(0, 0, 0)); //draw text always in black
549+
p->setFont( textFont );
550+
p->setPen( QColor( 0, 0, 0 ) ); //draw text always in black
551551
double scaleFactor = 1.0 / FONT_WORKAROUND_SCALE;
552-
p->scale(scaleFactor, scaleFactor);
553-
p->drawText(scaledRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, text);
552+
p->scale( scaleFactor, scaleFactor );
553+
p->drawText( scaledRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, text );
554554
p->restore();
555555
}
556556

557-
double QgsComposerItem::textWidthMM(const QFont& font, const QString& text) const
557+
double QgsComposerItem::textWidthMM( const QFont& font, const QString& text ) const
558558
{
559-
QFont metricsFont = scaledFontPixelSize(font);
560-
QFontMetrics fontMetrics(metricsFont);
561-
return (fontMetrics.width(text) / FONT_WORKAROUND_SCALE);
559+
QFont metricsFont = scaledFontPixelSize( font );
560+
QFontMetrics fontMetrics( metricsFont );
561+
return ( fontMetrics.width( text ) / FONT_WORKAROUND_SCALE );
562562
}
563563

564-
double QgsComposerItem::fontAscentMM(const QFont& font) const
564+
double QgsComposerItem::fontAscentMM( const QFont& font ) const
565565
{
566-
QFont metricsFont = scaledFontPixelSize(font);
567-
QFontMetrics fontMetrics(metricsFont);
568-
return (fontMetrics.ascent() / FONT_WORKAROUND_SCALE);
566+
QFont metricsFont = scaledFontPixelSize( font );
567+
QFontMetrics fontMetrics( metricsFont );
568+
return ( fontMetrics.ascent() / FONT_WORKAROUND_SCALE );
569569
}
570570

571-
double QgsComposerItem::pixelFontSize(double pointSize) const
571+
double QgsComposerItem::pixelFontSize( double pointSize ) const
572572
{
573-
return (pointSize * 0.3527);
573+
return ( pointSize * 0.3527 );
574574
}
575575

576-
QFont QgsComposerItem::scaledFontPixelSize(const QFont& font) const
576+
QFont QgsComposerItem::scaledFontPixelSize( const QFont& font ) const
577577
{
578578
QFont scaledFont = font;
579-
double pixelSize = pixelFontSize(font.pointSizeF()) * FONT_WORKAROUND_SCALE + 0.5;
580-
scaledFont.setPixelSize(pixelSize);
579+
double pixelSize = pixelFontSize( font.pointSizeF() ) * FONT_WORKAROUND_SCALE + 0.5;
580+
scaledFont.setPixelSize( pixelSize );
581581
return scaledFont;
582582
}

‎src/core/composer/qgscomposeritem.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,27 +105,27 @@ class CORE_EXPORT QgsComposerItem: public QGraphicsRectItem
105105

106106
const QgsComposition* composition() const {return mComposition;}
107107

108-
//functions that encapsulate the workaround for the Qt font bug (that is to scale the font size up and then scale the
108+
//functions that encapsulate the workaround for the Qt font bug (that is to scale the font size up and then scale the
109109
//painter down by the same factor for drawing
110110

111111
/**Draws Text. Takes care about all the composer specific issues (calculation to pixel, scaling of font and painter
112112
to work arount the Qt font bug)*/
113-
void drawText(QPainter* p, int x, int y, const QString& text, const QFont& font) const;
113+
void drawText( QPainter* p, int x, int y, const QString& text, const QFont& font ) const;
114114

115115
/**Like the above, but with a rectangle for multiline text*/
116-
void drawText(QPainter* p, const QRectF& rect, const QString& text, const QFont& font) const;
116+
void drawText( QPainter* p, const QRectF& rect, const QString& text, const QFont& font ) const;
117117

118118
/**Returns the font width in MM (considers upscaling and downscaling with FONT_WORKAROUND_SCALE*/
119-
double textWidthMM(const QFont& font, const QString& text) const;
119+
double textWidthMM( const QFont& font, const QString& text ) const;
120120

121121
/**Returns the font ascent in MM (considers upscaling and downscaling with FONT_WORKAROUND_SCALE*/
122-
double fontAscentMM(const QFont& font) const;
122+
double fontAscentMM( const QFont& font ) const;
123123

124124
/**Calculates font to from point size to pixel size*/
125-
double pixelFontSize(double pointSize) const;
125+
double pixelFontSize( double pointSize ) const;
126126

127127
/**Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE*/
128-
QFont scaledFontPixelSize(const QFont& font) const;
128+
QFont scaledFontPixelSize( const QFont& font ) const;
129129

130130
protected:
131131

0 commit comments

Comments
 (0)
Please sign in to comment.