summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-06-08 17:50:37 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-06-08 20:00:11 +0200
commit9df8a2eb8c216b16927aac2182b881b21d8b2d14 (patch)
tree0196a2a715bbfa8d578fb41d97a66dc8fd80c688 /sfx2
parent45e37616b811366f4773ab384911a88121f47726 (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/73715 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/guisaveas.cxx35
1 files changed, 23 insertions, 12 deletions
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 72f85f225ddb..614c35e3459f 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1286,6 +1286,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,
@@ -1636,6 +1651,11 @@ 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
@@ -1657,19 +1677,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;