[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - filter/source filter/uiconfig include/vcl officecfg/registry vcl/source
Muhammet Kara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Sep 23 14:55:36 UTC 2019
filter/source/pdf/impdialog.cxx | 19 +++++++++++
filter/source/pdf/impdialog.hxx | 2 +
filter/source/pdf/pdfexport.cxx | 4 ++
filter/source/pdf/pdfexport.hxx | 1
filter/source/pdf/pdffilter.cxx | 1
filter/uiconfig/ui/pdfgeneralpage.ui | 21 +++++++++++--
include/vcl/pdfextoutdevdata.hxx | 4 ++
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 7 ++++
vcl/source/gdi/pdfextoutdevdata.cxx | 5 +++
9 files changed, 60 insertions(+), 4 deletions(-)
New commits:
commit 079cd016408d54d91e6e8bfdafa150d30681bbcb
Author: Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Mon Sep 23 13:07:49 2019 +0300
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Sep 23 16:54:53 2019 +0200
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 at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index b2e3b1fa3fd6..72607d3e9904 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -86,7 +86,8 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, Sequence< PropertyValue
mbExportFormFieldsUserSelection( true ),
mbAllowDuplicateFieldNames( false ),
mbExportBookmarks( true ),
- mbExportHiddenSlides ( false),
+ mbExportHiddenSlides ( false ),
+ mbSinglePageSheets ( false ),
mnOpenBookmarkLevels( -1 ),
mbHideViewerToolbar( false ),
@@ -200,6 +201,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 );
@@ -388,6 +391,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 );
@@ -480,6 +485,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(TabPageParent pParent, const SfxItemS
, 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"))
@@ -601,6 +607,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->show(false);
+ mxCbSinglePageSheets->set_active(false);
}
mxCbExportPlaceholders->show(mbIsWriter);
@@ -637,6 +651,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 768ab2ac96a8..c41b9a22676e 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -90,6 +90,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 12dea0a241ca..63d7d79aa046 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -101,6 +101,7 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc,
mbUseTransitionEffects ( true ),
mbExportBookmarks ( true ),
mbExportHiddenSlides ( false ),
+ mbSinglePageSheets ( false ),
mnOpenBookmarkLevels ( -1 ),
mbUseLosslessCompression ( false ),
mbReduceImageResolution ( true ),
@@ -558,6 +559,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" )
@@ -837,6 +840,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 872c515e0543..78f7c8a8b8be 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 631b31cee483..aee2993b5f6a 100644
--- a/filter/uiconfig/ui/pdfgeneralpage.ui
+++ b/filter/uiconfig/ui/pdfgeneralpage.ui
@@ -631,7 +631,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">11</property>
+ <property name="top_attach">12</property>
</packing>
</child>
<child>
@@ -646,7 +646,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">12</property>
+ <property name="top_attach">13</property>
</packing>
</child>
<child>
@@ -661,7 +661,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">13</property>
+ <property name="top_attach">14</property>
</packing>
</child>
<child>
@@ -716,6 +716,21 @@
<property name="top_attach">9</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>
diff --git a/include/vcl/pdfextoutdevdata.hxx b/include/vcl/pdfextoutdevdata.hxx
index fa218655cb0c..61859d25505d 100644
--- a/include/vcl/pdfextoutdevdata.hxx
+++ b/include/vcl/pdfextoutdevdata.hxx
@@ -83,6 +83,7 @@ class VCL_DLLPUBLIC PDFExtOutDevData : public ExtOutDevData
bool mbExportFormFields;
bool mbExportBookmarks;
bool mbExportHiddenSlides;
+ bool mbSinglePageSheets;
bool mbExportNDests; //i56629
sal_Int32 mnPage;
sal_Int32 mnCompressionQuality;
@@ -125,6 +126,9 @@ public:
bool GetIsExportHiddenSlides() const { return mbExportHiddenSlides;}
void SetIsExportHiddenSlides( const bool bExportHiddenSlides );
+ bool GetIsSinglePageSheets() const { return mbSinglePageSheets;}
+ void SetIsSinglePageSheets( const bool bSinglePageSheets );
+
bool GetIsExportNamedDestinations() const { return mbExportNDests;} //i56629
void SetIsExportNamedDestinations( const bool bExportNDests ); //i56629
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index dde788c15c7b..bb285d61585c 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -4933,6 +4933,13 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="SinglePageSheets" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Specifies if each sheet is exported to PDF as a single page.
+ (Available in Calc documents only).</desc>
+ </info>
+ <value>false</value>
+ </prop>
<prop oor:name="ExportFormFields" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Specifies whether form fields are exported as widgets or
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index 0624bee326ef..86922853272a 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -524,6 +524,7 @@ PDFExtOutDevData::PDFExtOutDevData( const OutputDevice& rOutDev ) :
mbExportFormFields ( false ),
mbExportBookmarks ( false ),
mbExportHiddenSlides ( false ),
+ mbSinglePageSheets ( false ),
mbExportNDests ( false ),
mnPage ( -1 ),
mnCompressionQuality ( 90 ),
@@ -591,6 +592,10 @@ void PDFExtOutDevData::SetIsExportHiddenSlides( const bool bExportHiddenSlides )
{
mbExportHiddenSlides = bExportHiddenSlides;
}
+void PDFExtOutDevData::SetIsSinglePageSheets( const bool bSinglePageSheets )
+{
+ mbSinglePageSheets = bSinglePageSheets;
+}
void PDFExtOutDevData::SetIsExportNamedDestinations( const bool bExportNDests )
{
mbExportNDests = bExportNDests;
More information about the Libreoffice-commits
mailing list