Apache OpenOffice (AOO) Bugzilla – Issue 53298
Overlength formulas inside a table crash writer app.
Last modified: 2013-08-07 14:55:44 UTC
If a formula is generated within a table and is longer then the page or column width writer crashes. Steps 2 reproduce: 1. new text document 2. type "fn" and press <F3> -> a table with a formula appears 3. select the "E=mc²" and type any long text into the formula editor 4. leave the editor by clicking somewhere else on the page 5. if the formula is long enough (try also to align the formula to the left) the system loops to infinite page no. and stalls This might be related to the fact that the formula object is non-wrapping (though it schould be), it is incompressible (in size, as it should be do keep the te font size constant) and writer does not find enough space to squeeze the thing into. To summarize, the problem is a result of: 1. missing wrapping code for formulae 2. lack of proper formula labelling/numbering/captioning (c.f. bug #3734) 3. A problem with the handling of oversize cells in tables
I use the newest build 680m122 and I cannot reproduce the problem. If you also use one of the newer builds, please attach a documnet to this issue, where the problem can be reproduced. Feel free to reopen issue when you have done so. Thanks for supporting us!
O.K. there is a minor step I missed to include: (I am using 1.9.m122 as well) you can do that after pos 2 or 4 of the "steps 2 reproduce" a) select the formula b) right click to open the "Object..." properties page c) change the anchor type Follow the further steps Now it inevitably crashes. BTW: why is there no formula auto-wrapping code? Is this just because it is too complicated, or is this due to some other reason?
Even if I set the anchot type to "To Page" it still does not crash. The formula is just rather misplaced. Can you provide an attachement where one has to add just another 10 or so characters in order for the crash to happen? And about auto-wrapping: It would be rather easy for formulas like "a+b+c+...." But for formulas that have a matrix inside depending of it's sooner or later you will get to a point where it will not possible to do a line break (when the matrix gets bigger than the line). This happens also in fraction where a large nominator or denominator is displayed. And since the readability to read such a large formula depends much on where a line break and following on indention is done it seems best to have the user choose the proper type of formatting to begin with. Also this approach is used for MathType formulas in MS-Word as well.
Unfortunately this is NOT ALWAYS reproducible! (as I thought before) However, try to play around with the anchor type (it also changes if you click the one that is already selected, BTW) and once you apply the changes it crashes. It was an awful task but now I have done the following: 1) fn+<F3> 2) replace "E=mc²" with "1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 " 3) leave the formula editor 4) right-click the formula and select "Object..."-properties 5) select anchor to paragraph 6) press OK for ENDLESS LOOP Concerning the autowrapping: I agree that the look might be changed (well that's the idea, ain't it?), but this applies also to standard text wrapping. However even automatic breaking for +,-,* would help for most of the formulae. (Though Latex does not support autobreaking of long formulae, there is an eqnarray function to provide nice formatting. (c.f. http://www.comp.leeds.ac.uk/andyr/misc/latex/latextutorial10.html) Since I do not know the code for the Equation-Editor in OOo, maybe you can tell me whether an -option- for autowrapping long formulae at +,-,* would be such a problem. (=insertion of a newline and proper alignment)
I've tried about a dozen times now and there still was no crash or endless loop. TL->MRU: Please check. Thanks!
confirming on linux with m123. * The important thing is to use the dialog to change the anchor. Changing the anchortype using the context menu works fine and doesn't cause the loop! regression keyword since the loop doesn't occur with OOo 1.1.5(rc2)
Created attachment 28874 [details] sample bugdoc
Open attached document, select formula and use the context menu to open the object dialog. Noe change the anchor type to "to paragraph" and close the dialog. While still having the formula selected press Return -> Loop.
FME: TL's bugdoc has some additional complexity: A table in table situation. This is not necessary to reproduce the bug. Open my new bugdoc, replace text of the math object by the text at the beginning of the document. Mark the object, change anchor type to "paragraph" *using the object dialog* -> Loops in SwObjectFormatter::_FormatObj()
Created attachment 28917 [details] new bugdoc
It might be that http://qa.openoffice.org/issues/show_bug.cgi?id=53485 is connected to this issue and could give some insight into the bug - there are two indications: 1) reformatting (shifting) of formulae within columns ends in an endless loop 2) in web view there is an endlessly looping refresh of formulae
Investigation reveals that the loop is caused by the size of the formula (OLE object), which can be fullfilled, if the formula isn't anchored as-character, and its vertical position 'center to margin (paragraph area). A fix is too risky for OOo 2.0.1. Thus, I will re-target this issue to OOo later. To workaround the defect: - change the anchor type via context menu. In this case the vertical position is set to 'top to margin' - on change of the anchor type via dialog, change also the vertical position to 'top to margin' or 'from top <x> cm to margin' Issue 53485 doesn't seem to be related to this issue.
*** Issue 53197 has been marked as a duplicate of this issue. ***
Correction, issue 53197 is not a duplicate of this one.
JA: as it is a regression I need to reset the target to 2.0.2
SBA: Set internal reference field (OK in OOo 1.1.5) according to Clophs description.
fixed in cws swqbf52 - changed file: /sw/source/core/layout/fly.cxx, 1.71.118.1 defect cause: Due to the vertical position the OLE object and its wrapping style the iterative positioning algorithms loops. This loop is detected and the straight-forward positioning algorithm is temporarly applied. This appliance of the straight-forward positioning algorithm is reseted each time the OLE object wants to fullfill its size attributes, which are wider than the page width. Thus, we are at the beginning of the layout loop caused by the given documents.
OD->MRU (2006-02-01): Checked in internal installation set of cws swqbf52 - please verify. re-open issue and reassign to mru@openoffice.org
reassign to mru@openoffice.org
reset resolution to FIXED
Verified fix in CWS swqbf52.
Checked fix in OO 2.0.2rc5.