Apache OpenOffice (AOO) Bugzilla – Issue 101980
OOo 3.1 freezes with 100% CPU on opening an odt file with fontwork objects
Last modified: 2013-08-07 14:43:57 UTC
OOo 3.1 can't open attached odt file which contains fontwork objects. On my ubuntu 8.04 native OOo 3.1 FR freezes with 100% CPU. Problem has reproduced on MS-Windows Vista and MacOS.
Created attachment 62307 [details] test file with fontwork objects
Complement : OOo 3.0.1 opens this file without problem.
In the first file, it seems that only one fontwork object causes the freeze. The guilty fontwork object has been isolated in the following file using OOo 2.4.2 Regards JBF
Created attachment 62308 [details] file with only one fontwork object
MRU->OD: attached document contains some fontwork objects and graphics in a table. This will lead to a loop in OOo 3.1. Did not loop in OOo 3.0.1. After removing the fontwork objects, the document could be opened. Disabling the "Anti-aliasing" did not help.
Investigation reveals that the calculation of the contour of the fontwork object takes very very long. The internal variable <nSize> in method <SdrObject::TakeContour(..)> has a value greater than 123000. OD->AW: Can you please have a look.
AW: Added to CWS aw074, taking a look...
AW: Indeed, the contour has 123960 polygons in it's PolyPolygon. With thick lines, this is a possible result. I will take a look how far thick lines were taken into account in older versions...
AW: Old version painted to a Metafile and extracted polygon data from the actions (META_RECT_ACTION, META_ELLIPSE_ACTION, META_POLYGON_ACTION, META_POLYPOLYGON_ACTION, META_POLYLINE_ACTION and META_LINE_ACTION). Thick/fat lines were not taken into account, so i will do the same in the new implenetation and will set the LineWidth to hairline (0). Testing...
AW: With reduced line width to hairline, still 2452 polygons exist; i also have to mention that the primitive creation of the 123960 polygons was done in second range; just the user of that data may have had a problem. To check that (to be safe) i need sw with debug. I will commit te first part of the fix...
AW: It's used in SwContourCache::ContourRect to create a TextRanger; not sure what this is doing, but it seems not necessary for the loaded document. It could be done on demand. Surely TextRanger and interacting with B2DPolyPolygons may be also optimized. Checked: TextRanger is in SVX and internally uses PolyPolygon (the old polygon). Checking the conversion... Ah, here is the problem. TextRanger::TextRanger converts the B2DPolyPolygon to a PolyPolygon, inserting all sub-polygons. The possible sub-polygon count in the old PolyPolygon is a USHORT, allowing 65535 sub-polygons. This is a potential problem, writing a FUp-task (#i103068#). For OOo 3.1.1, the problem is solved with the changes done.
AW: Ckecked with wntmsci12.pro build, works as expected.
AW->WG: Please reviewas described
Verified in CWS.
Tested in m17. Closed.