Skip to content

Commit

Permalink
fix an encoding issue of QgsPalLabeling (fix #8347)
Browse files Browse the repository at this point in the history
  • Loading branch information
minorua committed Jul 23, 2013
1 parent 5ea75bd commit c7ca40a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/qgspallabeling.cpp
Expand Up @@ -3855,14 +3855,14 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
}

//layer names
QString layerNameUtf8 = QString::fromUtf8(( *it )->getLayerName() );
QString layerName = QString::fromUtf8( ( *it )->getLayerName() );
if ( palGeometry->isDiagram() )
{
//render diagram
QHash<QgsVectorLayer*, QgsDiagramLayerSettings>::iterator dit = mActiveDiagramLayers.begin();
for ( dit = mActiveDiagramLayers.begin(); dit != mActiveDiagramLayers.end(); ++dit )
{
if ( dit.key() && dit.key()->id().append( "d" ) == layerNameUtf8 )
if ( dit.key() && dit.key()->id().append( "d" ) == layerName )
{
QgsPoint outPt = xform->transform(( *it )->getX(), ( *it )->getY() );
dit.value().renderer->renderDiagram( palGeometry->diagramAttributes(), context, QPointF( outPt.x(), outPt.y() ) );
Expand All @@ -3873,14 +3873,14 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
if ( mLabelSearchTree )
{
//for diagrams, remove the additional 'd' at the end of the layer id
QString layerId = layerNameUtf8;
QString layerId = layerName;
layerId.chop( 1 );
mLabelSearchTree->insertLabel( *it, QString( palGeometry->strId() ).toInt(), QString( "" ), layerId, QFont(), true, false );
}
continue;
}

const QgsPalLayerSettings& lyr = layer( layerNameUtf8 );
const QgsPalLayerSettings& lyr = layer( layerName );

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

Expand Down

0 comments on commit c7ca40a

Please sign in to comment.