[PATCH] fdo#37222 and fdo#37219 Open pdf after Export and added to ...

Anurag Kanungo (via Code Review) gerrit at gerrit.libreoffice.org
Tue Apr 30 01:38:58 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3693

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/93/3693/1

fdo#37222 and fdo#37219  Open pdf after Export and added to recent documents.

Added an checkbox option "view pdf after Export"  in Export Dialog Box .

If a user ticks it , pdf file will be opened after export
else only export will be done .

Change-Id: Ibc4bf200c67d090d61e6024519b9057f9f8bfd6f
---
M filter/source/pdf/impdialog.cxx
M filter/source/pdf/impdialog.hrc
M filter/source/pdf/impdialog.hxx
M filter/source/pdf/impdialog.src
M filter/source/pdf/pdffilter.cxx
5 files changed, 29 insertions(+), 0 deletions(-)



diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 9ddf052..d70d17f 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -39,6 +39,7 @@
 
 #include <boost/shared_ptr.hpp>
 
+extern int pdfview;
 static ResMgr& getPDFFilterResMgr()
 {
     static ResMgr *pRes = ResMgr::CreateResMgr( "pdffilter", Application::GetSettings().GetUILanguageTag());
@@ -80,6 +81,7 @@
     mnMaxImageResolution( 300 ),
     mbUseTaggedPDF( sal_False ),
     mbExportNotes( sal_True ),
+    mbVIEWPDF( sal_False ),
     mbExportNotesPages( sal_False ),
     mbUseTransitionEffects( sal_False ),
     mbIsSkipEmptyPages( sal_True ),
@@ -511,6 +513,7 @@
     maCbExportBookmarks( this, PDFFilterResId( CB_EXPORTBOOKMARKS ) ),
     maCbExportHiddenSlides( this, PDFFilterResId( CB_EXPORTHIDDENSLIDES ) ),
     maCbExportNotes( this, PDFFilterResId( CB_EXPORTNOTES ) ),
+    maCbVIEWPDF( this, PDFFilterResId( CB_VIEWPDF ) ),
     maCbExportNotesPages( this, PDFFilterResId( CB_EXPORTNOTESPAGES ) ),
     maCbExportEmptyPages( this, PDFFilterResId( CB_EXPORTEMPTYPAGES ) ),
     maCbAddStream( this, PDFFilterResId( CB_ADDSTREAM ) ),
@@ -702,6 +705,12 @@
         paParent->mbExportFormFields = maCbExportFormFields.IsChecked();
         paParent->mbEmbedStandardFonts = maCbEmbedStandardFonts.IsChecked();
     }
+    
+    if( maCbVIEWPDF.IsChecked() )
+        pdfview=1;
+    else
+        pdfview=0;
+
     paParent->maWatermarkText = maEdWatermark.GetText();
 
     /*
diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc
index 03b6d55..938b622 100644
--- a/filter/source/pdf/impdialog.hrc
+++ b/filter/source/pdf/impdialog.hrc
@@ -87,6 +87,7 @@
 #define CB_WATERMARK                32
 #define FT_WATERMARK                33
 #define ED_WATERMARK                34
+#define CB_VIEWPDF                  35
 
 
 //controls for open options tab page
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 11a3f38..3b0d96c 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -94,6 +94,7 @@
     sal_Bool                    mbUseTaggedPDF;
     sal_Int32                   mnPDFTypeSelection;
     sal_Bool                    mbExportNotes;
+    sal_Bool                    mbVIEWPDF;
     sal_Bool                    mbExportNotesPages;
     sal_Bool                    mbUseTransitionEffects;
     sal_Bool                    mbIsSkipEmptyPages;
@@ -210,6 +211,7 @@
     CheckBox                    maCbExportBookmarks;
     CheckBox                    maCbExportHiddenSlides;
     CheckBox                    maCbExportNotes;
+    CheckBox                    maCbVIEWPDF;
     CheckBox                    maCbExportNotesPages;
 
     CheckBox                    maCbExportEmptyPages;
diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src
index 8d74616..1d6e202 100644
--- a/filter/source/pdf/impdialog.src
+++ b/filter/source/pdf/impdialog.src
@@ -278,6 +278,13 @@
         TabStop = TRUE ;
         Text[ en-US ] = "~Export comments";
     };
+    CheckBox CB_VIEWPDF
+    {
+        Pos = MAP_APPFONT ( 188 , 131 ) ;
+        Size = MAP_APPFONT ( 158 , 10 ) ;
+        TabStop = TRUE ;
+        Text[ en-US ] = "~View Pdf after Export";
+    };
     CheckBox CB_EXPORTNOTESPAGES
     {
         HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTNOTESPAGES";
diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index 9aadfed..8c660b9 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -24,7 +24,11 @@
 #include <vcl/window.hxx>
 #include <svl/outstrm.hxx>
 #include <vcl/FilterConfigItem.hxx>
+#include <com/sun/star/system/SystemShellExecute.hpp>
+#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
 
+using namespace css::system;
+int pdfview;
 // -------------
 // - PDFFilter -
 // -------------
@@ -51,6 +55,7 @@
     sal_Bool                    bRet = sal_False;
     Reference< task::XStatusIndicator > xStatusIndicator;
     Reference< task::XInteractionHandler > xIH;
+    OUString aUrl; 
 
     for ( sal_Int32 i = 0 ; ( i < nLength ) && !xOStm.is(); ++i)
     {
@@ -62,6 +67,8 @@
             pValue[ i ].Value >>= xStatusIndicator;
         else if ( pValue[i].Name == "InteractionHandler" )
             pValue[i].Value >>= xIH;
+        else if ( pValue[ i ].Name == "URL" )
+            pValue[ i ].Value >>= aUrl;
     }
 
     /* we don't get FilterData if we are exporting directly
@@ -133,6 +140,9 @@
         }
     }
 
+if(pdfview==1) {
+    Reference<XSystemShellExecute> xSystemShellExecute(SystemShellExecute::create( ::comphelper::getProcessComponentContext() ) ); //Open the newly exported pdf
+    xSystemShellExecute->execute(aUrl, "", SystemShellExecuteFlags::URIS_ONLY ); }
     return bRet;
 }
 

-- 
To view, visit https://gerrit.libreoffice.org/3693
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc4bf200c67d090d61e6024519b9057f9f8bfd6f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Anurag Kanungo <anuragkanungo at gmail.com>



More information about the LibreOffice mailing list