Skip to content
Permalink
Browse files

fix atlas composition warnings with msvc 64bit

  • Loading branch information
jef-n committed Sep 5, 2013
1 parent 135ef36 commit 618b58b05d981e78d7c1fb22ca2a25d2c6fcf2d6
@@ -750,7 +750,7 @@ void QgsComposer::on_mActionExportAsPDF_triggered()
QProgressDialog progress( tr( "Rendering maps..." ), tr( "Abort" ), 0, atlasMap->numFeatures(), this );
QApplication::setOverrideCursor( Qt::BusyCursor );

for ( size_t featureI = 0; featureI < atlasMap->numFeatures(); ++featureI )
for ( int featureI = 0; featureI < atlasMap->numFeatures(); ++featureI )
{
progress.setValue( featureI );
// process input events in order to allow aborting
@@ -880,7 +880,7 @@ void QgsComposer::on_mActionPrint_triggered()
}
QProgressDialog progress( tr( "Rendering maps..." ), tr( "Abort" ), 0, atlasMap->numFeatures(), this );

for ( size_t i = 0; i < atlasMap->numFeatures(); ++i )
for ( int i = 0; i < atlasMap->numFeatures(); ++i )
{
progress.setValue( i );
// process input events in order to allow cancelling
@@ -1095,7 +1095,7 @@ void QgsComposer::on_mActionExportAsImage_triggered()

QProgressDialog progress( tr( "Rendering maps..." ), tr( "Abort" ), 0, atlasMap->numFeatures(), this );

for ( size_t feature = 0; feature < atlasMap->numFeatures(); ++feature )
for ( int feature = 0; feature < atlasMap->numFeatures(); ++feature )
{
progress.setValue( feature );
// process input events in order to allow cancelling
@@ -1246,7 +1246,7 @@ void QgsComposer::on_mActionExportAsSVG_triggered()

mView->setPaintingEnabled( false );

size_t featureI = 0;
int featureI = 0;
if ( hasAnAtlas )
{
try
@@ -153,7 +153,7 @@ void QgsAtlasComposition::beginRender()

if ( mSortFeatures )
{
mFeatureKeys.insert( std::make_pair( feat.id(), feat.attributes()[ mSortKeyAttributeIdx ] ) );
mFeatureKeys.insert( feat.id(), feat.attributes()[ mSortKeyAttributeIdx ] );
}
}

@@ -211,12 +211,12 @@ void QgsAtlasComposition::endRender()
mComposerMap->setNewExtent( mOrigExtent );
}

size_t QgsAtlasComposition::numFeatures() const
int QgsAtlasComposition::numFeatures() const
{
return mFeatureIds.size();
}

void QgsAtlasComposition::prepareForFeature( size_t featureI )
void QgsAtlasComposition::prepareForFeature( int featureI )
{
if ( !mComposerMap || !mCoverageLayer )
{
@@ -78,19 +78,19 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
QString featureFilter() const { return mFeatureFilter; }
void setFeatureFilter( const QString& expression ) { mFeatureFilter = expression; }

size_t sortKeyAttributeIndex() const { return mSortKeyAttributeIdx; }
void setSortKeyAttributeIndex( size_t idx ) { mSortKeyAttributeIdx = idx; }
int sortKeyAttributeIndex() const { return mSortKeyAttributeIdx; }
void setSortKeyAttributeIndex( int idx ) { mSortKeyAttributeIdx = idx; }

/** Begins the rendering. */
void beginRender();
/** Ends the rendering. Restores original extent */
void endRender();

/** Returns the number of features in the coverage layer */
size_t numFeatures() const;
int numFeatures() const;

/** Prepare the atlas map for the given feature. Sets the extent and context variables */
void prepareForFeature( size_t i );
void prepareForFeature( int i );

/** Returns the current filename. Must be called after prepareForFeature( i ) */
const QString& currentFilename() const;
@@ -123,12 +123,12 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
// sort direction
bool mSortAscending;
public:
typedef std::map< QgsFeatureId, QVariant > SorterKeys;
typedef QMap< QgsFeatureId, QVariant > SorterKeys;
private:
// value of field that is used for ordering of features
SorterKeys mFeatureKeys;
// key (attribute index) used for ordering
size_t mSortKeyAttributeIdx;
int mSortKeyAttributeIdx;

// feature filtering
bool mFilterFeatures;
@@ -153,7 +153,7 @@ void TestQgsAtlasComposition::filename()
{
mAtlas->setFilenamePattern( "'output_' || $feature" );
mAtlas->beginRender();
for ( size_t fi = 0; fi < mAtlas->numFeatures(); ++fi )
for ( int fi = 0; fi < mAtlas->numFeatures(); ++fi )
{
mAtlas->prepareForFeature( fi );
QString expected = QString( "output_%1" ).arg(( int )( fi + 1 ) );
@@ -170,7 +170,7 @@ void TestQgsAtlasComposition::autoscale_render()

mAtlas->beginRender();

for ( size_t fit = 0; fit < 2; ++fit )
for ( int fit = 0; fit < 2; ++fit )
{
mAtlas->prepareForFeature( fit );
mLabel1->adjustSizeToText();
@@ -191,7 +191,7 @@ void TestQgsAtlasComposition::fixedscale_render()

mAtlas->beginRender();

for ( size_t fit = 0; fit < 2; ++fit )
for ( int fit = 0; fit < 2; ++fit )
{
mAtlas->prepareForFeature( fit );
mLabel1->adjustSizeToText();
@@ -214,7 +214,7 @@ void TestQgsAtlasComposition::hiding_render()

mAtlas->beginRender();

for ( size_t fit = 0; fit < 2; ++fit )
for ( int fit = 0; fit < 2; ++fit )
{
mAtlas->prepareForFeature( fit );
mLabel1->adjustSizeToText();
@@ -240,7 +240,7 @@ void TestQgsAtlasComposition::sorting_render()

mAtlas->beginRender();

for ( size_t fit = 0; fit < 2; ++fit )
for ( int fit = 0; fit < 2; ++fit )
{
mAtlas->prepareForFeature( fit );
mLabel1->adjustSizeToText();
@@ -267,7 +267,7 @@ void TestQgsAtlasComposition::filtering_render()

mAtlas->beginRender();

for ( size_t fit = 0; fit < 1; ++fit )
for ( int fit = 0; fit < 1; ++fit )
{
mAtlas->prepareForFeature( fit );
mLabel1->adjustSizeToText();

0 comments on commit 618b58b

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