Bug 142450 - Remember .uno:Show/HideWhiteSpace across sessions
Summary: Remember .uno:Show/HideWhiteSpace across sessions
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.3.2 release
Hardware: All All
: medium enhancement
Assignee: Dhiraj Holden
URL:
Whiteboard: target:7.4.0 target:7.6.0 target:7.5....
Keywords: difficultyMedium, easyHack, skillCpp, topicUI
: 128116 146380 (view as bug list)
Depends on:
Blocks: Writer-Enhancements Show/Hide-Whitespace
  Show dependency treegraph
 
Reported: 2021-05-23 17:32 UTC by krumple_sodium
Modified: 2023-03-27 07:45 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description krumple_sodium 2021-05-23 17:32:32 UTC
Description:
I am running Kubuntu 20.10 + Libre Office 7.1.3.2 that I installed myself on Kubuntu.
This is a feature request.
When we open Writer, can it restore the software state?

More specifically, in the menu, we have
View -> Normal
View -> Web

Can you program it so that it saves the state in a file. Call it Config.ini or whatever.
Or maybe, put this in the Options dialog box.


Steps to Reproduce:
1. Open Writer and it is in Normal view. It is always in Normal view.

Actual Results:
1. Open Writer and it is in Normal view. It is always in Normal view.

Expected Results:
Can you program it so that it saves the program state in a file. Call it Config.ini or whatever.
Or maybe, put this in the Options dialog box.


Reproducible: Always


User Profile Reset: No



Additional Info:
N/A
Comment 1 V Stuart Foote 2021-05-23 18:55:16 UTC
Setting default view mode should be doable.

However why would you want arbitrary page format of Web View mode with a Writer document? 

If your workflow need is to work in a non-page/non-WYSIWYG layout that would be as for an outline view mode as for bug 135307; or another somewhat more "focused" view as in bug 37817--both in addtition to the Print Preview mode and Full-screen view mode that are not currently grouped with the view modes.
Comment 2 krumple_sodium 2021-05-24 17:53:21 UTC
About bug 135307, so he wants to have Web View renamed to Outline View?
To be honest, I don’t understand why it is called Web View either. So, the guy has a point.
Perhaps because ordinary HTML pages are like infinite height pages.
I don’t need 37817 and that is a request from 2011.

I prefer the Outline View mode (or let’s call it infinite height paper) because the page breaks are distracting. I am typing something and suddenly, poof, it jumps a few centimeter down. It is also distracting when I read my own writings.
Or perhaps I paste an image. If I start to type something above the image, poof, the image flies to the next page. Writer calculates that there isn’t enough room on the page so it pushes the image to the next page.
Again, this makes reading my own stuff difficult.
I have a few hundred documents with text and images. So, once in a while, I read them again.
I don’t print anything. I don’t need WYSIWYG.

Whatever the solution is, the total program state should be saved in a Config.ini.
When I leave my house and come back, everything is in its original state. The cups and magazines are in the same exact location.

Currently, when you save in the ODT format while it is in Web view, it saves that state in the ODT file.
That’s fine but the program should have its own state save as well.
Comment 3 V Stuart Foote 2021-05-24 20:20:39 UTC
OK, so the issue here is to expose the view mode setting(s) per module and record preference to user profile.  Either last used, or in a tools -> options panel.

Again that should be doable.
Comment 4 Heiko Tietze 2021-05-25 07:03:59 UTC
Do you know the option to hide whitespace? Either double click at the space between pages or use View > Show Whitespace (should be off). It's the supposed way to omit the page breaks.

I disagree with the web view mode since its purpose is different and depends on the content. While it might serve your workflow resetting the view mode could be a regression for other.
Comment 5 krumple_sodium 2021-05-25 13:59:01 UTC
To V Stuart Foote: Yes

To Heiko Tietze: Your suggestion has a problem. The program state is not saved. That’s bad.
If I close Writer and reopen, Writer is back to its initial state.

If my suggestion is a problem, the solution is simple.
In Tools -> Options
They can add an option that says
Would you like Writer to be opened in
[X] View -> Normal mode
[X] View -> Web mode
[X] Last state before closing Writer
Comment 6 Heiko Tietze 2021-05-25 14:29:54 UTC
(In reply to krumple_sodium from comment #5)
> Your suggestion has a problem. The program state is not saved. 

The setting of View > [ ] Show Whitespace is saved, at least within the current session. If we agree on making this persistent (or store per document) it would be easy to implement. 

I disagree with more options that with unclear reason. The average user is happy with whitespace and normal view mode and has no idea why this need some special handling ending up in confusion.
Comment 7 krumple_sodium 2021-05-25 15:10:36 UTC
I tried it.
I open Writer
I click on View -> Show Whitespace (so that it gets unchecked)
I close Writer
I open Writer
The checkmark on Show Whitespace is present.
==> That’s bad. Program state was not saved.

If you don’t want to clutter Tools -> Options dialog box, I’m fine with that.
Just save the state in Config.ini (or whatever the real name is) and tell me what the name is and I’ll set the state by hand.
Comment 8 Heiko Tietze 2021-05-25 15:45:24 UTC
Code pointer: Check how .uno:ShowGraphics / FN_VIEW_GRAPHIC is implemented.
Comment 9 QA Administrators 2021-11-23 04:32:27 UTC Comment hidden (obsolete)
Comment 10 krumple_sodium 2021-11-23 18:01:53 UTC
I am setting this to UNCONFIRMED since V Stuart Foote understands what I asked for.
Comment 11 Buovjaga 2021-11-23 18:07:05 UTC
(In reply to krumple_sodium from comment #10)
> I am setting this to UNCONFIRMED since V Stuart Foote understands what I
> asked for.

Heiko forgot to change the status and unfortunately it meant this easy hack was basically invisible to newcomer devs for 6 months.
Comment 12 Dieter 2021-12-10 07:52:49 UTC
Is it a duplicate of bug 128116?
Comment 13 Heiko Tietze 2021-12-10 08:55:28 UTC
*** Bug 128116 has been marked as a duplicate of this bug. ***
Comment 14 Heiko Tietze 2022-01-05 06:49:33 UTC
*** Bug 146380 has been marked as a duplicate of this bug. ***
Comment 15 Mike Kaganski 2022-01-05 07:23:23 UTC
(In reply to Heiko Tietze from comment #8)
> Code pointer: Check how .uno:ShowGraphics / FN_VIEW_GRAPHIC is implemented.

Do you meant that the setting should be not specific to document, but to application? That will make it completely orthogonal to single-page layout, which it is *documented* [1] to be bound to. I do not think it's good to make these two concepts saved independently - the "Show Whitespace" setting would become even more confusing (cf. bug 98446 and bug 146380, where users already do not see the connection between single-page and show whitespace options).

[1] https://help.libreoffice.org/7.2/en-US/text/swriter/main0103.html?DbPAR=WRITER#hd_id102720150854018740
Comment 16 Heiko Tietze 2022-01-05 08:01:34 UTC
(In reply to Mike Kaganski from comment #15)

The patch just saves the last state and makes whitespace persistent on the workplace. Using the multi-page view right now has the same odd consequence on this option being just ignored. If we want to clarify the situation, meaning to resolve bug 98446, we could disable the whitespace option in multi-page mode.
Comment 17 Mike Kaganski 2022-01-05 08:51:38 UTC
(In reply to Heiko Tietze from comment #16)
> The patch just saves the last state and makes whitespace persistent on the
> workplace.

And that is plain wrong. The two options, that control a similar aspect (document view), and that are inter-connetced, should behave similarly - meaning they should be both per-document, or both stored in profile, but not like "one in profile, another in document".

> Using the multi-page view right now has the same odd consequence
> on this option being just ignored. If we want to clarify the situation,
> meaning to resolve bug 98446, we could disable the whitespace option in
> multi-page mode.

You just do not see the picture. If you read the bug 98446 carefully, you see that initially, we *already* had the function *disabled* for modes other than single-page; and *that* was already the problem that caused that bug to appear. So no, restoring that will not fic bug 98446, even though current situation (the mode being not disabled in other modes) is likely an accidental regression.
Comment 18 V Stuart Foote 2022-01-05 15:16:44 UTC
Rather than fussing with the show/hide of white space, would prefer to implement enhancement of bug 67698, bug 135307 (and dupes) to provide an additional VCL canvas view mode (i.e. beside 'Normal' WYSIWYG, or 'WEB' views) that eliminates margins and whitespace of WYSIWYG while otherwise retaining document structure.
Comment 19 Heiko Tietze 2022-01-06 08:23:44 UTC
Please remember to support new volunteers. Dhiraj did a great job so far and we should not skew the topic.

Mike, if you insist on saving the whitespace status in the document please help with code pointers.
Comment 20 V Stuart Foote 2022-01-06 14:40:02 UTC
(In reply to V Stuart Foote from comment #18)
> Rather than fussing with the show/hide of white space, would prefer to
> implement enhancement of bug 67698, bug 135307 (and dupes) to provide an
> additional VCL canvas view mode (i.e. beside 'Normal' WYSIWYG, or 'WEB'
> views) that eliminates margins and whitespace of WYSIWYG while otherwise
> retaining document structure.

(In reply to Heiko Tietze from comment #19)
> Please remember to support new volunteers. Dhiraj did a great job so far and
> we should not skew the topic.
> 
>... 

Apologies, agree the current focus of this issue to retain the collapsed white space between sessions is the appropriate easyHack, and the UX goal.

Just that adding an additional view mode (or modifying Web view) for the outlining UX and workflows would reduce dependence on the Show Whitespace setting to hide whitespace distractions while in WYSIWYG page Normal view mode.
Comment 21 Mike Kaganski 2022-01-06 14:41:38 UTC
(In reply to Heiko Tietze from comment #19)
> Mike, if you insist on saving the whitespace status in the document please
> help with code pointers.

Yes, I will - just need some time. Sorry for the delay :-)
Comment 22 Mike Kaganski 2022-01-08 12:36:34 UTC
(In reply to Heiko Tietze from comment #19)
> Mike, if you insist on saving the whitespace status in the document please
> help with code pointers.

Comment 17 has mentioned bug 98446, which discussed the related view options - and bug 98446 comment 12 contained an XML snippet with the settings. Namely, ViewLayoutColumns config item is relevant.

Grepping for ViewLayoutColumns [1] gives only a dozen of results, and all but one are in documents, and only one being in a CXX file, namely sw/source/uibase/uiview/view.cxx. There you may look at the implementation of reading and writing of that config item; a similar thing is needed for this one.

[1] https://opengrok.libreoffice.org/search?&full=ViewLayoutColumns&project=core
Comment 23 Commit Notification 2022-01-17 06:33:39 UTC
Dhiraj Holden committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5b07acbf3345918f450fccf7ee243ad5bcb3fd67

tdf#142450 add code to store showing whitespace

It will be available in 7.4.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 24 Heiko Tietze 2022-02-07 15:32:19 UTC
Guess we can resolve this as fixed now.
Comment 25 krumple_sodium 2023-03-22 03:14:16 UTC
Hello,
I am the original poster.
The problem is still present.
I run Kubuntu 22.04 and LibreOffice 7.5.1.2 (This is the official release, I downloaded it from the official website and installed it myself).

I also tried LibreOffice Development 7.5.3.0
The problem is still present, on both version.
Comment 26 Commit Notification 2023-03-24 14:12:15 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#149485: Revert "tdf#142450 add code to store showing whitespace"

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 27 Xisco Faulí 2023-03-24 14:52:37 UTC
Unfortunately, the commit fixing this issue was reverted because it was causing bug 149485.
Basically the problem is that the option was saved across sessions, instead it should be saved per document as previous discussions suggested.

At this point, my proposal to move forward is:
1. Close this issue as RESOLVED WONTFIX
2. Create a new ticket for "Remember .uno:Show/HideWhiteSpace per document"
3. If someone provides code pointers, turn the new ticket into an easyhack.

@Heiko, @Mike K. what do you think ?
Comment 28 Heiko Tietze 2023-03-24 16:32:44 UTC
(In reply to Xisco Faulí from comment #27)
> 1. Close this issue as RESOLVED WONTFIX
> 2. Create a new ticket...

Or keep this ticket :-)
It's at least not FIXED anymore.
Comment 29 Commit Notification 2023-03-25 19:42:11 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#149485: Revert "tdf#142450 add code to store showing whitespace"

It will be available in 7.5.3.

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 30 Commit Notification 2023-03-26 10:11:32 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

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

tdf#149485: Revert "tdf#142450 add code to store showing whitespace"

It will be available in 7.4.7.

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 31 Xisco Faulí 2023-03-27 07:45:14 UTC
(In reply to Heiko Tietze from comment #28)
> (In reply to Xisco Faulí from comment #27)
> > 1. Close this issue as RESOLVED WONTFIX
> > 2. Create a new ticket...
> 
> Or keep this ticket :-)
> It's at least not FIXED anymore.

The problem with this ticket is that it talks about "across sessions" which has been proven to be wrong