MM: detect save error based on the return value

There is actually GetError() and GetErrorCode(). While the error
code can also be a warning, which isn't reported by GetError(),
this detects the error based on the DoSaveAs return value (actually
I got warnings in case of save failures in my MM unit tests).

Change-Id: I3db749c798ad80336ee7ada9eaa71177e8ffb248
Reviewed-on: https://gerrit.libreoffice.org/11456
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index cf6683d..d89ffaf 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -815,8 +815,7 @@ static void lcl_SaveDoc( SfxObjectShell *xTargetDocShell,
    SfxMedium* pDstMed = new SfxMedium(
        aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ),
        STREAM_STD_READWRITE );
    xTargetDocShell->DoSaveAs( *pDstMed );
    if( xTargetDocShell->GetError() )
    if( !xTargetDocShell->DoSaveAs( *pDstMed ) )
        SAL_WARN( "sw.mailmerge", "Error saving: " << aTempFile->GetURL() );
    else
        SAL_INFO( "sw.mailmerge", "Saved doc as: " << aTempFile->GetURL() );