[Libreoffice-commits] core.git: sc/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 20 23:24:47 UTC 2020


 sc/source/ui/docshell/docsh.cxx |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 6a308d2bfaf1d756aa4cfca6a40b80cf5e88e5fa
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Mon Jan 20 21:37:18 2020 +0100
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Tue Jan 21 00:24:14 2020 +0100

    Propagate warning error code from dBASE export, tdf#130020
    
    Long time existing code cleared all warnings set by the actual
    export routine. I could not figure out why this ever was done. It
    started short after the initial OOo import with
    
        commit 0ec1e9cbdfb4be18ea18b6b9be567d23bff5963f
        CommitDate: Fri Oct 27 18:00:10 2000 +0000
    
            dBase export: don't set warning errorcodes
    
    that did not set warnings at the medium anymore without giving a
    rationale.
    
    Change-Id: I0f26d0644890c53557076ac7b99ffe7c8756a047
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87109
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index d932944cff6e..aee27cb1b13f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2447,15 +2447,10 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
         ErrCode eError = DBaseExport(
             rMed.GetPhysicalName(), ScGlobal::GetCharsetValue(sCharSet), bHasMemo);
 
-        if ( eError != ERRCODE_NONE && eError.IsWarning() )
-        {
-            eError = ERRCODE_NONE;
-        }
-
         INetURLObject aTmpFile( rMed.GetPhysicalName(), INetProtocol::File );
         if ( bHasMemo )
             aTmpFile.setExtension("dbt");
-        if ( eError != ERRCODE_NONE )
+        if ( eError != ERRCODE_NONE && !eError.IsWarning() )
         {
             if (!GetError())
                 SetError(eError);
@@ -2473,8 +2468,13 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
 
                 // tdf#40713: don't lose dbt file
                 // if aDbtFile corresponds exactly to aTmpFile, we just have to return
-                if (aDbtFile.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous ) == aTmpFile.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous ))
+                if (aDbtFile.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous ) ==
+                    aTmpFile.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous ))
+                {
+                    if (eError != ERRCODE_NONE && !GetError())
+                        SetError(eError);
                     return bRet;
+                }
 
                 if ( IsDocument( aDbtFile ) && !KillFile( aDbtFile ) )
                     bRet = false;
@@ -2483,10 +2483,12 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
                 if ( !bRet )
                 {
                     KillFile( aTmpFile );
-                    if ( !GetError() )
-                        SetError(SCERR_EXPORT_DATA);
+                    if (eError == ERRCODE_NONE || eError.IsWarning())
+                        eError = SCERR_EXPORT_DATA;
                 }
             }
+            if (eError != ERRCODE_NONE && !GetError())
+                SetError(eError);
         }
     }
     else if (aFltName == pFilterDif)


More information about the Libreoffice-commits mailing list