Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Oct 1, 2012
1 parent 8a1953b commit 86a56b6a24d18dce36548a1488e9dbb20be0d8fb
@@ -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 );
@@ -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 )
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;
@@ -3946,10 +3946,10 @@ QString QgsGeometry::exportToWkt()
{
mWkt += "POINT(";
x = ( double * )( mGeometry + 5 );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
mWkt += " ";
y = ( double * )( mGeometry + 5 + sizeof( double ) );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
mWkt += ")";
return mWkt;
}
@@ -3975,11 +3975,11 @@ QString QgsGeometry::exportToWkt()
mWkt += ", ";
}
x = ( double * ) ptr;
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
mWkt += " ";
ptr += sizeof( double );
y = ( double * ) ptr;
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
if ( hasZValue )
{
@@ -4030,11 +4030,11 @@ QString QgsGeometry::exportToWkt()
mWkt += ",";
}
x = ( double * ) ptr;
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
mWkt += " ";
ptr += sizeof( double );
y = ( double * ) ptr;
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
if ( hasZValue )
{
@@ -4068,11 +4068,11 @@ QString QgsGeometry::exportToWkt()
mWkt += ", ";
}
x = ( double * )( ptr );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
mWkt += " ";
ptr += sizeof( double );
y = ( double * )( ptr );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
if ( hasZValue )
{
@@ -4112,11 +4112,11 @@ QString QgsGeometry::exportToWkt()
mWkt += ", ";
}
x = ( double * ) ptr;
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
mWkt += " ";
y = ( double * ) ptr;
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
if ( hasZValue )
{
@@ -4168,11 +4168,11 @@ QString QgsGeometry::exportToWkt()
mWkt += ",";
}
x = ( double * ) ptr;
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
mWkt += " ";
y = ( double * ) ptr;
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
if ( hasZValue )
{
@@ -4226,10 +4226,10 @@ QString QgsGeometry::exportToGeoJSON()
{
mWkt += "{ \"type\": \"Point\", \"coordinates\": [";
x = ( double * )( mGeometry + 5 );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
mWkt += ", ";
y = ( double * )( mGeometry + 5 + sizeof( double ) );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
mWkt += "] }";
return mWkt;
}
@@ -4256,11 +4256,11 @@ QString QgsGeometry::exportToGeoJSON()
}
mWkt += "[";
x = ( double * ) ptr;
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
mWkt += ", ";
ptr += sizeof( double );
y = ( double * ) ptr;
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
if ( hasZValue )
{
@@ -4313,11 +4313,11 @@ QString QgsGeometry::exportToGeoJSON()
}
mWkt += "[";
x = ( double * ) ptr;
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
mWkt += ", ";
ptr += sizeof( double );
y = ( double * ) ptr;
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
if ( hasZValue )
{
@@ -4353,11 +4353,11 @@ QString QgsGeometry::exportToGeoJSON()
}
mWkt += "[";
x = ( double * )( ptr );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
mWkt += ", ";
ptr += sizeof( double );
y = ( double * )( ptr );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
if ( hasZValue )
{
@@ -4399,11 +4399,11 @@ QString QgsGeometry::exportToGeoJSON()
}
mWkt += "[";
x = ( double * ) ptr;
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
mWkt += ", ";
y = ( double * ) ptr;
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
if ( hasZValue )
{
@@ -4457,11 +4457,11 @@ QString QgsGeometry::exportToGeoJSON()
}
mWkt += "[";
x = ( double * ) ptr;
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *x, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
mWkt += ", ";
y = ( double * ) ptr;
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
mWkt += QString::number( *y, 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
ptr += sizeof( double );
if ( hasZValue )
{
@@ -442,10 +442,10 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
if ( bboxOk )
searchRect.set( minx, miny, maxx, maxy );
else
searchRect.set( searchRect.xMinimum()-0.000001
, searchRect.yMinimum()-0.000001
, searchRect.xMaximum()+0.000001
, searchRect.yMaximum()+0.000001 );
searchRect.set( searchRect.xMinimum() - 0.000001
, searchRect.yMinimum() - 0.000001
, searchRect.xMaximum() + 0.000001
, searchRect.yMaximum() + 0.000001 );
QgsCoordinateReferenceSystem layerCrs = layer->crs();

startGetFeature( request, format, layerCrs, &searchRect );
@@ -516,7 +516,7 @@ void QgsWFSServer::startGetFeature( QgsRequestHandler& request, const QString& f
if ( format == "GeoJSON" )
{
fcString = "{\"type\": \"FeatureCollection\",\n";
fcString += " \"bbox\": [ " + QString::number( rect->xMinimum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( rect->yMinimum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( rect->xMaximum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( rect->yMaximum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + "],\n";
fcString += " \"bbox\": [ " + QString::number( rect->xMinimum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( rect->yMinimum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( rect->xMaximum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( rect->yMaximum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + "],\n";
fcString += " \"features\": [\n";
result = fcString.toUtf8();
request.startGetFeatureResponse( &result, format );
@@ -696,7 +696,7 @@ QString QgsWFSServer::createFeatureGeoJSON( QgsFeature* feat, QgsCoordinateRefer
{
QgsRectangle box = geom->boundingBox();

fStr += " \"bbox\": [ " + QString::number( box.xMinimum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( box.yMinimum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( box.xMaximum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + ", " + QString::number( box.yMaximum(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") ) + "],\n";
fStr += " \"bbox\": [ " + QString::number( box.xMinimum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( box.yMinimum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( box.xMaximum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + ", " + QString::number( box.yMaximum(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) ) + "],\n";

fStr += " \"geometry\": ";
fStr += geom->exportToGeoJSON();
@@ -1025,9 +1025,9 @@ QDomElement QgsWFSServer::createCoordinateElem( const QVector<QgsPoint> points,
{
coordString += " ";
}
coordString += QString::number( pointIt->x(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
coordString += QString::number( pointIt->x(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
coordString += ",";
coordString += QString::number( pointIt->y(), 'f', 6 ).remove( QRegExp("[0]{1,5}$") );
coordString += QString::number( pointIt->y(), 'f', 6 ).remove( QRegExp( "[0]{1,5}$" ) );
}

QDomText coordText = doc.createTextNode( coordString );
@@ -1377,7 +1377,7 @@ QString QgsGdalProvider::buildPyramids( QList<QgsRasterPyramid> const & theRaste
}

// are we using Erdas Imagine external overviews?
char* myConfigUseRRD = strdup(CPLGetConfigOption( "USE_RRD", "NO" ));
char* myConfigUseRRD = strdup( CPLGetConfigOption( "USE_RRD", "NO" ) );
if ( theFormat == PyramidsErdas )
CPLSetConfigOption( "USE_RRD", "YES" );
else
@@ -1471,7 +1471,7 @@ QString QgsGdalProvider::buildPyramids( QList<QgsRasterPyramid> const & theRaste
//emit drawingProgress( 0, 0 );
// restore former USE_RRD config (Erdas)
CPLSetConfigOption( "USE_RRD", myConfigUseRRD );
free(myConfigUseRRD);
free( myConfigUseRRD );
return "FAILED_NOT_SUPPORTED";
}
else
@@ -1488,7 +1488,7 @@ QString QgsGdalProvider::buildPyramids( QList<QgsRasterPyramid> const & theRaste

// restore former USE_RRD config (Erdas)
CPLSetConfigOption( "USE_RRD", myConfigUseRRD );
free(myConfigUseRRD);
free( myConfigUseRRD );

QgsDebugMsg( "Pyramid overviews built" );

0 comments on commit 86a56b6

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