From 9ab3cb580354c980f342ce323da9717fbd0039aa Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 3 Mar 2017 00:55:35 +0300 Subject: [PATCH 1/3] Fix subquery loading --- limereport/lrdatasourcemanager.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/limereport/lrdatasourcemanager.cpp b/limereport/lrdatasourcemanager.cpp index cfbafab..dc2c32e 100644 --- a/limereport/lrdatasourcemanager.cpp +++ b/limereport/lrdatasourcemanager.cpp @@ -856,7 +856,7 @@ QList DataSourceManager::childDatasources(const QString &parentDatasour foreach(QString datasourceName, dataSourceNames()){ if (isSubQuery(datasourceName)){ SubQueryHolder* sh = dynamic_cast(dataSourceHolder(datasourceName)); - if (sh->masterDatasource().compare(parentDatasourceName,Qt::CaseInsensitive)==0){ + if (sh && sh->masterDatasource().compare(parentDatasourceName,Qt::CaseInsensitive)==0){ result.append(datasourceName); } } @@ -868,7 +868,8 @@ void DataSourceManager::invalidateChildren(const QString &parentDatasourceName) { foreach(QString datasourceName, childDatasources(parentDatasourceName)){ SubQueryHolder* sh = dynamic_cast(dataSourceHolder(datasourceName)); - sh->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE); + if (sh) + sh->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE); invalidateChildren(datasourceName); } } @@ -1110,7 +1111,12 @@ void DataSourceManager::collectionLoadFinished(const QString &collectionName) if (!m_datasources.contains(it.value()->queryName().toLower())){ connect(it.value(), SIGNAL(queryTextChanged(QString,QString)), this, SLOT(slotQueryTextChanged(QString,QString))); - putHolder(it.value()->queryName(),new QueryHolder(it.value()->queryText(), it.value()->connectionName(), this)); + putHolder(it.value()->queryName(),new SubQueryHolder( + it.value()->queryText(), + it.value()->connectionName(), + it.value()->master(), + this) + ); } else { delete it.value(); it.remove(); From 322ded365910712d1efa108686689d19f46834a4 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 3 Mar 2017 01:12:29 +0300 Subject: [PATCH 2/3] Null pointer access has been fixed --- limereport/lrscriptenginemanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/limereport/lrscriptenginemanager.cpp b/limereport/lrscriptenginemanager.cpp index f69283b..f8d157d 100644 --- a/limereport/lrscriptenginemanager.cpp +++ b/limereport/lrscriptenginemanager.cpp @@ -520,8 +520,11 @@ QString ScriptEngineManager::expandDataFields(QString context, ExpandType expand context.replace(rx.cap(0),fieldValue); } else { - QString error = QString("Field %1 not found in %2 !!! ").arg(field).arg(reportItem->objectName()); - dataManager()->putError(error); + QString error; + if (reportItem){ + error = QString("Field %1 not found in %2 !!! ").arg(field).arg(reportItem->objectName()); + dataManager()->putError(error); + } varValue = QVariant(); if (!dataManager()->reportSettings() || !dataManager()->reportSettings()->suppressAbsentFieldsAndVarsWarnings()) context.replace(rx.cap(0),error); From d864b1bf3e0ff4b9e342f8997080dbc7ea07236a Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 3 Mar 2017 01:12:45 +0300 Subject: [PATCH 3/3] Version has been fixed --- common.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.pri b/common.pri index 3f8f6b5..6b59a37 100644 --- a/common.pri +++ b/common.pri @@ -56,7 +56,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 2 +LIMEREPORT_VERSION_RELEASE = 4 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\"