[Okular-devel] Review Request: Improve facing pages (center first page) mode when document contains only 1 or 2 pages

Albert Astals Cid tsdgeos at terra.es
Mon Dec 19 22:31:06 UTC 2011



> On Dec. 19, 2011, 7:12 p.m., Albert Astals Cid wrote:
> > ui/pageview.cpp, line 3646
> > <http://git.reviewboard.kde.org/r/103424/diff/3/?file=43585#file43585line3646>
> >
> >     Wouldn't this just be
> >     const bool facingPages = facing || centerFirstPage;
> >     ?
> 
> Stephen Anthony wrote:
>     No, because if overrideCentering is enabled, then it doesn't matter whether facing mode is specified or not; it is disabled.  Your fix includes the possibility that overrideCentering may be true (which forces centerFirstPage to be false), yet facing will still be true (because of the ||).  But this should never happen, since overrideCentering *always* overrides any facing mode.

Hmmm, can you check my logic and tell me what's wrong?
const bool facingPages = (facing || facingCentered) && !overrideCentering;
?
const bool facingPages = ((facing && !overrideCentering) || (facingCentered && !overrideCentering)) 
? because const bool centerFirstPage = facingCentered && !overrideCentering;
const bool facingPages = ((facing && !overrideCentering) || (centerFirstPage))
? because const bool overrideCentering = facingCentered && pageCount < 3;
const bool facingPages = ((facing && !(facingCentered && pageCount < 3)) || (centerFirstPage))
?
const bool facingPages = ((facing && (!facingCentered || pageCount >= 3)) || (centerFirstPage))
? because  const bool facing = Okular::Settings::viewMode() == Okular::Settings::EnumViewMode::Facing; and const bool facingCentered = Okular::Settings::viewMode() == Okular::Settings::EnumViewMode::FacingFirstCentered; thus if facing is true facingCentered will be fase confirming the first part of the || so we can just collapse it
const bool facingPages = ((facing) || (centerFirstPage))


- Albert


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103424/#review9096
-----------------------------------------------------------


On Dec. 17, 2011, 11:16 p.m., Stephen Anthony wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103424/
> -----------------------------------------------------------
> 
> (Updated Dec. 17, 2011, 11:16 p.m.)
> 
> 
> Review request for Okular.
> 
> 
> Description
> -------
> 
> This patch improves 'facing pages (center first page)' mode in the case where a document consists of only 1 or 2 pages.  Currently, this mode always assumes two columns of output (which makes sense for 'facing pages').  However, in the case of 1 or 2 page documents, the pages are sized according to two columns, when only one column will ever be used (because of the number of pages present), resulting in pages that don't fill the page in 'Fit to Page' view mode.
> 
> Basically, this patch overrides facing pages in such a case and uses one virtual column, allowing the page to take all available space.
> 
> 
> Diffs
> -----
> 
>   ui/pageview.cpp 78a007a 
> 
> Diff: http://git.reviewboard.kde.org/r/103424/diff/diff
> 
> 
> Testing
> -------
> 
> Testing was done on 1, 2, 3, many page documents in all modes and views.  This patch addresses the specific case where 'facing pages (center first page)' is enabled AND the pagecount is 2 or less.
> 
> 
> Thanks,
> 
> Stephen Anthony
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20111219/30251c27/attachment.html>


More information about the Okular-devel mailing list