summaryrefslogtreecommitdiff
path: root/source/html/html-layout.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-11-11 16:05:30 +0000
committerRobin Watts <robin.watts@artifex.com>2016-11-14 16:09:39 +0000
commit37f95f87bdfb2e0b01d649afae5fffe60bf99d3a (patch)
treeda3491c62d6af86c1a5bc4e523e8f9ebe19793d1 /source/html/html-layout.c
parentc0e1dfdab1a13def046e94d771f8a821ba2a10d9 (diff)
downloadmupdf-37f95f87bdfb2e0b01d649afae5fffe60bf99d3a.tar.xz
Make fz_buffer structure private to fitz.
Move the definition of the structure contents into new fitz-imp.h file. Make all code outside of fitz access the buffer through the defined API. Add a convenience API for people that want to get buffers as null terminated C strings.
Diffstat (limited to 'source/html/html-layout.c')
-rw-r--r--source/html/html-layout.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/html/html-layout.c b/source/html/html-layout.c
index 8b7a08db..945149f4 100644
--- a/source/html/html-layout.c
+++ b/source/html/html-layout.c
@@ -2117,8 +2117,7 @@ html_load_css(fz_context *ctx, fz_archive *zip, const char *base_uri, fz_css *cs
fz_try(ctx)
{
buf = fz_read_archive_entry(ctx, zip, path);
- fz_write_buffer_byte(ctx, buf, 0);
- fz_parse_css(ctx, css, (char*)buf->data, path);
+ fz_parse_css(ctx, css, fz_string_from_buffer(ctx, buf), path);
}
fz_always(ctx)
fz_drop_buffer(ctx, buf);
@@ -2500,6 +2499,8 @@ fz_parse_html(fz_context *ctx, fz_html_font_set *set, fz_archive *zip, const cha
{
fz_xml *xml;
fz_html *html;
+ unsigned char *data;
+ size_t len = fz_buffer_storage(ctx, buf, &data);
fz_css_match match;
struct genstate g;
@@ -2512,7 +2513,7 @@ fz_parse_html(fz_context *ctx, fz_html_font_set *set, fz_archive *zip, const cha
g.emit_white = 0;
g.last_brk_cls = UCDN_LINEBREAK_CLASS_OP;
- xml = fz_parse_xml(ctx, buf->data, buf->len, 1);
+ xml = fz_parse_xml(ctx, data, len, 1);
g.css = fz_new_css(ctx);
fz_try(ctx)