summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-03-13 20:46:15 +0100
committerAndras Timar <andras.timar@collabora.com>2023-04-02 23:38:06 +0200
commit7b8fa7d7e5bcaffc48ebab94f06c8c302717476b (patch)
treedc0894e2a5531f04f26ecfa55387ec4b636273ac
parentec1d4bb10a5daec8eb263d7d66630368ff66ba97 (diff)
filter: PDF export dialog: always enable Outlines for PDF/UA
This is not a hard requirement, but why not prevent this pitfall at least in the dialog: 7.17 Navigation A document should include a document outline that matches the reading order and level of navigational targets (ISO 32000-1:2008, 12.3.3). Change-Id: I06533123cdfe5fe1c79180d6ebd4e961b25a63b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148818 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit e564e4d14367ae5c8e6b1f7a76f69113fea660e6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148857 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--filter/source/pdf/impdialog.cxx24
-rw-r--r--filter/source/pdf/impdialog.hxx1
2 files changed, 24 insertions, 1 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 4693652292ed..b3314ba0df1d 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -198,6 +198,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const Sequence< Property
mbViewPDF = maConfigItem.ReadBool( "ViewPDFAfterExport", false );
mbExportBookmarks = maConfigItem.ReadBool( "ExportBookmarks", true );
+ mbExportBookmarksUserSelection = mbExportBookmarks;
if ( mbIsPresentation )
mbExportHiddenSlides = maConfigItem.ReadBool( "ExportHiddenSlides", false );
if ( mbIsSpreadsheet )
@@ -619,6 +620,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
mxCbTaggedPDF->set_active(pParent->mbUseTaggedPDFUserSelection);
else
mbUseTaggedPDFUserSelection = pParent->mbUseTaggedPDFUserSelection;
+ mxCbExportBookmarks->set_active(pParent->mbExportBookmarksUserSelection);
TogglePDFVersionOrUniversalAccessibilityHandle(*mxCbPDFA);
mxCbExportFormFields->set_active(pParent->mbExportFormFields);
@@ -628,7 +630,6 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
mxCbAllowDuplicateFieldNames->set_active( pParent->mbAllowDuplicateFieldNames );
mxFormsFrame->set_sensitive(pParent->mbExportFormFields);
- mxCbExportBookmarks->set_active( pParent->mbExportBookmarks );
mxCbExportNotes->set_active( pParent->mbExportNotes );
mxCbExportNotesInMargin->set_active( pParent->mbExportNotesInMargin );
@@ -761,6 +762,10 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* pParent )
if (!bIsPDFA && !bIsPDFUA)
mbUseTaggedPDFUserSelection = pParent->mbUseTaggedPDF;
+ if (!bIsPDFUA)
+ {
+ pParent->mbExportBookmarksUserSelection = pParent->mbExportBookmarks;
+ }
pParent->mbUseTaggedPDFUserSelection = mbUseTaggedPDFUserSelection;
pParent->mbExportFormFields = mxCbExportFormFields->get_active();
@@ -898,6 +903,23 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, TogglePDFVersionOrUniversalAccessibilityHa
mxCbTaggedPDF->set_active(mbUseTaggedPDFUserSelection);
}
+ if (bIsPDFUA)
+ {
+ if (mxCbExportBookmarks->get_sensitive())
+ {
+ if (mpParent)
+ {
+ mpParent->mbExportBookmarksUserSelection = mxCbExportBookmarks->get_active();
+ }
+ mxCbExportBookmarks->set_active(true);
+ }
+ }
+ else if (mpParent)
+ {
+ mxCbExportBookmarks->set_active(mpParent->mbExportBookmarksUserSelection);
+ }
+ mxCbExportBookmarks->set_sensitive(!bIsPDFUA);
+
// PDF/A doesn't allow launch action, so enable/disable the selection on the Link page
ImpPDFTabLinksPage* pLinksPage = mpParent ? mpParent->getLinksPage() : nullptr;
if (pLinksPage)
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index dd2a9a3add98..aac0185482b6 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -97,6 +97,7 @@ class ImpPDFTabDialog final : public SfxTabDialogController
bool mbExportFormFields;
bool mbAllowDuplicateFieldNames;
bool mbExportBookmarks;
+ bool mbExportBookmarksUserSelection = true;
bool mbExportHiddenSlides;
bool mbSinglePageSheets;
sal_Int32 mnOpenBookmarkLevels;