Hi Talen,

Õ»ª¾ü wrote:
Hello everyone
I am a developer from Beijing Redflag CH2000 Software Co.,Ltd.,my name is huajun zhang,you can call me talen,now I am investigating somthing of SW,can be one observer of SW is my pleasure and hope to do many useful job for this project.
    Recently,I got one issue of SW,detail like below:
OS:Windows XP PRO. SP2
Language:Anyone
Summary:Compare two different *.odt files and delete all of content of those 
files will crash OO.
[..]

Yes, it's reproducible. If you compare two documents with complete different content, the content of the first document will be marked as "deleted" and the content of the second document as "inserted". If you reject the insertion and accept the deletion you will got an empty document, unfortunately a _very_ empty document and OOo crashes.
    I tracked the OO process and found,after the OO process deleted the last SwFrm 
of this document,it will call pRoot->SetSuperfluous(),so in the EndAction OO 
will do RemoveSuperfluous,then call AdjustRootSize( CHG_CUTPAGE, 0 ),crash will be 
happened while ::SetLastPage( (SwPageFrm*)GetPrev() ) in the AdjustRootSize 
function,because (SwPageFrm*)GetPrev() is NULL,so my questions are:
1.Why we need SetSuperfluous in this case,is this a bug of design?
No, I don't think so, an empty page is superflous and has to be removed. A page which contains e.g. an empty paragraph is not empty.
2.Why we do not create one new SwFrm after we delete the last SwFrm?
The problem is not the last SwFrm, the main reason is the destruction of the last SwTxtNode. Our current model relies on the fact that there is always at least one paragraph (empty or not) in the document model (i.d. there is a SwTxtNode in the nodes array).
3.What can I do to fix this issue?Now,I add AppenTxtNode function befor delete last SectionNode to create one new SwFrm and can avoid this issue,but I don't think it's right or complete method for fixing this issue.
Yes, this fix would assert that at least one paragraph will remain. But this fix would have side-effects, e.g. I imagine that undo would run into trouble afterwards.
Is there anybody can tell me anything about this???

Thanks & Best Regards
Talen Zhang

I propose to have a look into the insertion of the change tracks (SwDoc::AppendRedline()). It is not allowed that the change tracking area covers the whole document. At least one empty paragraph has to be outside these change tracks.
These are my first thoughts about this issue.
Best regards
   Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to