Skip to content

Commit 17d4d3a

Browse files
committed
Fix some failing tests
1 parent f1b2940 commit 17d4d3a

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎src/core/qgspropertycollection.cpp‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,16 @@ void QgsPropertyCollection::rescan() const
222222
QHash<int, QgsProperty>::const_iterator it = mProperties.constBegin();
223223
for ( ; it != mProperties.constEnd(); ++it )
224224
{
225+
if ( it.value() )
226+
mCount++;
225227
if ( it.value().isActive() )
226228
{
227229
mHasActiveProperties = true;
228230
if ( it.value().propertyType() != QgsProperty::StaticProperty )
229231
{
230232
mHasDynamicProperties = true;
231-
break;
232233
}
233234
}
234-
if ( it.value() )
235-
mCount++;
236235
}
237236
}
238237
mDirty = false;

‎src/core/symbology-ng/qgsfillsymbollayer.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,6 +2818,7 @@ QgsLinePatternFillSymbolLayer* QgsLinePatternFillSymbolLayer::clone() const
28182818
clonedLayer->setSubSymbol( mFillLineSymbol->clone() );
28192819
}
28202820
copyPaintEffect( clonedLayer );
2821+
copyDataDefinedProperties( clonedLayer );
28212822
return clonedLayer;
28222823
}
28232824

@@ -3227,6 +3228,7 @@ QgsPointPatternFillSymbolLayer* QgsPointPatternFillSymbolLayer::clone() const
32273228
{
32283229
clonedLayer->setSubSymbol( mMarkerSymbol->clone() );
32293230
}
3231+
copyDataDefinedProperties( clonedLayer );
32303232
copyPaintEffect( clonedLayer );
32313233
return clonedLayer;
32323234
}

‎src/core/symbology-ng/qgsmarkersymbollayer.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,7 @@ QgsFilledMarkerSymbolLayer *QgsFilledMarkerSymbolLayer::clone() const
15961596
{
15971597
QgsFilledMarkerSymbolLayer* m = static_cast< QgsFilledMarkerSymbolLayer* >( QgsFilledMarkerSymbolLayer::create( properties() ) );
15981598
copyPaintEffect( m );
1599+
copyDataDefinedProperties( m );
15991600
m->setSubSymbol( mFill->clone() );
16001601
return m;
16011602
}

‎tests/src/core/testqgscomposerscalebar.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ void TestQgsComposerScaleBar::dataDefined()
210210
QCOMPARE( mComposerScaleBar->pen().color().name(), QColor( 255, 255, 0 ).name() );
211211
QCOMPARE( mComposerScaleBar->pen().widthF(), 1.2 );
212212
mComposerScaleBar->setDataDefinedProperties( QgsPropertyCollection() );
213+
mComposerScaleBar->setLineWidth( 1.0 );
213214
}
214215

215216
QGSTEST_MAIN( TestQgsComposerScaleBar )

‎tests/src/core/testqgsproperty.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,7 @@ void TestQgsProperty::propertyCollection()
890890
collection.setProperty( Property2, QgsProperty::fromValue( "v2", false ) );
891891
collection.setProperty( Property3, QgsProperty::fromField( "field1", true ) );
892892
collection.setProperty( Property4, QgsProperty::fromExpression( "\"field1\" + \"field2\"", true ) );
893+
QCOMPARE( collection.count(), 4 );
893894

894895
// test referenced fields
895896
QCOMPARE( collection.referencedFields( context ).count(), 2 );
@@ -1041,7 +1042,7 @@ void TestQgsProperty::collectionStack()
10411042

10421043
//now add a property to the collection
10431044
QgsProperty property = QgsProperty::fromValue( "value", true );
1044-
collection->setProperty( Property1, property );
1045+
stack.at( 0 )->setProperty( Property1, property );
10451046
QVERIFY( stack.isActive( Property1 ) );
10461047
QCOMPARE( stack.property( Property1 ).value( context ), property.value( context ) );
10471048
QCOMPARE( stack.value( Property1, context ), property.value( context ) );

0 commit comments

Comments
 (0)