Fix bug with nesting a descending group.
Together with "Nest quantity" and limited space Valentina removes all duplicates except first for each next paper sheet. --HG-- branch : develop
This commit is contained in:
parent
ba69759634
commit
5978df2629
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "../vmisc/diagnostic.h"
|
||||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "vlayoutpiece.h"
|
||||
#include "vlayoutdef.h"
|
||||
#include "../ifc/exception/vexception.h"
|
||||
#include "../vpatterndb/floatItemData/floatitemdef.h"
|
||||
|
@ -95,7 +94,8 @@ int CountDetails(const T &container)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool NotArrangedDetail(QMap<uint, QHash<int, qint64>> &container, QMap<uint, QHash<int, qint64>> &unsorted, int i)
|
||||
bool NotArrangedDetail(QMap<uint, QHash<int, qint64>> &container, QMap<uint, QHash<int, qint64>> &unsorted,
|
||||
int i)
|
||||
{
|
||||
QMutableMapIterator<uint, QHash<int, qint64>> iterator(container);
|
||||
while (iterator.hasNext())
|
||||
|
@ -122,19 +122,20 @@ bool NotArrangedDetail(QMap<uint, QHash<int, qint64>> &container, QMap<uint, QHa
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool NotArrangedDetail(QMap<uint, QMultiMap<qint64, int>> &container, QMap<uint, QHash<int, qint64>> &unsorted, int i)
|
||||
bool NotArrangedDetail(QMap<uint, QMultiMap<qint64, int>> &container, QMap<uint, QHash<int, qint64>> &unsorted,
|
||||
int i)
|
||||
{
|
||||
QMutableMapIterator<uint, QMultiMap<qint64, int>> iterator(container);
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
iterator.next();
|
||||
auto containerGroup = container.value(iterator.key());
|
||||
auto detailIterator = std::find(containerGroup.cbegin(), containerGroup.cend(), i);
|
||||
if (detailIterator != containerGroup.cend())
|
||||
auto detailIterator = std::find(containerGroup.begin(), containerGroup.end(), i);
|
||||
if (detailIterator != containerGroup.end())
|
||||
{
|
||||
Insert(unsorted, iterator.key(), i, detailIterator.key());
|
||||
containerGroup.erase(detailIterator);
|
||||
|
||||
containerGroup.remove(detailIterator.key());
|
||||
if (not containerGroup.isEmpty())
|
||||
{
|
||||
container.insert(iterator.key(), containerGroup);
|
||||
|
@ -165,18 +166,6 @@ int TakeFirstForPriority(const QMap<uint, QHash<int, qint64>> &container, uint p
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VBank::VBank()
|
||||
: details(),
|
||||
unsorted(),
|
||||
big(),
|
||||
middle(),
|
||||
small(),
|
||||
desc(),
|
||||
groups(),
|
||||
arranged(),
|
||||
layoutWidth(0),
|
||||
caseType(Cases::CaseDesc),
|
||||
prepare(false),
|
||||
diagonal(0)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -622,7 +611,7 @@ void VBank::SqMaxMin(qint64 &sMax, qint64 &sMin, uint priority) const
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VBank::ArrangedDetail(QMap<uint, QHash<int, qint64>> &container, int i)
|
||||
bool VBank::ArrangedDetail(QMap<uint, QHash<int, qint64> > &container, int i)
|
||||
{
|
||||
QMutableMapIterator<uint, QHash<int, qint64>> iterator(container);
|
||||
while (iterator.hasNext())
|
||||
|
@ -655,11 +644,11 @@ bool VBank::ArrangedDetail(QMap<uint, QMultiMap<qint64, int>> &container, int i)
|
|||
{
|
||||
iterator.next();
|
||||
auto containerGroup = container.value(iterator.key());
|
||||
auto detailIterator = std::find(containerGroup.cbegin(), containerGroup.cend(), i);
|
||||
if (detailIterator != containerGroup.cend())
|
||||
auto detailIterator = std::find(containerGroup.begin(), containerGroup.end(), i);
|
||||
if (detailIterator != containerGroup.end())
|
||||
{
|
||||
arranged.append(details.at(detailIterator.value()).GetId());
|
||||
containerGroup.remove(detailIterator.key(), detailIterator.value());
|
||||
containerGroup.erase(detailIterator);
|
||||
|
||||
if (not containerGroup.isEmpty())
|
||||
{
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <QLoggingCategory>
|
||||
|
||||
#include "../vmisc/typedef.h"
|
||||
#include "vlayoutpiece.h"
|
||||
|
||||
// An annoying char define, from the Windows team in <rpcndr.h>
|
||||
// #define small char
|
||||
|
@ -48,8 +49,6 @@
|
|||
|
||||
Q_DECLARE_LOGGING_CATEGORY(lBank)
|
||||
|
||||
class VLayoutPiece;
|
||||
|
||||
enum class Cases : char { CaseThreeGroup = 0, CaseTwoGroup, CaseDesc, UnknownCase};
|
||||
|
||||
class VBank
|
||||
|
@ -88,22 +87,22 @@ public:
|
|||
|
||||
private:
|
||||
Q_DISABLE_COPY(VBank)
|
||||
QVector<VLayoutPiece> details;
|
||||
QVector<VLayoutPiece> details{};
|
||||
|
||||
QMap<uint, QHash<int, qint64>> unsorted;
|
||||
QMap<uint, QHash<int, qint64>> big;
|
||||
QMap<uint, QHash<int, qint64>> middle;
|
||||
QMap<uint, QHash<int, qint64>> small;
|
||||
QMap<uint, QMultiMap<qint64, int>> desc;
|
||||
QMap<uint, QHash<int, qint64>> unsorted{};
|
||||
QMap<uint, QHash<int, qint64>> big{};
|
||||
QMap<uint, QHash<int, qint64>> middle{};
|
||||
QMap<uint, QHash<int, qint64>> small{};
|
||||
QMap<uint, QMultiMap<qint64, int>> desc{};
|
||||
|
||||
QVector<uint> groups;
|
||||
QVector<vidtype> arranged;
|
||||
QVector<uint> groups{};
|
||||
QVector<vidtype> arranged{};
|
||||
|
||||
qreal layoutWidth;
|
||||
qreal layoutWidth{0};
|
||||
|
||||
Cases caseType;
|
||||
bool prepare;
|
||||
qreal diagonal;
|
||||
Cases caseType{Cases::CaseDesc};
|
||||
bool prepare{false};
|
||||
qreal diagonal{0};
|
||||
bool m_nestQuantity{false};
|
||||
bool m_manualPriority{false};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user