Resolved issue #984. Issue with up to date list of unique names.
--HG-- branch : develop
This commit is contained in:
parent
ec8d7777a4
commit
40363230dc
|
@ -36,6 +36,7 @@
|
||||||
- [#984] Special variable "CurrentLength" for tools Cut Arc, Cut Spline and Cut Spline Path.
|
- [#984] Special variable "CurrentLength" for tools Cut Arc, Cut Spline and Cut Spline Path.
|
||||||
- Added a ruler at the bottom of a tiled PDF document.
|
- Added a ruler at the bottom of a tiled PDF document.
|
||||||
- Export tiled PDF with watermark.
|
- Export tiled PDF with watermark.
|
||||||
|
- [#984] Issue with up to date list of unique names.
|
||||||
|
|
||||||
# Version 0.6.2 (unreleased)
|
# Version 0.6.2 (unreleased)
|
||||||
- [#903] Bug in tool Cut Spline path.
|
- [#903] Bug in tool Cut Spline path.
|
||||||
|
|
|
@ -511,6 +511,7 @@ bool MainWindow::LoadMeasurements(const QString &path)
|
||||||
}
|
}
|
||||||
ToolBarOption();
|
ToolBarOption();
|
||||||
pattern->ClearVariables(VarType::Measurement);
|
pattern->ClearVariables(VarType::Measurement);
|
||||||
|
m->StoreNames(false);
|
||||||
m->ReadMeasurements(height, size);
|
m->ReadMeasurements(height, size);
|
||||||
}
|
}
|
||||||
catch (VExceptionEmptyParameter &e)
|
catch (VExceptionEmptyParameter &e)
|
||||||
|
@ -563,6 +564,7 @@ bool MainWindow::UpdateMeasurements(const QString &path, int size, int height)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pattern->ClearVariables(VarType::Measurement);
|
pattern->ClearVariables(VarType::Measurement);
|
||||||
|
m->StoreNames(false);
|
||||||
m->ReadMeasurements(height, size);
|
m->ReadMeasurements(height, size);
|
||||||
if (m->Type() == MeasurementsType::Individual)
|
if (m->Type() == MeasurementsType::Individual)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3932,7 +3932,7 @@ void VPattern::ParseIncrementsElement(const QDomNode &node, const Document &pars
|
||||||
increment->SetFormula(value, formula, ok);
|
increment->SetFormula(value, formula, ok);
|
||||||
increment->SetDescription(desc);
|
increment->SetDescription(desc);
|
||||||
increment->SetPreviewCalculation(node.toElement().tagName() == TagPreviewCalculations);
|
increment->SetPreviewCalculation(node.toElement().tagName() == TagPreviewCalculations);
|
||||||
data->AddVariable(increment);
|
data->AddUniqueVariable(increment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4433,6 +4433,7 @@ void VPattern::PrepareForParse(const Document &parse)
|
||||||
}
|
}
|
||||||
|
|
||||||
data->ClearVariables(types);
|
data->ClearVariables(types);
|
||||||
|
parse == Document::FullLiteParse ? data->ClearUniqueNames() : data->ClearExceptUniqueIncrementNames();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -249,6 +249,12 @@ void VMeasurements::MoveBottom(const QString &name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VMeasurements::StoreNames(bool store)
|
||||||
|
{
|
||||||
|
m_keepNames = store;
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VMeasurements::ReadMeasurements(qreal height, qreal size) const
|
void VMeasurements::ReadMeasurements(qreal height, qreal size) const
|
||||||
{
|
{
|
||||||
|
@ -308,8 +314,11 @@ void VMeasurements::ReadMeasurements(qreal height, qreal size) const
|
||||||
meash = QSharedPointer<VMeasurement>(new VMeasurement(data, static_cast<quint32>(i), name, value, formula,
|
meash = QSharedPointer<VMeasurement>(new VMeasurement(data, static_cast<quint32>(i), name, value, formula,
|
||||||
ok, fullName, description));
|
ok, fullName, description));
|
||||||
}
|
}
|
||||||
tempData->AddVariable(tempMeash);
|
if (m_keepNames)
|
||||||
data->AddVariable(meash);
|
{
|
||||||
|
tempData->AddUniqueVariable(tempMeash);
|
||||||
|
data->AddUniqueVariable(meash);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,8 @@ public:
|
||||||
void MoveDown(const QString &name);
|
void MoveDown(const QString &name);
|
||||||
void MoveBottom(const QString &name);
|
void MoveBottom(const QString &name);
|
||||||
|
|
||||||
|
void StoreNames(bool store);
|
||||||
|
|
||||||
void ReadMeasurements(qreal height, qreal size) const;
|
void ReadMeasurements(qreal height, qreal size) const;
|
||||||
void ClearForExport();
|
void ClearForExport();
|
||||||
|
|
||||||
|
@ -143,6 +145,9 @@ private:
|
||||||
VContainer *data;
|
VContainer *data;
|
||||||
MeasurementsType type;
|
MeasurementsType type;
|
||||||
|
|
||||||
|
/** @brief m_keepNames store names in container to check uniqueness. */
|
||||||
|
bool m_keepNames{true};
|
||||||
|
|
||||||
void CreateEmptyMultisizeFile(Unit unit, int baseSize, int baseHeight);
|
void CreateEmptyMultisizeFile(Unit unit, int baseSize, int baseHeight);
|
||||||
void CreateEmptyIndividualFile(Unit unit);
|
void CreateEmptyIndividualFile(Unit unit);
|
||||||
|
|
||||||
|
|
|
@ -719,6 +719,21 @@ void VContainer::ClearUniqueIncrementNames() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VContainer::ClearExceptUniqueIncrementNames() const
|
||||||
|
{
|
||||||
|
const QList<QString> list = uniqueNames.value(d->nspace).values();
|
||||||
|
ClearUniqueNames();
|
||||||
|
|
||||||
|
for(auto &name : list)
|
||||||
|
{
|
||||||
|
if (name.startsWith('#'))
|
||||||
|
{
|
||||||
|
uniqueNames[d->nspace].insert(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief SetSize set value of size
|
* @brief SetSize set value of size
|
||||||
|
|
|
@ -162,6 +162,10 @@ public:
|
||||||
void AddCurveWithSegments(const QSharedPointer<VAbstractCubicBezierPath> &curve, const quint32 &id,
|
void AddCurveWithSegments(const QSharedPointer<VAbstractCubicBezierPath> &curve, const quint32 &id,
|
||||||
quint32 parentId = NULL_ID);
|
quint32 parentId = NULL_ID);
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void AddUniqueVariable(T *var);
|
||||||
|
template <typename T>
|
||||||
|
void AddUniqueVariable(const QSharedPointer<T> &var);
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void AddVariable(T *var);
|
void AddVariable(T *var);
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -184,6 +188,7 @@ public:
|
||||||
void ClearVariables(const QVector<VarType> &types);
|
void ClearVariables(const QVector<VarType> &types);
|
||||||
void ClearUniqueNames() const;
|
void ClearUniqueNames() const;
|
||||||
void ClearUniqueIncrementNames() const;
|
void ClearUniqueIncrementNames() const;
|
||||||
|
void ClearExceptUniqueIncrementNames() const;
|
||||||
|
|
||||||
void SetSize(qreal size) const;
|
void SetSize(qreal size) const;
|
||||||
void SetHeight(qreal height) const;
|
void SetHeight(qreal height) const;
|
||||||
|
@ -307,6 +312,25 @@ QSharedPointer<T> VContainer::GetVariable(const QString &name) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
template <typename T>
|
||||||
|
void VContainer::AddUniqueVariable(T *var)
|
||||||
|
{
|
||||||
|
AddUniqueVariable(QSharedPointer<T>(var));
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
template <typename T>
|
||||||
|
void VContainer::AddUniqueVariable(const QSharedPointer<T> &var)
|
||||||
|
{
|
||||||
|
AddVariable(var);
|
||||||
|
|
||||||
|
if (d->variables.contains(var->GetName()))
|
||||||
|
{
|
||||||
|
uniqueNames[d->nspace].insert(var->GetName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void VContainer::AddVariable(T *var)
|
void VContainer::AddVariable(T *var)
|
||||||
|
@ -338,7 +362,6 @@ void VContainer::AddVariable(const QSharedPointer<T> &var)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
d->variables.insert(var->GetName(), var);
|
d->variables.insert(var->GetName(), var);
|
||||||
uniqueNames[d->nspace].insert(var->GetName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user