Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a debug assert relating to multiframe item crashes
  • Loading branch information
nyalldawson committed Jan 22, 2018
1 parent 20f50fb commit 77b570d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/layout/qgslayoutframe.cpp
Expand Up @@ -163,6 +163,7 @@ void QgsLayoutFrame::draw( QgsRenderContext &context, const QStyleOptionGraphics
{
//calculate index of frame
int frameIndex = mMultiFrame->frameIndex( this );
Q_ASSERT_X( frameIndex >= 0, "QgsLayoutFrame::draw", "Invalid frame index for frame" );
mMultiFrame->render( context, mSection, frameIndex, itemStyle );
}
}
Expand Down
1 change: 1 addition & 0 deletions src/core/layout/qgslayoutitemattributetable.cpp
Expand Up @@ -540,6 +540,7 @@ QgsExpressionContext QgsLayoutItemAttributeTable::createExpressionContext() cons

void QgsLayoutItemAttributeTable::finalizeRestoreFromXml()
{
QgsLayoutTable::finalizeRestoreFromXml();
if ( !mMap && !mMapUuid.isEmpty() && mLayout )
{
mMap = qobject_cast< QgsLayoutItemMap *>( mLayout->itemByUuid( mMapUuid, true ) );
Expand Down
2 changes: 1 addition & 1 deletion src/core/layout/qgslayoutmultiframe.cpp
Expand Up @@ -54,7 +54,7 @@ double QgsLayoutMultiFrame::findNearbyPageBreak( double yPos )

void QgsLayoutMultiFrame::addFrame( QgsLayoutFrame *frame, bool recalcFrameSizes )
{
if ( !frame )
if ( !frame || mFrameItems.contains( frame ) )
return;

mFrameItems.push_back( frame );
Expand Down

0 comments on commit 77b570d

Please sign in to comment.