Skip to content

Commit

Permalink
[composer] Avoid crash when atlas page name field has spaces
Browse files Browse the repository at this point in the history
Fix #15297

(cherry-picked from 631b5e8)
  • Loading branch information
nyalldawson committed Jul 19, 2016
1 parent 5dabc9d commit 8f2eb81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/composer/qgsatlascompositionwidget.cpp
Expand Up @@ -271,8 +271,9 @@ void QgsAtlasCompositionWidget::on_mAtlasFeatureFilterCheckBox_stateChanged( int
updateAtlasFeatures();
}

void QgsAtlasCompositionWidget::pageNameExpressionChanged( const QString& expression, bool valid )
void QgsAtlasCompositionWidget::pageNameExpressionChanged( const QString&, bool valid )
{
QString expression = mPageNameWidget->asExpression();
QgsAtlasComposition* atlasMap = &mComposition->atlasComposition();
if ( !atlasMap || ( !valid && !expression.isEmpty() ) )
{
Expand Down
5 changes: 4 additions & 1 deletion src/core/composer/qgsatlascomposition.cpp
Expand Up @@ -220,7 +220,10 @@ int QgsAtlasComposition::updateFeatures()
{
nameExpression.reset( nullptr );
}
nameExpression->prepare( &expressionContext );
else
{
nameExpression->prepare( &expressionContext );
}
}

// We cannot use nextFeature() directly since the feature pointer is rewinded by the rendering process
Expand Down

0 comments on commit 8f2eb81

Please sign in to comment.