diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-06-08 17:50:37 +0100 |
---|---|---|
committer | Aron Budea <aron.budea@collabora.com> | 2019-11-18 17:55:06 +0100 |
commit | dec31de5062ca3ddd3661ab25708c885c9544a80 (patch) | |
tree | 34cd97d3daac013cbed01048dbf8b18897d7f794 | |
parent | 7dba640b5691c22d6529e53752255fddc2b461e6 (diff) |
Resolves: tdf#120343 show pdf in async pdf export dialog callback
not after dialog async exec begins, but defer to during that response
callback
Change-Id: I316022c01a87cf251d57b1007ae93fefddada776
Reviewed-on: https://gerrit.libreoffice.org/73717
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
(cherry picked from commit d3655c22aa393dd70459f42bee547c39306e4bf0)
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 956a03f30002..289869eab01a 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1305,6 +1305,21 @@ uno::Reference< css::frame::XModuleManager2 > const & SfxStoringHelper::GetModul return m_xModuleManager; } +namespace +{ + void LaunchPDFViewer(const INetURLObject& rURL) + { + // Launch PDF viewer + FilterConfigItem aItem( "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, const OUString& aSlotName, @@ -1653,6 +1668,11 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo { SfxStoringHelper::SetDocInfoState(aModel.GetModel(), xOldDocProps, true); } + + // Launch PDF viewer + if (nStoreMode & PDFEXPORT_REQUESTED) + LaunchPDFViewer(aURL); + }; // use dispatch API to show document info dialog @@ -1674,19 +1694,10 @@ 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 ) - { - FilterConfigItem aItem( "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 ); - } + // Launch PDF viewer + if (nStoreMode & PDFEXPORT_REQUESTED) + LaunchPDFViewer(aURL); } return bDialogUsed; |