From ce90a3cb3dcf35d8b7dbf886b62bb3ebc2c1ebef Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 9 Jun 2016 16:30:27 +0200 Subject: svx: implement per-view LOK_CALLBACK_GRAPHIC_SELECTION With this, selecting an image sends the selection callback only to the relevant view. Change-Id: I0d5d611b969715d8eafa8d813202984acff32fbd Reviewed-on: https://gerrit.libreoffice.org/26112 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- svx/source/svdraw/svdmrkv.cxx | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'svx') diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index ab11ff0caeda..4f5d0bba87f4 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -53,6 +53,7 @@ #include #include #include +#include using namespace com::sun::star; @@ -703,8 +704,16 @@ void SdrMarkView::SetMarkHandles() if(pSdrTextObj && pSdrTextObj->IsInEditMode()) { if (bTiledRendering) + { // Suppress handles -> empty graphic selection. - GetModel()->libreOfficeKitCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); + if (comphelper::LibreOfficeKit::isViewCallback()) + { + if(SfxViewShell* pViewShell = SfxViewShell::Current()) + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); + } + else + GetModel()->libreOfficeKitCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); + } return; } } @@ -723,7 +732,13 @@ void SdrMarkView::SetMarkHandles() if (xController.is() && xController->hasSelectedCells()) { // The table shape has selected cells, which provide text selection already -> no graphic selection. - GetModel()->libreOfficeKitCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); + if (comphelper::LibreOfficeKit::isViewCallback()) + { + if(SfxViewShell* pViewShell = SfxViewShell::Current()) + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); + } + else + GetModel()->libreOfficeKitCallback(LOK_CALLBACK_GRAPHIC_SELECTION, "EMPTY"); return; } } @@ -754,7 +769,13 @@ void SdrMarkView::SetMarkHandles() // hide the text selection too GetModel()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, ""); } - GetModel()->libreOfficeKitCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelection.getStr()); + if (comphelper::LibreOfficeKit::isViewCallback()) + { + if(SfxViewShell* pViewShell = SfxViewShell::Current()) + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelection.getStr()); + } + else + GetModel()->libreOfficeKitCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelection.getStr()); } if (bFrmHdl) -- cgit