diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 1626b3d..ba8bc62 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -2785,8 +2785,8 @@ oo_table_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 	GnmRange r;
 	int rows, cols;
 	int max_cols, max_rows;
-	GSList *l;
-	gint top_z = -1;
+	GSList *l, *sorted;
+	gint top_z = -1, pos;
 
 	maybe_update_progress (xin);
 
@@ -2878,8 +2878,22 @@ oo_table_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 	g_slist_free (state->chart_list);
 	state->chart_list = NULL;
 
-	state->pos.sheet->sheet_objects = g_slist_sort (state->pos.sheet->sheet_objects,
-							odf_z_idx_compare);
+	sorted = g_slist_sort (g_slist_copy (state->pos.sheet->sheet_objects),
+			       odf_z_idx_compare);
+
+	for (l = sorted, pos = 0; l != NULL; l = l->next, pos++) {
+		SheetObject *so = l->data;
+		gint old_pos = sheet_object_get_stacking (so);
+		if (IS_GNM_SO_FILLED (so)) {
+			gchar *text;
+			g_object_get (G_OBJECT(so), "text", &text, NULL);
+			g_print ("Obj; %s was at %i and should be at %i\n", text, old_pos, pos);
+		}
+		if (pos != old_pos)
+			sheet_object_adjust_stacking (so, old_pos - pos);
+	}
+	
+	g_slist_free (sorted);
 
 	state->pos.eval.col = state->pos.eval.row = 0;
 	state->pos.sheet = NULL;
