Skip to content

Commit 6db2432

Browse files
committedJan 5, 2018
Fix project retrieval for QgsReport
1 parent f4a99b6 commit 6db2432

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
 

‎src/core/layout/qgsabstractreportsection.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ QgsAbstractReportSection::~QgsAbstractReportSection()
3333

3434
QgsProject *QgsAbstractReportSection::project()
3535
{
36+
if ( QgsReport *report = dynamic_cast< QgsReport * >( this ) )
37+
return report->layoutProject();
38+
3639
QgsAbstractReportSection *current = this;
3740
while ( QgsAbstractReportSection *parent = current->parentSection() )
3841
{

‎tests/src/python/test_qgsreport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def testGettersSetters(self):
3737
r = QgsReport(p)
3838

3939
self.assertEqual(r.layoutProject(), p)
40+
self.assertEqual(r.project(), p)
4041

4142
r.setHeaderEnabled(True)
4243
self.assertTrue(r.headerEnabled())

0 commit comments

Comments
 (0)
Please sign in to comment.