From bee370d047b32376fbf718c7dd0f3ef8f35b5036 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 2 Sep 2011 14:59:21 +1000 Subject: Removed archaic unused deallocation calls. --- gtk/PlatGTK.cxx | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'gtk') diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index b8ee6b385..39dba1d71 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1592,7 +1592,6 @@ void SurfaceImpl::DrawTextBase(PRectangle rc, Font &font_, int ybase, const char int xText = rc.left; if (PFont(font_)->pfd) { char *utfForm = 0; - bool useGFree = false; if (et == UTF8) { pango_layout_set_text(layout, s, len); } else { @@ -1626,11 +1625,7 @@ void SurfaceImpl::DrawTextBase(PRectangle rc, Font &font_, int ybase, const char #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 @@ -1808,7 +1803,6 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, int *positi } 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) { @@ -1830,11 +1824,7 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, int *positi } clusterStart = clusterEnd; } - if (useGFree) { - g_free(utfForm); - } else { - delete []utfForm; - } + delete []utfForm; PLATFORM_ASSERT(i == lenPositions); } } @@ -1910,7 +1900,6 @@ int 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 { @@ -1933,11 +1922,7 @@ int 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_PIXELS(pos.width); } #ifndef DISABLE_GDK_FONT -- cgit v1.2.3 From 7b37ceb5f14dbc8bf17c03c7b6e202bf023cfac7 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 6 Sep 2011 15:49:25 +1000 Subject: Always use Cairo for drawing. --- gtk/PlatGTK.cxx | 4 +--- gtk/ScintillaGTK.cxx | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'gtk') diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 39dba1d71..8fe55145a 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 @@ -2961,7 +2959,7 @@ bool Platform::IsDBCSLeadByte(int codePage, char ch) { // Shift_jis return ((uch >= 0x81) && (uch <= 0x9F)) || ((uch >= 0xE0) && (uch <= 0xFC)); - // Lead bytes F0 to FC may be a Microsoft addition. + // Lead bytes F0 to FC may be a Microsoft addition. case 936: // GBK return (uch >= 0x81) && (uch <= 0xFE); diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index b7cea5ed3..0932c6e3b 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -74,9 +74,7 @@ #define IS_WIDGET_VISIBLE(w) (GTK_WIDGET_VISIBLE(w)) #endif -#if GTK_CHECK_VERSION(2,22,0) #define USE_CAIRO 1 -#endif static GdkWindow *WindowFromWidget(GtkWidget *w) { #if GTK_CHECK_VERSION(3,0,0) -- cgit v1.2.3