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.
12 get_style(ImpRenderCtx *ctx, iks *node, char *style, char *attr)
17 if (!style) return NULL;
19 if (iks_root (node) == ctx->content) {
20 x = iks_find_with_attrib (iks_find (ctx->content, "office:automatic-styles"),
21 "style:style", "style:name", style);
23 x = iks_find_with_attrib (iks_find (ctx->styles, "office:automatic-styles"),
24 "style:style", "style:name", style);
29 ret = iks_find_attrib (iks_find (x, "style:properties"), attr);
31 ret = iks_find_attrib (iks_find (x, "style:text-properties"), attr);
33 ret = iks_find_attrib (iks_find (x, "style:paragraph-properties"), attr);
35 ret = iks_find_attrib (iks_find (x, "style:graphic-properties"), attr);
37 ret = iks_find_attrib (iks_find (x, "style:drawing-page-properties"), attr);
40 style = iks_find_attrib (x, "style:parent-style-name");
41 if (!style) return NULL;
43 x = iks_find_with_attrib (iks_find (ctx->styles, "office:styles"),
44 "style:style", "style:name", style);
51 r_get_style (ImpRenderCtx *ctx, iks *node, char *attr)
56 ret = iks_find_attrib (node, attr);
59 for (x = node; x; x = iks_parent (x)) {
60 s = iks_find_attrib (x, "text:style-name");
61 ret = get_style (ctx, node, s, attr);
63 s = iks_find_attrib (x, "presentation:style-name");
64 ret = get_style (ctx, node, s, attr);
66 s = iks_find_attrib (x, "draw:style-name");
67 ret = get_style (ctx, node, s, attr);
75 get_style_x (ImpRenderCtx *ctx, iks *node, char *style, char *attr)
79 if (!style) return NULL;
81 if (iks_root (node) == ctx->content) {
82 x = iks_find_with_attrib (iks_find (ctx->content, "office:automatic-styles"),
83 "text:list-style", "style:name", style);
85 x = iks_find_with_attrib (iks_find (ctx->styles, "office:automatic-styles"),
86 "text:list-style", "style:name", style);
92 r_get_bullet (ImpRenderCtx *ctx, iks *node, char *attr)
98 for (x = node; x; x = iks_parent (x)) {
99 s = iks_find_attrib (x, "text:style-name");
100 ret = get_style_x (ctx, node, s, attr);
102 s = iks_find_attrib (x, "presentation:style-name");
103 ret = get_style_x (ctx, node, s, attr);
105 s = iks_find_attrib (x, "draw:style-name");
106 ret = get_style_x (ctx, node, s, attr);