sfx2/source/doc/objserv.cxx |   25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 61abda685e2bc1ec4b108614799b8bc1c01183ec
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Thu Nov 19 11:33:12 2020 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Thu Nov 19 20:55:28 2020 +0100

    lok: don't log warnings
    
    Change-Id: If0ecee7d01eb0efc8b1096a9097c7d0d7ef0fd27
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106129
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 3ebb1feb5f70..b7e8abdc823e 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -458,20 +458,23 @@ uno::Reference<security::XCertificate> 
SfxObjectShell::GetSignPDFCertificate() c
 
 static void sendErrorToLOK(ErrCode error)
 {
-    boost::property_tree::ptree aTree;
-    aTree.put("code", error);
-    aTree.put("kind", "");
-    aTree.put("cmd", "");
+    if (error.GetClass() != ErrCodeClass::NONE)
+    {
+        boost::property_tree::ptree aTree;
+        aTree.put("code", error);
+        aTree.put("kind", "");
+        aTree.put("cmd", "");
 
-    std::unique_ptr<ErrorInfo> pInfo = ErrorInfo::GetErrorInfo(error);
-    OUString aErr;
-    if (ErrorStringFactory::CreateString(pInfo.get(), aErr))
-        aTree.put("message", aErr.toUtf8());
+        std::unique_ptr<ErrorInfo> pInfo = ErrorInfo::GetErrorInfo(error);
+        OUString aErr;
+        if (ErrorStringFactory::CreateString(pInfo.get(), aErr))
+            aTree.put("message", aErr.toUtf8());
 
-    std::stringstream aStream;
-    boost::property_tree::write_json(aStream, aTree);
+        std::stringstream aStream;
+        boost::property_tree::write_json(aStream, aTree);
 
-    SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, 
aStream.str().c_str());
+        
SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, 
aStream.str().c_str());
+    }
 }
 
 void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to