From eaf921501faa5b5df935ad8aeb9fe7d17656a022 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Mon, 14 Oct 2019 23:47:14 +0300 Subject: [PATCH] print process has been fixed --- common.pri | 2 +- limereport/lrpagedesignintf.cpp | 11 ++++++++++- limereport/lrpagedesignintf.h | 1 + limereport/lrreportengine.cpp | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/common.pri b/common.pri index 3085e0b..6a5f6d5 100644 --- a/common.pri +++ b/common.pri @@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 15 +LIMEREPORT_VERSION_RELEASE = 19 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/lrpagedesignintf.cpp b/limereport/lrpagedesignintf.cpp index 09e6574..b767128 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -280,7 +280,8 @@ void PageDesignIntf::setPageItems(QList pages) { m_currentPage = 0; if (!m_pageItem.isNull()) { - removeItem(m_pageItem.data()); + if (m_pageItem->scene() == this) + removeItem(m_pageItem.data()); m_pageItem.clear(); } int curHeight = 0; @@ -303,6 +304,14 @@ void PageDesignIntf::setPageItems(QList pages) } +void PageDesignIntf::removePageItem(PageItemDesignIntf::Ptr pageItem) +{ + if (m_pageItem == pageItem){ + removeItem(m_pageItem.data()); + m_pageItem.clear(); + } +} + void PageDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (m_insertMode) { diff --git a/limereport/lrpagedesignintf.h b/limereport/lrpagedesignintf.h index b02a2de..1256c7a 100644 --- a/limereport/lrpagedesignintf.h +++ b/limereport/lrpagedesignintf.h @@ -113,6 +113,7 @@ namespace LimeReport { PageItemDesignIntf *pageItem(); void setPageItem(PageItemDesignIntf::Ptr pageItem); void setPageItems(QList pages); + void removePageItem(PageItemDesignIntf::Ptr pageItem); QList pageItems(){return m_reportPages;} bool isItemInsertMode(); diff --git a/limereport/lrreportengine.cpp b/limereport/lrreportengine.cpp index 0253911..2c977f9 100644 --- a/limereport/lrreportengine.cpp +++ b/limereport/lrreportengine.cpp @@ -1772,6 +1772,7 @@ PrintProcessor::PrintProcessor(QPrinter* printer) bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page) { if (!m_firstPage && !m_painter->isActive()) return false; + PageDesignIntf* backupPage = dynamic_cast(page->scene()); //LimeReport::PageDesignIntf m_renderPage; //m_renderPage.setItemMode(PrintMode); @@ -1825,6 +1826,8 @@ bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page) m_renderPage.render(m_painter); } page->setPos(backupPagePos); + m_renderPage.removePageItem(page); + if (backupPage) backupPage->reactivatePageItem(page); return true; }