Skip to content
Permalink
Browse files

Revert "indentation update"

This reverts commit 7dd58aa.
  • Loading branch information
timlinux committed Oct 1, 2012
1 parent 4b263d6 commit af0782d7d540ee8f270ccb4775196b1827969c06

Large diffs are not rendered by default.

@@ -102,7 +102,7 @@ void QgsComposerLabelWidget::on_mFontColorButton_clicked()

void QgsComposerLabelWidget::on_mInsertExpressionButton_clicked()
{
if ( !mComposerLabel )
if ( !mComposerLabel)
{
return;
}
@@ -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 );
@@ -438,7 +438,7 @@ void QgsComposerMapWidget::updateGuiElements()
{
mIsAtlasCheckBox->setCheckState( Qt::Unchecked );
}

blockAllSignals( false );
}
}
@@ -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 );
@@ -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() ) );
}
}

@@ -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 );
}

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

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

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

void QgsComposerMapWidget::on_mAtlasSingleFileCheckBox_stateChanged( int state )
{
if ( !mComposerMap )
if (!mComposerMap)
{
return;
}
@@ -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 );
@@ -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 );
@@ -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 );
}

@@ -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 ) );
@@ -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;
@@ -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();
@@ -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 );
@@ -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();
@@ -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 );
@@ -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 );
@@ -919,7 +919,7 @@ void QgsCoordinateReferenceSystem::setProj4String( QString theProj4String )
#endif

setlocale( LC_NUMERIC, oldlocale );
free( oldlocale );
free(oldlocale);
}
void QgsCoordinateReferenceSystem::setGeographicFlag( bool theGeoFlag )
{
@@ -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;
@@ -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;
@@ -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 );
}

@@ -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" ) )
;
}
@@ -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;
}
@@ -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() );
@@ -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 )

0 comments on commit af0782d

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