Skip to content
Permalink
Browse files

Fix composer legend "Filter by Atlas Feature" does not save

Fix #16663
  • Loading branch information
nyalldawson committed Jun 6, 2017
1 parent 008f385 commit ecb4c5a6924693b3604706edbbed19439c2b1949
Showing with 5 additions and 0 deletions.
  1. +2 −0 src/app/composer/qgscomposerlegendwidget.cpp
  2. +3 −0 src/core/composer/qgscomposerlegend.cpp
@@ -155,6 +155,7 @@ void QgsComposerLegendWidget::setGuiElements()
mCheckBoxAutoUpdate->setChecked( mLegend->autoUpdateModel() );

mCheckboxResizeContents->setChecked( mLegend->resizeToContents() );
mFilterLegendByAtlasCheckBox->setChecked( mLegend->legendFilterOutAtlas() );

const QgsComposerMap* map = mLegend->composerMap();
mMapComboBox->setItem( map );
@@ -922,6 +923,7 @@ void QgsComposerLegendWidget::blockAllSignals( bool b )
mWmsLegendHeightSpinBox->blockSignals( b );
mCheckboxResizeContents->blockSignals( b );
mTitleSpaceBottomSpinBox->blockSignals( b );
mFilterLegendByAtlasCheckBox->blockSignals( b );
}

void QgsComposerLegendWidget::selectedChanged( const QModelIndex & current, const QModelIndex & previous )
@@ -413,6 +413,8 @@ bool QgsComposerLegend::writeXML( QDomElement& elem, QDomDocument & doc ) const
composerLegendElem.setAttribute( "legendFilterByMap", "1" );
}

composerLegendElem.setAttribute( "legendFilterByAtlas", mFilterOutAtlas ? "1" : "0" );

return _writeXML( composerLegendElem, doc );
}

@@ -522,6 +524,7 @@ bool QgsComposerLegend::readXML( const QDomElement& itemElem, const QDomDocument
{
setComposerMap( mComposition->getComposerMapById( itemElem.attribute( "map" ).toInt() ) );
}
mFilterOutAtlas = itemElem.attribute( "legendFilterByAtlas", "0" ).toInt();

QDomElement oldLegendModelElem = itemElem.firstChildElement( "Model" );
if ( !oldLegendModelElem.isNull() )

0 comments on commit ecb4c5a

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