Bug 73483 - FORMATTING: "Clear direct formatting" deletes page breaks but this does not show up until file is reopened
Summary: FORMATTING: "Clear direct formatting" deletes page breaks but this does not s...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Mike Kaganski
URL:
Whiteboard: target:7.6.0 target:7.5.5
Keywords:
: 47471 73411 90221 92352 95752 104988 111002 120007 125790 139079 139311 140163 145849 (view as bug list)
Depends on:
Blocks: Clear-Formatting Writer-Page-Break
  Show dependency treegraph
 
Reported: 2014-01-10 20:04 UTC by Robert Großkopf
Modified: 2023-11-03 10:36 UTC (History)
15 users (show)

See Also:
Crash report or crash signature:


Attachments
Loosing of pagebreak when direct format is lost - try. (10.02 KB, application/vnd.oasis.opendocument.text)
2014-01-10 20:04 UTC, Robert Großkopf
Details
Writer file showing "Clear direct formatting" issue (24.32 KB, application/vnd.oasis.opendocument.text)
2020-06-29 15:21 UTC, R. Green
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2014-01-10 20:04:56 UTC
Created attachment 91840 [details]
Loosing of pagebreak when direct format is lost - try.

Open the attached document:
1. Press Ctrl+A to select all content.
2. Press Ctrl+M to reset direct formatting.
3. Save the document.
4. Close the document and reopen it.

The "Text"-formatted paragraph, which starts at the second page with a manual pagebreak before, has lost the pagebreak and will be changed to "Default" paragraph.

It is the same behavior in all LO-Versions from LO 3.3.0beta1 up to LO 4.2.0rc2
Comment 1 Cor Nouws 2014-01-11 18:13:34 UTC
Hi Robert,

The behaviour sounds logic since a hard page break is direct formatting (contrary to automatic page style sequences)..
Cioa,
Cor
Comment 2 Robert Großkopf 2014-01-11 18:31:58 UTC
(In reply to comment #1)
Hi Cor,
> 
> The behaviour sounds logic since a hard page break is direct formatting
> (contrary to automatic page style sequences)..

Could be logic to delete the page-break. So I have to chose a separate paragraph-style, which I set for a page-break.

Not logic: The paragraph-style is reset from "Text" to "Default". 

1. When I clear direct formatting, I should only clear it to the style I have chosen.
2. When I clear direct formatting the consequence must be shown directly, not after saving and reloading.

Regards

Robert
Comment 3 Cor Nouws 2014-01-11 19:37:21 UTC Comment hidden (obsolete)
Comment 4 Robert Großkopf 2014-01-11 20:00:43 UTC
(In reply to comment #3)
> hmm, I have some paragraphs Text block, some text bold, in one I change
> Format > Paragraph with page break, select some paragraphs, choose Format >
> Clear direct formatting ...
> and the hard page break remains. In 4.2.0.2 on Ubuntu...

Could you test the attachment?
Have you saved the document, closed it and reopened it? The hard page break remains when you won't save the file.
I have just tested again with openSUSE 12.3 64bit rpm Linux and LO 4.2.0.rc2 - same here in all other versions I have tested.
Comment 5 Cor Nouws 2014-01-11 21:52:35 UTC
Ah yes - why should I read your full instructions :-\
sorry > confirmed!
When I add the manual break to a paragraph Heading 1, that is preserved after saving and opening again..
So the change of style maybe only is Text block > Default ?

I changed the summary - maybe should be split up in two bugs, or stick with only the second problem (since the first is by design) ?
Comment 6 Joel Madero 2015-05-02 15:44:07 UTC Comment hidden (obsolete)
Comment 7 Robert Großkopf 2015-05-02 17:29:16 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2016-09-20 10:11:24 UTC Comment hidden (obsolete)
Comment 9 Robert Großkopf 2016-10-01 09:46:11 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2018-06-15 02:46:12 UTC Comment hidden (obsolete)
Comment 11 Robert Großkopf 2018-06-15 06:10:59 UTC
Nothing changed.

The "Text"-formatted paragraph, which starts at the second page with a manual pagebreak before, has lost the pagebreak and will be changed to "Default" paragraph.

Tested with LO 6.0.5.1 on OpenSUSE 42.3 64bit rpm Linux.
Comment 12 Timur 2019-01-03 09:03:35 UTC
The "Text"-formatted paragraph is no longer changed to "Default" paragraph. That was Bug 47471.
That Ctrl+M resets manual pagebreak before - sounds logic.
Only issue I see here is that with clear direct formatting the consequence must be shown directly, not only after saving and reloading. So I retitle.
Comment 13 R. Green 2020-06-29 15:21:39 UTC
Created attachment 162511 [details]
Writer file showing "Clear direct formatting" issue

Version: 6.4.4.2 (x64)
Build ID: 3d775be2011f3886db32dfd395a6a6d1ca2630ff
CPU threads: 4; OS: Windows 10.0 Build 19041; UI render: default; VCL: win; 
Locale: en-GB (en_GB); UI-Language: en-GB
Calc: threaded

See attached file. The effect of "Clear direct formatting" on page breaks and page styles is only apparent when you save, close and reload the file.

I would not expect page breaks to be deleted by the "Clear direct formatting" command. In books, for example, you may need to remove directly-applied character formatting but not want to lose the layout of chapters which depends on page breaks and page styles. Would this be a feasible feature request?
Comment 14 R. Green 2020-12-19 20:37:34 UTC
See also, Bug 139079.
Comment 15 Timur 2020-12-20 08:15:07 UTC
*** Bug 139079 has been marked as a duplicate of this bug. ***
Comment 16 Mike Kaganski 2020-12-20 09:53:52 UTC
Definitely a bug. The code (see bug 138628 comment 9) makes explicit precautions to keep the breaks; so this "do not clear page breaks" is intentional and wanted (but the mentioned bug is for making it configurable); when saving to *DOCX*, the breaks get correctly saved; so not saving is a bug that likely relates to *something* about breaks being *unintentionally* cleared, which breaks export to ODF, but not to other formats.
Comment 17 Buovjaga 2021-11-25 15:26:59 UTC
*** Bug 139311 has been marked as a duplicate of this bug. ***
Comment 18 BogdanB 2023-05-29 17:25:35 UTC
*** Bug 145849 has been marked as a duplicate of this bug. ***
Comment 19 Mike Kaganski 2023-05-30 09:55:11 UTC
Possibly a relevant code is SwXMLAutoStylePoolP::exportStyleAttributes, which has a case for CTF_PAGEDESCNAME. Yet, it is called both without and *with* Ctrl+M, so the autostyle gets the 'style:master-page-name' attribute; but the autostyle somehow doesn't apply to the paragraph ('text:p', its 'text:style-name' attribute). Maybe it could help someone who tries to fix this.
Comment 20 Mike Kaganski 2023-05-30 13:39:40 UTC
https://gerrit.libreoffice.org/c/core/+/152393
Comment 21 Commit Notification 2023-05-30 16:05:56 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/05bc773b0e88b408a997ffa5851cc9207d3303e5

tdf#73483: make sure to not reset style names

It will be available in 7.6.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 22 Mike Kaganski 2023-05-30 16:19:57 UTC
*** Bug 90221 has been marked as a duplicate of this bug. ***
Comment 23 Mike Kaganski 2023-05-30 16:58:10 UTC
*** Bug 140163 has been marked as a duplicate of this bug. ***
Comment 24 Mike Kaganski 2023-05-31 06:28:23 UTC
*** Bug 47471 has been marked as a duplicate of this bug. ***
Comment 25 Mike Kaganski 2023-05-31 06:29:15 UTC
*** Bug 73411 has been marked as a duplicate of this bug. ***
Comment 26 Mike Kaganski 2023-05-31 06:29:43 UTC
*** Bug 92352 has been marked as a duplicate of this bug. ***
Comment 27 Mike Kaganski 2023-05-31 06:30:13 UTC
*** Bug 95752 has been marked as a duplicate of this bug. ***
Comment 28 Mike Kaganski 2023-05-31 06:30:25 UTC
*** Bug 104988 has been marked as a duplicate of this bug. ***
Comment 29 Mike Kaganski 2023-05-31 06:32:49 UTC
*** Bug 111002 has been marked as a duplicate of this bug. ***
Comment 30 Mike Kaganski 2023-05-31 06:36:54 UTC
In bug 47471, a part of this problem got a workaround, allowing to preserve at least the main paragraph style, when autostyle couldn't be found because of this Ctrl+M bug.
Comment 31 Commit Notification 2023-05-31 09:05:52 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/944f47c592085a160413f7bf42736054848af676

tdf#73483: make sure to not reset style names

It will be available in 7.5.5.

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 32 Mike Kaganski 2023-11-03 10:35:30 UTC
*** Bug 120007 has been marked as a duplicate of this bug. ***
Comment 33 Mike Kaganski 2023-11-03 10:36:59 UTC
*** Bug 125790 has been marked as a duplicate of this bug. ***