Bug 96580 - "Edit with External Tool" damages svg image
Summary: "Edit with External Tool" damages svg image
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
5.2.0.0.alpha0+
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:5.2.0 target:5.1.1
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2015-12-18 13:29 UTC by Regina Henschel
Modified: 2016-10-25 19:10 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2015-12-18 13:29:30 UTC
I work on Windows 7 and have associated the file extension .svg to Notepad++. I have tested it on Version: 5.2.0.0.alpha0+
Build ID: c910e229aa19edd0502aa05dffedc91dd727da6f
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-12-12_23:53:45
Locale: de-DE (de_DE)

How to reproduce:
1. Start a draw document and insert a svg-image as embedded image.
2. From context menu select item "Edit with External Tool". The application Notepad++ starts correctly with a temp copy of the file.

Notice, that this svg file has got additional bytes in front of the source start <?xml version="1.0" encoding="UTF-8"?> and that the closing </svg> is missing. This does not hurt Nodepad++ but it makes the file invalid XML and a pure XML editor like "XML Notepad 2007" or a browser like "Seamonkey" will refuse to open the file.



In addition you will see the following error, but that is likely another incarnation of bug 91891.

4. Change something, for example add a space and immediately delete it, so that 'save' is enabled in that application, save the file.

Notice, that the image is lost in the Draw document. This happens whether you correct the errors you have seen in 3. or not.

5. Close the application.

Notice, the image is still lost and not replaced from the temp file. This happens even if you have corrected the errors you have seen in step 3.
Comment 1 Buovjaga 2015-12-22 13:03:05 UTC
Repro.
5.0.4 works ok.

However, could not repro step 4: the image stayed in Draw after saving in Notepad++.

Win 7 Pro 64-bit Version: 5.2.0.0.alpha0+
Build ID: 014633f83e44ae8ba33087b6f38e8e253e281969
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-12-15_06:21:44
Locale: fi-FI (fi_FI)
Comment 2 raal 2015-12-23 11:44:45 UTC
This seems to have begun at the below commit.
Adding Cc: to Caolán McNamara; Could you possibly take a look at this one? Thanks
 76d78065370b5f15be8653a6fa83ee2527858196 is the first bad commit
commit 76d78065370b5f15be8653a6fa83ee2527858196
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Thu Oct 1 20:08:22 2015 -0700

    source sha:78c83032b266fbb6fc20ddca86df80affaff7c24

    source sha:78c83032b266fbb6fc20ddca86df80affaff7c24

:040000 040000 a4354ac95f7e0519963c64377589fe80c5374280 d171ce3da84dfd1c4fcc53b824eeb0a69009f627 M      instdir

author	Caolán McNamara <caolanm@redhat.com>	2015-09-30 08:40:16 (GMT)
committer	Caolán McNamara <caolanm@redhat.com>	2015-09-30 12:35:43 (GMT)
commit 78c83032b266fbb6fc20ddca86df80affaff7c24 (patch)
maSvgDataArray only populates a uno::Sequence, so use that instead

/bibisect-win32-5.1
$ git bisect log
# bad: [a2ca6bb70db1ba8f306a617d92070351d9a3a624] source sha:8b5182155b6d35a1be64d37136584e30ea6a6ef8
# good: [c1efd324c6ad448ac9edb030dc9738b9e6899e4d] source sha:ab465b90f6c6da5595393a0ba73f33a1e71a2b65
git bisect start 'a2ca6bb70db1ba8f306a617d92070351d9a3a624' 'c1efd324c6ad448ac9edb030dc9738b9e6899e4d'
# good: [1e602523875e23a7969d8c28276c82311eb2fa74] source sha:5b8e4f3d676eb0a026ce1eb4c1df2ec6e0736cb1
git bisect good 1e602523875e23a7969d8c28276c82311eb2fa74
# good: [1e602523875e23a7969d8c28276c82311eb2fa74] source sha:5b8e4f3d676eb0a026ce1eb4c1df2ec6e0736cb1
git bisect good 1e602523875e23a7969d8c28276c82311eb2fa74
# bad: [e488633c49c1a6da848fc37cdc85da06b487baf6] source sha:d30f5bc3e65463f28c3087acad6f88e12d60e53b
git bisect bad e488633c49c1a6da848fc37cdc85da06b487baf6
# good: [4f8d5011e8ea2fa616c2dc85957769bc79e437d9] source sha:00a6992b97a806b183e368d412508801dc632f8b
git bisect good 4f8d5011e8ea2fa616c2dc85957769bc79e437d9
# bad: [43c3f17d3bc1a6202342b46ce46a388f38bd368b] source sha:b94eccd1d1bb7e1a849e6a024acf84b7a7c12ed3
git bisect bad 43c3f17d3bc1a6202342b46ce46a388f38bd368b
# bad: [22cae5c14840b0c8428de2cb0a4cd6c52be1726a] source sha:85f93697defd9a812a0cda0bc4e9364e28c0339e
git bisect bad 22cae5c14840b0c8428de2cb0a4cd6c52be1726a
# good: [2589978ff6a620a7c1c0a6e6b25ee2e82f9839bf] source sha:36739d33d3dfee4bc95b546bc297015f7cb6ca00
git bisect good 2589978ff6a620a7c1c0a6e6b25ee2e82f9839bf
# good: [9a33df39bcb8988b505374b59d3645c05c46672a] source sha:d6e82846ce8bdd21db4a4aa783555950f0a8e442
git bisect good 9a33df39bcb8988b505374b59d3645c05c46672a
# good: [18eef8001eab24435be5380d98beb69a961d6f96] source sha:652158c3f2c9cd0d6f71ecd14bf5d5cc02a71b50
git bisect good 18eef8001eab24435be5380d98beb69a961d6f96
# bad: [2b0ffb113b17fdfe966ce726d58a8593d1466785] source sha:8217c99f6ef29207965ffd43aff64b24b399934d
git bisect bad 2b0ffb113b17fdfe966ce726d58a8593d1466785
# bad: [2b34baf12b92a1a3f4d00e360883c72ad0ad8dfd] source sha:ae13a6819e1dea6646aa0eba435ca9c81101f52c
git bisect bad 2b34baf12b92a1a3f4d00e360883c72ad0ad8dfd
# bad: [d60dd88b6a861f7a9cc7f0e69df21261ed915854] source sha:66343a8aeb4328a61766e4df41515130290e8a93
git bisect bad d60dd88b6a861f7a9cc7f0e69df21261ed915854
# good: [9e1e78fdc2c9402a77aacecc98693e7bc78d2013] source sha:00d2eeebc8b1842c4ab7a544552f259208ee0e25
git bisect good 9e1e78fdc2c9402a77aacecc98693e7bc78d2013
# bad: [76d78065370b5f15be8653a6fa83ee2527858196] source sha:78c83032b266fbb6fc20ddca86df80affaff7c24
git bisect bad 76d78065370b5f15be8653a6fa83ee2527858196
# first bad commit: [76d78065370b5f15be8653a6fa83ee2527858196] source sha:78c83032b266fbb6fc20ddca86df80affaff7c24
Comment 3 Commit Notification 2016-01-28 14:37:24 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ab60f6cb0f46cb71172e4248ed40e212f6ebb4da

Resolves: tdf#96580 Sequence::get doesn't return the start of the data

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2016-01-28 15:59:48 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6d15196a2a8aea48dd50591abb06017a04f5122f&h=libreoffice-5-1

Resolves: tdf#96580 Sequence::get doesn't return the start of the data

It will be available in 5.1.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.