Forgot save paper after creation.

--HG--
branch : feature
This commit is contained in:
dismine 2015-01-16 21:34:37 +02:00
parent f849d16018
commit b04d1f92e7

View File

@ -90,7 +90,7 @@ void VLayoutGenerator::Generate()
if (bank->Prepare()) if (bank->Prepare())
{ {
CheckDetailsSize(); CheckDetailsSize();
do while (bank->AllDetailsCount() > 0)
{ {
if (stopGeneration) if (stopGeneration)
{ {
@ -100,7 +100,7 @@ void VLayoutGenerator::Generate()
VLayoutPaper paper(paperHeight, paperWidth); VLayoutPaper paper(paperHeight, paperWidth);
paper.SetShift(shift); paper.SetShift(shift);
paper.SetPaperIndex(papers.count()); paper.SetPaperIndex(papers.count());
if (bank->LeftArrange() > 0) do
{ {
const int index = bank->GetTiket(); const int index = bank->GetTiket();
if (paper.ArrangeDetail(bank->GetDetail(index), stopGeneration)) if (paper.ArrangeDetail(bank->GetDetail(index), stopGeneration))
@ -117,22 +117,19 @@ void VLayoutGenerator::Generate()
{ {
break; break;
} }
} while(bank->LeftArrange() > 0);
if (paper.Count() > 0)
{
papers.append(paper);
} }
else else
{ {
if (paper.Count() > 0) state = LayoutErrors::EmptyPaperError;
{ emit Error(state);
papers.append(paper); return;
}
else
{
state = LayoutErrors::EmptyPaperError;
emit Error(state);
return;
}
} }
}
} while (bank->AllDetailsCount() > 0);
} }
else else
{ {