Skip to content

Commit ae84a07

Browse files
committedJul 13, 2014
[composer] Fix annotation settings only being applied to first grid in list, not selected grid (fix #10880)
1 parent 877f07a commit ae84a07

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed
 

‎src/app/composer/qgscomposermapwidget.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -912,23 +912,24 @@ void QgsComposerMapWidget::insertAnnotationDirectionEntries( QComboBox* c )
912912

913913
void QgsComposerMapWidget::handleChangedAnnotationPosition( QgsComposerMap::Border border, const QString& text )
914914
{
915-
if ( !mComposerMap )
915+
QgsComposerMapGrid* grid = currentGrid();
916+
if ( !grid )
916917
{
917918
return;
918919
}
919920

920921
mComposerMap->beginCommand( tr( "Annotation position changed" ) );
921922
if ( text == tr( "Inside frame" ) )
922923
{
923-
mComposerMap->setGridAnnotationPosition( QgsComposerMap::InsideMapFrame, border );
924+
grid->setGridAnnotationPosition( QgsComposerMap::InsideMapFrame, border );
924925
}
925926
else if ( text == tr( "Disabled" ) )
926927
{
927-
mComposerMap->setGridAnnotationPosition( QgsComposerMap::Disabled, border );
928+
grid->setGridAnnotationPosition( QgsComposerMap::Disabled, border );
928929
}
929930
else //Outside frame
930931
{
931-
mComposerMap->setGridAnnotationPosition( QgsComposerMap::OutsideMapFrame, border );
932+
grid->setGridAnnotationPosition( QgsComposerMap::OutsideMapFrame, border );
932933
}
933934

934935
mComposerMap->updateBoundingRect();
@@ -938,19 +939,20 @@ void QgsComposerMapWidget::handleChangedAnnotationPosition( QgsComposerMap::Bord
938939

939940
void QgsComposerMapWidget::handleChangedAnnotationDirection( QgsComposerMap::Border border, const QString& text )
940941
{
941-
if ( !mComposerMap )
942+
QgsComposerMapGrid* grid = currentGrid();
943+
if ( !grid )
942944
{
943945
return;
944946
}
945947

946948
mComposerMap->beginCommand( tr( "Changed annotation direction" ) );
947949
if ( text == tr( "Horizontal" ) )
948950
{
949-
mComposerMap->setGridAnnotationDirection( QgsComposerMap::Horizontal, border );
951+
grid->setGridAnnotationDirection( QgsComposerMap::Horizontal, border );
950952
}
951953
else //Vertical
952954
{
953-
mComposerMap->setGridAnnotationDirection( QgsComposerMap::Vertical, border );
955+
grid->setGridAnnotationDirection( QgsComposerMap::Vertical, border );
954956
}
955957
mComposerMap->updateBoundingRect();
956958
mComposerMap->update();

0 commit comments

Comments
 (0)
Please sign in to comment.