Skip to content
Permalink
Browse files

Code foramtting cleanups only

  • Loading branch information
timlinux committed Dec 30, 2013
1 parent ba229e5 commit a15231276939047942f678c1050f68a166b01883
@@ -723,7 +723,7 @@ void QgsMapToolNodeTool::keyPressEvent( QKeyEvent* e )
if ( mSelectedFeature && ( e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Delete ) )
{
int firstSelectedIndex = firstSelectedVertex();
if ( firstSelectedIndex == -1) return;
if ( firstSelectedIndex == -1 ) return;

mSelectedFeature->deleteSelectedVertexes();
safeSelectVertex( firstSelectedIndex );
@@ -733,15 +733,15 @@ void QgsMapToolNodeTool::keyPressEvent( QKeyEvent* e )
e->ignore();
}
else
if ( mSelectedFeature && ( e->key() == Qt::Key_Less || e->key() == Qt::Key_Greater ) )
{
int firstSelectedIndex = firstSelectedVertex();
if ( firstSelectedIndex == -1) return;
if ( mSelectedFeature && ( e->key() == Qt::Key_Less || e->key() == Qt::Key_Greater ) )
{
int firstSelectedIndex = firstSelectedVertex();
if ( firstSelectedIndex == -1 ) return;

mSelectedFeature->deselectAllVertexes();
safeSelectVertex( firstSelectedIndex + ( (e->key() == Qt::Key_Less) ? -1 : +1 ) );
mCanvas->refresh();
}
mSelectedFeature->deselectAllVertexes();
safeSelectVertex( firstSelectedIndex + (( e->key() == Qt::Key_Less ) ? -1 : + 1 ) );
mCanvas->refresh();
}
}

void QgsMapToolNodeTool::keyReleaseEvent( QKeyEvent* e )
@@ -790,13 +790,13 @@ int QgsMapToolNodeTool::safeSelectVertex( int vertexNr )
{
if ( mSelectedFeature )
{
QList<QgsVertexEntry*> &vertexMap = mSelectedFeature->vertexMap();
QList<QgsVertexEntry*> &vertexMap = mSelectedFeature->vertexMap();

if ( vertexNr >= vertexMap.size() ) vertexNr -= vertexMap.size();
if ( vertexNr < 0 ) vertexNr = vertexMap.size() - 1 + vertexNr;
if ( vertexNr >= vertexMap.size() ) vertexNr -= vertexMap.size();
if ( vertexNr < 0 ) vertexNr = vertexMap.size() - 1 + vertexNr;

mSelectedFeature->selectVertex( vertexNr );
return vertexNr;
mSelectedFeature->selectVertex( vertexNr );
return vertexNr;
}
return -1;
}
@@ -1904,7 +1904,7 @@ void QgisApp::setupConnections()
mMapCanvas, SLOT( setRenderFlag( bool ) ) );

// connect MapCanvas keyPress event so we can check if selected feature collection must be deleted
connect( mMapCanvas, SIGNAL( keyPressed( QKeyEvent * ) ),
connect( mMapCanvas, SIGNAL( keyPressed( QKeyEvent * ) ),
this, SLOT( mapCanvas_keyPressed( QKeyEvent * ) ) );

// connect renderer
@@ -9097,7 +9097,7 @@ void QgisApp::keyPressEvent( QKeyEvent * e )
void QgisApp::mapCanvas_keyPressed( QKeyEvent *e )
{
// Delete selected features when it is possible and KeyEvent was not managed by current MapTool
if ( ( e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Delete ) && e->isAccepted() )
if (( e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Delete ) && e->isAccepted() )
{
deleteSelected();
}
@@ -226,7 +226,7 @@ void QgsAttributeTableDialog::keyPressEvent( QKeyEvent* event )
{
QDialog::keyPressEvent( event );

if ( ( event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete ) && mDeleteSelectedButton->isEnabled() )
if (( event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete ) && mDeleteSelectedButton->isEnabled() )
{
QgisApp::instance()->deleteSelected( mLayer, this );
}
@@ -97,7 +97,7 @@ class CORE_EXPORT QgsComposerMouseHandles: public QObject, public QGraphicsRectI

/**Redraws handles when selected item rotation changes*/
void selectedItemRotationChanged();

private:

QgsComposition* mComposition; //reference to composition
@@ -131,8 +131,8 @@ class CORE_EXPORT QgsComposerMouseHandles: public QObject, public QGraphicsRectI

/**Returns the mouse handle bounds of current selection*/
QRectF selectionBounds() const;
/**Returns true if all selected items have same rotation, and if so, updates passed rotation variable*/

/**Returns true if all selected items have same rotation, and if so, updates passed rotation variable*/
bool selectionRotation( double & rotation ) const;

/**Redraws or hides the handles based on the current selection*/
@@ -413,11 +413,11 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
void computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const;

QgsAtlasComposition& atlasComposition() { return mAtlasComposition; };

/**Resizes a QRectF relative to the change from boundsBefore to boundsAfter*/
static void relativeResizeRect( QRectF& rectToResize, const QRectF& boundsBefore, const QRectF& boundsAfter );
/**Returns a scaled position given a before and after range*/
static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );
static double relativePosition( double position, double beforeMin, double beforeMax, double afterMin, double afterMax );

public slots:
/**Casts object to the proper subclass type and calls corresponding itemAdded signal*/
@@ -119,7 +119,7 @@ void QgsRelationManagerDialog::on_mBtnAddRelation_clicked()
void QgsRelationManagerDialog::on_mBtnRemoveRelation_clicked()
{
if ( mRelationsTable->currentIndex().isValid() )
mRelationsTable->removeRow( mRelationsTable->currentItem()->row() );
mRelationsTable->removeRow( mRelationsTable->currentItem()->row() );
}

QList< QgsRelation > QgsRelationManagerDialog::relations()
@@ -69,15 +69,15 @@ void TestQgsComposerEffects::initTestCase()
void TestQgsComposerEffects::cleanupTestCase()
{
delete mComposition;

QString myReportFile = QDir::tempPath() + QDir::separator() + "qgistest.html";
QFile myFile( myReportFile );
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
{
QTextStream myQTextStream( &myFile );
myQTextStream << mReport;
myFile.close();
}
}
}

void TestQgsComposerEffects::init()
@@ -95,7 +95,7 @@ void TestQgsComposerEffects::blend_modes()
mComposerRect2->setBlendMode( QPainter::CompositionMode_Multiply );

QgsCompositionChecker checker( "composereffects_blend", mComposition );
QVERIFY( checker.testComposition( mReport) );
QVERIFY( checker.testComposition( mReport ) );
// reset blending
mComposerRect2->setBlendMode( QPainter::CompositionMode_SourceOver );
}
@@ -40,7 +40,7 @@ class TestQgsComposerShapes: public QObject
private:
QgsComposition* mComposition;
QgsComposerShape* mComposerShape;
QString mReport;
QString mReport;
};

void TestQgsComposerShapes::initTestCase()
@@ -54,22 +54,22 @@ void TestQgsComposerShapes::initTestCase()
mComposerShape = new QgsComposerShape( 20, 20, 150, 100, mComposition );
mComposerShape->setBackgroundColor( QColor::fromRgb( 255, 150, 0 ) );
mComposition->addComposerShape( mComposerShape );
mReport = "<h1>Composer Shape Tests</h1>\n";

mReport = "<h1>Composer Shape Tests</h1>\n";
}

void TestQgsComposerShapes::cleanupTestCase()
{
delete mComposition;

QString myReportFile = QDir::tempPath() + QDir::separator() + "qgistest.html";
QFile myFile( myReportFile );
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
{
QTextStream myQTextStream( &myFile );
myQTextStream << mReport;
myFile.close();
}
}
}

void TestQgsComposerShapes::init()

0 comments on commit a152312

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