summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdpntv.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-07-26 11:02:38 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-26 10:34:07 +0000
commit9d91d371e92548c7f75a7d0155eecaf3769fdee6 (patch)
tree64741e1461c7eada1eb1be6c37600daebd7b4e1c /svx/source/svdraw/svdpntv.cxx
parentbfb8b56e1d8e1241045b435c42856f5606faad4f (diff)
svx lok: draw text edits in all views
Use case: a document has a shape with text, and two views. If one view starts to edit the shape text, the model text is hidden (via TextHierarchyEditPrimitive2D), and the in-progress text was painted directly only in the view that edits it. The remaining views presented the shape as if it had no text. This commit addresses the subset of this use case when the views are already created and they already show the same draw page. Fix the problem by looking for other views showing the same draw page, create a view of the text edit for them, and paint them in all views after the own text edit is painted. There is not much LOK-specific in this code, except that some extra code would be needed to not paint the blinking cursor of the text edit in other views, and then it could be enabled in the non-LOK case as well. Change-Id: Ib3096a3369fa56663ee209794e102090d362de66 Reviewed-on: https://gerrit.libreoffice.org/27535 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'svx/source/svdraw/svdpntv.cxx')
-rw-r--r--svx/source/svdraw/svdpntv.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 1b5a20af652f..8b6dbdbd0806 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -60,6 +60,7 @@
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <comphelper/lok.hxx>
+#include <svx/svdviter.hxx>
using namespace ::com::sun::star;
@@ -740,6 +741,26 @@ void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFo
static_cast< SdrView* >(this)->TextEditDrawing(rPaintWindow);
}
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // Look for active text edits in other views showing the same page,
+ // and show them as well.
+ if (SdrPageView* pPageView = GetSdrPageView())
+ {
+ SdrViewIter aIter(pPageView->GetPage());
+ for (SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView())
+ {
+ if (pView == this)
+ continue;
+
+ if (pView->IsTextEdit() && pView->GetSdrPageView())
+ {
+ static_cast<SdrView*>(pView)->TextEditDrawing(rPaintWindow);
+ }
+ }
+ }
+ }
+
// draw Overlay, also to PreRender device if exists
rPaintWindow.DrawOverlay(rPaintWindow.GetRedrawRegion());