Increment per item, not per merge record.
This commit is contained in:
@@ -37,8 +37,8 @@ namespace
|
||||
// All variable increments. (must be in sorted order)
|
||||
const QVector<glabels::model::Variable::Increment> allIncrements = {
|
||||
glabels::model::Variable::Increment::NEVER,
|
||||
glabels::model::Variable::Increment::PER_ITEM,
|
||||
glabels::model::Variable::Increment::PER_COPY,
|
||||
glabels::model::Variable::Increment::PER_MERGE_RECORD,
|
||||
glabels::model::Variable::Increment::PER_PAGE
|
||||
};
|
||||
}
|
||||
|
||||
@@ -283,6 +283,7 @@ namespace glabels
|
||||
iLabel++;
|
||||
iCurrentPage = iLabel / mNLabelsPerPage;
|
||||
|
||||
mVariables->incrementVariablesOnItem();
|
||||
mVariables->incrementVariablesOnCopy();
|
||||
if ( (iLabel % mNLabelsPerPage) == 0 /* starting a new page */ )
|
||||
{
|
||||
@@ -341,7 +342,7 @@ namespace glabels
|
||||
iLabel++;
|
||||
iCurrentPage = iLabel / mNLabelsPerPage;
|
||||
|
||||
mVariables->incrementVariablesOnMerge();
|
||||
mVariables->incrementVariablesOnItem();
|
||||
if ( iRecord == 0 )
|
||||
{
|
||||
mVariables->incrementVariablesOnCopy();
|
||||
|
||||
+12
-12
@@ -90,9 +90,9 @@ namespace glabels
|
||||
}
|
||||
|
||||
|
||||
void Variable::incrementValueOnCopy()
|
||||
void Variable::incrementValueOnItem()
|
||||
{
|
||||
if ( mIncrement == Increment::PER_COPY )
|
||||
if ( mIncrement == Increment::PER_ITEM )
|
||||
{
|
||||
switch (mType)
|
||||
{
|
||||
@@ -110,9 +110,9 @@ namespace glabels
|
||||
}
|
||||
|
||||
|
||||
void Variable::incrementValueOnMerge()
|
||||
void Variable::incrementValueOnCopy()
|
||||
{
|
||||
if ( mIncrement == Increment::PER_MERGE_RECORD )
|
||||
if ( mIncrement == Increment::PER_COPY )
|
||||
{
|
||||
switch (mType)
|
||||
{
|
||||
@@ -219,10 +219,10 @@ namespace glabels
|
||||
{
|
||||
case Increment::NEVER:
|
||||
return tr("Never");
|
||||
case Increment::PER_ITEM:
|
||||
return tr("Per item");
|
||||
case Increment::PER_COPY:
|
||||
return tr("Per copy");
|
||||
case Increment::PER_MERGE_RECORD:
|
||||
return tr("Per merge record");
|
||||
case Increment::PER_PAGE:
|
||||
return tr("Per page");
|
||||
}
|
||||
@@ -235,10 +235,10 @@ namespace glabels
|
||||
{
|
||||
case Increment::NEVER:
|
||||
return "never";
|
||||
case Increment::PER_ITEM:
|
||||
return "per_item";
|
||||
case Increment::PER_COPY:
|
||||
return "per_copy";
|
||||
case Increment::PER_MERGE_RECORD:
|
||||
return "per_merge_record";
|
||||
case Increment::PER_PAGE:
|
||||
return "per_page";
|
||||
}
|
||||
@@ -251,14 +251,14 @@ namespace glabels
|
||||
{
|
||||
return Increment::NEVER;
|
||||
}
|
||||
else if ( id == "per_item" )
|
||||
{
|
||||
return Increment::PER_ITEM;
|
||||
}
|
||||
else if ( id == "per_copy" )
|
||||
{
|
||||
return Increment::PER_COPY;
|
||||
}
|
||||
else if ( id == "per_merge_record" )
|
||||
{
|
||||
return Increment::PER_MERGE_RECORD;
|
||||
}
|
||||
else if ( id == "per_page" )
|
||||
{
|
||||
return Increment::PER_PAGE;
|
||||
|
||||
+2
-2
@@ -46,8 +46,8 @@ namespace glabels
|
||||
enum class Increment
|
||||
{
|
||||
NEVER,
|
||||
PER_ITEM,
|
||||
PER_COPY,
|
||||
PER_MERGE_RECORD,
|
||||
PER_PAGE
|
||||
};
|
||||
|
||||
@@ -71,8 +71,8 @@ namespace glabels
|
||||
QString stepSize() const;
|
||||
|
||||
void resetValue();
|
||||
void incrementValueOnItem();
|
||||
void incrementValueOnCopy();
|
||||
void incrementValueOnMerge();
|
||||
void incrementValueOnPage();
|
||||
QString value() const;
|
||||
|
||||
|
||||
+12
-12
@@ -97,6 +97,18 @@ namespace glabels
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Increment variables on item
|
||||
///
|
||||
void Variables::incrementVariablesOnItem()
|
||||
{
|
||||
for ( auto& v : *this )
|
||||
{
|
||||
v.incrementValueOnItem();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Increment variables on copy
|
||||
///
|
||||
@@ -109,18 +121,6 @@ namespace glabels
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Increment variables on merge record
|
||||
///
|
||||
void Variables::incrementVariablesOnMerge()
|
||||
{
|
||||
for ( auto& v : *this )
|
||||
{
|
||||
v.incrementValueOnMerge();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Increment variables on page
|
||||
///
|
||||
|
||||
+1
-1
@@ -64,8 +64,8 @@ namespace glabels
|
||||
void replaceVariable( const QString& name, const Variable& variable );
|
||||
|
||||
void resetVariables();
|
||||
void incrementVariablesOnItem();
|
||||
void incrementVariablesOnCopy();
|
||||
void incrementVariablesOnMerge();
|
||||
void incrementVariablesOnPage();
|
||||
|
||||
|
||||
|
||||
@@ -1072,10 +1072,6 @@
|
||||
<source>Per copy</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Per merge record</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Per page</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1088,6 +1084,10 @@
|
||||
<source>Floating Point</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Per item</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>VariablesView</name>
|
||||
|
||||
Reference in New Issue
Block a user