Check if we seek in a measurement file an empty name.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-10-03 01:49:15 +03:00
parent b5000e5fae
commit bdfae8230d
2 changed files with 7 additions and 1 deletions

View File

@ -739,6 +739,12 @@ QDomElement VMeasurements::MakeEmpty(const QString &name, const QString &formula
//---------------------------------------------------------------------------------------------------------------------
QDomElement VMeasurements::FindM(const QString &name) const
{
if (name.isEmpty())
{
qWarning() << tr("The measurement name is empty!");
return QDomElement();
}
QDomNodeList list = elementsByTagName(TagMeasurement);
for (int i=0; i < list.size(); ++i)

View File

@ -36,7 +36,7 @@ enum class SexType : char { Male, Female, Unknown };
class VMeasurements : public VDomDocument
{
Q_DECLARE_TR_FUNCTIONS(VMeasurements)
public:
VMeasurements(VContainer *data);
VMeasurements(Unit unit, VContainer *data);