diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-16 17:15:05 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-19 09:58:23 +0200 |
commit | 681dcf0063f8a22d9acbc617067832c50c84c2fe (patch) | |
tree | c674a27d5c7b91a87a84ec3e1ba9f8071e4b0674 | |
parent | c485dfc8c38972e0538ec4dde0a457b7fa050d05 (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
(cherry picked from commit d53bb5c044f039bd2fd38977a85012b03abbe32c)
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/ViewShellBase.cxx | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 38e917439dc1..4c92622aac13 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -1054,7 +1054,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 ad60dd74442f..b14774e2a57e 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -1071,6 +1071,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 { |