Skip to content

Commit

Permalink
fix atlas composition warnings with msvc 64bit
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 5, 2013
1 parent 135ef36 commit 618b58b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1246,7 +1246,7 @@ void QgsComposer::on_mActionExportAsSVG_triggered()

mView->setPaintingEnabled( false );

size_t featureI = 0;
int featureI = 0;
if ( hasAnAtlas )
{
try
Expand Down
6 changes: 3 additions & 3 deletions src/core/composer/qgsatlascomposition.cpp
Expand Up @@ -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 ] );
}
}

Expand Down Expand Up @@ -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 )
{
Expand Down
12 changes: 6 additions & 6 deletions src/core/composer/qgsatlascomposition.h
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions tests/src/core/testqgsatlascomposition.cpp
Expand Up @@ -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 ) );
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 618b58b

Please sign in to comment.