diff options
author | nyamatongwe <unknown> | 2011-09-09 16:59:38 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2011-09-09 16:59:38 +1000 |
commit | c4e2263b026a0b5aa67c421b767c3ebbabda654f (patch) | |
tree | a81b91816ba7a5b16ad676ba3a2776e99a3316af /gtk/PlatGTK.cxx | |
parent | 9f1e13f587c8c3221a99cd2beee90242c32862fc (diff) | |
parent | 9b4a855ed7962ce5da8c3e538a38f3eb396a8cc7 (diff) | |
download | scintilla-mirror-c4e2263b026a0b5aa67c421b767c3ebbabda654f.tar.gz |
Merge with main repository.
Diffstat (limited to 'gtk/PlatGTK.cxx')
-rw-r--r-- | gtk/PlatGTK.cxx | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index a8bd051a8..ffb04d005 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -43,9 +43,7 @@ #define IS_WIDGET_FOCUSSED(w) (GTK_WIDGET_HAS_FOCUS(w)) #endif -#if GTK_CHECK_VERSION(2,22,0) #define USE_CAIRO 1 -#endif #ifdef USE_CAIRO @@ -1589,7 +1587,6 @@ void SurfaceImpl::DrawTextBase(PRectangle rc, Font &font_, XYPOSITION ybase, con XYPOSITION xText = rc.left; if (PFont(font_)->pfd) { char *utfForm = 0; - bool useGFree = false; if (et == UTF8) { pango_layout_set_text(layout, s, len); } else { @@ -1623,11 +1620,7 @@ void SurfaceImpl::DrawTextBase(PRectangle rc, Font &font_, XYPOSITION ybase, con #else gdk_draw_layout_line(drawable, gc, xText, ybase, pll); #endif - if (useGFree) { - g_free(utfForm); - } else { - delete []utfForm; - } + delete []utfForm; return; } #ifndef DISABLE_GDK_FONT @@ -1805,7 +1798,6 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION } if (positionsCalculated < 1 ) { // Either Latin1 or DBCS conversion failed so treat as Latin1. - bool useGFree = false; SetConverter(PFont(font_)->characterSet); char *utfForm = UTF8FromIconv(conv, s, len); if (!utfForm) { @@ -1827,11 +1819,7 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION } clusterStart = clusterEnd; } - if (useGFree) { - g_free(utfForm); - } else { - delete []utfForm; - } + delete []utfForm; PLATFORM_ASSERT(i == lenPositions); } } @@ -1907,7 +1895,6 @@ XYPOSITION SurfaceImpl::WidthText(Font &font_, const char *s, int len) { char *utfForm = 0; pango_layout_set_font_description(layout, PFont(font_)->pfd); PangoRectangle pos; - bool useGFree = false; if (et == UTF8) { pango_layout_set_text(layout, s, len); } else { @@ -1930,11 +1917,7 @@ XYPOSITION SurfaceImpl::WidthText(Font &font_, const char *s, int len) { PangoLayoutLine *pangoLine = pango_layout_get_line(layout,0); #endif pango_layout_line_get_extents(pangoLine, NULL, &pos); - if (useGFree) { - g_free(utfForm); - } else { - delete []utfForm; - } + delete []utfForm; return pango_units_to_double(pos.width); } #ifndef DISABLE_GDK_FONT |