Skip to content
Permalink
Browse files

Add a debug assert relating to multiframe item crashes

  • Loading branch information
nyalldawson committed Jan 22, 2018
1 parent 20f50fb commit 77b570dab7da85f70ec8c25b84ea7b4a81cea02c
@@ -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 );
}
}
@@ -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 ) );
@@ -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 );

0 comments on commit 77b570d

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