Skip to content

Commit 618b58b

Browse files
committedSep 5, 2013
fix atlas composition warnings with msvc 64bit
1 parent 135ef36 commit 618b58b

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed
 

‎src/app/composer/qgscomposer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ void QgsComposer::on_mActionExportAsPDF_triggered()
750750
QProgressDialog progress( tr( "Rendering maps..." ), tr( "Abort" ), 0, atlasMap->numFeatures(), this );
751751
QApplication::setOverrideCursor( Qt::BusyCursor );
752752

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

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

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

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

12471247
mView->setPaintingEnabled( false );
12481248

1249-
size_t featureI = 0;
1249+
int featureI = 0;
12501250
if ( hasAnAtlas )
12511251
{
12521252
try

‎src/core/composer/qgsatlascomposition.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void QgsAtlasComposition::beginRender()
153153

154154
if ( mSortFeatures )
155155
{
156-
mFeatureKeys.insert( std::make_pair( feat.id(), feat.attributes()[ mSortKeyAttributeIdx ] ) );
156+
mFeatureKeys.insert( feat.id(), feat.attributes()[ mSortKeyAttributeIdx ] );
157157
}
158158
}
159159

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

214-
size_t QgsAtlasComposition::numFeatures() const
214+
int QgsAtlasComposition::numFeatures() const
215215
{
216216
return mFeatureIds.size();
217217
}
218218

219-
void QgsAtlasComposition::prepareForFeature( size_t featureI )
219+
void QgsAtlasComposition::prepareForFeature( int featureI )
220220
{
221221
if ( !mComposerMap || !mCoverageLayer )
222222
{

‎src/core/composer/qgsatlascomposition.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,19 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
7878
QString featureFilter() const { return mFeatureFilter; }
7979
void setFeatureFilter( const QString& expression ) { mFeatureFilter = expression; }
8080

81-
size_t sortKeyAttributeIndex() const { return mSortKeyAttributeIdx; }
82-
void setSortKeyAttributeIndex( size_t idx ) { mSortKeyAttributeIdx = idx; }
81+
int sortKeyAttributeIndex() const { return mSortKeyAttributeIdx; }
82+
void setSortKeyAttributeIndex( int idx ) { mSortKeyAttributeIdx = idx; }
8383

8484
/** Begins the rendering. */
8585
void beginRender();
8686
/** Ends the rendering. Restores original extent */
8787
void endRender();
8888

8989
/** Returns the number of features in the coverage layer */
90-
size_t numFeatures() const;
90+
int numFeatures() const;
9191

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

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

133133
// feature filtering
134134
bool mFilterFeatures;

‎tests/src/core/testqgsatlascomposition.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void TestQgsAtlasComposition::filename()
153153
{
154154
mAtlas->setFilenamePattern( "'output_' || $feature" );
155155
mAtlas->beginRender();
156-
for ( size_t fi = 0; fi < mAtlas->numFeatures(); ++fi )
156+
for ( int fi = 0; fi < mAtlas->numFeatures(); ++fi )
157157
{
158158
mAtlas->prepareForFeature( fi );
159159
QString expected = QString( "output_%1" ).arg(( int )( fi + 1 ) );
@@ -170,7 +170,7 @@ void TestQgsAtlasComposition::autoscale_render()
170170

171171
mAtlas->beginRender();
172172

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

192192
mAtlas->beginRender();
193193

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

215215
mAtlas->beginRender();
216216

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

241241
mAtlas->beginRender();
242242

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

268268
mAtlas->beginRender();
269269

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

0 commit comments

Comments
 (0)
Please sign in to comment.