diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2011-10-04 18:44:19 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2011-10-04 18:44:19 +0100 |
commit | d208be26537db558edb70236ae517cea31b7ebab (patch) | |
tree | 57da95b97e354a53bd4517a42010e90968f007d9 /apps/win_main.c | |
parent | ba46cad4b09bb957085900a203206c8fa5868cd4 (diff) | |
download | mupdf-d208be26537db558edb70236ae517cea31b7ebab.tar.xz |
Move to exception handling rather than error passing throughout.
This frees us from passing errors back everywhere, and hence enables us
to pass results back as return values.
Rather than having to explicitly check for errors everywhere and bubble
them, we now allow exception handling to do the work for us; the
downside to this is that we no longer emit as much debugging information
as we did before (though this could be put back in). For now, the
debugging information we have lost has been retained in comments
with 'RJW:' at the start.
This code needs fuller testing, but is being committed as a work in
progress.
Diffstat (limited to 'apps/win_main.c')
-rw-r--r-- | apps/win_main.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/apps/win_main.c b/apps/win_main.c index 24279e1d..a77347e4 100644 --- a/apps/win_main.c +++ b/apps/win_main.c @@ -241,7 +241,7 @@ dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) SetDlgItemTextA(hwnd, 0x13, "n/a"); } - info = fz_dict_gets(xref->ctx, xref->trailer, "Info"); + info = fz_dict_gets(xref->trailer, "Info"); if (!info) return TRUE; @@ -253,21 +253,21 @@ dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) fz_free(context, ucs); \ } - if ((obj = fz_dict_gets(xref->ctx, info, "Title"))) + if ((obj = fz_dict_gets(info, "Title"))) SETUCS(0x20); - if ((obj = fz_dict_gets(xref->ctx, info, "Author"))) + if ((obj = fz_dict_gets(info, "Author"))) SETUCS(0x21); - if ((obj = fz_dict_gets(xref->ctx, info, "Subject"))) + if ((obj = fz_dict_gets(info, "Subject"))) SETUCS(0x22); - if ((obj = fz_dict_gets(xref->ctx, info, "Keywords"))) + if ((obj = fz_dict_gets(info, "Keywords"))) SETUCS(0x23); - if ((obj = fz_dict_gets(xref->ctx, info, "Creator"))) + if ((obj = fz_dict_gets(info, "Creator"))) SETUCS(0x24); - if ((obj = fz_dict_gets(xref->ctx, info, "Producer"))) + if ((obj = fz_dict_gets(info, "Producer"))) SETUCS(0x25); - if ((obj = fz_dict_gets(xref->ctx, info, "CreationDate"))) + if ((obj = fz_dict_gets(info, "CreationDate"))) SETUCS(0x26); - if ((obj = fz_dict_gets(xref->ctx, info, "ModDate"))) + if ((obj = fz_dict_gets(info, "ModDate"))) SETUCS(0x27); return TRUE; @@ -858,7 +858,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShow fz_accelerate(); - ctx = fz_context_init(&fz_alloc_default); + ctx = fz_new_context(/*&fz_alloc_default*/); if (ctx == NULL) { fprintf(stderr, "Failed to init context"); |