Bug 129162 - UI: PDF Export: Disable range options when "Full-sheet previews" option is checked (See comment#4)
Summary: UI: PDF Export: Disable range options when "Full-sheet previews" option is ch...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyInteresting, implementationError, skillCpp, topicUI
Depends on:
Blocks: PDF-Export-Options-Dialog
  Show dependency treegraph
 
Reported: 2019-12-03 16:42 UTC by Cor Nouws
Modified: 2020-02-18 13:26 UTC (History)
4 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 Cor Nouws 2019-12-03 16:42:18 UTC
With a spreadsheet, with multiple sheets and a defined print range

- Select one sheet
- File > Export as PDF
- Tab General, Range.. choose Selected sheets

  > one expects that only selected sheet (possibly print range) is exported.

If however the Full-sheet Preview (Structure) is set (is remembered from last export), the result of the export is the full spreadsheet.
Comment 1 Cor Nouws 2019-12-03 16:45:27 UTC
So should "Full-sheet previews" disable the widgets for setting the range?

The distance/position of the various controls is not ideal for that, I think.
Comment 2 Heiko Tietze 2019-12-06 10:11:23 UTC
First of all it behaves differently depending on the checkbox on or off. And that's a clear bug (if Full Preview alters the printing options it's required to enabled/disable those respectively, but that's likely not true here).

The "Full-Sheet previews" (why plural) is another undocumented and misleading function. At least we should provide a tooltip explaining "If this option is enabled you see all pages in one" (with a better text of course).
Comment 3 Muhammet Kara 2019-12-06 10:32:13 UTC
(In reply to Heiko Tietze from comment #2)
> First of all it behaves differently depending on the checkbox on or off. And
> that's a clear bug (if Full Preview alters the printing options it's
> required to enabled/disable those respectively, but that's likely not true
> here).

That's actually the case here. full-sheet previews option disregards some other options intentionally.

> 
> The "Full-Sheet previews" (why plural) is another undocumented and
> misleading function. At least we should provide a tooltip explaining "If
> this option is enabled you see all pages in one" (with a better text of
> course).

I explained it on a blog post[0], but might have forgotten to add to the release notes. I'll add it to the release notes, and create a documentation bug report also.

I agree on disabling/greying-out the disregarded options.

[0] https://muhammetkara.com/post/2019-10-18-full-sheet-previews-in-libreoffice/
Comment 4 Muhammet Kara 2019-12-06 10:55:25 UTC
Let's make this an easyhack.

Check for the value of mbSinglePageSheets in the ImpPDFTabDialog class, and disable related items (all of the items under "General > Range" of the "PDF Options" dialog, which could be displayed by following "File > Export as PDF..." menu) on the dialog based on the value of it.

You will need to do the first disabling (if needed) inside ImpPDFTabGeneralPage::SetFilterConfigItem() method, probably just after this line:

mxCbSinglePageSheets->set_active(pParent->mbSinglePageSheets);

Then you need to add a toggle handler for the mxCbSinglePageSheets checkbox, and enable/disable the range options inside that toggle handler based on the value/state of the checkbox. (You may check the toggle handlers of the mxCbReduceImageResolution and the mxCbWatermark checkboxes to see how it is done.)

It is also probably a good idea to check the related blog post to understand the option, and get some tips: https://muhammetkara.com/post/2019-10-18-full-sheet-previews-in-libreoffice/
Comment 5 Mohamed Sameh 2020-02-15 20:11:22 UTC
I would like to work on this easy hack but I can not reproduce it as I can't find the 'Full-Sheet previewes' option. I have a Calc window with 2 empty sheets and I dont have the option described in https://muhammetkara.com/post/2019-10-18-full-sheet-previews-in-libreoffice/

a screenshot of my options https://imgur.com/a/d7Vw7DS
Comment 6 Muhammet Kara 2020-02-18 13:26:39 UTC
(In reply to Mohamed Sameh from comment #5)
> I would like to work on this easy hack but I can not reproduce it as I can't
> find the 'Full-Sheet previewes' option. I have a Calc window with 2 empty
> sheets and I dont have the option described in
> https://muhammetkara.com/post/2019-10-18-full-sheet-previews-in-libreoffice/
> 
> a screenshot of my options https://imgur.com/a/d7Vw7DS

It was renamed to "Whole sheet export"