1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

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

This commit is contained in:
MiroslavR 2014-09-22 21:25:41 +02:00
parent 4b1df64fba
commit f87d7c3fce
2 changed files with 3 additions and 4 deletions

View File

@ -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()

View File

@ -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)
{