diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2015-12-09 00:45:44 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2015-12-09 00:45:44 +0000 |
| commit | 1c18349cc106bb55c7bca12fd572fb7b899ff225 (patch) | |
| tree | 68150ab0e7a637f7f7d3b3e97424c03827409570 /src/extension/internal/cairo-render-context.cpp | |
| parent | finally removed all GSList from main folder .h files (diff) | |
| download | inkscape-1c18349cc106bb55c7bca12fd572fb7b899ff225.tar.gz inkscape-1c18349cc106bb55c7bca12fd572fb7b899ff225.zip | |
replaced remaining GHashTable with std::map
(bzr r14504.1.16)
Diffstat (limited to 'src/extension/internal/cairo-render-context.cpp')
| -rw-r--r-- | src/extension/internal/cairo-render-context.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 97b84606f..8b7a22f21 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -130,14 +130,12 @@ CairoRenderContext::CairoRenderContext(CairoRenderer *parent) : _clip_mode(CLIP_MODE_MASK), _omittext_state(EMPTY) { - font_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, font_data_free); } CairoRenderContext::~CairoRenderContext(void) { - if(font_table != NULL) { - g_hash_table_remove_all(font_table); - } + for (std::map<gpointer, cairo_font_face_t *>::const_iterator iter = font_table.begin(); iter != font_table.end(); ++iter) + font_data_free(iter->second); if (_cr) cairo_destroy(_cr); if (_surface) cairo_surface_destroy(_surface); @@ -1645,7 +1643,9 @@ CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Affine const &font_ma // create a cairo_font_face from PangoFont double size = style->font_size.computed; /// \fixme why is this variable never used? gpointer fonthash = (gpointer)font; - cairo_font_face_t *font_face = (cairo_font_face_t *)g_hash_table_lookup(font_table, fonthash); + cairo_font_face_t *font_face = NULL; + if(font_table.find(fonthash)!=font_table.end()) + font_face = font_table[fonthash]; FcPattern *fc_pattern = NULL; @@ -1660,7 +1660,7 @@ CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Affine const &font_ma if(font_face == NULL) { font_face = cairo_win32_font_face_create_for_logfontw(&lfw); - g_hash_table_insert(font_table, fonthash, font_face); + font_table[fonthash] = font_face; } # endif #else @@ -1669,7 +1669,7 @@ CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Affine const &font_ma fc_pattern = fc_font->font_pattern; if(font_face == NULL) { font_face = cairo_ft_font_face_create_for_pattern(fc_pattern); - g_hash_table_insert(font_table, fonthash, font_face); + font_table[fonthash] = font_face; } # endif #endif |
