summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-09-23 13:07:49 +0300
committerMuhammet Kara <muhammet.kara@collabora.com>2019-10-11 09:46:54 +0200
commit68dc00e3bfc7a99166196f479f616e9ef222fe8a (patch)
tree2cb4f1b7a4215c4ccd01dd43ee996766efa83b55 /filter
parent10357bdfc0a254a76681e29e8a412f91738f1dda (diff)
Add 'SinglePageSheets' option to the PDF export dialog
This handles the UI, and carrying the filter option to the pdfexport code. It will be handled in PDFExport class. Change-Id: I92c3f14a4ae38c4ab81f4f9eee63e5f3c864d0a6 Reviewed-on: https://gerrit.libreoffice.org/79397 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/80634 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/pdf/impdialog.cxx19
-rw-r--r--filter/source/pdf/impdialog.hxx2
-rw-r--r--filter/source/pdf/pdfexport.cxx4
-rw-r--r--filter/source/pdf/pdfexport.hxx1
-rw-r--r--filter/source/pdf/pdffilter.cxx1
-rw-r--r--filter/uiconfig/ui/pdfgeneralpage.ui27
6 files changed, 47 insertions, 7 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index e5e93b8ae461..1b0e8c327964 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -87,7 +87,8 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, Sequence< PropertyValue
mbExportFormFields( true ),
mbAllowDuplicateFieldNames( false ),
mbExportBookmarks( true ),
- mbExportHiddenSlides ( false),
+ mbExportHiddenSlides ( false ),
+ mbSinglePageSheets ( false ),
mnOpenBookmarkLevels( -1 ),
mbHideViewerToolbar( false ),
@@ -201,6 +202,8 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, Sequence< PropertyValue
mbExportBookmarks = maConfigItem.ReadBool( "ExportBookmarks", true );
if ( mbIsPresentation )
mbExportHiddenSlides = maConfigItem.ReadBool( "ExportHiddenSlides", false );
+ if ( mbIsSpreadsheet )
+ mbSinglePageSheets = maConfigItem.ReadBool( "SinglePageSheets", false );
mnOpenBookmarkLevels = maConfigItem.ReadInt32( "OpenBookmarkLevels", -1 );
mbUseTransitionEffects = maConfigItem.ReadBool( "UseTransitionEffects", true );
mbIsSkipEmptyPages = maConfigItem.ReadBool( "IsSkipEmptyPages", false );
@@ -386,6 +389,8 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
maConfigItem.WriteBool( "ExportBookmarks", mbExportBookmarks );
if ( mbIsPresentation )
maConfigItem.WriteBool( "ExportHiddenSlides", mbExportHiddenSlides );
+ if ( mbIsSpreadsheet )
+ maConfigItem.WriteBool( "SinglePageSheets", mbSinglePageSheets );
maConfigItem.WriteBool( "UseTransitionEffects", mbUseTransitionEffects );
maConfigItem.WriteBool( "IsSkipEmptyPages", mbIsSkipEmptyPages );
maConfigItem.WriteBool( "ExportPlaceholders", mbIsExportPlaceholders );
@@ -478,6 +483,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogC
, mxCbAllowDuplicateFieldNames(m_xBuilder->weld_check_button("allowdups"))
, mxCbExportBookmarks(m_xBuilder->weld_check_button("bookmarks"))
, mxCbExportHiddenSlides(m_xBuilder->weld_check_button("hiddenpages"))
+ , mxCbSinglePageSheets(m_xBuilder->weld_check_button("singlepagesheets"))
, mxCbExportNotes(m_xBuilder->weld_check_button("comments"))
, mxCbViewPDF(m_xBuilder->weld_check_button("viewpdf"))
, mxCbUseReferenceXObject(m_xBuilder->weld_check_button("usereferencexobject"))
@@ -602,6 +608,14 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
mxRbSelection->set_label(mxSheetsFt->get_label());
// tdf#105965 Make Selection/Selected sheets the default PDF export range setting for spreadsheets
mxRbSelection->set_active(true);
+
+ mxCbSinglePageSheets->show();
+ mxCbSinglePageSheets->set_active(pParent->mbSinglePageSheets);
+ }
+ else
+ {
+ mxCbSinglePageSheets->hide();
+ mxCbSinglePageSheets->set_active(false);
}
mxCbExportPlaceholders->set_visible(mbIsWriter);
@@ -643,6 +657,9 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* pParent )
if ( mbIsPresentation )
pParent->mbExportHiddenSlides = mxCbExportHiddenSlides->get_active();
+ if (mbIsSpreadsheet)
+ pParent->mbSinglePageSheets = mxCbSinglePageSheets->get_active();
+
pParent->mbIsSkipEmptyPages = !mxCbExportEmptyPages->get_active();
pParent->mbIsExportPlaceholders = mxCbExportPlaceholders->get_active();
pParent->mbAddStream = mxCbAddStream->get_visible() && mxCbAddStream->get_active();
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 5087f6a4bee8..4827e125fbc0 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -89,6 +89,7 @@ class ImpPDFTabDialog final : public SfxTabDialogController
bool mbAllowDuplicateFieldNames;
bool mbExportBookmarks;
bool mbExportHiddenSlides;
+ bool mbSinglePageSheets;
sal_Int32 mnOpenBookmarkLevels;
bool mbHideViewerToolbar;
@@ -192,6 +193,7 @@ class ImpPDFTabGeneralPage : public SfxTabPage
std::unique_ptr<weld::CheckButton> mxCbAllowDuplicateFieldNames;
std::unique_ptr<weld::CheckButton> mxCbExportBookmarks;
std::unique_ptr<weld::CheckButton> mxCbExportHiddenSlides;
+ std::unique_ptr<weld::CheckButton> mxCbSinglePageSheets;
std::unique_ptr<weld::CheckButton> mxCbExportNotes;
std::unique_ptr<weld::CheckButton> mxCbViewPDF;
std::unique_ptr<weld::CheckButton> mxCbUseReferenceXObject;
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 7368512293bf..b0a91ace6e4f 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -105,6 +105,7 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc,
mbUseTransitionEffects ( true ),
mbExportBookmarks ( true ),
mbExportHiddenSlides ( false ),
+ mbSinglePageSheets ( false ),
mnOpenBookmarkLevels ( -1 ),
mbUseLosslessCompression ( false ),
mbReduceImageResolution ( true ),
@@ -566,6 +567,8 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
rFilterData[ nData ].Value >>= mbExportBookmarks;
else if ( rFilterData[ nData ].Name == "ExportHiddenSlides" )
rFilterData[ nData ].Value >>= mbExportHiddenSlides;
+ else if ( rFilterData[ nData ].Name == "SinglePageSheets" )
+ rFilterData[ nData ].Value >>= mbSinglePageSheets;
else if ( rFilterData[ nData ].Name == "OpenBookmarkLevels" )
rFilterData[ nData ].Value >>= mnOpenBookmarkLevels;
else if ( rFilterData[ nData ].Name == "SignPDF" )
@@ -851,6 +854,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
pPDFExtOutDevData->SetIsExportFormFields( mbExportFormFields );
pPDFExtOutDevData->SetIsExportBookmarks( mbExportBookmarks );
pPDFExtOutDevData->SetIsExportHiddenSlides( mbExportHiddenSlides );
+ pPDFExtOutDevData->SetIsSinglePageSheets( mbSinglePageSheets );
pPDFExtOutDevData->SetIsLosslessCompression( mbUseLosslessCompression );
pPDFExtOutDevData->SetCompressionQuality( mnQuality );
pPDFExtOutDevData->SetIsReduceImageResolution( mbReduceImageResolution );
diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx
index 6d2d1ffd63e7..f133e12c5ffa 100644
--- a/filter/source/pdf/pdfexport.hxx
+++ b/filter/source/pdf/pdfexport.hxx
@@ -51,6 +51,7 @@ private:
bool mbUseTransitionEffects;
bool mbExportBookmarks;
bool mbExportHiddenSlides;
+ bool mbSinglePageSheets;
sal_Int32 mnOpenBookmarkLevels;
bool mbUseLosslessCompression;
diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index 1051f2b1bd2b..698735c969e0 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -115,6 +115,7 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
aCfgItem.ReadBool( "ExportBookmarks", true );
aCfgItem.ReadBool( "ExportHiddenSlides", false );
+ aCfgItem.ReadBool( "SinglePageSheets", false );
aCfgItem.ReadInt32( "OpenBookmarkLevels", -1 );
aCfgItem.ReadBool( "IsRedactMode", false);
diff --git a/filter/uiconfig/ui/pdfgeneralpage.ui b/filter/uiconfig/ui/pdfgeneralpage.ui
index 1fa47b4a23e1..2f86f81d76b5 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.20.4 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="flt">
<requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1">
@@ -615,7 +615,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">11</property>
+ <property name="top_attach">12</property>
</packing>
</child>
<child>
@@ -630,7 +630,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">12</property>
+ <property name="top_attach">13</property>
</packing>
</child>
<child>
@@ -645,7 +645,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">13</property>
+ <property name="top_attach">14</property>
</packing>
</child>
<child>
@@ -729,7 +729,7 @@
<property name="column_spacing">14</property>
<child>
<object class="GtkRadioButton" id="pdfa2">
- <property name="label" translatable="no" context="pdfgeneralpage|pdfa">PDF/A-2b</property>
+ <property name="label" context="pdfgeneralpage|pdfa">PDF/A-2b</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -743,7 +743,7 @@
</child>
<child>
<object class="GtkRadioButton" id="pdfa1">
- <property name="label" translatable="no" context="pdfgeneralpage|pdfa">PDF/A-1b</property>
+ <property name="label" context="pdfgeneralpage|pdfa">PDF/A-1b</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -768,6 +768,21 @@
<property name="top_attach">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="singlepagesheets">
+ <property name="label" translatable="yes" context="pdfgeneralpage|singlepagesheets">Single-page sheets</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</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">11</property>
+ </packing>
+ </child>
</object>
</child>
</object>