Apache OpenOffice (AOO) Bugzilla – Issue 124188
CRASH when pasting grouped contents from Draw over a selected image
Last modified: 2017-05-20 10:35:15 UTC
I have a bitmap image into Writer. It is into a table and is a bitmap. I copy this image into Draw and add some elements (text, arrow, lines, rectangles). I associate the image with these elements (making a group). Then I copy the group to the clipboard. Switching back to Writer, the image is still selected. I paste the image and then OO crashes (both writer and draw, loosing any changes made since last save). This bug seems to happen almost every time I do this on Mavericks. Not tested on other platforms/versions. I think there is too much bug into this version to consider it is "production ready".
NOT Reproducible with "AOO 4.0.1 – German UI / German locale [Rev. 1524958 2013-09-20 11:40:29]" on German WIN7 Home Premium (64bit)", “historic” 4.0 User Profile used for all predecessor versions @reporter: Thank you for your feedback – unfortunately important information we will need to reproduce your problem is missing. Please add all information requested in following: b) Attach a sample document (not only screenshot) or refer to an existing sample document in an other Bug with a link; to attach a file to this bug report, just click on "Add an attachment" right on this page. If you want to attach a test kit with multiple documents zip them into a single testkit.zip and attach the testkit.zip c) Contribute a document related step by step instruction containing every key press and every mouse click how to reproduce your problem e) if possible contribute an instruction how to create a sample document from the scratch f) add information f4) concerning your Operating System (Language) f5) concerning your AOO version (with Build/revision ID if it's not a public release) and localization (UI language, Locale setting) f6) AOO settings that might be related to your problems (video hardware acceleration, ...) f7) how you launch AOO and how you opened the sample document f8) Whether your problem persists after you have renamed your user profile (Quit Quickstart before!) before you launch AOO (please see <http://www.openoffice.org/development/releases f9) Whether that worked in former OOO / AOO Versions Please do not cite these hints in your reply, but cite the items like: f7): Desktop-icon for soffice.exe / AOO File menu -> Open
b) https://www.dropbox.com/s/am4zjasceggdi6p/Cours%20-%20Automatique.odt c) In the writer document, paste a bitmap image. Select this image, and set the "As character" anchor. Copy the bitmap image to the clipboard Open a Draw document. Paste the image (Cmd-V) Add some objects (boxes and lines). Select all the objects and the image. Group the objects Press Cmd-C (copy) Go back to the Writer Document. Select the image (it should already be selected) Press Cmd-V (paste) OO crashes. e) any new document with an images with "As character" anchor following the step above. f4) Mac OS X 10.9.1 french language f5) AOO401m5(Build:9714) - Rev. 1524958 2013-09-20 11:07:55 (Fri, 20 Sep 2013) French localization f6) none f7) Launched AOO from the Mac OS X LaunchPad. Create a new document from the AOO main menu f8) did not find the instructions for Mac and have not the time to search. f9) I don't know
Still Reproducible with reporter's document or attached test kit and server installation of "AOO 4.1.0-Dev – English UI / German locale - [AOO410m1(Build:9750) - Rev. 1566800 - 2014-02-12]" on German WIN7 Home Premium (64bit)", own separate user profile. Steps with test kit 0. Download / Unzip test kit 1. Open "target.odt" and "Source.odg" 2. In "Source.odg" select the Smileys (grouped Shapes) with single mouse click 3. <control+c> for copy 4. Switch back to "target.odt" 5. Single click raster graphic "Computer" 6. <control+v> for paste CRASH Additional info: h) Already reproducible with OOo 2.0.2 i) Still worked fine with OOo 1.1.5 (completely different behavior.
Created attachment 82568 [details] Simle Test Kit See comment above how to use!
(j): LibO 4.1.3 also affected
Created attachment 82591 [details] Avoid NULL pointer access The crash is caused in SwDoc::Insert by accessing an SwTxtNode that does not exist. Calling InsertItem() only when the pointer returned by rRg.GetPoint()->nNode.GetNode().GetTxtNode() is not NULL fixes the crash. The document looks like expected after the insert but I don't know enough about the Writer internals to be sure.
taking over to review Andre's patch
Comment on attachment 82591 [details] Avoid NULL pointer access The patch avoids the crash, but the document is afterwards in an inconsistent state as the anchor attribute for the as-character anchored object inside the corresponding text node is missing.
Comment on attachment 82591 [details] Avoid NULL pointer access obsoleting this patch
fix in progress
"orw" committed SVN revision 1569286 into trunk: 124188: <SwDoc::InsertDrawObj(..)> - assure correct insertion of text attribu...
fixed in trunk for the next release
Verified on AOO Rev 1571942 en-US, no crash, so change status to verified Test ENV: Win7 professional 64 bit SP1, Chinese version.