summaryrefslogtreecommitdiff
path: root/eel/eel-editable-label.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-01-16 13:09:46 +0100
committerraveit65 <[email protected]>2022-01-30 19:34:03 +0100
commitfae6f1ca5184bd21262a68de6c3446d626934e59 (patch)
treefdbca179b118a60052ffc487ca7cde22661eb479 /eel/eel-editable-label.c
parent95dcc0147afba6c11c5eaa273e2602aecafeac8b (diff)
downloadcaja-fae6f1ca5184bd21262a68de6c3446d626934e59.tar.bz2
caja-fae6f1ca5184bd21262a68de6c3446d626934e59.tar.xz
eel-editable-label: drop eel_editable_label_clear_layout
Diffstat (limited to 'eel/eel-editable-label.c')
-rw-r--r--eel/eel-editable-label.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index a3b6813b..ab94ca9b 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -135,7 +135,6 @@ static gboolean eel_editable_label_delete_surrounding_cb (GtkIMContext
gint offset,
gint n_chars,
EelEditableLabel *label);
-static void eel_editable_label_clear_layout (EelEditableLabel *label);
static void eel_editable_label_recompute (EelEditableLabel *label);
static void eel_editable_label_ensure_layout (EelEditableLabel *label,
gboolean include_preedit);
@@ -849,7 +848,7 @@ eel_editable_label_set_font_description (EelEditableLabel *label,
else
label->font_desc = NULL;
- eel_editable_label_clear_layout (label);
+ g_clear_object (&label->layout);
}
static void
@@ -873,29 +872,15 @@ eel_editable_label_finalize (GObject *object)
g_free (label->text);
label->text = NULL;
- if (label->layout)
- {
- g_object_unref (G_OBJECT (label->layout));
- label->layout = NULL;
- }
+ g_clear_object (&label->layout);
G_OBJECT_CLASS (eel_editable_label_parent_class)->finalize (object);
}
static void
-eel_editable_label_clear_layout (EelEditableLabel *label)
-{
- if (label->layout)
- {
- g_object_unref (G_OBJECT (label->layout));
- label->layout = NULL;
- }
-}
-
-static void
eel_editable_label_recompute (EelEditableLabel *label)
{
- eel_editable_label_clear_layout (label);
+ g_clear_object (&label->layout);
eel_editable_label_check_cursor_blink (label);
}
@@ -962,8 +947,10 @@ eel_editable_label_ensure_layout (EelEditableLabel *label,
include_preedit = include_preedit != 0;
if (label->preedit_length > 0 &&
- include_preedit != label->layout_includes_preedit)
- eel_editable_label_clear_layout (label);
+ include_preedit != label->layout_includes_preedit)
+ {
+ g_clear_object (&label->layout);
+ }
widget = GTK_WIDGET (label);