To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=64584
                  Issue #:|64584
                  Summary:|Crash on .odm save if a style used in inserted .odt
                          |is modified
                Component:|xml
                  Version:|OOo 2.0.2
                 Platform:|All
                      URL:|
               OS/Version:|All
                   Status:|UNCONFIRMED
        Status whiteboard:|
                 Keywords:|
               Resolution:|
               Issue type:|DEFECT
                 Priority:|P3
             Subcomponent:|code
              Assigned to:|mba
              Reported by:|snail_edwards





------- Additional comments from [EMAIL PROTECTED] Thu Apr 20 13:17:53 -0700 
2006 -------
DESCRIPTION AS PER Robert Taylor (RTaylor at wjsgroup.com)
It's reproducible in win2k and winxp machines. 

Tested on 3 win2k machines and 2 winxp home edition systems.  Win2k was at sp4 i
believe home at sp2 or whatever the latest is. 

Version of OpenOffice.org used was latest installer, version 2.0.2 

To reproduce the problem (sample zip file provided): 

1. create 3 plain odt file, with simple titles.  Each title should be styled
with the default HEADING1 style. 

2. create 1 master document file (odm of course), add some text at top, insert
the 3 documents into master document. 

3.  add a footer 

4.  in the footer add two fields: page number and chapter number (like in the
sample file provided) 

5. HERE IS WHERE IT GETS FUN:   
- we know that master document style sheets override styles of child documents. 
- because the master document style doesn't have a numbering style associated
with HEADING1 style, there is no page number listed in footer.   
- lets MODIFY the HEADING1 style in the master document, in the NUMBERING tab,
lets select the numbering style labeled "NUMBERING1".  It could be anything but
thats what i have used for the example. 
- lets go back to the master document and hit CTRL/S to save our files.  OO.org2
should try to save the file mostly, then hang and crash. 

6.  Those are my exact steps and it crashed here as per description.  I have
observed crashes with other changes to say the HEADING1 style but it should work
for you guys as well. 

ROOT CAUSE:
<src_root>/xmloff/source/text/txtparae.cxx
void XMLTextParagraphExport::exportListChange()
causes segmentation fault in
671: OUString *pElem = (*pListElements)[pListElements->Count()-1];
above is
663: DBG_ASSERT(pListElements &&
pListElements->Count() >= 2*(nNextLevel-nPrevLevel),
"SwXMLExport::ExportListChange: list elements missing" );
It is probably assumed that
pListElements->Count() < 2*(nNextLevel-nPrevLevel)
will never happen, but the above scenario disproves.

SUGGESTED FIX:
...
                for( sal_Int16 i=nPrevLevel; i > nNextLevel; i-- )
                {
                        for( sal_uInt16 j=0; j<2; j++ )
                        {
/* THIS IS ADDED LINE */if(pListElements && pListElements->Count() >=
2*(nNextLevel-nPrevLevel))
/* THIS IS ADDED LINE */{
                                        OUString *pElem = 
(*pListElements)[pListElements->Count()-1];
                                        pListElements->Remove( 
pListElements->Count()-1 );

                                        GetExport().EndElement( *pElem, 
sal_True );

                                        delete pElem;
/* THIS IS ADDED LINE */}
                        }
                }
...
TEST:
xo680mi.dll was rebuilt w/the above changes, issue not observed

COMMENT:
This change may probably lead to a memory leak under some circumstances. However
I'm doubtful that the leak will be severe enough.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

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


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

Reply via email to