summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-02 17:32:04 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-02 17:21:56 +0000
commit1e1eb87f36095acefe73579448ceef8442beba5f (patch)
tree1f0997915b44edac0112cc7c7db1de6b1f49bce4 /svx
parent6228d6c52e4a6e6c0d82632a135211286e06852e (diff)
sd lok: implement SfxViewShell::NotifyCursor() API
The same API is already implemented in sw and sc already, the sd implementation allows selecting a shape in one view, then creating a second view, and seeing the selection of the first view in the second view, without de-selecting and re-selecting the shape in question in the first view. Change-Id: Ia36e4772584d132f1ff6a7eb07ca4cadaa384ee9 Reviewed-on: https://gerrit.libreoffice.org/28623 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/engine3d/view3d.cxx2
-rw-r--r--svx/source/svdraw/svddrgv.cxx8
-rw-r--r--svx/source/svdraw/svdmrkv.cxx21
-rw-r--r--svx/source/svdraw/svdmrkv1.cxx2
4 files changed, 21 insertions, 12 deletions
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 82fde6d555ba..b60bf78c8dc3 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -1409,7 +1409,7 @@ void E3dView::Start3DCreation()
maRef2.Y() = nY2;
// Turn on marks
- SetMarkHandles();
+ SetMarkHandles(nullptr);
//HMHif (bVis) ShowMarkHdl();
if (AreObjectsMarked()) MarkListHasChanged();
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 50cead0ca780..9c517a56373c 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -558,7 +558,7 @@ bool SdrDragView::EndDragObj(bool bCopy)
if (mbInsPolyPoint)
{
- SetMarkHandles();
+ SetMarkHandles(nullptr);
mbInsPolyPoint=false;
if( bUndo )
{
@@ -605,7 +605,7 @@ void SdrDragView::BrkDragObj()
mpInsPointUndo->Undo(); // delete inserted point again
delete mpInsPointUndo;
mpInsPointUndo=nullptr;
- SetMarkHandles();
+ SetMarkHandles(nullptr);
mbInsPolyPoint=false;
}
@@ -874,12 +874,12 @@ bool SdrDragView::IsOrthoDesired() const
return false;
}
-void SdrDragView::SetMarkHandles()
+void SdrDragView::SetMarkHandles(SfxViewShell* pOtherShell)
{
if( mpDragHdl )
mpDragHdl = nullptr;
- SdrExchangeView::SetMarkHandles();
+ SdrExchangeView::SetMarkHandles(pOtherShell);
}
void SdrDragView::SetSolidDragging(bool bOn)
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index a4a791644677..526b6e81187a 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -616,7 +616,7 @@ bool SdrMarkView::ImpIsFrameHandles() const
return bFrmHdl;
}
-void SdrMarkView::SetMarkHandles()
+void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
{
// remember old focus handle values to search for it again
const SdrHdl* pSaveOldFocusHdl = maHdlList.GetFocusHdl();
@@ -767,8 +767,17 @@ void SdrMarkView::SetMarkHandles()
}
if(SfxViewShell* pViewShell = GetSfxViewShell())
{
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelection.getStr());
- SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelection);
+ if (pOtherShell)
+ // An other shell wants to know about our existing
+ // selection.
+ SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelection);
+ else
+ {
+ // We have a new selection, so both pViewShell and the
+ // other views want to know about it.
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelection.getStr());
+ SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelection);
+ }
}
}
@@ -951,7 +960,7 @@ void SdrMarkView::SetDragMode(SdrDragMode eMode)
if (meDragMode==SdrDragMode::Resize) meDragMode=SdrDragMode::Move;
if (meDragMode!=eMode0) {
ForceRefToMarked();
- SetMarkHandles();
+ SetMarkHandles(nullptr);
{
if (AreObjectsMarked()) MarkListHasChanged();
}
@@ -1993,11 +2002,11 @@ void SdrMarkView::MarkAllObj(SdrPageView* _pPV)
}
}
-void SdrMarkView::AdjustMarkHdl()
+void SdrMarkView::AdjustMarkHdl(SfxViewShell* pOtherShell)
{
CheckMarked();
SetMarkRects();
- SetMarkHandles();
+ SetMarkHandles(pOtherShell);
}
Rectangle SdrMarkView::GetMarkedObjBoundRect() const
diff --git a/svx/source/svdraw/svdmrkv1.cxx b/svx/source/svdraw/svdmrkv1.cxx
index d75950603f93..319d7edb222d 100644
--- a/svx/source/svdraw/svdmrkv1.cxx
+++ b/svx/source/svdraw/svdmrkv1.cxx
@@ -271,7 +271,7 @@ void SdrMarkView::SetPlusHandlesAlwaysVisible(bool bOn)
ForceUndirtyMrkPnt();
if (bOn!=mbPlusHdlAlways) {
mbPlusHdlAlways=bOn;
- SetMarkHandles();
+ SetMarkHandles(nullptr);
MarkListHasChanged();
}
}