Skip to content

Commit 03855f5

Browse files
author
mhugent
committedApr 20, 2010
Simplified composerView function
git-svn-id: http://svn.osgeo.org/qgis/trunk@13331 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 0603c45 commit 03855f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/gui/qgscomposerview.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ void QgsComposerView::sendItemRemovedSignal( QgsComposerItem* item )
607607

608608
QMainWindow* QgsComposerView::composerWindow()
609609
{
610-
QObject* composerObject = 0;
610+
QMainWindow* composerObject = 0;
611611
QObject* currentObject = parent();
612612
if ( !currentObject )
613613
{
@@ -616,14 +616,14 @@ QMainWindow* QgsComposerView::composerWindow()
616616

617617
while ( true )
618618
{
619-
if ( currentObject->parent() == 0 )
619+
composerObject = qobject_cast<QMainWindow*>( currentObject );
620+
if ( composerObject || currentObject->parent() == 0 )
620621
{
621-
composerObject = currentObject;
622-
break;
622+
return composerObject;
623623
}
624624
currentObject = currentObject->parent();
625625
}
626626

627-
return qobject_cast<QMainWindow *>( composerObject );
627+
return 0;
628628
}
629629

0 commit comments

Comments
 (0)
Please sign in to comment.