[Libreoffice-commits] core.git: filter/source filter/uiconfig include/vcl officecfg/registry vcl/source

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 11 07:47:56 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                       |   27 ++++++++++---
 include/vcl/pdfextoutdevdata.hxx                           |    4 +
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |    7 +++
 vcl/source/gdi/pdfextoutdevdata.cxx                        |    5 ++
 9 files changed, 63 insertions(+), 7 deletions(-)

New commits:
commit 68dc00e3bfc7a99166196f479f616e9ef222fe8a
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Mon Sep 23 13:07:49 2019 +0300
Commit:     Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Fri Oct 11 09:46:54 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>
    Reviewed-on: https://gerrit.libreoffice.org/80634
    Tested-by: Jenkins
    Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>

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>
diff --git a/include/vcl/pdfextoutdevdata.hxx b/include/vcl/pdfextoutdevdata.hxx
index 5a932570af6a..a352f04c2784 100644
--- a/include/vcl/pdfextoutdevdata.hxx
+++ b/include/vcl/pdfextoutdevdata.hxx
@@ -80,6 +80,7 @@ class VCL_DLLPUBLIC PDFExtOutDevData : public ExtOutDevData
     bool                        mbExportFormFields;
     bool                        mbExportBookmarks;
     bool                        mbExportHiddenSlides;
+    bool                        mbSinglePageSheets;
     bool                        mbExportNDests; //i56629
     sal_Int32                   mnPage;
     sal_Int32                   mnCompressionQuality;
@@ -122,6 +123,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 4dce5f44acd2..0fd0786a77a9 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -4970,6 +4970,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 1af5c48938b5..b87cee3037c4 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -523,6 +523,7 @@ PDFExtOutDevData::PDFExtOutDevData( const OutputDevice& rOutDev ) :
     mbExportFormFields      ( false ),
     mbExportBookmarks       ( false ),
     mbExportHiddenSlides    ( false ),
+    mbSinglePageSheets      ( false ),
     mbExportNDests          ( false ),
     mnPage                  ( -1 ),
     mnCompressionQuality    ( 90 ),
@@ -590,6 +591,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