summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-09 16:30:27 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-09 15:29:21 +0000
commitce90a3cb3dcf35d8b7dbf886b62bb3ebc2c1ebef (patch)
tree0d038c136d77b6f16435732be4ce6b39823e76b5 /svx
parent4bcb4774a331cbe7edbb8d92bc6b628e79eee9a6 (diff)
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 <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdmrkv.cxx27
1 files changed, 24 insertions, 3 deletions
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 <editeng/editdata.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <comphelper/lok.hxx>
+#include <sfx2/viewsh.hxx>
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)