2010/3/15 Caolán McNamara <[email protected]> > On Mon, 2010-03-15 at 15:05 +0100, Michael Stahl wrote: > > On 10/03/2010 14:26, fan Zheng wrote: > > > In OO, Some flying object related undo action in SW, for example the > inherit > > > class of SwFlyingUndoBase, refer a SwFlyFrmFmt pointer as a member > data, all > > > the recording modifications must be undone or redone on the flying > object > > > through said pointer. For maintaining the validate of the pointer, any > user > > > modification of flying object must have corresponding undo action to be > > > recorded into undo list. Some special modifications, such as the > deletion of > > > flying object, will just remove the corresponding SwFlyFrmFmt from the > > > flying frame format list of data module (SwDoc::pSpzFrmFmtTbl), and the > > > exact memory alloced in heap is not actually destructed. The > destruction of > > > said flying frame format could be invoked inside the corresponding undo > > > actions. > > > > > > But on the other side, in the process of changing redline mode from > "Show" > > > to "Hide", the Deleted sections will be copied into SHC (by > > > SwRedline::CopyToSection) and the original parts will be deleted from > data > > > module (by SwRedline::DelCopyOfSection), which is the directly deletion > > > without any corresponding undo action recorded in (of cause should be > > > designed like this. For changing redline mode from Show to Hide is not > exact > > > a user modification). That means, if there is any flying object inside > > > corresponding deletion range, it will be deleted directly (destructed > > > already). Any said flying object related undo actions recorded in list > > > become time bombs. Crash is just standing at the corner of the street. > > > > hmmmm.... that sounds pretty bad... > > > > i'm not (yet) familiar with most of the code that handles frames. > > > > i've looked a bit in issuezilla, and there is this: > > http://www.openoffice.org/issues/show_bug.cgi?id=101666 > > > maybe cmc remembers what problems exactly are caused by Move...? > > I forget unfortunately, I thought I was on a winner with a move instead > of copy/delete for exactly the reasons mentioned in that bug and the > above commentary which is pretty much the same problem. > > All I can remember is that the new problem is pretty obvious quickly > enough if you just toggle copy/delete to move and do a few undos with > frames and/or tables. More than likely the copy/delete was to workaround > the move problem. The whole thing should be taken out the back and > buried in a shallow grave, its difficult to get involved with red-lining > when you're unsure if there is any solid ground in there to lay > foundations on top of. >
Hi, McNamara: Thanks for your response. I do agree with what you said. Redline of writer is pretty complex and horror in design. I still trying to find some solid ground :) Actually, I have thought another method to solving the crash problem (just want to keep away from Redline...): make the undo action for flying objects recording the name of SwFrmFmt which is referred as pointer inside. When undo/redo happens, retrieval the SwFrmFmt object form SwDoc::pSpzFrmFmtTbl by recorded name. Unfortunately, said name is user visible and modifiable. And in several cases, the SwFrmFmt will be created with a empty name string. And there could be 2 or more SwFrmFmt in table with duplicated name. All the exceptions also introduce serious problems. Do you have further plan for said problem? Thanks alot! Easyfan. > > C. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
