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 21:39:25 -0000
@@ -718,15 +718,16 @@ current_width (EllipsizeState *state)
  * 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
+int
 _pango_layout_line_ellipsize (PangoLayoutLine *line,
 			      PangoAttrList   *attrs)
 {
   EllipsizeState state;
+  int is_ellipsized = 0;
 
   if (line->layout->ellipsize == PANGO_ELLIPSIZE_NONE ||
       line->layout->width < 0)
-    return;
+    goto ret; 
 
   init_state (&state, line, attrs);
 
@@ -737,15 +738,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 = 1;
 
  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 21:40:39 -0000
@@ -52,6 +52,7 @@ struct _PangoLayout
   
   guint wrap : 2;		/* PangoWrapMode */
   guint ellipsize : 2;		/* PangoEllipsizeMode */
+  guint is_ellipsized : 1; /* Whether the Layout is effectively ellpsized 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,
+int _pango_layout_line_ellipsize (PangoLayoutLine *line,
 				   PangoAttrList   *attrs);
 
 #endif /* __PANGO_LAYOUT_PRIVATE_H__ */
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 21:41:01 -0000
@@ -149,7 +149,7 @@ static void pango_layout_check_lines (Pa
 static PangoAttrList *pango_layout_get_effective_attributes (PangoLayout *layout);
 
 static PangoLayoutLine * pango_layout_line_new         (PangoLayout     *layout);
-static void              pango_layout_line_postprocess (PangoLayoutLine *line,
+static int              pango_layout_line_postprocess (PangoLayoutLine *line,
 							ParaBreakState  *state);
 
 static int *pango_layout_line_get_log2vis_map (PangoLayoutLine  *line,
@@ -185,6 +185,7 @@ pango_layout_init (PangoLayout *layout)
 
   layout->wrap = PANGO_WRAP_WORD;
   layout->ellipsize = PANGO_ELLIPSIZE_NONE;
+  layout->is_ellipsized = 0;
 }
 
 static void
@@ -810,6 +811,12 @@ pango_layout_set_ellipsize (PangoLayout 
     }
 }
 
+gboolean
+pango_layout_is_ellipsized (PangoLayout *layout)
+{
+  return (layout->is_ellipsized != 0) ? TRUE : FALSE;
+}
+
 /**
  * pango_layout_get_ellipsize:
  * @layout: a #PangoLayout
@@ -2352,6 +2359,8 @@ pango_layout_get_pixel_size (PangoLayout
 static void
 pango_layout_clear_lines (PangoLayout *layout)
 {
+  layout->is_ellipsized = 0;
+
   if (layout->lines)
     {
       GSList *tmp_list = layout->lines;
@@ -3065,7 +3074,7 @@ line_set_resolved_dir (PangoLayoutLine *
     }
 }
 
-static void
+static int
 process_line (PangoLayout    *layout,
 	      ParaBreakState *state)
 {
@@ -3075,6 +3084,7 @@ process_line (PangoLayout    *layout,
   int break_remaining_width = 0;    /* Remaining width before adding run with break */
   int break_start_offset = 0;	    /* Start width before adding run with break */
   GSList *break_link = NULL;        /* Link holding run before break */
+  int line_is_ellipsized = 0;     /* Whether the line is effectively ellpisized */
 
   line = pango_layout_line_new (layout);
   line->start_index = state->line_start_index;
@@ -3152,10 +3162,12 @@ process_line (PangoLayout    *layout,
     }
 
  done:  
-  pango_layout_line_postprocess (line, state);
+  line_is_ellipsized = pango_layout_line_postprocess (line, state);
   layout->lines = g_slist_prepend (layout->lines, line);
   state->first_line = FALSE;
   state->line_start_index += line->length;
+
+  return line_is_ellipsized;
 }
 
 static void
@@ -3397,7 +3409,7 @@ pango_layout_check_lines (PangoLayout *l
 	  state.log_widths = NULL;
 	  
 	  while (state.items)
-            process_line (layout, &state);
+            layout->is_ellipsized |= process_line (layout, &state);
 	}
       else
         {
@@ -4395,10 +4407,12 @@ adjust_line_letter_spacing (PangoLayoutL
     line->runs = g_slist_reverse (line->runs);
 }
 
-static void
+static int
 pango_layout_line_postprocess (PangoLayoutLine *line,
 			       ParaBreakState  *state)
 {
+  int line_is_ellipsized = 0;
+
   /* NB: the runs are in reverse order at this point, since we prepended them to the list
    */
   
@@ -4408,7 +4422,7 @@ pango_layout_line_postprocess (PangoLayo
 
   /* Ellipsize the line if necessary
    */
-  _pango_layout_line_ellipsize (line, state->attrs);
+  line_is_ellipsized = _pango_layout_line_ellipsize (line, state->attrs);
   
   /* Now convert logical to visual order
    */
@@ -4417,6 +4431,8 @@ pango_layout_line_postprocess (PangoLayo
   /* Fixup letter spacing between runs
    */
   adjust_line_letter_spacing (line);
+
+  return line_is_ellipsized;
 }
 
 static void
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 21:41:02 -0000
@@ -151,8 +151,9 @@ void           pango_layout_set_single_p
 gboolean       pango_layout_get_single_paragraph_mode (PangoLayout                *layout);
 
 void               pango_layout_set_ellipsize (PangoLayout        *layout,
-					       PangoEllipsizeMode  ellipsize);
+                              					       PangoEllipsizeMode  ellipsize);
 PangoEllipsizeMode pango_layout_get_ellipsize (PangoLayout        *layout);
+gboolean  pango_layout_is_ellipsized          (PangoLayout *layout);
 
 void           pango_layout_context_changed (PangoLayout    *layout);
 
