Bug 129176 - "Un-float Table" does not clear "floating" attribute in DOCX floating tables
Summary: "Un-float Table" does not clear "floating" attribute in DOCX floating tables
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.5.0 target:6.4.0.1
Keywords:
Depends on:
Blocks: DOCX-Tables
  Show dependency treegraph
 
Reported: 2019-12-04 11:38 UTC by Mike Kaganski
Modified: 2019-12-17 08:08 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
A simple floating multi-page table (16.44 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-12-04 11:38 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2019-12-04 11:38:10 UTC
Created attachment 156290 [details]
A simple floating multi-page table

The new "Un-float Table" function (tdf#112704) allows to move floating tables, imported from DOC(X) inside floating frames, out from the frame into the document main text body: selecting the frame that holds the table, it has a blue "Un-float Table" button in its top right corner, clicking on which, the frame is removed, and the table gets into the text flow.

However, saving the result back into DOCX again, and reloading, results in the table becoming floating again, as if the "unfloating" was not performed, and the old table properties were kept that were set in original DOCX.

The same is true if "un-floating" is done not using the mentioned button, but by copying the table into clipboard, removing the frame, and pasting the table into the main text - the original table settings are kept when roundtripped through clipboard.

This is reproducible with the attached DOCX. Only saving the un-floated document into ODT, reopening and then saving into DOCX actually clears the floating setting of the table - obviously the original DOCX settings are dropped in this round-trip.

At least the direct "Un-float Table" function should explicitly clear the "floating" setting read from DOCX originally.

Tested with Version: 6.3.4.1 (x64)
Build ID: a21169d87339dfa44546f33d6d159e89881e9d92
CPU threads: 12; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded
Comment 1 Dieter 2019-12-04 13:06:16 UTC
I can't confirm it with your steps

Version: 6.4.0.0.beta1 (x64)
Build ID: 4d7e5b0c40ed843384704eca3ce21981d4e98920
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: GL; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-GB
Calc: threaded

What I did (in line with your description):
1. I opened attachment
2. I unfloated table => save as odt
3. I Opend odt-file and saved it as docx.
4. I reopened docx-file

But reproducible with the following steps:
1. I opened attachment
2. I unfloated table => save as docx
4. I reopened docx-file
Comment 2 Mike Kaganski 2019-12-04 13:10:38 UTC
(In reply to Dieter Praas from comment #1)
> What I did (in line with your description):

Hmm... :-) I wrote:

> The new "Un-float Table" function (tdf#112704) allows to move floating
> tables, imported from DOC(X) inside floating frames, out from the frame into
> the document main text body ...
> However, saving the result back into DOCX again, and reloading, results in
> the table becoming floating again, as if the "unfloating" was not performed,
> and the old table properties were kept that were set in original DOCX.
> ...
> This is reproducible with the attached DOCX. Only saving the un-floated
> document into ODT, reopening and then saving into DOCX actually clears the
> floating setting of the table - obviously the original DOCX settings are
> dropped in this round-trip.

So the description says: opening DOCX, un-floating, and saving into DOCX is broken; *only having an intermediate save-to-ODT* allows to workaround the problem :-)
Comment 3 Dieter 2019-12-04 13:13:35 UTC
(In reply to Mike Kaganski from comment #2)
> So the description says: opening DOCX, un-floating, and saving into DOCX is
> broken; *only having an intermediate save-to-ODT* allows to workaround the
> problem :-)

Sorry for not reading carefully enough
=> NEW
Comment 4 Mike Kaganski 2019-12-04 17:32:59 UTC
https://gerrit.libreoffice.org/84446
Comment 5 Commit Notification 2019-12-05 05:00:59 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2a9e162564a6af63bece77f50fc553640e747b9e

tdf#129176: clear "TablePosition" grab bag when unfloating table

It will be available in 6.5.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 6 Dieter 2019-12-15 12:25:13 UTC
Verified with

Version: 6.5.0.0.alpha0+ (x64)
Build ID: e26d89371f0e4f41476c9a99be01d98dedb76776
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-GB
Calc: threaded

Mike, thanks for fixing it!
Comment 7 Commit Notification 2019-12-17 08:08:33 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/089b409a618491c2881d2380ccd1dc4f57272445

tdf#129176: clear "TablePosition" grab bag when unfloating table

It will be available in 6.4.0.1.

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.