summaryrefslogtreecommitdiff
path: root/pango/pango-markup.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-02-10 19:36:52 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-02-10 19:36:52 +0000
commitd36c9d1c576b78bfe9403f39ae6ef13132790a05 (patch)
tree20340437c90943a8fc74c5dfc89c2c9a4b5ebc97 /pango/pango-markup.c
parent7b40f0d6d84d3c1205ff86c7c126dd91f4a5f5b6 (diff)
downloadpango-d36c9d1c576b78bfe9403f39ae6ef13132790a05.tar.gz
Handle 'tag' being NULL in a bunch of places. (#122844, Noah Levitt)
Tue Feb 10 14:33:54 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-markup.c: Handle 'tag' being NULL in a bunch of places. (#122844, Noah Levitt)
Diffstat (limited to 'pango/pango-markup.c')
-rw-r--r--pango/pango-markup.c42
1 files changed, 30 insertions, 12 deletions
diff --git a/pango/pango-markup.c b/pango/pango-markup.c
index df139d97..a0697380 100644
--- a/pango/pango-markup.c
+++ b/pango/pango-markup.c
@@ -767,8 +767,11 @@ big_parse_func (MarkupData *md,
CHECK_NO_ATTRS("big");
/* Grow text one level */
- tag->scale_level_delta += 1;
- tag->scale_level += 1;
+ if (tag)
+ {
+ tag->scale_level_delta += 1;
+ tag->scale_level += 1;
+ }
return TRUE;
}
@@ -989,13 +992,19 @@ span_parse_func (MarkupData *md,
}
else if (strcmp (size, "smaller") == 0)
{
- tag->scale_level_delta -= 1;
- tag->scale_level -= 1;
+ if (tag)
+ {
+ tag->scale_level_delta -= 1;
+ tag->scale_level -= 1;
+ }
}
else if (strcmp (size, "larger") == 0)
{
- tag->scale_level_delta += 1;
- tag->scale_level += 1;
+ if (tag)
+ {
+ tag->scale_level_delta += 1;
+ tag->scale_level += 1;
+ }
}
else if (parse_absolute_size (tag, size))
; /* nothing */
@@ -1262,8 +1271,11 @@ sub_parse_func (MarkupData *md,
CHECK_NO_ATTRS("sub");
/* Shrink font, and set a negative rise */
- tag->scale_level_delta -= 1;
- tag->scale_level -= 1;
+ if (tag)
+ {
+ tag->scale_level_delta -= 1;
+ tag->scale_level -= 1;
+ }
add_attribute (tag, pango_attr_rise_new (-SUPERSUB_RISE));
@@ -1281,8 +1293,11 @@ sup_parse_func (MarkupData *md,
CHECK_NO_ATTRS("sup");
/* Shrink font, and set a positive rise */
- tag->scale_level_delta -= 1;
- tag->scale_level -= 1;
+ if (tag)
+ {
+ tag->scale_level_delta -= 1;
+ tag->scale_level -= 1;
+ }
add_attribute (tag, pango_attr_rise_new (SUPERSUB_RISE));
@@ -1300,8 +1315,11 @@ small_parse_func (MarkupData *md,
CHECK_NO_ATTRS("small");
/* Shrink text one level */
- tag->scale_level_delta -= 1;
- tag->scale_level -= 1;
+ if (tag)
+ {
+ tag->scale_level_delta -= 1;
+ tag->scale_level -= 1;
+ }
return TRUE;
}