Skip to content
Permalink
Browse files

[reports] Fix crash in designer when no layout selected

Fixes #18019
  • Loading branch information
nyalldawson committed Feb 3, 2018
1 parent 872871f commit be6674b8196f1c59e619b4bbe5f9394f163a62c8
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/gui/layout/qgslayoutruler.cpp
@@ -339,6 +339,9 @@ void QgsLayoutRuler::drawGuideAtPos( QPainter *painter, QPoint pos )

void QgsLayoutRuler::createTemporaryGuideItem()
{
if ( !mView->currentLayout() )
return;

delete mGuideItem;
mGuideItem = new QGraphicsLineItem();

@@ -579,6 +582,9 @@ void QgsLayoutRuler::mouseMoveEvent( QMouseEvent *event )
mMarkerPos = event->pos();
update();

if ( !mView->currentLayout() )
return;

QPointF displayPos;
if ( mCreatingGuide || mDraggingGuide )
{
@@ -678,6 +684,9 @@ void QgsLayoutRuler::mouseMoveEvent( QMouseEvent *event )

void QgsLayoutRuler::mousePressEvent( QMouseEvent *event )
{
if ( !mView->currentLayout() )
return;

if ( event->button() == Qt::LeftButton )
{
mDraggingGuide = guideAtPoint( event->pos() );
@@ -706,6 +715,9 @@ void QgsLayoutRuler::mousePressEvent( QMouseEvent *event )

void QgsLayoutRuler::mouseReleaseEvent( QMouseEvent *event )
{
if ( mView->currentLayout() )
return;

if ( event->button() == Qt::LeftButton )
{
if ( mDraggingGuide )

0 comments on commit be6674b

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