diff options
| author | Ralf Stephan <ralf@ark.in-berlin.de> | 2006-05-29 07:05:46 +0000 |
|---|---|---|
| committer | rwst <rwst@users.sourceforge.net> | 2006-05-29 07:05:46 +0000 |
| commit | d7cafbb411464bddf1e1cf45c48308fe60cc5d2d (patch) | |
| tree | d62d005ba3a1d0111e3fbb83829524e562c0504e /src/text-context.cpp | |
| parent | Updated italian installer (diff) | |
| download | inkscape-d7cafbb411464bddf1e1cf45c48308fe60cc5d2d.tar.gz inkscape-d7cafbb411464bddf1e1cf45c48308fe60cc5d2d.zip | |
use unions for type-punning to remove some gcc-4.1 warnings
(bzr r1061)
Diffstat (limited to 'src/text-context.cpp')
| -rw-r--r-- | src/text-context.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/text-context.cpp b/src/text-context.cpp index 641d8bce2..9bfc21d1e 100644 --- a/src/text-context.cpp +++ b/src/text-context.cpp @@ -1356,12 +1356,13 @@ sp_text_context_style_query(SPStyle *style, int property, SPTextContext *tc) if (!begin_it.prevCharacter()) end_it.nextCharacter(); for (Inkscape::Text::Layout::iterator it = begin_it ; it < end_it ; it.nextStartOfSpan()) { - SPObject const *pos_obj = NULL; - layout->getSourceOfCharacter(it, (void**)&pos_obj); - if (pos_obj == NULL) continue; - while (SP_OBJECT_STYLE(pos_obj) == NULL && SP_OBJECT_PARENT(pos_obj)) - pos_obj = SP_OBJECT_PARENT(pos_obj); // SPStrings don't have style - styles_list = g_slist_prepend(styles_list, (gpointer)pos_obj); + union { SPObject const *op; void *vp; } pos_obj; + pos_obj.vp = NULL; + layout->getSourceOfCharacter(it, &pos_obj.vp); + if (pos_obj.vp == NULL) continue; + while (SP_OBJECT_STYLE(pos_obj.op) == NULL && SP_OBJECT_PARENT(pos_obj.op)) + pos_obj.op = SP_OBJECT_PARENT(pos_obj.op); // SPStrings don't have style + styles_list = g_slist_prepend(styles_list, (gpointer)pos_obj.op); } int result = sp_desktop_query_style_from_list (styles_list, style, property); |
