diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-15 16:30:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-15 15:50:36 +0000 |
commit | 50787b48a8378a555a71cc2c6b0966debb2e5104 (patch) | |
tree | b915237b20b4d48b819769cd3538a2d2ac1e5d32 /sc | |
parent | 1792493e765f8027c2605bd72b9978c6769a262d (diff) |
sc, sd: add per-view support to recently added LOK_CALLBACK_SET_PART calls
These caushed an assertion failure when opening a Calc or Impress
document in gtktiledviewer.
Change-Id: If9cf1ef6c5a9d8e1b0d578b20dd3f513989b669b
Reviewed-on: https://gerrit.libreoffice.org/26311
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/tabcont.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index f61e32a80228..dbc4af745689 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -35,6 +35,7 @@ #include "markdata.hxx" #include <gridwin.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> ScTabControl::ScTabControl( vcl::Window* pParent, ScViewData* pData ) : TabBar(pParent, WB_3DLOOK | WB_MINSCROLL | WB_SCROLL | WB_RANGESELECT | WB_MULTISELECT | WB_DRAG) @@ -414,9 +415,15 @@ void ScTabControl::SwitchToPageId(sal_uInt16 nId) SelectPage( i, i==nId ); Select(); - // notify LibreOfficeKit about changed page - OString aPayload = OString::number(nId - 1); - pViewData->GetDocument()->GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr()); + if (comphelper::LibreOfficeKit::isActive()) + { + // notify LibreOfficeKit about changed page + OString aPayload = OString::number(nId - 1); + if (comphelper::LibreOfficeKit::isViewCallback()) + pViewData->GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr()); + else + pViewData->GetDocument()->GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr()); + } } } } |