Skip to content

Commit

Permalink
Revert "indentation update"
Browse files Browse the repository at this point in the history
This reverts commit 7dd58aa.
  • Loading branch information
timlinux committed Oct 1, 2012
1 parent 4b263d6 commit af0782d
Show file tree
Hide file tree
Showing 17 changed files with 308 additions and 310 deletions.
262 changes: 130 additions & 132 deletions src/app/composer/qgscomposer.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/app/composer/qgscomposerlabelwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void QgsComposerLabelWidget::on_mFontColorButton_clicked()

void QgsComposerLabelWidget::on_mInsertExpressionButton_clicked()
{
if ( !mComposerLabel )
if ( !mComposerLabel)
{
return;
}
Expand Down
34 changes: 17 additions & 17 deletions src/app/composer/qgscomposermapwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,13 @@ void QgsComposerMapWidget::updateGuiElements()
{
mIsAtlasCheckBox->setCheckState( Qt::Checked );

int idx = mAtlasCoverageLayerComboBox->findData( qVariantFromValue(( void* )mComposerMap->atlasCoverageLayer() ) );
int idx = mAtlasCoverageLayerComboBox->findData( qVariantFromValue( (void*)mComposerMap->atlasCoverageLayer() ));
if ( idx != -1 )
{
mAtlasCoverageLayerComboBox->setCurrentIndex( idx );
mAtlasCoverageLayerComboBox->setCurrentIndex( idx );
}

mAtlasMarginSpinBox->setValue( static_cast<int>( mComposerMap->atlasMargin() * 100 ) );
mAtlasMarginSpinBox->setValue( static_cast<int>(mComposerMap->atlasMargin() * 100) );
mAtlasFilenamePatternEdit->setText( mComposerMap->atlasFilenamePattern() );
mAtlasFixedScaleCheckBox->setCheckState( mComposerMap->atlasFixedScale() ? Qt::Checked : Qt::Unchecked );
mAtlasHideCoverageCheckBox->setCheckState( mComposerMap->atlasHideCoverage() ? Qt::Checked : Qt::Unchecked );
Expand All @@ -438,7 +438,7 @@ void QgsComposerMapWidget::updateGuiElements()
{
mIsAtlasCheckBox->setCheckState( Qt::Unchecked );
}

blockAllSignals( false );
}
}
Expand Down Expand Up @@ -940,14 +940,14 @@ void QgsComposerMapWidget::on_mIsAtlasCheckBox_stateChanged( int state )
if ( composition->atlasMap() != 0 && composition->atlasMap() != mComposerMap )
{
QMessageBox msgBox;
msgBox.setText( tr( "An atlas map already exists." ) );
msgBox.setInformativeText( "Are you sure to define this map as the new atlas map ?" );
msgBox.setStandardButtons( QMessageBox::Yes | QMessageBox::No );
msgBox.setDefaultButton( QMessageBox::No );
msgBox.setText(tr("An atlas map already exists."));
msgBox.setInformativeText("Are you sure to define this map as the new atlas map ?");
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No );
msgBox.setDefaultButton(QMessageBox::No);
if ( msgBox.exec() != QMessageBox::Yes )
{
mIsAtlasCheckBox->setCheckState( Qt::Unchecked );
return;
mIsAtlasCheckBox->setCheckState( Qt::Unchecked );
return;
}
}
composition->setAtlasMap( mComposerMap );
Expand All @@ -959,9 +959,9 @@ void QgsComposerMapWidget::on_mIsAtlasCheckBox_stateChanged( int state )
for ( QMap<QString, QgsMapLayer*>::const_iterator it = layers.begin(); it != layers.end(); ++it )
{
// Only consider vector layers
if ( dynamic_cast<QgsVectorLayer*>( it.value() ) )
if ( dynamic_cast<QgsVectorLayer*>(it.value()) )
{
mAtlasCoverageLayerComboBox->insertItem( idx++, it.key(), /* userdata */ qVariantFromValue(( void* )it.value() ) );
mAtlasCoverageLayerComboBox->insertItem( idx++, it.key(), /* userdata */ qVariantFromValue( (void*)it.value() ) );
}
}

Expand All @@ -987,7 +987,7 @@ void QgsComposerMapWidget::on_mAtlasCoverageLayerComboBox_currentIndexChanged( i
return;
}

QgsVectorLayer* layer = reinterpret_cast<QgsVectorLayer*>( mAtlasCoverageLayerComboBox->itemData( index ).value<void*>() );
QgsVectorLayer* layer = reinterpret_cast<QgsVectorLayer*>(mAtlasCoverageLayerComboBox->itemData( index ).value<void*>());
mComposerMap->setAtlasCoverageLayer( layer );
}

Expand Down Expand Up @@ -1026,7 +1026,7 @@ void QgsComposerMapWidget::on_mAtlasFilenameExpressionButton_clicked()

void QgsComposerMapWidget::on_mAtlasHideCoverageCheckBox_stateChanged( int state )
{
if ( !mComposerMap )
if (!mComposerMap)
{
return;
}
Expand All @@ -1035,7 +1035,7 @@ void QgsComposerMapWidget::on_mAtlasHideCoverageCheckBox_stateChanged( int state

void QgsComposerMapWidget::on_mAtlasFixedScaleCheckBox_stateChanged( int state )
{
if ( !mComposerMap )
if (!mComposerMap)
{
return;
}
Expand All @@ -1054,7 +1054,7 @@ void QgsComposerMapWidget::on_mAtlasFixedScaleCheckBox_stateChanged( int state )

void QgsComposerMapWidget::on_mAtlasSingleFileCheckBox_stateChanged( int state )
{
if ( !mComposerMap )
if (!mComposerMap)
{
return;
}
Expand Down
12 changes: 6 additions & 6 deletions src/core/composer/qgscomposerhtml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ void QgsComposerHtml::setUrl( const QUrl& url )
qApp->processEvents();
}

if ( frameCount() < 1 ) return;
if ( frameCount() < 1) return;
//QSize contentsSize = mWebPage->mainFrame()->contentsSize();

QRectF contentRect = this->mFrameItems.at( 0 )->boundingRect();
QRectF contentRect = this->mFrameItems.at(0)->boundingRect();
//there is going to be a little rounding error converting from float to int
QSize contentsSize = QSize(( int )( contentRect.width() * mHtmlUnitsToMM ),
( int )( contentRect.height() * mHtmlUnitsToMM ) );
QSize contentsSize = QSize( (int)(contentRect.width() * mHtmlUnitsToMM),
(int)(contentRect.height() * mHtmlUnitsToMM));
mWebPage->setViewportSize( contentsSize );

//suppress scroll bars always
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
mWebPage->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
mWebPage->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);

mSize.setWidth( contentsSize.width() / mHtmlUnitsToMM );
mSize.setHeight( contentsSize.height() / mHtmlUnitsToMM );
Expand Down
14 changes: 7 additions & 7 deletions src/core/composer/qgscomposerlabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <QPainter>

QgsComposerLabel::QgsComposerLabel( QgsComposition *composition ):
QgsComposerItem( composition ), mMargin( 1.0 ), mFontColor( QColor( 0, 0, 0 ) ),
mHAlignment( Qt::AlignLeft ), mVAlignment( Qt::AlignTop ),
mExpressionFeature( 0 ), mExpressionLayer( 0 )
QgsComposerItem( composition ), mMargin( 1.0 ), mFontColor( QColor( 0, 0, 0 ) ),
mHAlignment( Qt::AlignLeft ), mVAlignment( Qt::AlignTop ),
mExpressionFeature( 0 ), mExpressionLayer( 0 )
{
//default font size is 10 point
mFont.setPointSizeF( 10 );
Expand Down Expand Up @@ -90,7 +90,7 @@ QString QgsComposerLabel::displayText() const
QString displayText = mText;
replaceDateText( displayText );
QMap<QString, QVariant> subs = mSubstitutions;
subs[ "$page" ] = QVariant(( int )mComposition->itemPageNumber( this ) + 1 );
subs[ "$page" ] = QVariant((int)mComposition->itemPageNumber( this ) + 1);
return QgsExpression::replaceExpressionText( displayText, mExpressionFeature, mExpressionLayer, &subs );
}

Expand All @@ -105,9 +105,9 @@ void QgsComposerLabel::replaceDateText( QString& text ) const
int openingBracketPos = text.indexOf( "(", currentDatePos );
int closingBracketPos = text.indexOf( ")", openingBracketPos + 1 );
if ( openingBracketPos != -1 &&
closingBracketPos != -1 &&
( closingBracketPos - openingBracketPos ) > 1 &&
openingBracketPos == currentDatePos + constant.size() )
closingBracketPos != -1 &&
( closingBracketPos - openingBracketPos ) > 1 &&
openingBracketPos == currentDatePos + constant.size() )
{
formatText = text.mid( openingBracketPos + 1, closingBracketPos - openingBracketPos - 1 );
text.replace( currentDatePos, closingBracketPos - currentDatePos + 1, QDate::currentDate().toString( formatText ) );
Expand Down
18 changes: 9 additions & 9 deletions src/core/composer/qgscomposermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@

QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int width, int height )
: QgsComposerItem( x, y, width, height, composition ), mKeepLayerSet( false ),
mOverviewFrameMapId( -1 ), mGridEnabled( false ), mGridStyle( Solid ),
mOverviewFrameMapId( -1 ), mGridEnabled( false ), mGridStyle( Solid ),
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ),
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ), mTopGridAnnotationPosition( OutsideMapFrame ),
mBottomGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ), mLeftGridAnnotationDirection( Horizontal ), mRightGridAnnotationDirection( Horizontal ),
mTopGridAnnotationDirection( Horizontal ), mBottomGridAnnotationDirection( Horizontal ), mGridFrameStyle( NoGridFrame ), mGridFrameWidth( 2.0 ),
mCrossLength( 3 ), mMapCanvas( 0 ), mDrawCanvasItems( true ),
mAtlasHideCoverage( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 ), mAtlasFilenamePattern( "'output_'||$feature" ), mAtlasCoverageLayer( 0 ), mAtlasSingleFile( false )
mCrossLength( 3 ), mMapCanvas( 0 ), mDrawCanvasItems( true ),
mAtlasHideCoverage( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 ), mAtlasFilenamePattern("'output_'||$feature"), mAtlasCoverageLayer(0), mAtlasSingleFile( false )
{
mComposition = composition;
mOverviewFrameMapSymbol = 0;
Expand Down Expand Up @@ -86,8 +86,8 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition )
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ), mTopGridAnnotationPosition( OutsideMapFrame ),
mBottomGridAnnotationPosition( OutsideMapFrame ), mAnnotationFrameDistance( 1.0 ), mLeftGridAnnotationDirection( Horizontal ), mRightGridAnnotationDirection( Horizontal ),
mTopGridAnnotationDirection( Horizontal ), mBottomGridAnnotationDirection( Horizontal ), mGridFrameStyle( NoGridFrame ), mGridFrameWidth( 2.0 ), mCrossLength( 3 ),
mMapCanvas( 0 ), mDrawCanvasItems( true ),
mAtlasHideCoverage( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 ), mAtlasFilenamePattern( "'output_'||$feature" ), mAtlasCoverageLayer( 0 ), mAtlasSingleFile( false )
mMapCanvas( 0 ), mDrawCanvasItems( true ),
mAtlasHideCoverage( false ), mAtlasFixedScale( false ), mAtlasMargin( 0.10 ), mAtlasFilenamePattern("'output_'||$feature"), mAtlasCoverageLayer(0), mAtlasSingleFile( false )
{
mOverviewFrameMapSymbol = 0;
createDefaultOverviewFrameSymbol();
Expand Down Expand Up @@ -762,7 +762,7 @@ bool QgsComposerMap::writeXML( QDomElement& elem, QDomDocument & doc ) const
atlasElem.setAttribute( "hideCoverage", mAtlasHideCoverage ? "true" : "false" );
atlasElem.setAttribute( "fixedScale", mAtlasFixedScale ? "true" : "false" );
atlasElem.setAttribute( "singleFile", mAtlasSingleFile ? "true" : "false" );
atlasElem.setAttribute( "margin", QString::number( mAtlasMargin ) );
atlasElem.setAttribute( "margin", QString::number(mAtlasMargin) );
atlasElem.setAttribute( "filenamePattern", mAtlasFilenamePattern );

composerMapElem.appendChild( atlasElem );
Expand Down Expand Up @@ -918,10 +918,10 @@ bool QgsComposerMap::readXML( const QDomElement& itemElem, const QDomDocument& d
QMap<QString, QgsMapLayer*> layers = QgsMapLayerRegistry::instance()->mapLayers();
for ( QMap<QString, QgsMapLayer*>::const_iterator it = layers.begin(); it != layers.end(); ++it )
{
if ( it.key() == atlasElem.attribute( "coverageLayer" ) )
if ( it.key() == atlasElem.attribute("coverageLayer") )
{
mAtlasCoverageLayer = dynamic_cast<QgsVectorLayer*>( it.value() );
break;
mAtlasCoverageLayer = dynamic_cast<QgsVectorLayer*>(it.value());
break;
}
}
mAtlasMargin = atlasElem.attribute( "margin", "0.0" ).toDouble();
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgslegendmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void QgsLegendModel::setLayerSet( const QStringList& layerIds )

QStandardItem* QgsLegendModel::addGroup( QString text, int position )
{
if ( text.isNull() )
if( text.isNull() )
text = tr( "Group" );

QgsComposerGroupItem* groupItem = new QgsComposerGroupItem( text );
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgscoordinatereferencesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,8 +902,8 @@ void QgsCoordinateReferenceSystem::setProj4String( QString theProj4String )
{
char *oldlocale = setlocale( LC_NUMERIC, NULL );
/* the next setlocale() invalides the return of previous setlocale() */
if ( oldlocale != NULL )
oldlocale = strdup( oldlocale );
if (oldlocale != NULL)
oldlocale = strdup(oldlocale);

setlocale( LC_NUMERIC, "C" );
OSRDestroySpatialReference( mCRS );
Expand All @@ -919,7 +919,7 @@ void QgsCoordinateReferenceSystem::setProj4String( QString theProj4String )
#endif

setlocale( LC_NUMERIC, oldlocale );
free( oldlocale );
free(oldlocale);
}
void QgsCoordinateReferenceSystem::setGeographicFlag( bool theGeoFlag )
{
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgscoordinatetransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ void QgsCoordinateTransform::transformInPlace( double& x, double& y, double& z,
}

void QgsCoordinateTransform::transformInPlace(
QVector<double>& x, QVector<double>& y, QVector<double>& z,
TransformDirection direction ) const
QVector<double>& x, QVector<double>& y, QVector<double>& z,
TransformDirection direction ) const
{
if ( mShortCircuit || !mInitialisedFlag )
return;
Expand Down Expand Up @@ -373,8 +373,8 @@ void QgsCoordinateTransform::transformInPlace( float& x, float& y, float& z,
}

void QgsCoordinateTransform::transformInPlace(
QVector<float>& x, QVector<float>& y, QVector<float>& z,
TransformDirection direction ) const
QVector<float>& x, QVector<float>& y, QVector<float>& z,
TransformDirection direction ) const
{
if ( mShortCircuit || !mInitialisedFlag )
return;
Expand Down
10 changes: 5 additions & 5 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ static QVariant fcnFormatNumber( const QVariantList& values, QgsFeature*, QgsExp
static QVariant fcnFormatDate( const QVariantList& values, QgsFeature*, QgsExpression* parent )
{
QDateTime dt = getDateTimeValue( values.at( 0 ), parent );
QString format = getStringValue( values.at( 1 ), parent );
QString format = getStringValue( values.at( 1 ), parent );
return dt.toString( format );
}

Expand Down Expand Up @@ -882,7 +882,7 @@ const QList<QgsExpression::FunctionDef> &QgsExpression::BuiltinFunctions()
<< FunctionDef( "$rownum", 0, fcnRowNumber, QObject::tr( "Record" ) )
<< FunctionDef( "$id", 0, fcnFeatureId, QObject::tr( "Record" ) )
<< FunctionDef( "$scale", 0, fcnScale, QObject::tr( "Record" ) )
// private functions
// private functions
<< FunctionDef( "_specialcol_", 1, fcnSpecialColumn, QObject::tr( "Special" ) )
;
}
Expand Down Expand Up @@ -933,7 +933,7 @@ QList<QgsExpression::FunctionDef> QgsExpression::specialColumns()
QList<FunctionDef> defs;
for ( QMap<QString, QVariant>::const_iterator it = gmSpecialColumns.begin(); it != gmSpecialColumns.end(); ++it )
{
defs << FunctionDef( it.key(), 0, 0, QObject::tr( "Record" ) );
defs << FunctionDef( it.key(), 0, 0, QObject::tr( "Record" ));
}
return defs;
}
Expand Down Expand Up @@ -1126,7 +1126,7 @@ QString QgsExpression::replaceExpressionText( QString action, QgsFeature* feat,
{
QVariant oldValue = QgsExpression::specialColumn( sit.key() );
if ( !oldValue.isNull() )
savedValues.insert( sit.key(), oldValue );
savedValues.insert( sit.key(), oldValue );

// set the new value
QgsExpression::setSpecialColumn( sit.key(), sit.value() );
Expand Down Expand Up @@ -2146,7 +2146,7 @@ QVariant QgsExpression::NodeColumnRef::eval( QgsExpression* /*parent*/, QgsFeatu
{
return f->attributeMap()[mIndex];
}
return QVariant( "[" + mName + "]" );
return QVariant("[" + mName + "]");
}

bool QgsExpression::NodeColumnRef::prepare( QgsExpression* parent, const QgsFieldMap& fields )
Expand Down

0 comments on commit af0782d

Please sign in to comment.