Fix unit tests and issues with cached layers

This code has been funded by Tuscany Region (Italy) - SITA (CIG: 63526840AE) and commissioned to Gis3W s.a.s.
This commit is contained in:
Martin Dobias 2015-09-18 22:29:11 +08:00
parent d0fcc9557f
commit 6cc1f4c2cb
4 changed files with 5 additions and 1 deletions

View File

@ -203,7 +203,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin
if ( mCache && ml->type() == QgsMapLayer::VectorLayer )
{
QgsVectorLayer* vl = qobject_cast<QgsVectorLayer *>( ml );
if ( vl->isEditable() || ( labelingEngine && labelingEngine->willUseLayer( vl ) ) )
if ( vl->isEditable() || (( labelingEngine || labelingEngine2 ) && QgsPalLabeling::staticWillUseLayer( vl ) ) )
mCache->clearCacheImage( ml->id() );
}

View File

@ -2361,7 +2361,10 @@ void QgsPalLayerSettings::registerObstacleFeature( QgsFeature& f, const QgsRende
try
{
if ( obstacleFeature )
{
*obstacleFeature = new QgsLabelFeature( lbl->strId(), lbl, QSizeF( 0, 0 ) );
( *obstacleFeature )->setIsObstacle( true );
}
else
if ( !palLayer->registerFeature( lbl->strId(), lbl, 0, 0 ) )
return;

View File

@ -63,6 +63,7 @@ void QgsVectorLayerDiagramProvider::init()
mPriority = 1 - mSettings.priority / 10.0; // convert 0..10 --> 1..0
mPlacement = QgsPalLayerSettings::Placement( mSettings.placement );
mLinePlacementFlags = mSettings.placementFlags;
mFlags |= DrawAllLabels;
if ( mSettings.obstacle ) mFlags |= GeometriesAreObstacles;
}

Binary file not shown.