Skip to content
Permalink
Browse files

[composer] Fix layer order when using visibility presets

  • Loading branch information
nyalldawson committed Sep 29, 2015
1 parent 708793f commit fed74b2dfa41a9c9572b65358cb4a100eeb5e78b
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/app/composer/qgscomposermapwidget.cpp
@@ -38,6 +38,7 @@
#include "qgsgenericprojectionselector.h"
#include "qgsproject.h"
#include "qgsvisibilitypresetcollection.h"
#include "qgsvisibilitypresets.h"
#include "qgisgui.h"

#include <QMessageBox>
@@ -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 );
@@ -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 );

0 comments on commit fed74b2

Please sign in to comment.
You can’t perform that action at this time.