diff --git a/common.pri b/common.pri index 35091ea..8f5d3b6 100644 --- a/common.pri +++ b/common.pri @@ -62,7 +62,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 87 +LIMEREPORT_VERSION_RELEASE = 88 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" diff --git a/limereport/databrowser/lrsqleditdialog.cpp b/limereport/databrowser/lrsqleditdialog.cpp index 05e3267..90ad426 100644 --- a/limereport/databrowser/lrsqleditdialog.cpp +++ b/limereport/databrowser/lrsqleditdialog.cpp @@ -113,8 +113,8 @@ void SQLEditDialog::accept() if (ui->fieldsMap->rowCount()>0){ for(int i=0;ifieldsMap->rowCount();++i){ LimeReport::FieldsCorrelation fieldsCorrelation; - fieldsCorrelation.master=ui->fieldsMap->item(i,0)->data(Qt::DisplayRole).toString(); - fieldsCorrelation.detail=ui->fieldsMap->item(i,1)->data(Qt::DisplayRole).toString(); + fieldsCorrelation.master = ui->fieldsMap->item(i,0) ? ui->fieldsMap->item(i,0)->data(Qt::DisplayRole).toString() : ""; + fieldsCorrelation.detail = ui->fieldsMap->item(i,1) ? ui->fieldsMap->item(i,1)->data(Qt::DisplayRole).toString() : ""; result.fieldMap.append(fieldsCorrelation); } } @@ -351,4 +351,13 @@ void SQLEditDialog::hidePreview() ui->pbHidePreview->setVisible(false); } +void SQLEditDialog::on_pbDelField_clicked() +{ + ui->fieldsMap->removeRow(ui->fieldsMap->currentRow()); +} + } // namespace LimeReport + + + + diff --git a/limereport/databrowser/lrsqleditdialog.h b/limereport/databrowser/lrsqleditdialog.h index 269f3f4..7773acd 100644 --- a/limereport/databrowser/lrsqleditdialog.h +++ b/limereport/databrowser/lrsqleditdialog.h @@ -73,6 +73,7 @@ private slots: void on_rbProxy_clicked(bool checked); void on_rbSubQuery_clicked(bool checked); void on_pbAddField_clicked(); + void on_pbDelField_clicked(); void initQueryMode(); void initSubQueryMode(); void initProxyMode(); diff --git a/limereport/lrdatadesignintf.cpp b/limereport/lrdatadesignintf.cpp index 18e0d49..6c155ce 100644 --- a/limereport/lrdatadesignintf.cpp +++ b/limereport/lrdatadesignintf.cpp @@ -628,14 +628,17 @@ QVariant MasterDetailProxyModel::sourceData(QString fieldName, int row) const QVariant MasterDetailProxyModel::masterData(QString fieldName) const { IDataSource* master = dataManager()->dataSource(m_masterName); - int columnIndex = master->columnIndexByName(fieldName); - if (columnIndex!=-1){ - return master->data(fieldName); - } else { - throw ReportError( - tr("Field: \"%1\" not found in \"%2\" master datasource").arg(fieldName).arg(m_masterName) - ); + if (master){ + int columnIndex = master->columnIndexByName(fieldName); + if (columnIndex!=-1){ + return master->data(fieldName); + } else { + throw ReportError( + tr("Field: \"%1\" not found in \"%2\" master datasource").arg(fieldName).arg(m_masterName) + ); + } } + return QVariant(); } bool CallbackDatasource::next(){