@@ -113,7 +113,7 @@ QgsProperty *findKey_( QString const &scope,
113
113
{
114
114
if ( nextProperty->isKey () )
115
115
{
116
- currentProperty = dynamic_cast <QgsPropertyKey*>( nextProperty );
116
+ currentProperty = static_cast <QgsPropertyKey*>( nextProperty );
117
117
}
118
118
else if ( nextProperty->isValue () && 1 == keySequence.count () )
119
119
{
@@ -164,7 +164,8 @@ QgsProperty *addKey_( QString const &scope,
164
164
165
165
// cursor through property key/value hierarchy
166
166
QgsPropertyKey *currentProperty = rootProperty;
167
- QgsProperty *newProperty; // link to next property down hiearchy
167
+ QgsProperty *nextProperty; // link to next property down hiearchy
168
+ QgsPropertyKey* newPropertyKey;
168
169
169
170
while ( ! keySequence.isEmpty () )
170
171
{
@@ -190,9 +191,9 @@ QgsProperty *addKey_( QString const &scope,
190
191
191
192
return currentProperty;
192
193
}
193
- else if (( newProperty = currentProperty->find ( keySequence.first () ) ) )
194
+ else if ( nextProperty = currentProperty->find ( keySequence.first () ) )
194
195
{
195
- currentProperty = dynamic_cast <QgsPropertyKey*>( newProperty );
196
+ currentProperty = dynamic_cast <QgsPropertyKey*>( nextProperty );
196
197
197
198
if ( currentProperty )
198
199
{
@@ -205,11 +206,9 @@ QgsProperty *addKey_( QString const &scope,
205
206
}
206
207
else // the next subkey doesn't exist, so add it
207
208
{
208
- newProperty = currentProperty->addKey ( keySequence.first () );
209
-
210
- if ( newProperty )
209
+ if ( newPropertyKey = currentProperty->addKey ( keySequence.first () ) )
211
210
{
212
- currentProperty = dynamic_cast <QgsPropertyKey*>( newProperty ) ;
211
+ currentProperty = newPropertyKey ;
213
212
}
214
213
continue ;
215
214
}
0 commit comments