Skip to content

Commit

Permalink
Fix unit tests and issues with cached layers
Browse files Browse the repository at this point in the history
This code has been funded by Tuscany Region (Italy) - SITA (CIG: 63526840AE) and commissioned to Gis3W s.a.s.
  • Loading branch information
wonder-sk committed Sep 21, 2015
1 parent d0fcc95 commit 6cc1f4c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/qgsmaprendererjob.cpp
Expand Up @@ -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() );
}

Expand Down
3 changes: 3 additions & 0 deletions src/core/qgspallabeling.cpp
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsvectorlayerdiagramprovider.cpp
Expand Up @@ -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;
}

Expand Down
Binary file modified tests/testdata/labeling/pal_features_v3.sqlite
Binary file not shown.

0 comments on commit 6cc1f4c

Please sign in to comment.