diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-01-08 16:19:36 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-01-09 17:05:05 +0100 |
commit | 08886d9d01eb5d3356290ba6d8eeca899cde45cc (patch) | |
tree | 9ee9700b82bd44203b31d0e59b405f47cf8358ba /filter/source/pdf | |
parent | 1327fa4b1dff932500c690c263840fde192988ed (diff) |
tdf#45636 trigger accessibility check when exporting as PDF/UA
This triggers the accessibility check, when we want to export
the PDF with PDF/UA functionallity. If issues are found, it will
show the issues. OK will continue with export despite the issues
and cancel will cancel the whole PDF export.
Change-Id: I2fde97381e08e9c2c79473888caa36e8dd828979
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86387
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'filter/source/pdf')
-rw-r--r-- | filter/source/pdf/impdialog.cxx | 18 | ||||
-rw-r--r-- | filter/source/pdf/impdialog.hxx | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index d19458a00e4d..0fe49d89b9cf 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -26,6 +26,8 @@ #include <sfx2/passwd.hxx> #include <unotools/resmgr.hxx> #include <tools/diagnose_ex.h> +#include <sfx2/objsh.hxx> +#include <svx/AccessibilityCheckDialog.hxx> #include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> @@ -55,6 +57,8 @@ using namespace ::com::sun::star::uno; ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, Sequence< PropertyValue >& rFilterData, const Reference< XComponent >& rxDoc) : SfxTabDialogController(pParent, "filter/ui/pdfoptionsdialog.ui", "PdfOptionsDialog"), + mrDoc(rxDoc), + mpParent(pParent), maConfigItem( "Office.Common/Filter/PDF/Export/", &rFilterData ), maConfigI18N( "Office.Common/I18N/CTL/" ), mbIsPresentation( false ), @@ -345,6 +349,20 @@ short ImpPDFTabDialog::Ok( ) { // here the whole mechanism of the base class is not used // when Ok is hit, the user means 'convert to PDF', so simply close with ok + + if (getGeneralPage()->IsPdfUaSelected()) + { + SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc); + if (pShell) + { + sfx::AccessibilityIssueCollection aCollection = pShell->runAccessibilityCheck(); + if (!aCollection.getIssues().empty()) + { + svx::AccessibilityCheckDialog aDialog(mpParent, aCollection); + return aDialog.run(); + } + } + } return RET_OK; } diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 52a37ad5cf4a..97a7464ffa6d 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -58,6 +58,9 @@ class ImpPDFTabLinksPage; /// Class tabbed dialog class ImpPDFTabDialog final : public SfxTabDialogController { + css::uno::Reference<css::lang::XComponent> mrDoc; + weld::Window* mpParent; + FilterConfigItem maConfigItem; FilterConfigItem maConfigI18N; @@ -238,6 +241,7 @@ public: void GetFilterConfigItem(ImpPDFTabDialog* paParent); void SetFilterConfigItem(ImpPDFTabDialog* paParent); bool IsPdfaSelected() const { return mxCbPDFA->get_active(); } + bool IsPdfUaSelected() const { return mxCbPDFUA->get_active(); } }; /// Class tab page viewer |