Skip to content

Commit

Permalink
Merge pull request #761 from minorua/label_enc
Browse files Browse the repository at this point in the history
fix an encoding issue of QgsPalLabeling (fix #8347)
  • Loading branch information
jef-n committed Jul 23, 2013
2 parents 5ea75bd + c7ca40a commit 49923dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/qgspallabeling.cpp
Original file line number Diff line number Diff line change
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 49923dd

Please sign in to comment.