Skip to content
Permalink
Browse files
[composer] Fix annotation settings only being applied to first grid i…
…n list, not selected grid (fix #10880)
  • Loading branch information
nyalldawson committed Jul 13, 2014
1 parent 877f07a commit ae84a0740399ea7b0e6baab8d2dce86f8b0a8ead
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/app/composer/qgscomposermapwidget.cpp
@@ -912,23 +912,24 @@ void QgsComposerMapWidget::insertAnnotationDirectionEntries( QComboBox* c )

void QgsComposerMapWidget::handleChangedAnnotationPosition( QgsComposerMap::Border border, const QString& text )
{
if ( !mComposerMap )
QgsComposerMapGrid* grid = currentGrid();
if ( !grid )
{
return;
}

mComposerMap->beginCommand( tr( "Annotation position changed" ) );
if ( text == tr( "Inside frame" ) )
{
mComposerMap->setGridAnnotationPosition( QgsComposerMap::InsideMapFrame, border );
grid->setGridAnnotationPosition( QgsComposerMap::InsideMapFrame, border );
}
else if ( text == tr( "Disabled" ) )
{
mComposerMap->setGridAnnotationPosition( QgsComposerMap::Disabled, border );
grid->setGridAnnotationPosition( QgsComposerMap::Disabled, border );
}
else //Outside frame
{
mComposerMap->setGridAnnotationPosition( QgsComposerMap::OutsideMapFrame, border );
grid->setGridAnnotationPosition( QgsComposerMap::OutsideMapFrame, border );
}

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

void QgsComposerMapWidget::handleChangedAnnotationDirection( QgsComposerMap::Border border, const QString& text )
{
if ( !mComposerMap )
QgsComposerMapGrid* grid = currentGrid();
if ( !grid )
{
return;
}

mComposerMap->beginCommand( tr( "Changed annotation direction" ) );
if ( text == tr( "Horizontal" ) )
{
mComposerMap->setGridAnnotationDirection( QgsComposerMap::Horizontal, border );
grid->setGridAnnotationDirection( QgsComposerMap::Horizontal, border );
}
else //Vertical
{
mComposerMap->setGridAnnotationDirection( QgsComposerMap::Vertical, border );
grid->setGridAnnotationDirection( QgsComposerMap::Vertical, border );
}
mComposerMap->updateBoundingRect();
mComposerMap->update();

0 comments on commit ae84a07

Please sign in to comment.