Skip to content

Commit

Permalink
[composer] Fix layer order when using visibility presets
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 29, 2015
1 parent 708793f commit fed74b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/composer/qgscomposermapwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "qgsgenericprojectionselector.h"
#include "qgsproject.h"
#include "qgsvisibilitypresetcollection.h"
#include "qgsvisibilitypresets.h"
#include "qgisgui.h"

#include <QMessageBox>
Expand Down Expand Up @@ -302,7 +303,7 @@ void QgsComposerMapWidget::aboutToShowVisibilityPresetsMenu()
{
QAction* a = menu->addAction( presetName, this, SLOT( visibilityPresetSelected() ) );
a->setCheckable( true );
QStringList layers = QgsProject::instance()->visibilityPresetCollection()->presetVisibleLayers( presetName );
QStringList layers = QgsVisibilityPresets::instance()->orderedPresetVisibleLayers( presetName );
QMap<QString, QString> styles = QgsProject::instance()->visibilityPresetCollection()->presetStyleOverrides( presetName );
if ( layers == mComposerMap->layerSet() && styles == mComposerMap->layerStyleOverrides() )
a->setChecked( true );
Expand All @@ -319,7 +320,7 @@ void QgsComposerMapWidget::visibilityPresetSelected()
return;

QString presetName = action->text();
QStringList lst = QgsProject::instance()->visibilityPresetCollection()->presetVisibleLayers( presetName );
QStringList lst = QgsVisibilityPresets::instance()->orderedPresetVisibleLayers( presetName );
if ( mComposerMap )
{
mKeepLayerListCheckBox->setChecked( true );
Expand Down

0 comments on commit fed74b2

Please sign in to comment.