Skip to content

Commit 77b570d

Browse files
committedJan 22, 2018
Add a debug assert relating to multiframe item crashes
1 parent 20f50fb commit 77b570d

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed
 

‎src/core/layout/qgslayoutframe.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ void QgsLayoutFrame::draw( QgsRenderContext &context, const QStyleOptionGraphics
163163
{
164164
//calculate index of frame
165165
int frameIndex = mMultiFrame->frameIndex( this );
166+
Q_ASSERT_X( frameIndex >= 0, "QgsLayoutFrame::draw", "Invalid frame index for frame" );
166167
mMultiFrame->render( context, mSection, frameIndex, itemStyle );
167168
}
168169
}

‎src/core/layout/qgslayoutitemattributetable.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ QgsExpressionContext QgsLayoutItemAttributeTable::createExpressionContext() cons
540540

541541
void QgsLayoutItemAttributeTable::finalizeRestoreFromXml()
542542
{
543+
QgsLayoutTable::finalizeRestoreFromXml();
543544
if ( !mMap && !mMapUuid.isEmpty() && mLayout )
544545
{
545546
mMap = qobject_cast< QgsLayoutItemMap *>( mLayout->itemByUuid( mMapUuid, true ) );

‎src/core/layout/qgslayoutmultiframe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ double QgsLayoutMultiFrame::findNearbyPageBreak( double yPos )
5454

5555
void QgsLayoutMultiFrame::addFrame( QgsLayoutFrame *frame, bool recalcFrameSizes )
5656
{
57-
if ( !frame )
57+
if ( !frame || mFrameItems.contains( frame ) )
5858
return;
5959

6060
mFrameItems.push_back( frame );

0 commit comments

Comments
 (0)
Please sign in to comment.