1 /* imposter (OO.org Impress viewer)
2 ** Copyright (C) 2003-2005 Gurer Ozen
3 ** This code is free software; you can redistribute it and/or
4 ** modify it under the terms of GNU General Public License.
11 get_style(ImpRenderCtx *ctx, iks *node, char *style, char *attr)
16 if (!style) return NULL;
18 if (iks_root (node) == ctx->content) {
19 x = iks_find_with_attrib (iks_find (ctx->content, "office:automatic-styles"),
20 "style:style", "style:name", style);
22 x = iks_find_with_attrib (iks_find (ctx->styles, "office:automatic-styles"),
23 "style:style", "style:name", style);
28 ret = iks_find_attrib (iks_find (x, "style:properties"), attr);
30 ret = iks_find_attrib (iks_find (x, "style:text-properties"), attr);
32 ret = iks_find_attrib (iks_find (x, "style:paragraph-properties"), attr);
34 ret = iks_find_attrib (iks_find (x, "style:graphic-properties"), attr);
36 ret = iks_find_attrib (iks_find (x, "style:drawing-page-properties"), attr);
39 style = iks_find_attrib (x, "style:parent-style-name");
40 if (!style) return NULL;
42 x = iks_find_with_attrib (iks_find (ctx->styles, "office:styles"),
43 "style:style", "style:name", style);
50 r_get_style (ImpRenderCtx *ctx, iks *node, char *attr)
55 ret = iks_find_attrib (node, attr);
58 for (x = node; x; x = iks_parent (x)) {
59 s = iks_find_attrib (x, "text:style-name");
60 ret = get_style (ctx, node, s, attr);
62 s = iks_find_attrib (x, "presentation:style-name");
63 ret = get_style (ctx, node, s, attr);
65 s = iks_find_attrib (x, "draw:style-name");
66 ret = get_style (ctx, node, s, attr);
74 get_style_x (ImpRenderCtx *ctx, iks *node, char *style, char *attr)
78 if (!style) return NULL;
80 if (iks_root (node) == ctx->content) {
81 x = iks_find_with_attrib (iks_find (ctx->content, "office:automatic-styles"),
82 "text:list-style", "style:name", style);
84 x = iks_find_with_attrib (iks_find (ctx->styles, "office:automatic-styles"),
85 "text:list-style", "style:name", style);
91 r_get_bullet (ImpRenderCtx *ctx, iks *node, char *attr)
97 for (x = node; x; x = iks_parent (x)) {
98 s = iks_find_attrib (x, "text:style-name");
99 ret = get_style_x (ctx, node, s, attr);
101 s = iks_find_attrib (x, "presentation:style-name");
102 ret = get_style_x (ctx, node, s, attr);
104 s = iks_find_attrib (x, "draw:style-name");
105 ret = get_style_x (ctx, node, s, attr);