[Libreoffice-commits] core.git: svx/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Jun 9 15:29:44 UTC 2016
svx/source/svdraw/svdmrkv.cxx | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
New commits:
commit ce90a3cb3dcf35d8b7dbf886b62bb3ebc2c1ebef
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jun 9 16:30:27 2016 +0200
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 at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index ab11ff0..4f5d0bb 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)
More information about the Libreoffice-commits
mailing list