[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - filter/source filter/uiconfig
Thorsten Behrens (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 1 17:51:37 UTC 2019
filter/source/pdf/impdialog.cxx | 52 +++++++++++++++------
filter/source/pdf/impdialog.hxx | 6 +-
filter/uiconfig/ui/pdfgeneralpage.ui | 86 ++++++++++++++++++++++++++++-------
3 files changed, 110 insertions(+), 34 deletions(-)
New commits:
commit 0aed9cf0126409f0a2d215212becc6d562a58a98
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
AuthorDate: Mon Jul 1 03:56:37 2019 +0200
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Mon Jul 1 19:51:02 2019 +0200
tdf#62728 Provide both A/1 and A/2 in PDF export dialog
Followup commit to ed4a0eed82e2f, adding back the A/1 option.
Change-Id: I9f509cb77f045de260bc22fc494fe4ecaac29bbc
Reviewed-on: https://gerrit.libreoffice.org/74941
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
(cherry picked from commit 49cfcf777d03abf59557cad021b4e5c4445de3c0)
Reviewed-on: https://gerrit.libreoffice.org/74960
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 52e22cf01a28..213f2cc2dc02 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -462,7 +462,9 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(TabPageParent pParent, const SfxItemS
, mxNfQuality(m_xBuilder->weld_metric_spin_button("quality", FieldUnit::PERCENT))
, mxCbReduceImageResolution(m_xBuilder->weld_check_button("reduceresolution"))
, mxCoReduceImageResolution(m_xBuilder->weld_combo_box("resolution"))
- , mxCbPDFA2b(m_xBuilder->weld_check_button("pdfa"))
+ , mxCbPDFA(m_xBuilder->weld_check_button("pdfa"))
+ , mxRbPDFA1b(m_xBuilder->weld_radio_button("pdfa1"))
+ , mxRbPDFA2b(m_xBuilder->weld_radio_button("pdfa2"))
, mxCbTaggedPDF(m_xBuilder->weld_check_button("tagged"))
, mxCbExportFormFields(m_xBuilder->weld_check_button("forms"))
, mxFormsFrame(m_xBuilder->weld_widget("formsframe"))
@@ -530,16 +532,31 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
mxCbWatermark->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleWatermarkHdl ) );
mxFtWatermark->set_sensitive(false );
mxEdWatermark->set_sensitive( false );
- mxCbPDFA2b->connect_toggled(LINK(this, ImpPDFTabGeneralPage, ToggleExportPDFAHdl));
+ mxCbPDFA->connect_toggled(LINK(this, ImpPDFTabGeneralPage, ToggleExportPDFAHdl));
+ mxRbPDFA1b->connect_toggled(LINK(this, ImpPDFTabGeneralPage, ToggleExportPDFAHdl));
+ mxRbPDFA2b->connect_toggled(LINK(this, ImpPDFTabGeneralPage, ToggleExportPDFAHdl));
switch( pParent->mnPDFTypeSelection )
{
default:
- mxCbPDFA2b->set_active( false ); // PDF 1.5
+ // PDF 1.5
+ mxCbPDFA->set_active( false );
+ mxRbPDFA1b->set_active( false );
+ mxRbPDFA2b->set_active( true );
break;
- case 2: mxCbPDFA2b->set_active(true); // PDF/A-2a
+ case 1:
+ // PDF A-1b
+ mxCbPDFA->set_active(true);
+ mxRbPDFA1b->set_active(true);
+ mxRbPDFA2b->set_active(false);
+ break;
+ case 2:
+ // PDF A-2b
+ mxCbPDFA->set_active(true);
+ mxRbPDFA2b->set_active(true);
+ mxRbPDFA1b->set_active(false);
break;
}
- ToggleExportPDFAHdl( *mxCbPDFA2b );
+ ToggleExportPDFAHdl( *mxCbPDFA );
mxCbExportFormFields->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleExportFormFieldsHdl ) );
@@ -547,7 +564,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
mbTaggedPDFUserSelection = pParent->mbUseTaggedPDF;
mbExportFormFieldsUserSelection = pParent->mbExportFormFields;
- if( !mxCbPDFA2b->get_active() )
+ if( !mxCbPDFA->get_active() )
{
// the value for PDF/A set by the ToggleExportPDFAHdl method called before
mxCbTaggedPDF->set_active( mbTaggedPDFUserSelection );
@@ -643,9 +660,12 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* pParent )
}
pParent->mnPDFTypeSelection = 0;
- if( mxCbPDFA2b->get_active() )
+ if( mxCbPDFA->get_active() )
{
pParent->mnPDFTypeSelection = 2;
+ if( mxRbPDFA1b->get_active() )
+ pParent->mnPDFTypeSelection = 1;
+
pParent->mbUseTaggedPDF = mbTaggedPDFUserSelection;
pParent->mbExportFormFields = mbExportFormFieldsUserSelection;
}
@@ -758,12 +778,10 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportPDFAHdl, weld::ToggleButton&,
// set the security page status (and its controls as well)
ImpPDFTabSecurityPage* pSecPage = mpParent ? mpParent->getSecurityPage() : nullptr;
if (pSecPage)
- {
- pSecPage->ImplPDFASecurityControl(!mxCbPDFA2b->get_active());
- }
+ pSecPage->ImplPDFASecurityControl(!mxCbPDFA->get_active());
// PDF/A-1 needs tagged PDF, so force disable the control, will be forced in pdfexport.
- bool bPDFA1Sel = mxCbPDFA2b->get_active();
+ bool bPDFA1Sel = mxCbPDFA->get_active();
mxFormsFrame->set_sensitive(bPDFA1Sel);
if(bPDFA1Sel)
{
@@ -774,24 +792,28 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportPDFAHdl, weld::ToggleButton&,
mbExportFormFieldsUserSelection = mxCbExportFormFields->get_active();
mxCbExportFormFields->set_active(false);
mxCbExportFormFields->set_sensitive(false);
+ mxRbPDFA1b->set_sensitive(true);
+ mxRbPDFA2b->set_sensitive(true);
}
else
{
// retrieve the values of subordinate controls
+ mxCbTaggedPDF->set_sensitive(false);
mxCbTaggedPDF->set_sensitive(true);
mxCbTaggedPDF->set_active(mbTaggedPDFUserSelection);
mxCbExportFormFields->set_active(mbExportFormFieldsUserSelection);
- mxCbExportFormFields->set_sensitive(true);
+ mxRbPDFA1b->set_sensitive(false);
+ mxRbPDFA2b->set_sensitive(false);
}
// PDF/A-2 doesn't allow launch action, so enable/disable the selection on
// Link page
ImpPDFTabLinksPage* pLinksPage = mpParent ? mpParent->getLinksPage() : nullptr;
if (pLinksPage)
- pLinksPage->ImplPDFALinkControl(!mxCbPDFA2b->get_active());
+ pLinksPage->ImplPDFALinkControl(!mxCbPDFA->get_active());
// if a password was set, inform the user that this will not be used in PDF/A case
- if( mxCbPDFA2b->get_active() && pSecPage && pSecPage->hasPassword() )
+ if( mxCbPDFA->get_active() && pSecPage && pSecPage->hasPassword() )
{
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xContainer.get(),
VclMessageType::Warning, VclButtonsType::Ok,
@@ -1351,7 +1373,7 @@ void ImpPDFTabLinksPage::SetFilterConfigItem( const ImpPDFTabDialog* pParent )
ImpPDFTabGeneralPage* pGeneralPage = pParent->getGeneralPage();
if (pGeneralPage)
- ImplPDFALinkControl(!pGeneralPage->mxCbPDFA2b->get_active());
+ ImplPDFALinkControl(!pGeneralPage->mxCbPDFA->get_active());
}
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 73b86e779d9b..9f9b8e38c33f 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -182,7 +182,9 @@ class ImpPDFTabGeneralPage : public SfxTabPage
std::unique_ptr<weld::MetricSpinButton> mxNfQuality;
std::unique_ptr<weld::CheckButton> mxCbReduceImageResolution;
std::unique_ptr<weld::ComboBox> mxCoReduceImageResolution;
- std::unique_ptr<weld::CheckButton> mxCbPDFA2b;
+ std::unique_ptr<weld::CheckButton> mxCbPDFA;
+ std::unique_ptr<weld::RadioButton> mxRbPDFA1b;
+ std::unique_ptr<weld::RadioButton> mxRbPDFA2b;
std::unique_ptr<weld::CheckButton> mxCbTaggedPDF;
std::unique_ptr<weld::CheckButton> mxCbExportFormFields;
std::unique_ptr<weld::Widget> mxFormsFrame;
@@ -227,7 +229,7 @@ public:
void GetFilterConfigItem(ImpPDFTabDialog* paParent);
void SetFilterConfigItem(ImpPDFTabDialog* paParent);
- bool IsPdfaSelected() const { return mxCbPDFA2b->get_active(); }
+ bool IsPdfaSelected() const { return mxCbPDFA->get_active(); }
};
/// Class tab page viewer
diff --git a/filter/uiconfig/ui/pdfgeneralpage.ui b/filter/uiconfig/ui/pdfgeneralpage.ui
index 2443e68ba57a..1d5173f2af0f 100644
--- a/filter/uiconfig/ui/pdfgeneralpage.ui
+++ b/filter/uiconfig/ui/pdfgeneralpage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.20.4 -->
<interface domain="flt">
<requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1">
@@ -462,22 +462,6 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="pdfa">
- <property name="label" translatable="yes" context="pdfgeneralpage|pdfa">Archive P_DF/A-2b (ISO 19005-2)</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes" context="pdfgeneralpage|pdfa|tooltip_text">Creates an ISO 19005-2 compliant PDF file, ideal for long-term document preservation</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
<object class="GtkCheckButton" id="tagged">
<property name="label" translatable="yes" context="pdfgeneralpage|tagged">_Tagged PDF (add document structure)</property>
<property name="visible">True</property>
@@ -716,6 +700,74 @@
<property name="top_attach">9</property>
</packing>
</child>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="pdfa">
+ <property name="label" translatable="yes" context="pdfgeneralpage|pdfa">Archive (P_DF/A, ISO 19005)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes" context="pdfgeneralpage|pdfa|tooltip_text">Creates an ISO 19005-2 compliant PDF file, ideal for long-term document preservation</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="pdfagrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">20</property>
+ <property name="column_spacing">14</property>
+ <child>
+ <object class="GtkRadioButton" id="pdfa2">
+ <property name="label" translatable="yes" context="pdfgeneralpage|pdfa">PDF/A-2b</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="pdfa1">
+ <property name="label" translatable="yes" context="pdfgeneralpage|pdfa">PDF/A-1b</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">pdfa2</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
</object>
</child>
</object>
More information about the Libreoffice-commits
mailing list