summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-07-22 16:39:47 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-22 18:07:18 +0200
commit599b1306ac59abc507f53ead3e7ca92bce3e6b77 (patch)
treeeaedc79f7796239f493ee82daf0edf256e7dbb28 /sw/source
parente81a237a6309c4ca147175770c6c4089b03d53e1 (diff)
sw: add new LOK_CALLBACK_VIEW_LOCK callback
When we're after SdrBeginTextEdit(), but before SdrEndTextEdit(), and have multiple views, then only the active view paints the edited text, the other views look like the shape has no text at all. Add a new callback that exposes the position and size of the rectangle where the shape text will be painted after text edit ended, so clients can draw some kind of locking indicator there. This way the rendered result can differ in the "shape has no text" and the "shape text is edited in an other view" cases. Reviewed-on: https://gerrit.libreoffice.org/27441 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 897189cfc6b3f6f3a9a0148b060ea25e5f8d9eaa) Conflicts: libreofficekit/source/gtk/lokdocview.cxx Change-Id: I6096479a8a05c2547d15222e6d997b848af02945
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/frmedt/feshview.cxx7
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx9
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 5c629b9f4425..6ee56a600d02 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -81,6 +81,9 @@
#include <sortedobjs.hxx>
#include <HandleAnchorNodeChg.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <comphelper/lok.hxx>
+#include <sfx2/lokhelper.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <calbck.hxx>
#include <com/sun/star/embed/EmbedMisc.hpp>
@@ -1057,6 +1060,10 @@ void SwFEShell::EndTextEdit()
}
else
pView->SdrEndTextEdit();
+
+ if (comphelper::LibreOfficeKit::isActive())
+ SfxLokHelper::notifyOtherViews(GetSfxViewShell(), LOK_CALLBACK_VIEW_LOCK, "rectangle", "EMPTY");
+
EndAllAction();
}
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 628eaf51b5bd..6fbd1f57dea1 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -68,6 +68,9 @@
#include <svx/svdpagv.hxx>
#include <svx/extrusionbar.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/lok.hxx>
+#include <sfx2/lokhelper.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
using namespace ::com::sun::star;
@@ -600,6 +603,12 @@ bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin,
if (pView)
{
pView->SetSelection(aNewSelection);
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ OString sRect = pView->GetOutputArea().toString();
+ SfxLokHelper::notifyOtherViews(this, LOK_CALLBACK_VIEW_LOCK, "rectangle", sRect);
+ }
}
}