summaryrefslogtreecommitdiff
path: root/source/tools/murun.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-08-01 18:15:23 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-08-17 13:38:48 +0200
commit626ea2ea771735492c9a4350ae02b26ea09d1423 (patch)
treec92241b181a51719cbb47402bad98bb1984bf963 /source/tools/murun.c
parente349ba5984fe837d3eec9649d718efe16169ca44 (diff)
downloadmupdf-626ea2ea771735492c9a4350ae02b26ea09d1423.tar.xz
Simplify stext structure and device.
* Use pool allocator and linked lists for all levels. * Remove separate fz_stext_sheet struct. * Remove unused 'script' style. * Remove 'span' level items. * Detect visual/logical RTL layouts. * Detect indented paragraphs.
Diffstat (limited to 'source/tools/murun.c')
-rw-r--r--source/tools/murun.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c
index b7443286..7a713903 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -1827,19 +1827,13 @@ static void ffi_Page_toStructuredText(js_State *J)
fz_context *ctx = js_getcontext(J);
fz_page *page = ffi_topage(J, 0);
const char *options = js_iscoercible(J, 1) ? js_tostring(J, 1) : NULL;
- fz_stext_sheet *sheet = NULL;
fz_stext_options so;
fz_stext_page *text;
- fz_var(sheet);
-
fz_try(ctx) {
- sheet = fz_new_stext_sheet(ctx);
fz_parse_stext_options(ctx, &so, options);
- text = fz_new_stext_page_from_page(ctx, page, sheet, &so);
+ text = fz_new_stext_page_from_page(ctx, page, &so);
}
- fz_always(ctx)
- fz_drop_stext_sheet(ctx, sheet);
fz_catch(ctx)
rethrow(J);
@@ -2673,19 +2667,13 @@ static void ffi_DisplayList_toStructuredText(js_State *J)
fz_context *ctx = js_getcontext(J);
fz_display_list *list = js_touserdata(J, 0, "fz_display_list");
const char *options = js_iscoercible(J, 1) ? js_tostring(J, 1) : NULL;
- fz_stext_sheet *sheet = NULL;
fz_stext_options so;
fz_stext_page *text;
- fz_var(sheet);
-
fz_try(ctx) {
- sheet = fz_new_stext_sheet(ctx);
fz_parse_stext_options(ctx, &so, options);
- text = fz_new_stext_page_from_display_list(ctx, list, sheet, &so);
+ text = fz_new_stext_page_from_display_list(ctx, list, &so);
}
- fz_always(ctx)
- fz_drop_stext_sheet(ctx, sheet);
fz_catch(ctx)
rethrow(J);