Bug 135016 - FILESAVE DOCX: Error The file could not be written. ( steps in comment 6 )
Summary: FILESAVE DOCX: Error The file could not be written. ( steps in comment 6 )
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: medium critical
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.1.0 target:7.0.2
Keywords: bibisected, bisected, dataLoss, regression
Depends on:
Blocks: WPSShapeTextImport-Change
  Show dependency treegraph
 
Reported: 2020-07-21 12:24 UTC by Telesto
Modified: 2020-08-31 11:38 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (1.76 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-07-26 10:21 UTC, Telesto
Details
Example file (1.76 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-07-26 10:21 UTC, Telesto
Details
Bibisect log (3.81 KB, text/plain)
2020-07-26 10:42 UTC, Telesto
Details
Additional Example file (2.10 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-07-28 11:33 UTC, Telesto
Details
minimal reproducer (48.37 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-08-05 15:37 UTC, Xisco Faulí
Details
Example file (1.29 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-08-08 14:19 UTC, Telesto
Details
Additional Example file (55.58 KB, application/vnd.oasis.opendocument.text)
2020-08-13 20:23 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-07-21 12:24:11 UTC Comment hidden (obsolete)
Comment 1 Telesto 2020-07-26 10:21:39 UTC Comment hidden (obsolete)
Comment 2 Telesto 2020-07-26 10:21:53 UTC
Created attachment 163546 [details]
Example file
Comment 3 Telesto 2020-07-26 10:29:40 UTC
No repro with
Version: 4.3.7.2
Build ID: 8a35821d8636a03b8bf4e15b48f59794652c68ba
Comment 4 Telesto 2020-07-26 10:42:59 UTC
Created attachment 163547 [details]
Bibisect log

Bisected to:
    commit d379d18666aa42031359ca8eb34b0021960347ae
    Author:     Miklos Vajna <vmiklos@collabora.co.uk>
    AuthorDate: Wed Jun 18 11:57:31 2014 +0200
    Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
    CommitDate: Wed Jun 18 12:09:15 2014 +0200
    
        oox: import WPS shape with text as shape with textbox
    
        This allows having real shapes (like having rounded corners) and complex
        content (like containing a table) at the same time.
    
        WPS shapes are wrappers around drawingML markup in DOCX files, so this
        only affects the DOCX import.
Comment 5 Telesto 2020-07-26 12:36:33 UTC
*** Bug 135149 has been marked as a duplicate of this bug. ***
Comment 6 Telesto 2020-07-28 11:33:57 UTC
Created attachment 163686 [details]
Additional Example file

1. Open the attached file
2. CTRL+A
3. CTRL+X
4. Undo
5. press save -> Failure
Comment 7 Telesto 2020-08-04 17:38:25 UTC
@Xisco,
If have some time to (un)confirm.. Not a big fan of write errors. OTOH, around for a quite some time now..
Comment 8 Xisco Faulí 2020-08-05 15:22:57 UTC
Reproduced in

Version: 7.1.0.0.alpha0+
Build ID: 76c40b82e6a44539cd43f326c00246e759449571
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 9 Xisco Faulí 2020-08-05 15:37:55 UTC
Created attachment 163978 [details]
minimal reproducer
Comment 10 Xisco Faulí 2020-08-05 18:18:58 UTC
(In reply to Telesto from comment #4)
> Created attachment 163547 [details]
> Bibisect log
> 
> Bisected to:
>     commit d379d18666aa42031359ca8eb34b0021960347ae
>     Author:     Miklos Vajna <vmiklos@collabora.co.uk>
>     AuthorDate: Wed Jun 18 11:57:31 2014 +0200
>     Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
>     CommitDate: Wed Jun 18 12:09:15 2014 +0200
>     
>         oox: import WPS shape with text as shape with textbox
>     
>         This allows having real shapes (like having rounded corners) and
> complex
>         content (like containing a table) at the same time.
>     
>         WPS shapes are wrappers around drawingML markup in DOCX files, so
> this
>         only affects the DOCX import.

Not sure if the bisection is correct.
1. the mentioned commit fixes an import issue. The problem described in this bug is an export issue
2. Before the mentioned commit, LibreOffice crashes cutting the content, so no possible to test all the steps (cut, undo, save)
Comment 11 Telesto 2020-08-05 18:24:25 UTC
(In reply to Xisco Faulí from comment #10)
> (In reply to Telesto from comment #4)
> > Created attachment 163547 [details]
> > Bibisect log
> > 
> > Bisected to:
> >     commit d379d18666aa42031359ca8eb34b0021960347ae
> >     Author:     Miklos Vajna <vmiklos@collabora.co.uk>
> >     AuthorDate: Wed Jun 18 11:57:31 2014 +0200
> >     Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
> >     CommitDate: Wed Jun 18 12:09:15 2014 +0200
> >     
> >         oox: import WPS shape with text as shape with textbox
> >     
> >         This allows having real shapes (like having rounded corners) and
> > complex
> >         content (like containing a table) at the same time.
> >     
> >         WPS shapes are wrappers around drawingML markup in DOCX files, so
> > this
> >         only affects the DOCX import.
> 
> Not sure if the bisection is correct.
> 1. the mentioned commit fixes an import issue. The problem described in this
> bug is an export issue
> 2. Before the mentioned commit, LibreOffice crashes cutting the content, so
> no possible to test all the steps (cut, undo, save)

It's quite possible i'm wrong.. don't remember how I did the bibisect
Comment 12 Xisco Faulí 2020-08-05 18:30:15 UTC
ok, so I've reverted d379d18666aa42031359ca8eb34b0021960347ae locally and now LibreOffice claims the document might be corrupted at import time. If I ignore the error and open the document, then I can cut the content, undo and save.

I believe this might no be a regression, but just an existing problem that became more visible after d379d18666aa42031359ca8eb34b0021960347ae, anyway, adding Miklos to the loop to hear from the expert.

Adding Cc: to Miklos Vajna
Comment 13 Telesto 2020-08-08 14:19:36 UTC
Created attachment 164049 [details]
Example file

Maybe even simpler

1. CTRL+A
2. CTRL+X
3. CTRL+Z
4. Press Save -> Error
5. Work around attempt -> Save As ODT & File reload -> Invisible frames
Comment 14 Telesto 2020-08-13 20:23:22 UTC
Created attachment 164283 [details]
Additional Example file

Not much different, so likely irrelevant but anyway
1. Open the attached file
2. Save as DOCX
3. File reload
4. Select the figure 1 frame
5. CTRL+X
6. CTRL+Z 
7. Save
Comment 15 Miklos Vajna 2020-08-14 06:59:05 UTC
(In reply to Telesto from comment #13)
> Maybe even simpler
> 
> 1. CTRL+A
> 2. CTRL+X
> 3. CTRL+Z
> 4. Press Save -> Error

I'll focus on this one. It helps if you don't add more documents & different list of steps to this bug. :-)
Comment 16 Commit Notification 2020-08-18 07:04:46 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b784ee4feb554987eff1c7fdaff640abb340504d

tdf#135016 DOCX export: fix unexpected error on save with undo/redo

It will be available in 7.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2020-08-19 09:33:30 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/949b42bb9fc32d0fcb99941a705ddfc8cae0b233

tdf#135016 DOCX export: fix unexpected error on save with undo/redo

It will be available in 7.0.2.

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

Affected users are encouraged to test the fix and report feedback.
Comment 18 Xisco Faulí 2020-08-31 11:38:00 UTC
Verified in

Version: 7.1.0.0.alpha0+
Build ID: e2f4e65a7b8024c00b049eebf0d87637efda7f24
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Miklos, thanks for fixing this issue!!