<div dir="ltr">It would require make dev-install to work .<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 3, 2013 at 10:55 PM, Anurag Kanungo (via Code Review) <span dir="ltr"><<a href="mailto:gerrit@gerrit.libreoffice.org" target="_blank">gerrit@gerrit.libreoffice.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have submitted a patch for review:<br>
<br>
    <a href="https://gerrit.libreoffice.org/3763" target="_blank">https://gerrit.libreoffice.org/3763</a><br>
<br>
To pull it, you can do:<br>
<br>
    git pull ssh://<a href="http://gerrit.libreoffice.org:29418/core" target="_blank">gerrit.libreoffice.org:29418/core</a> refs/changes/63/3763/1<br>
<br>
fdo#37222 and fdo#37219  Open pdf after Export and added to recent documents.<br>
<br>
Added an checkbox option "View PDF after Export"  in Export as Pdf  Dialog Box .<br>
<br>
If a user ticks the checkbox , pdf file will be opened after export<br>
else only export will be done .<br>
<br>
Goto File > Export as PDF >> Tick the checkbox "View PDF after Export "<br>
<br>
to observe changes .<br>
<br>
Change-Id: I6717c08348d2df72b6ad79c163216e5bf01b196c<br>
---<br>
M filter/source/pdf/impdialog.cxx<br>
M filter/source/pdf/impdialog.hrc<br>
M filter/source/pdf/impdialog.hxx<br>
M filter/source/pdf/impdialog.src<br>
M filter/source/pdf/pdfexport.cxx<br>
M filter/source/pdf/pdfexport.hxx<br>
M filter/source/pdf/pdffilter.cxx<br>
M officecfg/registry/data/org/openoffice/Office/WebWizard.xcu<br>
M officecfg/registry/schema/org/openoffice/Office/Common.xcs<br>
M vcl/inc/vcl/pdfextoutdevdata.hxx<br>
M vcl/source/gdi/pdfextoutdevdata.cxx<br>
11 files changed, 60 insertions(+), 0 deletions(-)<br>
<br>
<br>
<br>
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx<br>
index 9ddf052..d265328 100644<br>
--- a/filter/source/pdf/impdialog.cxx<br>
+++ b/filter/source/pdf/impdialog.cxx<br>
@@ -80,6 +80,7 @@<br>
     mnMaxImageResolution( 300 ),<br>
     mbUseTaggedPDF( sal_False ),<br>
     mbExportNotes( sal_True ),<br>
+    mbViewPDF( sal_False ),<br>
     mbExportNotesPages( sal_False ),<br>
     mbUseTransitionEffects( sal_False ),<br>
     mbIsSkipEmptyPages( sal_True ),<br>
@@ -192,6 +193,7 @@<br>
     if ( mbIsPresentation )<br>
         mbExportNotesPages = maConfigItem.ReadBool( "ExportNotesPages", sal_False );<br>
     mbExportNotes = maConfigItem.ReadBool( "ExportNotes", sal_False );<br>
+    mbViewPDF = maConfigItem.ReadBool( "ViewPDFAfterExport", sal_False );<br>
<br>
     mbExportBookmarks = maConfigItem.ReadBool( "ExportBookmarks", sal_True );<br>
     if ( mbIsPresentation )<br>
@@ -360,6 +362,7 @@<br>
     if ( mbIsPresentation )<br>
         maConfigItem.WriteBool( "ExportNotesPages", mbExportNotesPages );<br>
     maConfigItem.WriteBool( "ExportNotes", mbExportNotes );<br>
+    maConfigItem.WriteBool( "ViewPDFAfterExport", mbViewPDF );<br>
<br>
     maConfigItem.WriteBool( "ExportBookmarks", mbExportBookmarks );<br>
     if ( mbIsPresentation )<br>
@@ -511,6 +514,7 @@<br>
     maCbExportBookmarks( this, PDFFilterResId( CB_EXPORTBOOKMARKS ) ),<br>
     maCbExportHiddenSlides( this, PDFFilterResId( CB_EXPORTHIDDENSLIDES ) ),<br>
     maCbExportNotes( this, PDFFilterResId( CB_EXPORTNOTES ) ),<br>
+    maCbViewPDF( this, PDFFilterResId( CB_VIEWPDF ) ),<br>
     maCbExportNotesPages( this, PDFFilterResId( CB_EXPORTNOTESPAGES ) ),<br>
     maCbExportEmptyPages( this, PDFFilterResId( CB_EXPORTEMPTYPAGES ) ),<br>
     maCbAddStream( this, PDFFilterResId( CB_ADDSTREAM ) ),<br>
@@ -624,6 +628,7 @@<br>
     maCbExportBookmarks.Check( paParent->mbExportBookmarks );<br>
<br>
     maCbExportNotes.Check( paParent->mbExportNotes );<br>
+    maCbViewPDF.Check( paParent->mbViewPDF);<br>
<br>
     if ( mbIsPresentation )<br>
     {<br>
@@ -668,6 +673,7 @@<br>
     paParent->mbReduceImageResolution = maCbReduceImageResolution.IsChecked();<br>
     paParent->mnMaxImageResolution = maCoReduceImageResolution.GetText().toInt32();<br>
     paParent->mbExportNotes = maCbExportNotes.IsChecked();<br>
+    paParent->mbViewPDF = maCbViewPDF.IsChecked();<br>
     if ( mbIsPresentation )<br>
         paParent->mbExportNotesPages = maCbExportNotesPages.IsChecked();<br>
     paParent->mbExportBookmarks = maCbExportBookmarks.IsChecked();<br>
@@ -702,6 +708,7 @@<br>
         paParent->mbExportFormFields = maCbExportFormFields.IsChecked();<br>
         paParent->mbEmbedStandardFonts = maCbEmbedStandardFonts.IsChecked();<br>
     }<br>
+<br>
     paParent->maWatermarkText = maEdWatermark.GetText();<br>
<br>
     /*<br>
diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc<br>
index 03b6d55..938b622 100644<br>
--- a/filter/source/pdf/impdialog.hrc<br>
+++ b/filter/source/pdf/impdialog.hrc<br>
@@ -87,6 +87,7 @@<br>
 #define CB_WATERMARK                32<br>
 #define FT_WATERMARK                33<br>
 #define ED_WATERMARK                34<br>
+#define CB_VIEWPDF                  35<br>
<br>
<br>
 //controls for open options tab page<br>
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx<br>
index 11a3f38..4049d53 100644<br>
--- a/filter/source/pdf/impdialog.hxx<br>
+++ b/filter/source/pdf/impdialog.hxx<br>
@@ -94,6 +94,7 @@<br>
     sal_Bool                    mbUseTaggedPDF;<br>
     sal_Int32                   mnPDFTypeSelection;<br>
     sal_Bool                    mbExportNotes;<br>
+    sal_Bool                    mbViewPDF;<br>
     sal_Bool                    mbExportNotesPages;<br>
     sal_Bool                    mbUseTransitionEffects;<br>
     sal_Bool                    mbIsSkipEmptyPages;<br>
@@ -210,6 +211,7 @@<br>
     CheckBox                    maCbExportBookmarks;<br>
     CheckBox                    maCbExportHiddenSlides;<br>
     CheckBox                    maCbExportNotes;<br>
+    CheckBox                    maCbViewPDF;<br>
     CheckBox                    maCbExportNotesPages;<br>
<br>
     CheckBox                    maCbExportEmptyPages;<br>
diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src<br>
index 8d74616..9efab3a 100644<br>
--- a/filter/source/pdf/impdialog.src<br>
+++ b/filter/source/pdf/impdialog.src<br>
@@ -278,6 +278,13 @@<br>
         TabStop = TRUE ;<br>
         Text[ en-US ] = "~Export comments";<br>
     };<br>
+    CheckBox CB_VIEWPDF<br>
+    {<br>
+        Pos = MAP_APPFONT ( 188 , 131 ) ;<br>
+        Size = MAP_APPFONT ( 158 , 10 ) ;<br>
+        TabStop = TRUE ;<br>
+        Text[ en-US ] = "~View PDF after Export";<br>
+    };<br>
     CheckBox CB_EXPORTNOTESPAGES<br>
     {<br>
         HelpID = "filter:CheckBox:RID_PDF_TAB_GENER:CB_EXPORTNOTESPAGES";<br>
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx<br>
index c6e2648..81beadc 100644<br>
--- a/filter/source/pdf/pdfexport.cxx<br>
+++ b/filter/source/pdf/pdfexport.cxx<br>
@@ -98,6 +98,7 @@<br>
     mbUseTaggedPDF              ( sal_False ),<br>
     mnPDFTypeSelection          ( 0 ),<br>
     mbExportNotes               ( sal_True ),<br>
+    mbViewPDF                   ( sal_True ),<br>
     mbExportNotesPages          ( sal_False ),<br>
     mbEmbedStandardFonts        ( sal_False ),//in preparation for i54636 and i76458.<br>
                                               //already used for i59651 (PDF/A-1)<br>
@@ -457,6 +458,8 @@<br>
                     rFilterData[ nData ].Value >>= mnPDFTypeSelection;<br>
                 else if ( rFilterData[ nData ].Name == "ExportNotes" )<br>
                     rFilterData[ nData ].Value >>= mbExportNotes;<br>
+                else if ( rFilterData[ nData ].Name == "ViewPDFAfterExport" )<br>
+                    rFilterData[ nData ].Value >>= mbViewPDF;<br>
                 else if ( rFilterData[ nData ].Name == "ExportNotesPages" )<br>
                     rFilterData[ nData ].Value >>= mbExportNotesPages;<br>
                 else if ( rFilterData[ nData ].Name == "EmbedStandardFonts" )<br>
@@ -811,6 +814,7 @@<br>
                 pPDFExtOutDevData = new vcl::PDFExtOutDevData( *pOut );<br>
                 pOut->SetExtOutDevData( pPDFExtOutDevData );<br>
                 pPDFExtOutDevData->SetIsExportNotes( mbExportNotes );<br>
+                pPDFExtOutDevData->SetIsViewPDF( mbViewPDF );<br>
                 pPDFExtOutDevData->SetIsExportTaggedPDF( mbUseTaggedPDF );<br>
                 pPDFExtOutDevData->SetIsExportTransitionEffects( mbUseTransitionEffects );<br>
                 pPDFExtOutDevData->SetFormsFormat( mnFormsFormat );<br>
diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx<br>
index a69de13..0398e2f 100644<br>
--- a/filter/source/pdf/pdfexport.hxx<br>
+++ b/filter/source/pdf/pdfexport.hxx<br>
@@ -47,6 +47,7 @@<br>
     sal_Bool                mbUseTaggedPDF;<br>
     sal_Int32               mnPDFTypeSelection;<br>
     sal_Bool                mbExportNotes;<br>
+    sal_Bool                mbViewPDF;<br>
     sal_Bool                mbExportNotesPages;<br>
     sal_Bool                mbEmbedStandardFonts;<br>
     sal_Bool                mbUseTransitionEffects;<br>
diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx<br>
index 9aadfed..ae70673 100644<br>
--- a/filter/source/pdf/pdffilter.cxx<br>
+++ b/filter/source/pdf/pdffilter.cxx<br>
@@ -18,13 +18,17 @@<br>
  */<br>
<br>
<br>
+<br>
 #include "pdffilter.hxx"<br>
 #include "pdfexport.hxx"<br>
 #include <vcl/svapp.hxx><br>
 #include <vcl/window.hxx><br>
 #include <svl/outstrm.hxx><br>
 #include <vcl/FilterConfigItem.hxx><br>
+#include <com/sun/star/system/SystemShellExecute.hpp><br>
+#include <com/sun/star/system/SystemShellExecuteFlags.hpp><br>
<br>
+using namespace css::system;<br>
 // -------------<br>
 // - PDFFilter -<br>
 // -------------<br>
@@ -51,6 +55,10 @@<br>
     sal_Bool                    bRet = sal_False;<br>
     Reference< task::XStatusIndicator > xStatusIndicator;<br>
     Reference< task::XInteractionHandler > xIH;<br>
+    OUString aUrl;<br>
+<br>
+    FilterConfigItem aItem( "Office.Common/Filter/PDF/Export/" );<br>
+    sal_Bool aViewPDF = aItem.ReadBool(  "ViewPDFAfterExport", sal_False );<br>
<br>
     for ( sal_Int32 i = 0 ; ( i < nLength ) && !xOStm.is(); ++i)<br>
     {<br>
@@ -62,6 +70,8 @@<br>
             pValue[ i ].Value >>= xStatusIndicator;<br>
         else if ( pValue[i].Name == "InteractionHandler" )<br>
             pValue[i].Value >>= xIH;<br>
+        else if ( pValue[ i ].Name == "URL" )<br>
+            pValue[ i ].Value >>= aUrl;<br>
     }<br>
<br>
     /* we don't get FilterData if we are exporting directly<br>
@@ -133,6 +143,10 @@<br>
         }<br>
     }<br>
<br>
+    if(aViewPDF==sal_True) {<br>
+    Reference<XSystemShellExecute> xSystemShellExecute(SystemShellExecute::create( ::comphelper::getProcessComponentContext() ) ); //Open the newly exported pdf<br>
+    xSystemShellExecute->execute(aUrl, "", SystemShellExecuteFlags::URIS_ONLY ); }<br>
+<br>
     return bRet;<br>
 }<br>
<br>
diff --git a/officecfg/registry/data/org/openoffice/Office/WebWizard.xcu b/officecfg/registry/data/org/openoffice/Office/WebWizard.xcu<br>
index c46ae46..bcdf2b2 100644<br>
--- a/officecfg/registry/data/org/openoffice/Office/WebWizard.xcu<br>
+++ b/officecfg/registry/data/org/openoffice/Office/WebWizard.xcu<br>
@@ -207,6 +207,11 @@<br>
                             <value>false</value><br>
                         </prop><br>
                     </node><br>
+                   <node oor:name="IsViewPDF" oor:op="replace"><br>
+                        <prop oor:name="Value"><br>
+                            <value>false</value><br>
+                        </prop><br>
+                    </node><br>
                     <node oor:name="Format" oor:op="replace"><br>
                         <prop oor:name="Value"><br>
                             <value>%1</value><br>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs<br>
index 4455509..0106dbb 100644<br>
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs<br>
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs<br>
@@ -5278,6 +5278,13 @@<br>
             </info><br>
             <value>false</value><br>
           </prop><br>
+         <prop<br>
+              oor:name="ViewPDFAfterExport" oor:type="xs:boolean" oor:nillable="false"><br>
+            <info><br>
+              <desc>Specifies if PDF automatically opens after export.</desc><br>
+            </info><br>
+            <value>false</value><br>
+          </prop><br>
           <prop<br>
               oor:name="ExportBookmarks" oor:type="xs:boolean"<br>
               oor:nillable="false"><br>
diff --git a/vcl/inc/vcl/pdfextoutdevdata.hxx b/vcl/inc/vcl/pdfextoutdevdata.hxx<br>
index 59a1189..b5fec70 100644<br>
--- a/vcl/inc/vcl/pdfextoutdevdata.hxx<br>
+++ b/vcl/inc/vcl/pdfextoutdevdata.hxx<br>
@@ -77,6 +77,7 @@<br>
<br>
     sal_Bool                        mbTaggedPDF;<br>
     sal_Bool                        mbExportNotes;<br>
+    sal_Bool                        mbViewPDF;<br>
     sal_Bool                        mbExportNotesPages;<br>
     sal_Bool                        mbTransitionEffects;<br>
     sal_Bool                        mbUseLosslessCompression;<br>
@@ -108,7 +109,9 @@<br>
<br>
<br>
     sal_Bool    GetIsExportNotes() const;<br>
+    sal_Bool    GetIsViewPDF() const;<br>
     void        SetIsExportNotes( const sal_Bool bExportNotes );<br>
+    void        SetIsViewPDF( const sal_Bool bViewPDF );<br>
<br>
     sal_Bool    GetIsExportNotesPages() const;<br>
     void        SetIsExportNotesPages( const sal_Bool bExportNotesPages );<br>
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx<br>
index 9895867..e619f8e 100644<br>
--- a/vcl/source/gdi/pdfextoutdevdata.cxx<br>
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx<br>
@@ -496,6 +496,7 @@<br>
     mrOutDev                ( rOutDev ),<br>
     mbTaggedPDF             ( sal_False ),<br>
     mbExportNotes           ( sal_True ),<br>
+    mbViewPDF               ( sal_True ),<br>
     mbExportNotesPages      ( sal_False ),<br>
     mbTransitionEffects     ( sal_True ),<br>
     mbUseLosslessCompression( sal_True ),<br>
@@ -552,10 +553,18 @@<br>
 {<br>
     return mbExportNotes;<br>
 }<br>
+sal_Bool PDFExtOutDevData::GetIsViewPDF() const<br>
+{<br>
+    return mbViewPDF;<br>
+}<br>
 void PDFExtOutDevData::SetIsExportNotes( const sal_Bool bExportNotes )<br>
 {<br>
     mbExportNotes = bExportNotes;<br>
 }<br>
+void PDFExtOutDevData::SetIsViewPDF( const sal_Bool bViewPDF )<br>
+{<br>
+    mbViewPDF = bViewPDF;<br>
+}<br>
 sal_Bool PDFExtOutDevData::GetIsExportNotesPages() const<br>
 {<br>
     return mbExportNotesPages;<br>
<br>
--<br>
To view, visit <a href="https://gerrit.libreoffice.org/3763" target="_blank">https://gerrit.libreoffice.org/3763</a><br>
To unsubscribe, visit <a href="https://gerrit.libreoffice.org/settings" target="_blank">https://gerrit.libreoffice.org/settings</a><br>
<br>
Gerrit-MessageType: newchange<br>
Gerrit-Change-Id: I6717c08348d2df72b6ad79c163216e5bf01b196c<br>
Gerrit-PatchSet: 1<br>
Gerrit-Project: core<br>
Gerrit-Branch: master<br>
Gerrit-Owner: Anurag Kanungo <<a href="mailto:anuragkanungo@gmail.com">anuragkanungo@gmail.com</a>><br>
<br>
_______________________________________________<br>
LibreOffice mailing list<br>
<a href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/libreoffice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a><br>
</blockquote></div><br></div>