Book formatter: Do not insert last page if it's empty, code cleanup

deque
MiroslavR 10 years ago
parent 4b1df64fba
commit f87d7c3fce

@ -233,7 +233,8 @@ namespace MWGui
}
// insert last page
pag << Paginator::Page(pag.getStartTop(), pag.getStartTop() + pag.getPageHeight());
if (pag.getStartTop() != pag.getCurrentTop())
pag << Paginator::Page(pag.getStartTop(), pag.getStartTop() + pag.getPageHeight());
paper->setSize(paper->getWidth(), pag.getCurrentTop());
@ -301,7 +302,7 @@ namespace MWGui
mPaginator.setStartTop(newStartTop);
}
mPaginator.modifyCurrentTop(getHeight());
mPaginator.setCurrentTop(newTop);
}
int GraphicElement::pageSplit()

@ -81,8 +81,6 @@ namespace MWGui
void setStartTop(int top) { mStartTop = top; }
void setCurrentTop(int top) { mCurrentTop = top; }
void modifyStartTop(int mod) { mStartTop += mod; }
void modifyCurrentTop(int mod) { mCurrentTop += mod; }
Paginator & operator<<(const Page & page)
{

Loading…
Cancel
Save