Description: When drawing with the tool "Curves and Polygons" very short lines, LibreOffice is not able to save the file anymore. Error message: Error saving the document mydocument: Write Error. The file could not be written. When LibreOffice makes an autosave (after a while), the application CRASHES because it is not able to save anything anymore. Steps to Reproduce: 1. Open a new sheet in LibreOffice Draw 2. Select the tool "Curves and Polygons" 3. Draw a short line (I mean very short) 4. Click "File" > "Save" and select a random place to save Actual Results: LibreOffice is not able to save the file, error message: Error saving the document mydocument: Write Error. The file could not be written. Expected Results: Save the file as normal Reproducible: Always User Profile Reset: Yes OpenGL enabled: Yes Additional Info: Version: 7.3.2.2 / LibreOffice Community Build ID: 49f2b1bff42cfccbd8f788c8dc32c1c309559be0 CPU threads: 4; OS: Linux 5.13; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
In menu Shape/Insert/Curves and Polygons, which option did you choose? Indeed, on pc Debian x86-64 with master sources updated today, I selected "Curve" Shape/Insert/Curves and Polygons, then I did a very short line and saved, no pb here.
I use at the user interface of LibreOffice Draw "Home">"Curves and Polygons">"Freeform Line". Drawing short lines with this tool makes Problems at saving the document
Created attachment 179708 [details] bt with debug symbols Thank you for your feedback. I could reproduce this on pc Debian x86-64 with master sources updated today.
Regina: thought you might be interested in this one.
Regina: here's a patch which seems to work: diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 55de243f07aa..9b069a07eb2c 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2338,11 +2338,13 @@ void XMLShapeExport::ImpExportPolygonShape( { // get PolygonBezier uno::Any aAny( xPropSet->getPropertyValue("Geometry") ); - const basegfx::B2DPolyPolygon aPolyPolygon( - basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(*o3tl::doAccess<drawing::PolyPolygonBezierCoords>(aAny))); - - if(aPolyPolygon.count()) + auto pSourcePolyPolygon = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(aAny); + if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength()) { + const basegfx::B2DPolyPolygon aPolyPolygon( + basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon( + *pSourcePolyPolygon)); + // complex polygon shape, write as svg:d const OUString aPolygonString( basegfx::utils::exportToSvgD( I took example below line 2789.
(In reply to Julien Nabet from comment #4) > Regina: thought you might be interested in this one. Sorry, I cannot reproduce the problem. That prevents properly fixing. Tested with Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community Build ID: 347622a98f512dae709f938a85498dcdcf9f225a CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win Locale: de-DE (en_US); UI: en-US Calc: threaded But from reading your changes, I think it does the correct thing.
(In reply to Regina Henschel from comment #6) > (In reply to Julien Nabet from comment #4) > > Regina: thought you might be interested in this one. > > Sorry, I cannot reproduce the problem. That prevents properly fixing. Tested > ... did you try to freeform line AND very short line? Indeed, if the draw is not enough short and can be considered just as a line, you can't reproduce the pb. > But from reading your changes, I think it does the correct thing. ok => https://gerrit.libreoffice.org/c/core/+/133273 thank you!
(In reply to Julien Nabet from comment #7) > did you try to freeform line AND very short line? Yes, I tried. Both with open and closed free form lines, size < 2mm. Saves without problems here. > ok => https://gerrit.libreoffice.org/c/core/+/133273 thank you! But you need someone other than me to test it.
(In reply to Julien Nabet from comment #3) > Created attachment 179708 [details] > bt with debug symbols > > Thank you for your feedback. > I could reproduce this on pc Debian x86-64 with master sources updated today. I hope this comment is not inappropriate: Thank you so much for all! It is so cool, to have some insights in LibreOffice! I hope I could have helped to locate this bug!
(In reply to Regina Henschel from comment #6) > Sorry, I cannot reproduce the problem. Strange, I do reproduce it: Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community Build ID: 4659fc2f0a7223a89446edff0b77e58758b5edf5 CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win Locale: en-US (nl_NL); UI: en-US Calc: CL Jumbo So Windows isn't excluded..
This sounds like bug 145240
(In reply to Gabor Kelemen (allotropia) from comment #11) > This sounds like bug 145240 Indeed! *** This bug has been marked as a duplicate of bug 145240 ***