0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 00:54:39 +03:00

Fix: #38 Allow to suppress warnings for unknown fields

This commit is contained in:
Arin Alex 2016-06-24 23:17:13 +03:00
parent ac98da1394
commit 43089b55d6

View File

@ -149,14 +149,12 @@ QString ContentItemDesignIntf::expandDataFields(QString context, ExpandType expa
context.replace(rx.cap(0),fieldValue); context.replace(rx.cap(0),fieldValue);
} else { } else {
QString error; QString error = QString("Field %1 not found in %2 !!! ").arg(field).arg(this->objectName());
if (dataManager->lastError().isEmpty()){
error = QString("Field %1 not found in %2 !!! ").arg(field).arg(this->objectName());
dataManager->putError(error); dataManager->putError(error);
} else { if (!reportSettings() || !reportSettings()->suppressAbsentFieldsAndVarsWarnings())
error = dataManager->lastError();
}
context.replace(rx.cap(0),error); context.replace(rx.cap(0),error);
else
context.replace(rx.cap(0),"");
} }
} }
} }
@ -188,7 +186,13 @@ QString ContentItemDesignIntf::expandUserVariables(QString context, RenderPass p
pos=0; pos=0;
} }
} else { } else {
context.replace(rx.cap(0),tr("Variable %1 not found").arg(variable)); QString error;
error = tr("Variable %1 not found").arg(variable);
dataManager->putError(error);
if (!reportSettings() || reportSettings()->suppressAbsentFieldsAndVarsWarnings())
context.replace(rx.cap(0),error);
else
context.replace(rx.cap(0),"");
} }
} }
} }