[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sfx2/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jun 9 13:48:13 UTC 2019
sfx2/source/doc/guisaveas.cxx | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
New commits:
commit d3655c22aa393dd70459f42bee547c39306e4bf0
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Jun 8 17:50:37 2019 +0100
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Sun Jun 9 15:47:28 2019 +0200
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 at ubuntu.com>
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index fa2a1149e7ad..15928451f2b1 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1284,6 +1284,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,
@@ -1634,6 +1649,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
@@ -1655,19 +1675,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;
More information about the Libreoffice-commits
mailing list