Code

Clear the mssage context after drag filling
[inkscape.git] / src / sp-text.cpp
index f9be549444d5986d804031f806a9f45edcf9c85a..5c2c5412c3bd8e606876b70d6c8e6d3cd2dab666 100644 (file)
@@ -248,6 +248,7 @@ sp_text_update (SPObject *object, SPCtx *ctx, guint flags)
         sp_item_invoke_bbox(text, &paintbox, NR::identity(), TRUE);
         for (SPItemView* v = text->display; v != NULL; v = v->next) {
             text->_clearFlow(NR_ARENA_GROUP(v->arenaitem));
+            nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object));
             // pass the bbox of the text object as paintbox (used for paintserver fills)
             text->layout.show(NR_ARENA_GROUP(v->arenaitem), &paintbox);
         }
@@ -273,6 +274,7 @@ sp_text_modified (SPObject *object, guint flags)
         sp_item_invoke_bbox(text, &paintbox, NR::identity(), TRUE);
         for (SPItemView* v = text->display; v != NULL; v = v->next) {
             text->_clearFlow(NR_ARENA_GROUP(v->arenaitem));
+            nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object));
             text->layout.show(NR_ARENA_GROUP(v->arenaitem), &paintbox);
         }
     }
@@ -301,13 +303,14 @@ sp_text_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
     SPText *text = SP_TEXT (object);
 
     if (flags & SP_OBJECT_WRITE_BUILD) {
+        Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
         if (!repr)
-            repr = sp_repr_new ("svg:text");
+            repr = xml_doc->createElement("svg:text");
         GSList *l = NULL;
         for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
             Inkscape::XML::Node *crepr = NULL;
             if (SP_IS_STRING(child)) {
-                crepr = sp_repr_new_text(SP_STRING(child)->string.c_str());
+                crepr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
             } else {
                 crepr = child->updateRepr(NULL, flags);
             }
@@ -375,6 +378,8 @@ sp_text_show(SPItem *item, NRArena *arena, unsigned /* key*/, unsigned /*flags*/
     NRArenaGroup *flowed = NRArenaGroup::create(arena);
     nr_arena_group_set_transparent (flowed, FALSE);
 
+    nr_arena_group_set_style(flowed, group->style);
+
     // pass the bbox of the text object as paintbox (used for paintserver fills)
     NRRect paintbox;
     sp_item_invoke_bbox(item, &paintbox, NR::identity(), TRUE);