mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 00:54:39 +03:00
Merge tag '1.5.32' into develop
Finish 1.5.32
This commit is contained in:
commit
c8c9252aa4
@ -128,7 +128,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
|
||||
|
||||
LIMEREPORT_VERSION_MAJOR = 1
|
||||
LIMEREPORT_VERSION_MINOR = 5
|
||||
LIMEREPORT_VERSION_RELEASE = 31
|
||||
LIMEREPORT_VERSION_RELEASE = 32
|
||||
|
||||
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
||||
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
||||
|
@ -468,7 +468,7 @@ public:
|
||||
QVariant getBookMark(const QString& key);
|
||||
void copyBookmarks(BookmarkContainerDesignIntf* source);
|
||||
private:
|
||||
QMap<QString,QVariant> m_bookmarks;
|
||||
QHash<QString,QVariant> m_bookmarks;
|
||||
};
|
||||
|
||||
} //namespace LimeReport
|
||||
|
@ -719,24 +719,35 @@ QVariant CallbackDatasource::dataByKeyField(const QString& columnName, const QSt
|
||||
{
|
||||
int backupCurrentRow = m_currentRow;
|
||||
QVariant result = QVariant();
|
||||
first();
|
||||
if (!checkIfEmpty()){
|
||||
int currentRow = 0;
|
||||
do {
|
||||
QVariant key = callbackData(keyColumnName, currentRow);
|
||||
|
||||
m_currentRow = m_lastKeyRow;
|
||||
if (next()){
|
||||
for (int i = 0; i < 10; ++i){
|
||||
QVariant key = callbackData(keyColumnName, m_currentRow);
|
||||
if (key == keyData){
|
||||
result = callbackData(columnName, currentRow);
|
||||
break;
|
||||
result = callbackData(columnName, m_currentRow);
|
||||
m_lastKeyRow = m_currentRow;
|
||||
m_currentRow = backupCurrentRow;
|
||||
return result;
|
||||
}
|
||||
if (!next()) break;
|
||||
}
|
||||
currentRow++;
|
||||
} while (next());
|
||||
}
|
||||
|
||||
first();
|
||||
if (backupCurrentRow != -1){
|
||||
for (int i = 0; i < backupCurrentRow; ++i)
|
||||
next();
|
||||
if (!checkIfEmpty()){
|
||||
do {
|
||||
QVariant key = callbackData(keyColumnName, m_currentRow);
|
||||
if (key == keyData){
|
||||
result = callbackData(columnName, m_currentRow);
|
||||
m_lastKeyRow = m_currentRow;
|
||||
m_currentRow = backupCurrentRow;
|
||||
return result;
|
||||
}
|
||||
} while (next());
|
||||
}
|
||||
|
||||
m_currentRow = backupCurrentRow;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -411,7 +411,7 @@ class CallbackDatasource :public ICallbackDatasource, public IDataSource {
|
||||
Q_OBJECT
|
||||
public:
|
||||
CallbackDatasource(): m_currentRow(-1), m_eof(false), m_columnCount(-1),
|
||||
m_rowCount(-1), m_getDataFromCache(false){}
|
||||
m_rowCount(-1), m_getDataFromCache(false), m_lastKeyRow(0){}
|
||||
bool next();
|
||||
bool hasNext(){ if (!m_eof) return checkNextRecord(m_currentRow); else return false;}
|
||||
bool prior();
|
||||
@ -431,6 +431,7 @@ public:
|
||||
private:
|
||||
bool checkNextRecord(int recordNum);
|
||||
bool checkIfEmpty();
|
||||
QVariant callbackData(const QString& columnName, int row);
|
||||
private:
|
||||
QVector<QString> m_headers;
|
||||
int m_currentRow;
|
||||
@ -439,7 +440,7 @@ private:
|
||||
int m_rowCount;
|
||||
QHash<QString, QVariant> m_valuesCache;
|
||||
bool m_getDataFromCache;
|
||||
QVariant callbackData(const QString& columnName, int row);
|
||||
int m_lastKeyRow;
|
||||
};
|
||||
|
||||
class CallbackDatasourceHolder :public QObject, public IDataSourceHolder{
|
||||
|
@ -722,6 +722,7 @@ void ReportDesignWidget::initThemeIfExist(const QString &themeName, const QStrin
|
||||
|
||||
void ReportDesignWidget::previewReport()
|
||||
{
|
||||
if (report()->isBusy()) return;
|
||||
prepareReport();
|
||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||
updateDialogs();
|
||||
@ -734,6 +735,7 @@ void ReportDesignWidget::previewReport()
|
||||
|
||||
void ReportDesignWidget::printReport()
|
||||
{
|
||||
if (report()->isBusy()) return;
|
||||
prepareReport();
|
||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||
updateDialogs();
|
||||
|
@ -1264,7 +1264,9 @@ void ReportDesignWindow::slotPrintReport()
|
||||
|
||||
void ReportDesignWindow::slotPreviewReport()
|
||||
{
|
||||
m_previewReportAction->setDisabled(true);
|
||||
m_reportDesignWidget->previewReport();
|
||||
m_previewReportAction->setDisabled(false);
|
||||
}
|
||||
|
||||
void ReportDesignWindow::slotItemActionCliked()
|
||||
|
@ -113,6 +113,7 @@ public:
|
||||
virtual void cancelRender() = 0;
|
||||
virtual void setShowProgressDialog(bool value) = 0;
|
||||
virtual bool isShowProgressDialog() const = 0;
|
||||
virtual bool isBusy() = 0;
|
||||
};
|
||||
|
||||
class PrintProcessor{
|
||||
|
@ -261,11 +261,11 @@ void ReportRender::renderPage(PageItemDesignIntf* patternPage, bool isTOC, bool
|
||||
renderReportHeader(m_patternPageItem, AfterPageHeader);
|
||||
|
||||
BandDesignIntf* lastRenderedBand = 0;
|
||||
for (int i=0;i<m_patternPageItem->dataBandCount() && !m_renderCanceled;i++){
|
||||
for (int i=0;i<m_patternPageItem->dataBandCount() && !m_renderCanceled; i++){
|
||||
lastRenderedBand = m_patternPageItem->dataBandAt(i);
|
||||
initDatasource(lastRenderedBand->datasourceName());
|
||||
renderDataBand(lastRenderedBand);
|
||||
if (i<m_patternPageItem->dataBandCount()-1) closeFooterGroup(lastRenderedBand);
|
||||
if (i < m_patternPageItem->dataBandCount()-1) closeFooterGroup(lastRenderedBand);
|
||||
}
|
||||
|
||||
if (reportFooter)
|
||||
@ -475,7 +475,7 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign
|
||||
if (bandData){
|
||||
bandClone = bandData;
|
||||
} else {
|
||||
bandClone=renderData(patternBand);
|
||||
bandClone = renderData(patternBand);
|
||||
}
|
||||
|
||||
if (isLast) bandClone->setBootomSpace(1);
|
||||
@ -543,8 +543,10 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign
|
||||
savePage();
|
||||
startNewPage();
|
||||
if (!bandIsSliced){
|
||||
BandDesignIntf* t = renderData(patternBand);
|
||||
t->copyBookmarks(bandClone);
|
||||
delete bandClone;
|
||||
bandClone = renderData(patternBand);
|
||||
bandClone = t;
|
||||
}
|
||||
}
|
||||
if (!registerBand(bandClone)) {
|
||||
|
Loading…
Reference in New Issue
Block a user