sfx2/source/doc/guisaveas.cxx |   36 ++++++++++++------------------------
 1 file changed, 12 insertions(+), 24 deletions(-)

New commits:
commit 3350ab7f2d5859ea242a5a63f66da5cdfcd0e6f3
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Nov 2 14:23:22 2021 +0000
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Nov 3 14:34:09 2021 +0100

    Revert "tdf#120343 show pdf in async pdf export dialog callback"
    
    This reverts commit 9df8a2eb8c216b16927aac2182b881b21d8b2d14 to try
    an alternative approach.
    
    Change-Id: I2f1e2cd28cbaee5ab3d7a3cec808ec5bb7777cb2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124604
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124616
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index e2a2209e7b38..65e346cba6e8 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1289,22 +1289,6 @@ uno::Reference< css::frame::XModuleManager2 > const & 
SfxStoringHelper::GetModul
     return m_xModuleManager;
 }
 
-namespace
-{
-    void LaunchPDFViewer(const INetURLObject& rURL)
-    {
-        // Launch PDF viewer
-        FilterConfigItem aItem( u"Office.Common/Filter/PDF/Export/" );
-        bool aViewPDF = aItem.ReadBool( "ViewPDFAfterExport", false );
-
-        if ( aViewPDF )
-        {
-            uno::Reference<XSystemShellExecute> 
xSystemShellExecute(SystemShellExecute::create(::comphelper::getProcessComponentContext()));
-            
xSystemShellExecute->execute(rURL.GetMainURL(INetURLObject::DecodeMechanism::NONE),
 "", SystemShellExecuteFlags::URIS_ONLY);
-        }
-    }
-}
-
 bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& 
xModel,
                                             std::u16string_view aSlotName,
                                             uno::Sequence< 
beans::PropertyValue >& aArgsSequence,
@@ -1657,11 +1641,6 @@ bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference< frame::XModel >& xMo
             {
                 SfxStoringHelper::SetDocInfoState(aModel.GetModel(), 
xOldDocProps);
             }
-
-            // Launch PDF viewer
-            if (nStoreMode & PDFEXPORT_REQUESTED)
-                LaunchPDFViewer(aURL);
-
         };
 
         // use dispatch API to show document info dialog
@@ -1683,10 +1662,19 @@ bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference< frame::XModel >& xMo
             aModelData.GetStorable()->storeToURL( aURL.GetMainURL( 
INetURLObject::DecodeMechanism::NONE ), aArgsSequence );
         else
             aModelData.GetStorable()->storeAsURL( aURL.GetMainURL( 
INetURLObject::DecodeMechanism::NONE ), aArgsSequence );
+    }
 
-        // Launch PDF viewer
-        if (nStoreMode & PDFEXPORT_REQUESTED)
-            LaunchPDFViewer(aURL);
+    // Launch PDF viewer
+    if ( nStoreMode & PDFEXPORT_REQUESTED )
+    {
+        FilterConfigItem aItem(u"Office.Common/Filter/PDF/Export/");
+        bool aViewPDF = aItem.ReadBool( "ViewPDFAfterExport", false );
+
+        if ( aViewPDF )
+        {
+            uno::Reference<XSystemShellExecute> 
xSystemShellExecute(SystemShellExecute::create( 
::comphelper::getProcessComponentContext() ) );
+            xSystemShellExecute->execute( aURL.GetMainURL( 
INetURLObject::DecodeMechanism::NONE ), "", SystemShellExecuteFlags::URIS_ONLY 
);
+        }
     }
 
     return bDialogUsed;

Reply via email to