summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-16 17:15:05 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-16 17:53:48 +0200
commitd53bb5c044f039bd2fd38977a85012b03abbe32c (patch)
treebe009e86054369146d270ca10918c90aaa0ce1e4 /sd
parent46f09cb1252078ef23ed93a3551acbdcca9d31cd (diff)
sd draw text: emit LOK_CALLBACK_VIEW_LOCK from registerCallback()
This is similar to commit 7b784e4e3927d91a96cd0b54fc43c9b488822e47 (sw draw text: emit LOK_CALLBACK_VIEW_LOCK from registerCallback(), 2016-09-14), but this fix is for Impress. Change-Id: I995d2ed223aa6ce7845c440039d176b6beada84e
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx4
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx11
2 files changed, 15 insertions, 0 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 67455cfdb7c3..37d06072068e 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1058,7 +1058,11 @@ void SdTiledRenderingTest::testCursorViews()
// second view as well, even if the second view was created after begin
// text edit in the first view.
ViewCallback aView2;
+ aView2.m_bViewLock = false;
SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView2);
+ // This failed: the second view didn't get a lock notification, even if the
+ // first view already started text edit.
+ CPPUNIT_ASSERT(aView2.m_bViewLock);
SfxLokHelper::setView(nView1);
aView2.m_bTilesInvalidated = false;
pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 8513599d920b..f07ba0447ee1 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1059,6 +1059,17 @@ void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const
rEditView.RegisterOtherShell(nullptr);
// Text selection, if any.
rEditView.DrawSelection(pOtherShell);
+
+ // Shape text lock.
+ if (OutlinerView* pOutlinerView = pDrawView->GetTextEditOutlinerView())
+ {
+ Rectangle aRectangle = pOutlinerView->GetOutputArea();
+ vcl::Window* pWin = pThisShell->GetActiveWindow();
+ if (pWin && pWin->GetMapMode().GetMapUnit() == MAP_100TH_MM)
+ aRectangle = OutputDevice::LogicToLogic(aRectangle, MAP_100TH_MM, MAP_TWIP);
+ OString sRectangle = aRectangle.toString();
+ SfxLokHelper::notifyOtherView(&pDrawViewShell->GetViewShellBase(), pOtherShell, LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle);
+ }
}
else
{