The printf() about the number of links on a page is very useful, but
only for debugging. As other instances of debugging printf() in djvu.c
and pdf.c are commented out, it seemed consistent to do the same with
this one.
1. Remove unused "-lsdtc++" from the compilation stage as no linking is
done then.
2. Add our standard CFLAGS to the compilation of cre.cpp which brings in
-O3 -march=armv6 which enables optimizations.
It seemed strange that we compile a cpp file with gcc (as opposed to
g++), but I left it as is for now.
Store last globalzoom_mode in self.pan_by_page so we can restore it
to force offsets recalculation on page change
This wasn't quite enough to trigger correct re-panning for page
changes when using fiveway to move in two-column mode, issue #275
I considered adding callback to goto method and than transfering
it through function calls, but this approach (allthough very
questionable) seemed to provide simplier code.
This fix makes the behaviour of Back command handler in crereader
identical with that in unireader, i.e. the last position is saved in
Jump History when pressing Back, so you can return to it by pressing
Shift-Back enough times.
Also, with this change we would need to handle the need for redrawing
the current page because the :addJump() method can force the call to
fillToc() (if TOC is not already present) and this will display
"Retrieving TOC..." message which will need clearing away.
Store last globalzoom_mode in self.pan_by_page so we can restore it
to force offsets recalculation on page change
This wasn't quite enough to trigger correct re-panning for page
changes when using fiveway to move in two-column mode, issue #275
I considered adding callback to goto method and than transfering
it through function calls, but this approach (allthough very
questionable) seemed to provide simplier code.
For PDF and DjVu files (but not for crereader) the command handler for
"Back" key can call addJump() in order to avoid losing the top of the
jump history on return. This (addJump()) can cause the TOC to be
retrieved and the message "Retrieving TOC..." to be displayed.
If this happens then we need to redraw the current page after displaying
our own "Already first jump!" message.
1. Remove unused assert() around io.open of the input device. The failure
to open input device is already guarded by the "if inputf" code.
2. Remove unneeded assert() around io.open of the output device. This is
unneeded because we should not crash the whole application just because
we cannot write screen dump (e.g. because filesystem is full, etc) ---
rather we should exit gracefully.
Even after restoring to the previous version, this function had a slight
bug that would cause a crash on valid .zip files (e.g.
mupdf-thirdparty.zip in kindlepdfviewer make tree). The reason is
because the value of s may be not nil, but the string.match() would
return nil and so string.lower() would get nil as an argument and crash.
So, we have to guard against this carefully.
The FileChooser:choose() method returns only a single argument,
so we can get rid of the second return value in reader.lua and
simplify the code a bit.