Printing: fix uninialized border width

In flow rendering the border width is not initialized which causes
huge borders that blocks the page while previewing.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
This commit is contained in:
Gehad elrobey 2015-08-21 10:56:59 +02:00 committed by Lubomir I. Ivanov
parent 20c22596f0
commit 13febc1eee

View file

@ -293,6 +293,8 @@ void Printer::previewOnePage()
pageSize.setHeight(paintDevice->height());
pageSize.setWidth(paintDevice->width());
webView->page()->setViewportSize(pageSize);
// initialize the border settings
templateOptions->border_width = std::max(1, pageSize.width() / 1000);
webView->setHtml(t.generate());
// render only one page