aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/PlatGTK.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/PlatGTK.cxx')
-rw-r--r--gtk/PlatGTK.cxx23
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