diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2022-07-27 14:02:48 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2022-07-28 14:49:19 +0200 |
commit | a71a5cdb972174cb7c33e67927cd519152fd3cf6 (patch) | |
tree | 2e6630ac29b4d75469fdf4cb64e7475ff47dc747 /include/sfx2 | |
parent | 2b0626e2e9d112280e9d9a296cc7d7ba3022bdc9 (diff) |
lok: add dumpState feature for better in-field diagnostics.
Always suspicious that some un-expected dialog / state can cause
strange behavior in a client. An initial cut at an API to make it
easier to unwind such problems by exposing the toolkit state.
Change-Id: If8f17943fa4837df4f9ca659a111dcdce5c23244
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137504
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'include/sfx2')
-rw-r--r-- | include/sfx2/lokcallback.hxx | 5 | ||||
-rw-r--r-- | include/sfx2/lokhelper.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/viewsh.hxx | 3 |
3 files changed, 12 insertions, 0 deletions
diff --git a/include/sfx2/lokcallback.hxx b/include/sfx2/lokcallback.hxx index 32b6c08f865b..a92f60572145 100644 --- a/include/sfx2/lokcallback.hxx +++ b/include/sfx2/lokcallback.hxx @@ -11,6 +11,10 @@ #include <sal/types.h> +namespace rtl +{ +class OStringBuffer; +} namespace tools { class Rectangle; @@ -46,6 +50,7 @@ public: virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int nViewId, int nSourceViewId) = 0; + virtual void dumpState(rtl::OStringBuffer& rState) = 0; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index 4ac50a19cc69..0b18c0fa7b5e 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -17,6 +17,7 @@ #include <sfx2/viewsh.hxx> #include <tools/gen.hxx> #include <cstddef> +#include <rtl/strbuf.hxx> #include <rtl/string.hxx> #include <optional> #include <string_view> @@ -147,6 +148,9 @@ public: /// This value is chosen such that sal_Int32 will not overflow when manipulated. static const tools::Long MaxTwips = 1e9; + /// Helper for diagnosing run-time problems + static void dumpState(rtl::OStringBuffer &rState); + private: static int createView(SfxViewFrame* pViewFrame, ViewShellDocId docId); }; diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index ea7d966c8cc7..3faf7aeb2071 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -55,6 +55,7 @@ class SfxPrinter; class NotifyEvent; class SfxInPlaceClient; class SfxLokCallbackInterface; +namespace rtl { class OStringBuffer; } namespace vcl { class PrinterController; } namespace com::sun::star::awt{ class XPopupMenu; } @@ -341,6 +342,8 @@ public: /// Set up a more efficient internal callback instead of LibreOfficeKitCallback. void setLibreOfficeKitViewCallback(SfxLokCallbackInterface* pCallback); + /// dump view state for diagnostics + void dumpLibreOfficeKitViewState(rtl::OStringBuffer &rState); /// Invokes the registered callback, if there are any. virtual void libreOfficeKitViewCallback(int nType, const char* pPayload) const override; virtual void libreOfficeKitViewCallbackWithViewId(int nType, const char* pPayload, int nViewId) const override; |