Skip to content

Commit

Permalink
Fix some failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 23, 2017
1 parent f1b2940 commit 17d4d3a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/core/qgspropertycollection.cpp
Expand Up @@ -222,17 +222,16 @@ void QgsPropertyCollection::rescan() const
QHash<int, QgsProperty>::const_iterator it = mProperties.constBegin();
for ( ; it != mProperties.constEnd(); ++it )
{
if ( it.value() )
mCount++;
if ( it.value().isActive() )
{
mHasActiveProperties = true;
if ( it.value().propertyType() != QgsProperty::StaticProperty )
{
mHasDynamicProperties = true;
break;
}
}
if ( it.value() )
mCount++;
}
}
mDirty = false;
Expand Down
2 changes: 2 additions & 0 deletions src/core/symbology-ng/qgsfillsymbollayer.cpp
Expand Up @@ -2818,6 +2818,7 @@ QgsLinePatternFillSymbolLayer* QgsLinePatternFillSymbolLayer::clone() const
clonedLayer->setSubSymbol( mFillLineSymbol->clone() );
}
copyPaintEffect( clonedLayer );
copyDataDefinedProperties( clonedLayer );
return clonedLayer;
}

Expand Down Expand Up @@ -3227,6 +3228,7 @@ QgsPointPatternFillSymbolLayer* QgsPointPatternFillSymbolLayer::clone() const
{
clonedLayer->setSubSymbol( mMarkerSymbol->clone() );
}
copyDataDefinedProperties( clonedLayer );
copyPaintEffect( clonedLayer );
return clonedLayer;
}
Expand Down
1 change: 1 addition & 0 deletions src/core/symbology-ng/qgsmarkersymbollayer.cpp
Expand Up @@ -1596,6 +1596,7 @@ QgsFilledMarkerSymbolLayer *QgsFilledMarkerSymbolLayer::clone() const
{
QgsFilledMarkerSymbolLayer* m = static_cast< QgsFilledMarkerSymbolLayer* >( QgsFilledMarkerSymbolLayer::create( properties() ) );
copyPaintEffect( m );
copyDataDefinedProperties( m );
m->setSubSymbol( mFill->clone() );
return m;
}
Expand Down
1 change: 1 addition & 0 deletions tests/src/core/testqgscomposerscalebar.cpp
Expand Up @@ -210,6 +210,7 @@ void TestQgsComposerScaleBar::dataDefined()
QCOMPARE( mComposerScaleBar->pen().color().name(), QColor( 255, 255, 0 ).name() );
QCOMPARE( mComposerScaleBar->pen().widthF(), 1.2 );
mComposerScaleBar->setDataDefinedProperties( QgsPropertyCollection() );
mComposerScaleBar->setLineWidth( 1.0 );
}

QGSTEST_MAIN( TestQgsComposerScaleBar )
Expand Down
3 changes: 2 additions & 1 deletion tests/src/core/testqgsproperty.cpp
Expand Up @@ -890,6 +890,7 @@ void TestQgsProperty::propertyCollection()
collection.setProperty( Property2, QgsProperty::fromValue( "v2", false ) );
collection.setProperty( Property3, QgsProperty::fromField( "field1", true ) );
collection.setProperty( Property4, QgsProperty::fromExpression( "\"field1\" + \"field2\"", true ) );
QCOMPARE( collection.count(), 4 );

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

//now add a property to the collection
QgsProperty property = QgsProperty::fromValue( "value", true );
collection->setProperty( Property1, property );
stack.at( 0 )->setProperty( Property1, property );
QVERIFY( stack.isActive( Property1 ) );
QCOMPARE( stack.property( Property1 ).value( context ), property.value( context ) );
QCOMPARE( stack.value( Property1, context ), property.value( context ) );
Expand Down

0 comments on commit 17d4d3a

Please sign in to comment.