diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-26 13:35:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-26 18:02:19 +0100 |
commit | b624b13b3d5a8e573c7de8158cadc66b1982d157 (patch) | |
tree | 56948e6a5e8d7f5a7cbde6328a27f13ecd8a72bc /sfx2/source/doc/objserv.cxx | |
parent | 8136620ff432bf17815bef1f88c7531edb839d23 (diff) |
loplugin:flatten
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/doc/objserv.cxx')
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index f5d5cd441831..8eaca3d639f2 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -448,23 +448,23 @@ uno::Reference<security::XCertificate> SfxObjectShell::GetSignPDFCertificate() c static void sendErrorToLOK(ErrCode error) { - if (error.GetClass() != ErrCodeClass::NONE) - { - boost::property_tree::ptree aTree; - aTree.put("code", error); - aTree.put("kind", ""); - aTree.put("cmd", ""); + if (error.GetClass() == ErrCodeClass::NONE) + return; - std::unique_ptr<ErrorInfo> pInfo = ErrorInfo::GetErrorInfo(error); - OUString aErr; - if (ErrorStringFactory::CreateString(pInfo.get(), aErr)) - aTree.put("message", aErr.toUtf8()); + boost::property_tree::ptree aTree; + aTree.put("code", error); + aTree.put("kind", ""); + aTree.put("cmd", ""); - std::stringstream aStream; - boost::property_tree::write_json(aStream, aTree); + std::unique_ptr<ErrorInfo> pInfo = ErrorInfo::GetErrorInfo(error); + OUString aErr; + if (ErrorStringFactory::CreateString(pInfo.get(), aErr)) + aTree.put("message", aErr.toUtf8()); - SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, aStream.str().c_str()); - } + std::stringstream aStream; + boost::property_tree::write_json(aStream, aTree); + + SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, aStream.str().c_str()); } void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) |