File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,15 @@ void QgsFeature::setValid( bool validity )
158
158
mValid = validity;
159
159
}
160
160
161
+ void QgsFeature::initAttributes ( int fieldCount )
162
+ {
163
+ mAttributes .resize ( fieldCount );
164
+ QVariant* ptr = mAttributes .data ();
165
+ for ( int i = 0 ; i < fieldCount; ++i, ++ptr )
166
+ ptr->clear ();
167
+ }
168
+
169
+
161
170
bool QgsFeature::setAttribute ( const QString& name, QVariant value )
162
171
{
163
172
int fieldIdx = fieldNameIndex ( name );
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ class CORE_EXPORT QgsFeature
141
141
QgsAttributes& attributes () { return mAttributes ; }
142
142
void setAttributes ( const QgsAttributes& attrs ) { mAttributes = attrs; }
143
143
void setAttribute ( int field, const QVariant& attr ) { mAttributes [field] = attr; }
144
- void initAttributes ( int fieldCount ) { mAttributes . resize ( fieldCount ); for ( int i = 0 ;i < fieldCount;++i ) mAttributes [i]. clear (); }
144
+ void initAttributes ( int fieldCount );
145
145
146
146
/* *Deletes an attribute and its value*/
147
147
void deleteAttribute ( int field );
You can’t perform that action at this time.
0 commit comments