Skip to content

Commit 033bd79

Browse files
committed
Identify selected items based on id's rather than translated text
1 parent 429eb40 commit 033bd79

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/app/qgsdiagramproperties.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer* layer, QWidget* pare
6262

6363
if ( layerType == QGis::Point || layerType == QGis::Polygon )
6464
{
65-
mPlacementComboBox->addItem( tr( "AroundPoint" ), 0 );
66-
mPlacementComboBox->addItem( tr( "OverPoint" ), 1 );
65+
mPlacementComboBox->addItem( tr( "Around Point" ), QgsDiagramLayerSettings::AroundPoint );
66+
mPlacementComboBox->addItem( tr( "Over Point" ), QgsDiagramLayerSettings::OverPoint );
6767
}
6868

6969
if ( layerType == QGis::Line || layerType == QGis::Polygon )
7070
{
71-
mPlacementComboBox->addItem( tr( "Line" ), 2 );
72-
mPlacementComboBox->addItem( tr( "Horizontal" ), 3 );
71+
mPlacementComboBox->addItem( tr( "Line" ), QgsDiagramLayerSettings::Line );
72+
mPlacementComboBox->addItem( tr( "Horizontal" ), QgsDiagramLayerSettings::Horizontal );
7373
}
7474

7575
if ( layerType == QGis::Polygon )
7676
{
77-
mPlacementComboBox->addItem( tr( "Free" ), 4 );
77+
mPlacementComboBox->addItem( tr( "Free" ), QgsDiagramLayerSettings::Free );
7878
}
7979

8080
if ( layerType == QGis::Line )
@@ -90,8 +90,8 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer* layer, QWidget* pare
9090
mLineOptionsLabel->setVisible( false );
9191
}
9292

93-
mDiagramTypeComboBox->addItem( tr( "Pie chart" ), "Pie" );
94-
mDiagramTypeComboBox->addItem( tr( "Text diagram" ), "Text");
93+
mDiagramTypeComboBox->addItem( tr( "Pie chart" ), DIAGRAM_NAME_PIE );
94+
mDiagramTypeComboBox->addItem( tr( "Text diagram" ), DIAGRAM_NAME_TEXT );
9595
mDiagramTypeComboBox->addItem( tr( "Histogram" ), DIAGRAM_NAME_HISTOGRAM );
9696

9797
mLabelPlacementComboBox->addItem( tr( "Height" ), QgsDiagramSettings::Height );

src/core/qgsdiagramrendererv2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct CORE_EXPORT QgsDiagramLayerSettings
3535
//avoid inclusion of QgsPalLabeling
3636
enum Placement
3737
{
38-
AroundPoint, // Point / Polygon
38+
AroundPoint = 0, // Point / Polygon
3939
OverPoint, // Point / Polygon
4040
Line, // Line / Polygon
4141
Curved, // Line

0 commit comments

Comments
 (0)