[Libreoffice-commits] core.git: sw/qa sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Sep 14 08:07:58 UTC 2016
sw/qa/extras/tiledrendering/tiledrendering.cxx | 4 ++++
sw/source/core/crsr/crsrsh.cxx | 7 +++++++
2 files changed, 11 insertions(+)
New commits:
commit 7b784e4e3927d91a96cd0b54fc43c9b488822e47
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Sep 14 09:16:56 2016 +0200
sw draw text: emit LOK_CALLBACK_VIEW_LOCK from registerCallback()
With this, in case the first view has an active text edit and a new view
is created, then the shape text lock is instantly visible in the second
view, even if the first view does not end + begin the text edit again
later.
Change-Id: I82d98ab1431a54a1a8897d16ce7fa0856baa2a10
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index eeef56d..d5bcf1d 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -1209,6 +1209,7 @@ void SwTiledRenderingTest::testShapeTextUndoGroupShells()
ViewCallback aView2;
aView2.m_aViewCursor = Rectangle();
aView2.m_bViewSelectionSet = false;
+ aView2.m_bViewLock = false;
SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView2);
// Difference was 935 twips, the new view didn't see the editeng cursor of
// the old one. The new difference should be <1px, but here we deal with twips.
@@ -1216,6 +1217,9 @@ void SwTiledRenderingTest::testShapeTextUndoGroupShells()
// This was false, editeng text selection of the first view wasn't noticed
// by the second view.
CPPUNIT_ASSERT(aView2.m_bViewSelectionSet);
+ // This was false, the new view wasn't aware of the shape text lock created
+ // by the old view.
+ CPPUNIT_ASSERT(aView2.m_bViewLock);
mxComponent->dispose();
mxComponent.clear();
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index f14f617..d0ffa27 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1205,6 +1205,13 @@ void SwCursorShell::NotifyCursor(SfxViewShell* pOtherShell) const
rEditView.RegisterOtherShell(nullptr);
// Text selection, if any.
rEditView.DrawSelection(pOtherShell);
+
+ // Shape text lock.
+ if (OutlinerView* pOutlinerView = pView->GetTextEditOutlinerView())
+ {
+ OString sRect = pOutlinerView->GetOutputArea().toString();
+ SfxLokHelper::notifyOtherView(GetSfxViewShell(), pOtherShell, LOK_CALLBACK_VIEW_LOCK, "rectangle", sRect);
+ }
}
else
{
More information about the Libreoffice-commits
mailing list