sfx2/source/doc/docfile.cxx |    2 +-
 sfx2/source/doc/objserv.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 25a997c15d39fb30676a375df8ea4ce1ed2e1acd
Author:     Matt K <matt...@gmail.com>
AuthorDate: Mon Aug 15 21:22:37 2022 -0500
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Mon Aug 29 13:28:40 2022 +0200

    tdf#53530 Only show 1 error dialog instead of 3 on export to PDF
    
    SfxObjectShell::ExecFile_Impl is called when exporting to PDF, and
    the 3rd error message pops up here, so we just add a check to see
    if we're about to show the general IO error during pdf export and
    skip showing the error message there.
    
    The first 2 error messages pop up from
    SfxMedium::TransactedTransferForFS_Impl, and so we just add a check
    to see if the first error message popped up in which case an abort
    error code is returned and we then skip popping up the 2nd error.
    
    Change-Id: Ifa85ca1e451b1f87c6ddd89a98d377ea04aeaa0f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138333
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 645cbc81f3d2..29bb07b03e6e 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2144,7 +2144,7 @@ void SfxMedium::TransactedTransferForFS_Impl( const 
INetURLObject& aSource,
                 pImpl->pTempFile.reset();
             }
         }
-        else if ( bTransactStarted )
+        else if ( bTransactStarted && pImpl->m_eError != ERRCODE_ABORT )
         {
             UseBackupToRestore_Impl( aOriginalContent, xDummyEnv );
         }
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 37f131d08098..4434e3ca855b 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1020,7 +1020,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
             {
                 if (comphelper::LibreOfficeKit::isActive())
                     sendErrorToLOK(lErr);
-                else
+                else if (!(lErr == ERRCODE_IO_GENERAL && bIsPDFExport))
                 {
                     SfxErrorContext aEc(ERRCTX_SFX_SAVEASDOC,GetTitle());
                     ErrorHandler::HandleError(lErr, pDialogParent);

Reply via email to