summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdotxat.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-08-04 18:56:43 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2017-08-10 15:17:58 +0200
commitf06b48a5dddab20fd1bbf9b5f3e8543593f5e590 (patch)
treece3bb9e57cdb21a8414a49bf919b1c442d2687ea /svx/source/svdraw/svdotxat.cxx
parent2ae717f2d722d78b29b51dc40194b64ab3bb5bc8 (diff)
editviewoverlay: Allow EditView to run in Overlay
This is the first basic functionality to get the active EditView with EditEngine work in the Overlay which all Apps support. Reason is that the current EditEngine 'plugs' into the Window and uses Invalidate() calls to repaint deeply everything under a text change. While this is acceptable for simple cases it can get very slow when there are excessive, expensive to paint objects in the background, e.g. MasterPages in Draw/Impress with gradients and other stuff. This was avoided in older versions (LO51) by 'guessing' a good BackgrundColor by the EditEngine, not invalidating but painting actively using that guess (with better or worse results) which someone removed. For the future it is anyways the better way to get the EditEngine functionality to Overlay and using Primitives, this will be a first step. This may enable Text Editing without repainting the Background (fast), using a non-XOR selection paint and more. It will need thorough testing and further experimenting due to EditEngine being used in many places (DrawObjects, Calc Cells, Formular Fields, Controls, ...) Change-Id: Ib9eb0f3999fd61a82ddf7a60ab1ea6ccda3a60da
Diffstat (limited to 'svx/source/svdraw/svdotxat.cxx')
-rw-r--r--svx/source/svdraw/svdotxat.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index 20325165a172..b25ead77cc87 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -287,8 +287,24 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight()
if (dynamic_cast<const SdrCaptionObj *>(this) != nullptr) { // this is a hack
static_cast<SdrCaptionObj*>(this)->ImpRecalcTail();
}
- SetChanged();
- BroadcastObjectChange();
+
+ // to not slow down EditView visualization on Overlay (see
+ // TextEditOverlayObject) it is necessary to suppress the
+ // Invalidates for the deep repaint when the size of the
+ // TextFrame changed (AdjustTextFrameWidthAndHeight returned
+ // true). The ObjectChanges are valid, invalidate will be
+ // done on EndTextEdit anyways
+ const bool bSuppressChangeWhenEditOnOverlay(
+ IsInEditMode() &&
+ GetTextEditOutliner() &&
+ GetTextEditOutliner()->hasEditViewCallbacks());
+
+ if (!bSuppressChangeWhenEditOnOverlay)
+ {
+ SetChanged();
+ BroadcastObjectChange();
+ }
+
SendUserCall(SdrUserCallType::Resize,aBoundRect0);
}
return bRet;