summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-02-06 22:07:47 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-02-06 22:07:47 +0000
commit99b7d4a1894f29ee6617380d4fc0b9b7d98c3033 (patch)
tree32340c5f23195d9a0d9ec6b3e7f180953eed63cd
parent2d1b1a623c796825d1eaa21b845cbe27bcdbeb73 (diff)
downloadgtk+-99b7d4a1894f29ee6617380d4fc0b9b7d98c3033.tar.gz
Add warnings if you try to use a child anchor that isn't inside a buffer.
2002-02-06 Havoc Pennington <hp@redhat.com> * gtk/gtktextchild.c: Add warnings if you try to use a child anchor that isn't inside a buffer. Really kind of lame; we should separate the anchor from the buffer. But not worth fixing for now. #70601
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLog.pre-2-07
-rw-r--r--ChangeLog.pre-2-107
-rw-r--r--ChangeLog.pre-2-27
-rw-r--r--ChangeLog.pre-2-47
-rw-r--r--ChangeLog.pre-2-67
-rw-r--r--ChangeLog.pre-2-87
-rw-r--r--gtk/gtktextchild.c13
8 files changed, 62 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7416948f74..ca832684f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-02-06 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextchild.c: Add warnings if you try to use a child
+ anchor that isn't inside a buffer. Really kind of lame;
+ we should separate the anchor from the buffer. But not worth
+ fixing for now. #70601
+
Wed Feb 6 18:25:24 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c: rip out all the debugging ifdefs, as
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 7416948f74..ca832684f5 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,10 @@
+2002-02-06 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextchild.c: Add warnings if you try to use a child
+ anchor that isn't inside a buffer. Really kind of lame;
+ we should separate the anchor from the buffer. But not worth
+ fixing for now. #70601
+
Wed Feb 6 18:25:24 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c: rip out all the debugging ifdefs, as
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 7416948f74..ca832684f5 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,10 @@
+2002-02-06 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextchild.c: Add warnings if you try to use a child
+ anchor that isn't inside a buffer. Really kind of lame;
+ we should separate the anchor from the buffer. But not worth
+ fixing for now. #70601
+
Wed Feb 6 18:25:24 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c: rip out all the debugging ifdefs, as
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 7416948f74..ca832684f5 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,10 @@
+2002-02-06 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextchild.c: Add warnings if you try to use a child
+ anchor that isn't inside a buffer. Really kind of lame;
+ we should separate the anchor from the buffer. But not worth
+ fixing for now. #70601
+
Wed Feb 6 18:25:24 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c: rip out all the debugging ifdefs, as
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 7416948f74..ca832684f5 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,10 @@
+2002-02-06 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextchild.c: Add warnings if you try to use a child
+ anchor that isn't inside a buffer. Really kind of lame;
+ we should separate the anchor from the buffer. But not worth
+ fixing for now. #70601
+
Wed Feb 6 18:25:24 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c: rip out all the debugging ifdefs, as
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 7416948f74..ca832684f5 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,10 @@
+2002-02-06 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextchild.c: Add warnings if you try to use a child
+ anchor that isn't inside a buffer. Really kind of lame;
+ we should separate the anchor from the buffer. But not worth
+ fixing for now. #70601
+
Wed Feb 6 18:25:24 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c: rip out all the debugging ifdefs, as
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 7416948f74..ca832684f5 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,10 @@
+2002-02-06 Havoc Pennington <hp@redhat.com>
+
+ * gtk/gtktextchild.c: Add warnings if you try to use a child
+ anchor that isn't inside a buffer. Really kind of lame;
+ we should separate the anchor from the buffer. But not worth
+ fixing for now. #70601
+
Wed Feb 6 18:25:24 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c: rip out all the debugging ifdefs, as
diff --git a/gtk/gtktextchild.c b/gtk/gtktextchild.c
index f22f10a79d..d340c71d2d 100644
--- a/gtk/gtktextchild.c
+++ b/gtk/gtktextchild.c
@@ -52,6 +52,9 @@
#include "gtktextbtree.h"
#include "gtktextlayout.h"
+#define CHECK_IN_BUFFER(anchor) do { if ((anchor)->segment == NULL) g_warning ("%s: GtkTextChildAnchor hasn't been in a buffer yet", __FUNCTION__); } while (0)
+#define CHECK_IN_BUFFER_RETURN(anchor, val) do { if ((anchor)->segment == NULL) g_warning ("%s: GtkTextChildAnchor hasn't been in a buffer yet", __FUNCTION__); return (val); } while (0)
+
static GtkTextLineSegment *
pixbuf_segment_cleanup_func (GtkTextLineSegment *seg,
GtkTextLine *line)
@@ -402,6 +405,8 @@ gtk_text_child_anchor_get_widgets (GtkTextChildAnchor *anchor)
GList *list = NULL;
GSList *iter;
+ CHECK_IN_BUFFER_RETURN (anchor, NULL);
+
g_return_val_if_fail (seg->type = &gtk_text_child_type, NULL);
iter = seg->body.child.widgets;
@@ -436,6 +441,8 @@ gtk_text_child_anchor_get_deleted (GtkTextChildAnchor *anchor)
{
GtkTextLineSegment *seg = anchor->segment;
+ CHECK_IN_BUFFER_RETURN (anchor, TRUE);
+
g_return_val_if_fail (seg->type = &gtk_text_child_type, TRUE);
return seg->body.child.tree == NULL;
@@ -449,6 +456,8 @@ gtk_text_child_anchor_register_child (GtkTextChildAnchor *anchor,
g_return_if_fail (GTK_IS_TEXT_CHILD_ANCHOR (anchor));
g_return_if_fail (GTK_IS_WIDGET (child));
+ CHECK_IN_BUFFER (anchor);
+
_gtk_anchored_child_set_layout (child, layout);
_gtk_widget_segment_add (anchor->segment, child);
@@ -463,6 +472,8 @@ gtk_text_child_anchor_unregister_child (GtkTextChildAnchor *anchor,
g_return_if_fail (GTK_IS_TEXT_CHILD_ANCHOR (anchor));
g_return_if_fail (GTK_IS_WIDGET (child));
+ CHECK_IN_BUFFER (anchor);
+
if (_gtk_anchored_child_get_layout (child))
{
gtk_text_child_anchor_queue_resize (anchor,
@@ -484,6 +495,8 @@ gtk_text_child_anchor_queue_resize (GtkTextChildAnchor *anchor,
g_return_if_fail (GTK_IS_TEXT_CHILD_ANCHOR (anchor));
g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
+
+ CHECK_IN_BUFFER (anchor);
seg = anchor->segment;