Skip to content

Commit 631b5e8

Browse files
committedJul 18, 2016
[composer] Avoid crash when atlas page name field has spaces
Fix #15297
1 parent 9f330fc commit 631b5e8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
 

‎src/app/composer/qgsatlascompositionwidget.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,9 @@ void QgsAtlasCompositionWidget::on_mAtlasFeatureFilterCheckBox_stateChanged( int
272272
updateAtlasFeatures();
273273
}
274274

275-
void QgsAtlasCompositionWidget::pageNameExpressionChanged( const QString& expression, bool valid )
275+
void QgsAtlasCompositionWidget::pageNameExpressionChanged( const QString&, bool valid )
276276
{
277+
QString expression = mPageNameWidget->asExpression();
277278
QgsAtlasComposition* atlasMap = &mComposition->atlasComposition();
278279
if ( !atlasMap || ( !valid && !expression.isEmpty() ) )
279280
{

‎src/core/composer/qgsatlascomposition.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ int QgsAtlasComposition::updateFeatures()
222222
{
223223
nameExpression.reset( nullptr );
224224
}
225-
nameExpression->prepare( &expressionContext );
225+
else
226+
{
227+
nameExpression->prepare( &expressionContext );
228+
}
226229
}
227230

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

0 commit comments

Comments
 (0)
Please sign in to comment.