Skip to content

Commit 73eb705

Browse files
author
jef
committedSep 21, 2008
automatic indentation update (r9281-r9365)
git-svn-id: http://svn.osgeo.org/qgis/trunk@9366 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 02e17b5 commit 73eb705

27 files changed

+203
-201
lines changed
 

‎src/app/composer/qgscomposer.cpp

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,10 @@ void QgsComposer::on_mActionPrint_activated( void )
435435
return;
436436
}
437437

438-
if(containsWMSLayer())
439-
{
440-
showWMSPrintingWarning();
441-
}
438+
if ( containsWMSLayer() )
439+
{
440+
showWMSPrintingWarning();
441+
}
442442

443443
QPrinter printer;
444444

@@ -492,10 +492,10 @@ void QgsComposer::on_mActionPrint_activated( void )
492492

493493
void QgsComposer::on_mActionExportAsImage_activated( void )
494494
{
495-
if(containsWMSLayer())
496-
{
497-
showWMSPrintingWarning();
498-
}
495+
if ( containsWMSLayer() )
496+
{
497+
showWMSPrintingWarning();
498+
}
499499

500500
// Image size
501501
int width = ( int )( mComposition->printoutResolution() * mComposition->paperWidth() / 25.4 );
@@ -567,7 +567,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
567567
)
568568
);
569569

570-
myQFileDialog->setFileMode(QFileDialog::AnyFile);
570+
myQFileDialog->setFileMode( QFileDialog::AnyFile );
571571

572572
// set the filter to the last one used
573573
myQFileDialog->selectFilter( myLastUsedFilter );
@@ -587,7 +587,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
587587
}
588588

589589
myOutputFileNameQString = myQFileDialog->selectedFiles().last();
590-
qWarning(myOutputFileNameQString.toLocal8Bit().data());
590+
qWarning( myOutputFileNameQString.toLocal8Bit().data() );
591591
QString myFilterString = myQFileDialog->selectedFilter();
592592
QgsDebugMsg( QString( "Selected filter: %1" ).arg( myFilterString ) );
593593
QgsDebugMsg( QString( "Image type: %1" ).arg( myFilterMap[myFilterString] ) );
@@ -618,10 +618,10 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
618618

619619
void QgsComposer::on_mActionExportAsSVG_activated( void )
620620
{
621-
if(containsWMSLayer())
622-
{
623-
showWMSPrintingWarning();
624-
}
621+
if ( containsWMSLayer() )
622+
{
623+
showWMSPrintingWarning();
624+
}
625625

626626
QString myQSettingsLabel = "/UI/displaySVGWarning";
627627
QSettings myQSettings;
@@ -1102,18 +1102,18 @@ bool QgsComposer::containsWMSLayer() const
11021102
QgsComposerItem* currentItem = 0;
11031103
QgsComposerMap* currentMap = 0;
11041104

1105-
for(; item_it != mItemWidgetMap.constEnd(); ++item_it)
1105+
for ( ; item_it != mItemWidgetMap.constEnd(); ++item_it )
1106+
{
1107+
currentItem = item_it.key();
1108+
currentMap = dynamic_cast<QgsComposerMap*>( currentItem );
1109+
if ( currentMap )
11061110
{
1107-
currentItem = item_it.key();
1108-
currentMap = dynamic_cast<QgsComposerMap*>(currentItem);
1109-
if(currentMap)
1110-
{
1111-
if(currentMap->containsWMSLayer())
1112-
{
1113-
return true;
1114-
}
1115-
}
1111+
if ( currentMap->containsWMSLayer() )
1112+
{
1113+
return true;
1114+
}
11161115
}
1116+
}
11171117
return false;
11181118
}
11191119

@@ -1123,15 +1123,15 @@ void QgsComposer::showWMSPrintingWarning()
11231123
QSettings myQSettings;
11241124

11251125
bool displayWMSWarning = myQSettings.value( myQSettingsLabel, true ).toBool();
1126-
if(displayWMSWarning)
1127-
{
1128-
QgsMessageViewer* m = new QgsMessageViewer( this );
1129-
m->setWindowTitle( tr( "Project contains WMS layers" ) );
1130-
m->setMessage(tr("Some WMS servers (e.g. UMN mapserver) have a limit for the WIDTH and HEIGHT parameter. Printing layers from such servers may exceed this limit. If this is the case, the WMS layer will not be printed"), QgsMessageOutput::MessageText);
1131-
m->setCheckBoxText( tr( "Don't show this message again" ) );
1132-
m->setCheckBoxState( Qt::Unchecked );
1133-
m->setCheckBoxVisible( true );
1134-
m->setCheckBoxQSettingsLabel( myQSettingsLabel );
1135-
m->exec();
1136-
}
1126+
if ( displayWMSWarning )
1127+
{
1128+
QgsMessageViewer* m = new QgsMessageViewer( this );
1129+
m->setWindowTitle( tr( "Project contains WMS layers" ) );
1130+
m->setMessage( tr( "Some WMS servers (e.g. UMN mapserver) have a limit for the WIDTH and HEIGHT parameter. Printing layers from such servers may exceed this limit. If this is the case, the WMS layer will not be printed" ), QgsMessageOutput::MessageText );
1131+
m->setCheckBoxText( tr( "Don't show this message again" ) );
1132+
m->setCheckBoxState( Qt::Unchecked );
1133+
m->setCheckBoxVisible( true );
1134+
m->setCheckBoxQSettingsLabel( myQSettingsLabel );
1135+
m->exec();
1136+
}
11371137
}

‎src/app/composer/qgscomposermapwidget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ void QgsComposerMapWidget::updateGuiElements()
230230

231231
//composer map extent
232232
QgsRect composerMapExtent = mComposerMap->extent();
233-
mXMinLineEdit->setText( QString::number( composerMapExtent.xMin(), 'f', 3));
234-
mXMaxLineEdit->setText( QString::number( composerMapExtent.xMax(), 'f', 3));
235-
mYMinLineEdit->setText( QString::number( composerMapExtent.yMin(), 'f', 3));
236-
mYMaxLineEdit->setText( QString::number( composerMapExtent.yMax(), 'f', 3));
233+
mXMinLineEdit->setText( QString::number( composerMapExtent.xMin(), 'f', 3 ) );
234+
mXMaxLineEdit->setText( QString::number( composerMapExtent.xMax(), 'f', 3 ) );
235+
mYMinLineEdit->setText( QString::number( composerMapExtent.yMin(), 'f', 3 ) );
236+
mYMaxLineEdit->setText( QString::number( composerMapExtent.yMax(), 'f', 3 ) );
237237
}
238238
}
239239

‎src/app/legend/qgslegendlayerfile.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,11 @@ void QgsLegendLayerFile::saveAsShapefileGeneral( bool saveOnlySelection )
274274
{
275275
destCRS = QgisApp::instance()->mapCanvas()->mapRenderer()->destinationSrs();
276276
}
277-
277+
278278
QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector();
279279
mySelector->setSelectedCrsId( destCRS.srsid() );
280-
mySelector->setMessage(tr("Select the coordinate reference system for the saved shapefile.") +
281-
tr("The data points will be transformed from the layer coordinate reference system."));
280+
mySelector->setMessage( tr( "Select the coordinate reference system for the saved shapefile." ) +
281+
tr( "The data points will be transformed from the layer coordinate reference system." ) );
282282

283283
if ( mySelector->exec() )
284284
{

‎src/app/qgsattributetable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ void QgsAttributeTable::bringSelectedToTop()
559559
for ( QList<QTableWidgetSelectionRange>::iterator iter = selections.begin();iter != selections.end();++iter )
560560
{
561561
removeselection = true;
562-
while ( swaptorow<rowCount() && item( swaptorow, 0 )->isSelected() )//selections are not necessary stored in ascending order
562+
while ( swaptorow < rowCount() && item( swaptorow, 0 )->isSelected() )//selections are not necessary stored in ascending order
563563
{
564564
++swaptorow;
565565
}

‎src/app/qgsmaptoolidentify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void QgsMapToolIdentify::identifyVectorLayer( const QgsPoint& point )
252252

253253
// toLayerCoordinates will throw an exception for an 'invalid' point.
254254
// For example, if you project a world map onto a globe using EPSG 2163
255-
// and then click somewhere off the globe, an exception will be thrown.
255+
// and then click somewhere off the globe, an exception will be thrown.
256256
try
257257
{
258258
// create the search rectangle

‎src/app/qgsmaptoolselect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void QgsMapToolSelect::canvasReleaseEvent( QMouseEvent * e )
9696
QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( mCanvas->currentLayer() );
9797
// toLayerCoordinates will throw an exception for an 'invalid' rectangle.
9898
// For example, if you project a world map onto a globe using EPSG 2163
99-
// and then click somewhere off the globe, an exception will be thrown.
99+
// and then click somewhere off the globe, an exception will be thrown.
100100
try
101101
{
102102
search = toLayerCoordinates( vlayer, search );

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ void QgsRasterLayerProperties::apply()
13841384
myNewColorRampItem.value = myCurrentItem->text( 0 ).toDouble();
13851385
myNewColorRampItem.color = myCurrentItem->background( 1 ).color();
13861386
myNewColorRampItem.label = myCurrentItem->text( 2 );
1387-
1387+
13881388
//Simple insertion sort - speed is not a huge factor here
13891389
inserted = false;
13901390
myCurrentIndex = 0;
@@ -1590,9 +1590,9 @@ void QgsRasterLayerProperties::on_buttonBuildPyramids_clicked()
15901590
{
15911591
QMessageBox::warning( this, tr( "Building pyramids failed." ),
15921592
tr( "Building pyramid overviews is not supported on this type of raster." ) );
1593-
//TODO: should really read -- Building pyramid overviews is not supported for 'warped virtual dataset'. -- But in feature freeze, and translation requests have already gone out PJE20080912
1593+
//TODO: should really read -- Building pyramid overviews is not supported for 'warped virtual dataset'. -- But in feature freeze, and translation requests have already gone out PJE20080912
15941594
}
1595-
1595+
15961596
}
15971597

15981598

@@ -2649,7 +2649,7 @@ void QgsRasterLayerProperties::handleColormapTreeWidgetDoubleClick( QTreeWidgetI
26492649
{
26502650
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
26512651
//show color dialog
2652-
QColor newColor = QColorDialog::getColor(item->background(column).color());
2652+
QColor newColor = QColorDialog::getColor( item->background( column ).color() );
26532653
if ( newColor.isValid() )
26542654
{
26552655
item->setBackground( 1, QBrush( newColor ) );

‎src/core/composer/qgscomposeritem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class CORE_EXPORT QgsComposerItem: public QGraphicsRectItem
7979
@param delta value from wheel event that describes magnitude and direction (positive /negative number)
8080
@param x x-position of mouse cursor (in item coordinates)
8181
@param y y-position of mouse cursor (in item coordinates)*/
82-
virtual void zoomContent( int delta, double x, double y) {}
82+
virtual void zoomContent( int delta, double x, double y ) {}
8383

8484
/**Sets this items bound in scene coordinates such that 1 item size units
8585
corresponds to 1 scene size unit*/

‎src/core/composer/qgscomposermap.cpp

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -280,62 +280,62 @@ void QgsComposerMap::moveContent( double dx, double dy )
280280
}
281281
}
282282

283-
void QgsComposerMap::zoomContent( int delta, double x, double y)
283+
void QgsComposerMap::zoomContent( int delta, double x, double y )
284284
{
285285
QSettings settings;
286-
286+
287287
//read zoom mode
288-
//0: zoom, 1: zoom and recenter, 2: zoom to cursor, 3: nothing
289-
int zoomMode = settings.value("/qgis/wheel_action", 0 ).toInt();
290-
if(zoomMode == 3) //do nothing
291-
{
292-
return;
293-
}
288+
//0: zoom, 1: zoom and recenter, 2: zoom to cursor, 3: nothing
289+
int zoomMode = settings.value( "/qgis/wheel_action", 0 ).toInt();
290+
if ( zoomMode == 3 ) //do nothing
291+
{
292+
return;
293+
}
294+
295+
double zoomFactor = settings.value( "/qgis/zoom_factor", 2.0 ).toDouble();
294296

295-
double zoomFactor = settings.value("/qgis/zoom_factor", 2.0).toDouble();
296-
297297
//find out new center point
298-
double centerX = (mExtent.xMax() + mExtent.xMin()) / 2;
299-
double centerY = (mExtent.yMax() + mExtent.yMin()) / 2;
298+
double centerX = ( mExtent.xMax() + mExtent.xMin() ) / 2;
299+
double centerY = ( mExtent.yMax() + mExtent.yMin() ) / 2;
300300

301-
if(zoomMode != 0)
301+
if ( zoomMode != 0 )
302+
{
303+
//find out map coordinates of mouse position
304+
double mapMouseX = mExtent.xMin() + ( x / rect().width() ) * ( mExtent.xMax() - mExtent.xMin() );
305+
double mapMouseY = mExtent.yMin() + ( 1 - ( y / rect().height() ) ) * ( mExtent.yMax() - mExtent.yMin() );
306+
if ( zoomMode == 1 ) //zoom and recenter
302307
{
303-
//find out map coordinates of mouse position
304-
double mapMouseX = mExtent.xMin() + (x / rect().width()) * (mExtent.xMax() - mExtent.xMin());
305-
double mapMouseY = mExtent.yMin() + (1 - (y / rect().height())) * (mExtent.yMax() - mExtent.yMin());
306-
if(zoomMode == 1) //zoom and recenter
307-
{
308-
centerX = mapMouseX;
309-
centerY = mapMouseY;
310-
}
311-
else if(zoomMode == 2) //zoom to cursor
312-
{
313-
centerX = mapMouseX + (centerX - mapMouseX) * (1.0 / zoomFactor);
314-
centerY = mapMouseY + (centerY - mapMouseY) * (1.0 / zoomFactor);
315-
}
308+
centerX = mapMouseX;
309+
centerY = mapMouseY;
316310
}
311+
else if ( zoomMode == 2 ) //zoom to cursor
312+
{
313+
centerX = mapMouseX + ( centerX - mapMouseX ) * ( 1.0 / zoomFactor );
314+
centerY = mapMouseY + ( centerY - mapMouseY ) * ( 1.0 / zoomFactor );
315+
}
316+
}
317317

318318
double newIntervalX, newIntervalY;
319319

320-
if(delta > 0)
321-
{
322-
newIntervalX = (mExtent.xMax() - mExtent.xMin()) / zoomFactor;
323-
newIntervalY = (mExtent.yMax() - mExtent.yMin()) / zoomFactor;
324-
}
325-
else if(delta < 0)
326-
{
327-
newIntervalX = (mExtent.xMax() - mExtent.xMin()) * zoomFactor;
328-
newIntervalY = (mExtent.yMax() - mExtent.yMin()) * zoomFactor;
329-
}
320+
if ( delta > 0 )
321+
{
322+
newIntervalX = ( mExtent.xMax() - mExtent.xMin() ) / zoomFactor;
323+
newIntervalY = ( mExtent.yMax() - mExtent.yMin() ) / zoomFactor;
324+
}
325+
else if ( delta < 0 )
326+
{
327+
newIntervalX = ( mExtent.xMax() - mExtent.xMin() ) * zoomFactor;
328+
newIntervalY = ( mExtent.yMax() - mExtent.yMin() ) * zoomFactor;
329+
}
330330
else //no need to zoom
331-
{
332-
return;
333-
}
331+
{
332+
return;
333+
}
334334

335-
mExtent.setXMaximum(centerX + newIntervalX / 2);
336-
mExtent.setXMinimum(centerX - newIntervalX / 2);
337-
mExtent.setYMaximum(centerY + newIntervalY / 2);
338-
mExtent.setYMinimum(centerY - newIntervalY / 2);
335+
mExtent.setXMaximum( centerX + newIntervalX / 2 );
336+
mExtent.setXMinimum( centerX - newIntervalX / 2 );
337+
mExtent.setYMaximum( centerY + newIntervalY / 2 );
338+
mExtent.setYMinimum( centerY - newIntervalY / 2 );
339339

340340
emit extentChanged();
341341
cache();
@@ -405,35 +405,35 @@ void QgsComposerMap::setOffset( double xOffset, double yOffset )
405405

406406
bool QgsComposerMap::containsWMSLayer() const
407407
{
408-
if(!mMapRenderer)
409-
{
410-
return false;
411-
}
408+
if ( !mMapRenderer )
409+
{
410+
return false;
411+
}
412412

413413
QStringList layers = mMapRenderer->layerSet();
414414

415415
QStringList::const_iterator layer_it = layers.constBegin();
416416
QgsMapLayer* currentLayer = 0;
417417

418-
for(; layer_it != layers.constEnd(); ++layer_it)
418+
for ( ; layer_it != layers.constEnd(); ++layer_it )
419+
{
420+
currentLayer = QgsMapLayerRegistry::instance()->mapLayer( *layer_it );
421+
if ( currentLayer )
419422
{
420-
currentLayer = QgsMapLayerRegistry::instance()->mapLayer(*layer_it);
421-
if(currentLayer)
422-
{
423-
QgsRasterLayer* currentRasterLayer = dynamic_cast<QgsRasterLayer*>(currentLayer);
424-
if(currentRasterLayer)
425-
{
426-
const QgsRasterDataProvider* rasterProvider = 0;
427-
if(rasterProvider = currentRasterLayer->dataProvider())
428-
{
429-
if(rasterProvider->name() == "wms")
430-
{
431-
return true;
432-
}
433-
}
434-
}
435-
}
423+
QgsRasterLayer* currentRasterLayer = dynamic_cast<QgsRasterLayer*>( currentLayer );
424+
if ( currentRasterLayer )
425+
{
426+
const QgsRasterDataProvider* rasterProvider = 0;
427+
if ( rasterProvider = currentRasterLayer->dataProvider() )
428+
{
429+
if ( rasterProvider->name() == "wms" )
430+
{
431+
return true;
432+
}
433+
}
434+
}
436435
}
436+
}
437437
return false;
438438
}
439439

‎src/core/composer/qgscomposermap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class CORE_EXPORT QgsComposerMap : /*public QWidget, private Ui::QgsComposerMapB
9191
@param delta value from wheel event that describes magnitude and direction (positive /negative number)
9292
@param x x-coordinate of mouse position in item coordinates
9393
@param y y-coordinate of mouse position in item coordinates*/
94-
void zoomContent( int delta, double x, double y);
94+
void zoomContent( int delta, double x, double y );
9595

9696
/**Sets new scene rectangle bounds and recalculates hight and extent*/
9797
void setSceneRect( const QRectF& rectangle );

0 commit comments

Comments
 (0)
Please sign in to comment.