Copying text with pattern stroke and fill + text decoration issue
Hi all,
After adding pattern fill and stroke support for text decoration I found that if both text decoration and a pattern are active, then trying to copy a text object with that combination crashes inkscape. That is, in rough terms, if the input file contains:
<text > <tspan style=" pattern fill " > A <tspan style="text-decoration:underline">B</tspan></tspan></text>
it loads and renders properly. But if "AB" is selected as an object (not as the text) and "^c" to copy, it crashes in style.cpp in sp_style_paint_server_ref_modified because "server" is not the same as style->getStrokePaintServer() (or style->getTextDecorationStrokePaintServer(), but these last two are identical in the test cases.) That is (sorry about the wrap):
(gdb) print *server $1 = {<SPObject> = {_vptr.SPObject = 0x8a13e48, cloned = 0, uflags = 0, mflags = 0, xml_space = {set = 0, value = 0}, hrefcount = 1, _total_hrefcount = 1, document = 0x9232a80, parent = 0xa082ad8, children = 0xa086210, _last_child = 0xa086210, next = 0xa0c2ea8, id = 0xbadc000 "Packedcircles", repr = 0xbbb26f0, refCount = 4, style = 0xa096200, _release_signal = {<sigc::signal1<void, SPObject*, sigc::nil>> = {sigc::signal_base = {sigc::trackable = {callback_list_ = 0x0}, impl_ = 0xa0f6d48}, <No data fields>}, <No data fields>}, _delete_signal = {<sigc::signal1<void, SPObject*, sigc::nil>> = {sigc::signal_base = {sigc::trackable = {callback_list_ = 0x0}, impl_ = 0x0}, <No data fields>}, <No data fields>}, _position_changed_signal = {<sigc::signal1<void, SPObject*, sigc::nil>> = {sigc::signal_base = {sigc::trackable = {callback_list_ = 0x0}, impl_ = 0x0}, <No data fields>}, <No data fields>}, _modified_signal = {<sigc::signal2<void, SPObject*, unsigned int, sigc::nil>> = {sigc::signal_base = {sigc::trackable = { callback_list_ = 0x0}, impl_ = 0xa0765e8}, <No data fields>}, <No data fields>}, _successor = 0x0, _collection_policy = SPObject::ALWAYS_COLLECT, _label = 0x0, _default_label = 0x0}, swatch = false}
(gdb) print *style->getTextDecorationStrokePaintServer() $2 = {<SPObject> = {_vptr.SPObject = 0x8a13e48, cloned = 0, uflags = 0, mflags = 0, xml_space = {set = 0, value = 0}, hrefcount = 7, _total_hrefcount = 7, document = 0x9232a80, parent = 0xa082ad8, children = 0x0, _last_child = 0x0, next = 0xa099530, id = 0xa059ab0 "pattern5506", repr = 0xbbb5ff0, refCount = 1, style = 0xa07be48, _release_signal = {<sigc::signal1<void, SPObject*, sigc::nil>> = {sigc::signal_base = {sigc::trackable = {callback_list_ = 0x0}, impl_ = 0xa0ccfc0}, <No data fields>}, <No data fields>}, _delete_signal = {<sigc::signal1<void, SPObject*, sigc::nil>> = {sigc::signal_base = {sigc::trackable = {callback_list_ = 0x0}, impl_ = 0x0}, <No data fields>}, <No data fields>}, _position_changed_signal = {<sigc::signal1<void, SPObject*, sigc::nil>> = {sigc::signal_base = {sigc::trackable = {callback_list_ = 0x0}, impl_ = 0x0}, <No data fields>}, <No data fields>}, _modified_signal = {<sigc::signal2<void, SPObject*, unsigned int, sigc::nil>> = {sigc::signal_base = {sigc::trackable = { callback_list_ = 0x0}, impl_ = 0xa0e8fd0}, <No data fields>}, <No data fields>}, _successor = 0x0, _collection_policy = SPObject::ALWAYS_COLLECT, _label = 0x0, _default_label = 0x0}, swatch = false}
It seems like the objects are put together differently when they are copied than when they are just read in. The clue comes from the "pattern5506" above. That ID isn't in the original file, it is somehow created during the copy operation. Can somebody tell me where that is happening? The object construction when the file is opened or reverted is in style.cpp, if the copy feeds through there too, I guess the question becomes "where is the SVG created" that is fed into it.
If the text-decoration just uses solid colors and fills there are no issues copying a complex formatted text object with text decorations. It is only when patterns and text decorations are both present that things go south.
Thanks,
David Mathog mathog@...1176... Manager, Sequence Analysis Facility, Biology Division, Caltech
participants (1)
-
mathog