Code

fix style querying: now all objects have style, so to go up from SPStrings we need...
authorbuliabyak <buliabyak@users.sourceforge.net>
Wed, 27 Jun 2007 00:47:49 +0000 (00:47 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Wed, 27 Jun 2007 00:47:49 +0000 (00:47 +0000)
src/text-context.cpp

index 670a863acb01f6b10cfcb6ad710bf399b20655d9..b45cd6e58090af5155975ba251de874154852655 100644 (file)
@@ -1402,8 +1402,9 @@ sp_text_context_style_query(SPStyle *style, int property, SPTextContext *tc)
         layout->getSourceOfCharacter(it, &rawptr);
         pos_obj = SP_OBJECT(rawptr);
         if (pos_obj == 0) continue;
-        while (SP_OBJECT_STYLE(pos_obj) == NULL && SP_OBJECT_PARENT(pos_obj))
-            pos_obj = SP_OBJECT_PARENT(pos_obj);   // SPStrings don't have style
+        while (SP_IS_STRING(pos_obj) && SP_OBJECT_PARENT(pos_obj)) {
+           pos_obj = SP_OBJECT_PARENT(pos_obj);   // SPStrings don't have style
+        }
         styles_list = g_slist_prepend(styles_list, (gpointer)pos_obj);
     }