include/vcl/errinf.hxx | 6 ++++ sfx2/source/doc/objserv.cxx | 37 ++++++++++++++++++++++--- sfx2/source/notebookbar/PriorityMergedHBox.cxx | 4 ++ vcl/source/window/errinf.cxx | 6 ---- 4 files changed, 44 insertions(+), 9 deletions(-)
New commits: commit 50e588ba7ff5e37ddbcdd97d10bf90613661356d Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Nov 24 14:56:41 2020 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Nov 24 18:20:38 2020 +0100 notebookbar: don't hide elements for online Change-Id: If0c48c6ab674ac282c23beac9cc115b0b404b0a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106504 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sfx2/source/notebookbar/PriorityMergedHBox.cxx b/sfx2/source/notebookbar/PriorityMergedHBox.cxx index d74d40f8a366..a5472f71ad7b 100644 --- a/sfx2/source/notebookbar/PriorityMergedHBox.cxx +++ b/sfx2/source/notebookbar/PriorityMergedHBox.cxx @@ -24,6 +24,7 @@ #include "PriorityHBox.hxx" #include "NotebookbarPopup.hxx" #include <sfx2/viewfrm.hxx> +#include <comphelper/lok.hxx> #define DUMMY_WIDTH 50 #define BUTTON_WIDTH 30 @@ -58,6 +59,9 @@ public: virtual void Resize() override { + if (comphelper::LibreOfficeKit::isActive()) + return VclHBox::Resize(); + if (!m_bInitialized && SfxViewFrame::Current()) Initialize(); commit d5ede20e0a7be77ba0415996395cade8db04f797 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Oct 20 22:05:11 2020 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Nov 24 18:20:18 2020 +0100 lok: Log save errors and avoid infinite loop Don't create synchronous dialogs on errors which were causing infinite loops. Just send error for logging purposes. Change-Id: I88e57ae34502a6f82e44051033c91ca41c1a7b8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104579 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Ashod Nakashian <a...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106418 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/include/vcl/errinf.hxx b/include/vcl/errinf.hxx index 4a0edc75b259..88f4a3bb2390 100644 --- a/include/vcl/errinf.hxx +++ b/include/vcl/errinf.hxx @@ -39,6 +39,12 @@ class DynamicErrorInfo; class ImplDynamicErrorInfo; enum class DialogMask; +class VCL_DLLPUBLIC ErrorStringFactory +{ +public: + static bool CreateString(const ErrorInfo*, OUString&); +}; + typedef void (* DisplayFnPtr)(); typedef DialogMask WindowDisplayErrorFunc( diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 404b7422017c..ef9925549149 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -61,6 +61,8 @@ #include <vcl/weld.hxx> #include <comphelper/documentconstants.hxx> #include <comphelper/storagehelper.hxx> +#include <comphelper/lok.hxx> +#include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <tools/link.hxx> #include <asyncfunc.hxx> @@ -107,6 +109,8 @@ #include <autoredactdialog.hxx> +#include <boost/property_tree/json_parser.hpp> + using namespace ::com::sun::star; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; @@ -438,6 +442,24 @@ uno::Reference<security::XCertificate> SfxObjectShell::GetSignPDFCertificate() c return uno::Reference<security::XCertificate>(it->second, uno::UNO_QUERY); } +static void sendErrorToLOK(ErrCode error) +{ + 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::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) { weld::Window* pDialogParent = rReq.GetFrameWeld(); @@ -983,8 +1005,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) // may be nErrorCode should be shown in future if ( lErr != ERRCODE_IO_ABORT ) { - SfxErrorContext aEc(ERRCTX_SFX_SAVEASDOC,GetTitle()); - ErrorHandler::HandleError(lErr, pDialogParent); + if (comphelper::LibreOfficeKit::isActive()) + sendErrorToLOK(lErr); + else + { + SfxErrorContext aEc(ERRCTX_SFX_SAVEASDOC,GetTitle()); + ErrorHandler::HandleError(lErr, pDialogParent); + } } if (nId == SID_DIRECTEXPORTDOCASPDF && @@ -1150,7 +1177,11 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) SetModified( false ); ErrCode lErr = GetErrorCode(); - ErrorHandler::HandleError(lErr, pDialogParent); + + if (comphelper::LibreOfficeKit::isActive()) + sendErrorToLOK(lErr); + else + ErrorHandler::HandleError(lErr, pDialogParent); rReq.SetReturnValue( SfxBoolItem(0, true) ); rReq.Done(); diff --git a/vcl/source/window/errinf.cxx b/vcl/source/window/errinf.cxx index 8e08dc361acd..d9c4310f0a06 100644 --- a/vcl/source/window/errinf.cxx +++ b/vcl/source/window/errinf.cxx @@ -35,12 +35,6 @@ class TheErrorRegistry: public rtl::Static<ErrorRegistry, TheErrorRegistry> {}; } -class ErrorStringFactory -{ -public: - static bool CreateString(const ErrorInfo*, OUString&); -}; - bool ErrorStringFactory::CreateString(const ErrorInfo* pInfo, OUString& rStr) { for(const ErrorHandler *pHdlr : TheErrorRegistry::get().errorHandlers) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits