Issue 53298 - Overlength formulas inside a table crash writer app.
Summary: Overlength formulas inside a table crash writer app.
Alias: None
Product: Math
Classification: Application
Component: code (show other issues)
Version: OOo 2.0 Beta
Hardware: All All
: P2 Trivial (vote)
Target Milestone: ---
Assignee: michael.ruess
QA Contact: issues@sw
Keywords: crash, oooqa, regression
Depends on:
Reported: 2005-08-14 17:07 UTC by madbop
Modified: 2013-08-07 14:55 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

sample bugdoc (8.59 KB, application/octet-stream)
2005-08-18 08:11 UTC, thomas.lange
no flags Details
new bugdoc (8.50 KB, application/vnd.oasis.opendocument.text)
2005-08-19 07:36 UTC, frank.meies
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description madbop 2005-08-14 17:07:35 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
Comment 1 michael.ruess 2005-08-15 08:43:32 UTC
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!
Comment 2 madbop 2005-08-15 09:54:10 UTC
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?
Comment 3 thomas.lange 2005-08-15 10:12:58 UTC
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.
Comment 4 madbop 2005-08-15 12:37:36 UTC
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.
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)
Comment 5 thomas.lange 2005-08-15 13:15:45 UTC
I've tried about a dozen times now and there still was no crash or endless loop.

TL->MRU: Please check. Thanks!
Comment 6 lohmaier 2005-08-17 23:08:16 UTC
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

regression keyword since the loop doesn't occur with OOo 1.1.5(rc2)
Comment 7 thomas.lange 2005-08-18 08:11:32 UTC
Created attachment 28874 [details]
sample bugdoc
Comment 8 thomas.lange 2005-08-18 08:14:01 UTC
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.
Comment 9 frank.meies 2005-08-19 07:36:19 UTC
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
Comment 10 frank.meies 2005-08-19 07:36:56 UTC
Created attachment 28917 [details]
new bugdoc
Comment 11 madbop 2005-08-19 08:29:10 UTC
It might be that is
connected to this issue and could give some insight into the bug - there are two
1) reformatting (shifting) of formulae within columns ends in an endless loop
2) in web view there is an endlessly looping refresh of formulae
Comment 12 Oliver-Rainer Wittmann 2005-08-19 09:33:52 UTC
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.
Comment 13 frank.meies 2005-08-19 13:47:23 UTC
*** Issue 53197 has been marked as a duplicate of this issue. ***
Comment 14 frank.meies 2005-08-19 13:51:22 UTC
Correction, issue 53197 is not a duplicate of this one.
Comment 15 Joost Andrae 2005-11-10 09:54:36 UTC
JA: as it is a regression I need to reset the target to 2.0.2
Comment 16 stefan.baltzer 2006-01-02 12:32:01 UTC
SBA: Set internal reference field (OK in OOo 1.1.5) according to Clophs description.
Comment 17 Oliver-Rainer Wittmann 2006-01-19 10:56:10 UTC
fixed in cws swqbf52 - changed file:

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.
Comment 18 Oliver-Rainer Wittmann 2006-02-01 10:50:10 UTC
OD->MRU (2006-02-01):
Checked in internal installation set of cws swqbf52 - please verify.

re-open issue and reassign to
Comment 19 Oliver-Rainer Wittmann 2006-02-01 10:50:14 UTC
reassign to
Comment 20 Oliver-Rainer Wittmann 2006-02-01 10:50:19 UTC
reset resolution to FIXED
Comment 21 michael.ruess 2006-02-01 14:58:32 UTC
Verified fix in CWS swqbf52.
Comment 22 michael.ruess 2006-02-22 13:58:49 UTC
Checked fix in OO 2.0.2rc5.