sfx2/source/doc/guisaveas.cxx | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-)
New commits: commit fffd76195e0701cf774e36963105cd63a2e65a26 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Nov 2 14:23:22 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Nov 2 18:28:49 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> diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 4c50b5e19f27..d5eb3369d735 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1305,22 +1305,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, @@ -1672,11 +1656,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 @@ -1698,10 +1677,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;