From 65f4cfcb30e664a78439c3c8302cd9999b337199 Mon Sep 17 00:00:00 2001 From: Laurent MONIN Date: Wed, 19 Oct 2005 11:49:00 +0200 Subject: [PATCH] Add a field did_superscript to struct renderer_context and use it instead of a local static variable. --- src/document/html/renderer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/document/html/renderer.c b/src/document/html/renderer.c index 07963f0c..ccd8bb67 100644 --- a/src/document/html/renderer.c +++ b/src/document/html/renderer.c @@ -119,7 +119,9 @@ struct renderer_context { int g_ctrl_num; int empty_format; - int did_subscript; + + unsigned int did_subscript:1; + unsigned int did_superscript:1; }; static struct renderer_context renderer_context; @@ -378,16 +380,14 @@ get_format_screen_char(struct html_context *html_context, } if (html_context->options->display_sups) { - static int super = 0; - if (format.style.attr & AT_SUPERSCRIPT) { - if (!super) { - super = 1; + if (!renderer_context.did_superscript) { + renderer_context.did_superscript = 1; put_chars(html_context, "^", 1); } } else { - if (super) { - super = 0; + if (renderer_context.did_superscript) { + renderer_context.did_superscript = 0; } } }