
On Tue, 2004-02-03 at 15:11, bulia byak wrote:
Mental: I noticed that editing a text node in the XML editor does not complete transaction (unlike e.g. editing an attribute) and thus breaks undo.
Ahh, good catch. Thank you ^_^
So I inserted sp_document_done() into sp_xmlview_content_changed() in widgets/sp-xmlview-content.cpp. This fixed the broken undo, but:
- I could not find out what document we are editing, so I did the
document_done function on SP_DT_DOCUMENT (SP_ACTIVE_DESKTOP). Can you rewrite it without ACTIVE_DESKTOP?
Well, as a matter of principle SPXMLViewContent shouldn't have to know anything about desktops -- the calls to sp_desktop_done() should be happening in src/dialogs/xml-tree.cpp.
But, obviously that requires SPXMLViewContent to offer some sort of notification so interested parties (e.g. src/dialogs/xml-tree.cpp) can know when the content changes.
Probably the best thing to do is to add a GObject signal to SPXMLViewContent that xml-tree.cpp can connect a signal handler to. The xml-tree.cpp handler can then invoke sp_document_done() for the proper desktop.
I can give you some pointers if you'd like to do it.
(by the way, while I'm modestly proud of the XML editor widgets, xml-tree.cpp in its current form is a glaring example of what _not_ to do -- note the use of global variables that among other things has prevented us from having more than one XML editor at a time)
- Now that the text node changes are undoable, undoing editing a text
object in XML editor has the same problem as in this bug:
http://sourceforge.net/tracker/index.php?func=detail&aid=861462&grou...
That is, if you create a text node, switch to any other tool, and then reproduce this bug's sequence but using XML editor instead of F8, the result is the same. Which proves that the source of the problem is not text tool, but the wrong way text node changes are logged and undone by the repr logger. It was only obvious in text tool because no other tools create/edit text nodes. Can you please have a look into it?
Sourceforge is down again, so I can't get to the bug tracker. Could you please summarize the bug for me in more detail?
-mental