There were three methods left that use PaintOrStrip in
a mode to directly draw Text: DrawText_ToRectangle,
DrawText_ToPosition and DrawText_ToEditView.
I adapted all three to use PaintOrStrip in a Primitive
creating mode and render using a PrmitiveRenderer.
While StripPortions was already using the Primitive
creating mode the others needed adaptions ranging from
handling clipping over rotation to transformations.
I checked these as good as I could, but since errors
cannot be excluded, I added an ENV_VAR called
DISBALE_EDITENGINE_ON_PRIMITIVES
with which that change can be deactivated. Please use
this by setting it for the office when bugs pop up
whose bibisect point to this change - if it does not
happen with that var set, this change is responsible.
Offering this comes with a cost: Currently PaintOrStrip
*still* offers both modes, but when this change causes
no big problems I will be enabled to remove all direct
paint and stuff done extra there. This will then allow
in the future simpler changes since changes to EditEngine
output will no longer have to be done in two scopes.
For now this allows all remaining places that paint
EditEngine content still directly to continue to work.
This can in the future be extended to get the exact
same context as seq<Primitives> so offers the path to
potential re-use (not only paint, you can process and
transform Primitives in many ways).
A special case is the SD OutlinerView: It uses a set
callback (PaintingFirstLineHdl) to additionally paint
a PageNumber and a Graphic in that mode, but I managed
to replace/extend that to Primitive usage so this is
also prepared for simplifications in the future. It
would also be good to change that callback from it's
current form then.
Change-Id: Idc9233f0ce27c3e4153851f4e45faa24d15af36d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187628
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>