Skip to content

Commit c7ca40a

Browse files
committed
fix an encoding issue of QgsPalLabeling (fix #8347)
1 parent 5ea75bd commit c7ca40a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/core/qgspallabeling.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -3855,14 +3855,14 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
38553855
}
38563856

38573857
//layer names
3858-
QString layerNameUtf8 = QString::fromUtf8(( *it )->getLayerName() );
3858+
QString layerName = QString::fromUtf8( ( *it )->getLayerName() );
38593859
if ( palGeometry->isDiagram() )
38603860
{
38613861
//render diagram
38623862
QHash<QgsVectorLayer*, QgsDiagramLayerSettings>::iterator dit = mActiveDiagramLayers.begin();
38633863
for ( dit = mActiveDiagramLayers.begin(); dit != mActiveDiagramLayers.end(); ++dit )
38643864
{
3865-
if ( dit.key() && dit.key()->id().append( "d" ) == layerNameUtf8 )
3865+
if ( dit.key() && dit.key()->id().append( "d" ) == layerName )
38663866
{
38673867
QgsPoint outPt = xform->transform(( *it )->getX(), ( *it )->getY() );
38683868
dit.value().renderer->renderDiagram( palGeometry->diagramAttributes(), context, QPointF( outPt.x(), outPt.y() ) );
@@ -3873,14 +3873,14 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
38733873
if ( mLabelSearchTree )
38743874
{
38753875
//for diagrams, remove the additional 'd' at the end of the layer id
3876-
QString layerId = layerNameUtf8;
3876+
QString layerId = layerName;
38773877
layerId.chop( 1 );
38783878
mLabelSearchTree->insertLabel( *it, QString( palGeometry->strId() ).toInt(), QString( "" ), layerId, QFont(), true, false );
38793879
}
38803880
continue;
38813881
}
38823882

3883-
const QgsPalLayerSettings& lyr = layer( layerNameUtf8 );
3883+
const QgsPalLayerSettings& lyr = layer( layerName );
38843884

38853885
// Copy to temp, editable layer settings
38863886
// these settings will be changed by any data defined values, then used for rendering label components
@@ -3951,7 +3951,7 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
39513951
if ( mLabelSearchTree )
39523952
{
39533953
QString labeltext = (( QgsPalGeometry* )( *it )->getFeaturePart()->getUserGeometry() )->text();
3954-
mLabelSearchTree->insertLabel( *it, QString( palGeometry->strId() ).toInt(), ( *it )->getLayerName(), labeltext, dFont, false, palGeometry->isPinned() );
3954+
mLabelSearchTree->insertLabel( *it, QString( palGeometry->strId() ).toInt(), layerName, labeltext, dFont, false, palGeometry->isPinned() );
39553955
}
39563956
}
39573957

0 commit comments

Comments
 (0)