summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-10-10 12:32:41 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-10-23 17:23:59 +0200
commite7719b15d0f72000835a38754c00598fbc841598 (patch)
treedc6bc52b3d11738df80713fd53711a4b1bd0f140 /platform
parent8ebce9c149112d59552ed530361f80372455fdb2 (diff)
downloadmupdf-e7719b15d0f72000835a38754c00598fbc841598.tar.xz
gl: Fix launching mupdf-gl to the page number passed on the command line.
Diffstat (limited to 'platform')
-rw-r--r--platform/gl/gl-main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c
index ec38f6f7..74e03cd3 100644
--- a/platform/gl/gl-main.c
+++ b/platform/gl/gl-main.c
@@ -849,22 +849,23 @@ static void load_document(void)
fz_catch(ctx)
outline = NULL;
+ load_history();
+
pdf = pdf_specifics(ctx, doc);
if (pdf)
{
if (enable_js)
pdf_enable_js(ctx, pdf);
if (anchor)
- currentpage = pdf_lookup_anchor(ctx, pdf, anchor, NULL, NULL);
+ jump_to_page(pdf_lookup_anchor(ctx, pdf, anchor, NULL, NULL));
}
else
{
if (anchor)
- currentpage = fz_atoi(anchor) - 1;
+ jump_to_page(fz_atoi(anchor) - 1);
}
anchor = NULL;
- load_history();
currentpage = fz_clampi(currentpage, 0, fz_count_pages(ctx, doc) - 1);
}