Index: pango/ellipsize.c
===================================================================
RCS file: /cvs/gnome/pango/pango/ellipsize.c,v
retrieving revision 1.8
diff -u -p -r1.8 ellipsize.c
--- pango/ellipsize.c	17 Feb 2006 08:11:02 -0000	1.8
+++ pango/ellipsize.c	19 Oct 2006 23:41:06 -0000
@@ -714,19 +714,23 @@ current_width (EllipsizeState *state)
  * _pango_layout_line_ellipsize:
  * @line: a #PangoLayoutLine
  * @attrs: Attributes being used for itemization/shaping
+ *
+ * Return value: whether the line had to be ellipsized
  * 
  * Given a PangoLayoutLine with the runs still in logical order, ellipsize
  * it according the layout's policy to fit within the set width of the layout.
+ *
  **/
-void
+gboolean
 _pango_layout_line_ellipsize (PangoLayoutLine *line,
 			      PangoAttrList   *attrs)
 {
   EllipsizeState state;
+  gboolean is_ellipsized = FALSE;
 
   if (line->layout->ellipsize == PANGO_ELLIPSIZE_NONE ||
       line->layout->width < 0)
-    return;
+    goto ret; 
 
   init_state (&state, line, attrs);
 
@@ -737,15 +741,17 @@ _pango_layout_line_ellipsize (PangoLayou
 
   while (current_width (&state) > state.layout->width)
     {
-      if (!remove_one_span (&state))
-	break;
+      if (!remove_one_span (&state)) break;
     }
 
   fixup_ellipsis_run (&state);
   
   g_slist_free (line->runs);
   line->runs = get_run_list (&state);
+  is_ellipsized = TRUE;
 
  out:
   free_state (&state);
+ ret:
+  return is_ellipsized;
 }
Index: pango/pango-layout-private.h
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-layout-private.h,v
retrieving revision 1.1
diff -u -p -r1.1 pango-layout-private.h
--- pango/pango-layout-private.h	14 Jul 2004 22:17:35 -0000	1.1
+++ pango/pango-layout-private.h	19 Oct 2006 23:41:06 -0000
@@ -52,6 +52,7 @@ struct _PangoLayout
   
   guint wrap : 2;		/* PangoWrapMode */
   guint ellipsize : 2;		/* PangoEllipsizeMode */
+  gboolean is_ellipsized; /* Whether the layout is effectively ellipsized or not */
   
   gint n_chars;		        /* Total number of characters in layout */
   PangoLogAttr *log_attrs;	/* Logical attributes for layout's text */
@@ -65,7 +66,7 @@ struct _PangoLayout
 
 G_END_DECLS
 
-void _pango_layout_line_ellipsize (PangoLayoutLine *line,
+gboolean _pango_layout_line_ellipsize (PangoLayoutLine *line,
 				   PangoAttrList   *attrs);
 
 #endif /* __PANGO_LAYOUT_PRIVATE_H__ */
Index: pango/pango-layout.h
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-layout.h,v
retrieving revision 1.38
diff -u -p -r1.38 pango-layout.h
--- pango/pango-layout.h	20 Aug 2006 17:41:35 -0000	1.38
+++ pango/pango-layout.h	19 Oct 2006 23:41:06 -0000
@@ -153,6 +153,7 @@ gboolean       pango_layout_get_single_p
 void               pango_layout_set_ellipsize (PangoLayout        *layout,
 					       PangoEllipsizeMode  ellipsize);
 PangoEllipsizeMode pango_layout_get_ellipsize (PangoLayout        *layout);
+gboolean pango_layout_is_ellipsized           (PangoLayout *layout);
 
 void           pango_layout_context_changed (PangoLayout    *layout);
 
Index: pango/pango-layout.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-layout.c,v
retrieving revision 1.191
diff -u -p -r1.191 pango-layout.c
--- pango/pango-layout.c	18 Sep 2006 19:57:16 -0000	1.191
+++ pango/pango-layout.c	19 Oct 2006 23:41:14 -0000
@@ -185,6 +185,7 @@ pango_layout_init (PangoLayout *layout)
 
   layout->wrap = PANGO_WRAP_WORD;
   layout->ellipsize = PANGO_ELLIPSIZE_NONE;
+  layout->is_ellipsized = FALSE;
 }
 
 static void
@@ -781,6 +782,19 @@ pango_layout_get_single_paragraph_mode (
 }
 
 /**
+ * pango_layout_is_ellipsized:
+ * @layout: a #PangoLayout
+ * 
+ * Return value: whether the layout is effectively ellipsized or not
+ *
+ */
+gboolean
+pango_layout_is_ellipsized (PangoLayout *layout)
+{
+  return layout->is_ellipsized;
+}
+
+/**
  * pango_layout_set_ellipsize:
  * @layout: a #PangoLayout
  * @ellipsize: the new ellipsization mode for @layout
@@ -2352,6 +2366,8 @@ pango_layout_get_pixel_size (PangoLayout
 static void
 pango_layout_clear_lines (PangoLayout *layout)
 {
+  layout->is_ellipsized = FALSE;
+
   if (layout->lines)
     {
       GSList *tmp_list = layout->lines;
@@ -4408,7 +4424,8 @@ pango_layout_line_postprocess (PangoLayo
 
   /* Ellipsize the line if necessary
    */
-  _pango_layout_line_ellipsize (line, state->attrs);
+  if (_pango_layout_line_ellipsize (line, state->attrs))
+    line->layout->is_ellipsized = TRUE;
   
   /* Now convert logical to visual order
    */
