Bug 105679 - PDF Filter: does not respect last value of ExportOnlyNotesPages setting
Summary: PDF Filter: does not respect last value of ExportOnlyNotesPages setting
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.2.0.0.alpha1
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: David Tardon
URL:
Whiteboard: target:6.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-01 19:09 UTC by Zach Travis
Modified: 2018-03-13 10:54 UTC (History)
3 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 Zach Travis 2017-02-01 19:09:47 UTC
Description:
When exporting with the pdf filter, the most recent settings should be honored (e.g. when exporting on the command line).  However, the "ExportOnlyNotesPage" setting is not.

Steps to Reproduce:
1. Export a presentation to PDF using the GUI, selecting "Export Notes Pages" and "Export Only Notes Pages". Your export should have only notes pages.
2. Run a command-line export of that same spreadsheet to pdf (`soffice --convert-to pdf in.pptx --outdir /tmp`).

Actual Results:  
The command-line exported pdf will have slide pages and note pages (as if ExportOnlyNotesPages is false).

Expected Results:
The command-line exported pdf should have only notes pages (matching the most recent GUI output).


Reproducible: Always

User Profile Reset: No

Additional Info:
I think this is due to a simple omission at LibreOffice/core/filter/source/pdf/pdffilter.cxx:74:

"""
/* we don't get FilterData if we are exporting directly
       to pdf, but we have to use the last user settings (especially for the CompressMode) */
    if ( !aFilterData.getLength() )
    {
        FilterConfigItem aCfgItem( "Office.Common/Filter/PDF/Export/" );
        ...
        aCfgItem.ReadBool(  "ExportNotesPages", false );
        aCfgItem.ReadBool(  "UseTransitionEffects", true );
        ...
    }
"""

A simple fix is to add `aCfgItem.ReadBool(  "ExportOnlyNotesPages", false );`.  More comprehensive/better
would be to re-write the configuration code so that the expected settings (and their types and default values)
are defined in a single place in such a way as to make creating/updating/merging a "configuration" possible without
enumerating all the necessary fields.


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Comment 1 Buovjaga 2017-02-05 12:42:07 UTC
Zach: would you like to submit a patch for the fix: https://wiki.documentfoundation.org/Development/gerrit
Comment 2 Xisco Faulí 2017-11-01 23:05:19 UTC
Dear Zach,
Could you please submit it to gerrit as described here:
https://wiki.documentfoundation.org/Development/gerrit/SubmitPatch?
Comment 3 Zach Travis 2017-11-01 23:07:02 UTC
I would like to add a patch but have not yet had time to do so.
Comment 4 Xisco Faulí 2017-11-01 23:17:32 UTC
(In reply to Zach Travis from comment #3)
> I would like to add a patch but have not yet had time to do so.

Ok, no problem. Whenever you have time. It's great you're around though. You can join @libreoffice-dev IRC channel if you have any question -> https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-dev

Assigning it yourself. Looking forward to seeing your patch!!
Comment 5 Xisco Faulí 2018-01-31 14:56:06 UTC
Dear Zach Travis,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.
Comment 6 Commit Notification 2018-03-13 10:54:28 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fd877edc1822816be04b2e2fa0f883c00b5d2fb0

tdf#105679 honor more saved settings on direct PDF export

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.