Commit Graph
400 Commits
Author SHA1 Message Date
Andrea Gelmini 60d7056184 Fix typo
Change-Id: Ia21de983bd4295f399e9753c29bc2a3cace2f250
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146835
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-02-12 19:36:03 +00:00
Andrea Gelmini 393b55e442 Fix typo
Change-Id: I51b5c88e1d82c596b926e7074ee3a7e1395a21a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146834
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-02-12 19:32:15 +00:00
Armin Le Grand (allotropia) 43de98fb59 MCGR: Add/Provide GradientSteps to FillGradientAttribute
MCGR stands for MultiColorGRadient. This change allows/
prepares adding multiple color steps to gradient rendering.

This is preparation work to allow rendering MCGRs in the
future. All places are adapted in a way that currently
no change of behaviour will happen. It will be the base
to get MCGR rendering/decompose for Primitives and our
internal/existing gradients working.

Change-Id: I28bbd7d10b8670042343ada2a66b5909d3d31bbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146748
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-02-12 10:54:06 +00:00
Andrea Gelmini 858ce89ab7 Fix typo
Change-Id: I276af93573a6b56a810265ba84b83c56c96b251d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145933
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-01-21 18:27:29 +00:00
Armin Le Grand (Allotropia) 6b6d1dc7bc SDPR: Unified some stuff & moved to tooling
Added and unified usage of a helper to create primitive
sub content easily, also for visibility checking of
primitives. Some smaller cleanups, too.

Change-Id: I3c4cd3e98e62b8cf7984351dbb0b154470fd8e3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145908
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-01-21 11:23:53 +00:00
Armin Le Grand (Allotropia) 53d927cd67 SDPR: Add support for InvertPrimitive2D
We urgently should get rid of XOR paint, modern
graphic systems allow no read access to the pixel
targets, but that's naturally a precondition for
XOR.
While we can do that for the office's
visualization, we can in principle *not* fully
avoid getting stuff that needs/defines XOR paint,
e.g. EMF/WMF imports, so we *have* to support
it (for now - sigh)...

This makes this renderer complete from the minimal
to-be-supported primitives, too.

Change-Id: Ie8fa98b777de764af0babe969296a671ca5cc7ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145739
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-01-18 15:03:57 +00:00
Stephan Bergmann b63afb3c74 Fix typo
...which happened to go largely unnoticed (the would-be additional overload, as
seen when including drawinglayer/processor2d/SDPRProcessor2dTools.hxx first
thing in drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx, was just
never defined nor used), but caused

> drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx(140,6): error: externally available entity 'prepareBitmapForDirectRender' is not previously declared in an included file (if it is only used in this translation unit, make it static; otherwise, provide a declaration of it in an included file) [loplugin:external]
> bool prepareBitmapForDirectRender(
> ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

with clang-cl

Change-Id: I9f338dd998b66fe3223af045206a423b016b93f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145696
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-18 07:45:51 +00:00
Andrea Gelmini 37e3455a13 Fix typos
Change-Id: Ib698f8cde8b332487deaae459ba5ed3d3c66692b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145517
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-01-14 22:48:13 +00:00
Andrea Gelmini 5ef5afbbd1 Removed executable bits on source file
Change-Id: I0becfd79fe71557e7b538e7d4122374c2164fcda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145518
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-01-14 22:46:45 +00:00
Andrea Gelmini 8e8353c717 Fix typos and exec bits
Change-Id: Ia23a7b507a8254a5d9143de055c28da9656425fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145515
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-01-14 22:46:09 +00:00
Armin Le Grand (Allotropia) 9455aae461 SDPR: Direct support for FillGraphicPrimitive2D
Added support to directly paint FillGraphicPrimitive2D, that
means object fill with multiple tiles/tiled fill. Note: This
may use not only bitmap data, but also metafile or svg.

The standard decompose creates one transformed bitmap/vector
data primitive per tile what is correct, but has some limits
(a) These may get many when tiles are small compared to
    mask polyPolygon (performance/ressources)
(b) Correctness: when rendering in AA the common edges of
    tiles will *not* sum up perfectly, but due to AA
    multiplying when blending will leave ugly 'traces'

This direct rendering avoids both. It can use the D2D Brush
functionality to repeat. Additionally to the current
office it can also do that when content is rotated/sheared.
This may not be well known since for those fills the office
always keeps the fill unrotated (for historical reasons,
primitives can do that, but not vcl). To see it you may
convert a SdrObject to metafile and rotate that, so the
content gets rotated and shows that ugly gaps.

Also added a square-pixel step value for vector fills where
the default gets used starting from some size. The argument
is better quality for vector data fills while only a
limited number of tiles will be rendered.

Also added a buffered handling of the (old and ugly)
OffsetX/OffsetY to make that work, we will not get rid of
that soon.

Packed all of this into tooling (so started a tooling
collection for SDPRs target-system independent) to be able
to easily re-use all these preparations/tests in other
SDPR implementations in the future.

Change-Id: Iafacf4181e7c9e2d2b2e3b5cf1f7e4cdd0a43f0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145466
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-01-13 20:00:19 +00:00
Armin Le Grand (Allotropia) 7e07225a1b SDPR: Overhauled D2DRenderer to use sal::systools::COMReference
All stuff used from MS with names starting with ID2D1* is COM
API stuff, so referenced and interface-based. I thought about
making this more safe since a while (shared/unique_ptr, ...)
but found no good way to do it.
Also did not want to use CComPtr from MS and expand the devenv
we need on win, so was short before doing an own small smartptr
class. Luckily I asked sberg and he pointed me to the already
existing sal::systools::COMReference which exactly does what
I need here - thanks!
Unluckily I now had to change a lot of code - sigh. I wish
I had known earlier :-/
This change contains the renderer completely adapted to using
that much safer and better ressource control.
Plus I added (even more) comments to try to make more clear
in many plasces what's going on, what is done and why.

Change-Id: Ia2aa3223d0e5f7ec6569cde176cec1fadcd921dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145142
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-01-06 15:24:39 +00:00
Andrea Gelmini 0d6dcc749f Fix typos
Change-Id: I49ca0e4e05420a4992acc348a3dc6e3533f4d30e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144618
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-01-05 18:07:41 +00:00
Stephan Bergmann e816ca42f9 -Werror,-Wmicrosoft-extra-qualification (clang-cl)
Change-Id: I7f0f551110d1df4e27d89ac1016fb5ff3f71151d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144736
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-12-22 10:44:42 +00:00
Caolán McNamara f2e8422f2f sync with latest additions to d2dpixelprocessor2d
commit 7d948d5c7e
Date:   Tue Dec 20 18:42:42 2022 +0100

    SDPR: Add handling/direct rendering of some simple Primitives

Change-Id: If5432ac02f51f4b9194ec5df347f93e11f58959b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144694
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-12-21 20:18:30 +00:00
Caolán McNamara ff46c8bf59 initial Experimental System-Dependent PrimitiveRenderer for Cairo
just some partial pieces

export TEST_SYSTEM_PRIMITIVE_RENDERER=1

and the simple drawing shapes work

Change-Id: I3e01501a1cb21ec86d6fe8f5637a23e7358ffc86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144632
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-12-21 19:14:53 +00:00
Armin Le Grand (allotropia) 7d948d5c7e SDPR: Add handling/direct rendering of some simple Primitives
(SDPR == SystemDependentPrimitiveRenderer)
Make D2DPixelProcessor2D directly render the added simple
Primitives
  LineRectanglePrimitive2D
  FilledRectanglePrimitive2D
  SingleLinePrimitive2D
to use less ressources & get faster since no conversion to
Polygons is done. These are Primitives that *may* be handled
directly, but do not have to - I checked that the decomposes
do work before adding direct handling.

Change-Id: Ifa97c595c262d84a9889f92571b2c9909bcef0e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144626
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-12-20 19:45:56 +00:00
Armin Le Grand (allotropia) fe589d8e54 Added two simple tooling Primitives for easy/common cases
Added three simple tooling Primitives:

(1) SingleLinePrimitive2D:
Just a Line from Point A to B with a BColor, decomposes
to a PolygonHairlinePrimitive2D (and to a PointArrayPrimitive2D
if only a single point aka A == B)

(2) LineRectanglePrimitive2D:
(3) FilledRectanglePrimitive2D:
Rectangles that support fill or line, gets decomposed
to maybe PolyPolygonColorPrimitive2D (if filled) and a
PolygonHairlinePrimitive2D (if line) or nothing if the
B2DRange is empty

NOTE: If using these despite being hor/ver aligned due to
their nature as B2DRange(s) (aka 'non rotated/sheared')
these may have to be transformed if the current
transformation context you are working in is rotated
or sheared, so *ensure* to handle these correctly if
you do handle them yourself. This is not needed with
the Polygon-based ones - that's why these are - and
stay - the common case(s).

Both are hairline primitives themselves, so are potentially
*view-dependent* (see comment in *.cxx and *.hxx). They will be
useful as very simple primitives for small renderers, e.g. to
avoid conversion from rectangles or just lines to polygons.

The more general Primitives are always the polygon-based ones,
so these new ones get decomposed to these (decomposition direction,
complex -> simpler). This assures that a processor/renderer has
minimally to support the polygon-based ones, but *can* use these
simple tooling ones directly if he wants to.

This will come in handy for future System-Dependent PrimitiveRenderers,
which I am currently working on one to offer as example - this leads
to identifying helpful upstream things that will come in handy in that
regard - like these ones.

Change-Id: Ie5039e6cfad6c9914c165cae6f8b59abecc38302
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144543
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-12-20 12:25:28 +00:00
Armin Le Grand (Allotropia) 5f29cb2fad Example System-Dependent PrimitiveRenderer for Direct2D (Win)
As promised at LiBoCon'22 I have finished an example
implementation of a System-Dependent PrimitiveRenderer.

It renders on Direct2D, so Win only. I chose this with
no special thoughts, did not even know too much about
Direct2D, so had to read quite some docu. Still managed
to do this in a view days.

NOTE: To make it run you need to switch off skia on Win
probably due to some global extra stuff done there (?)

The Renderer is in a new file (ca. 1000 lines) in the
drawinglayer libary. It implements all of the needed
primitives, so capable of rendering EditViews (Draw/
Impress complete, Writer/Calc in parts, interactions,
overlay, selection(s), etc.). It is used completely
as replacement of the VclPixelProcessor2D which is
not used in the patched version *at all*.

Just one primitive is missing:
- InvertPrimitive2D: Not needed much (hopefully will
  vanish), could also be added

It is not in production state, mostly intended as a
demonstration how Primitives are intended: Render
*without* using an OutputDevice at all, directly to
the traget GraphicsSystem. It can (and should) be
used as pattern for other implementations.

NOTE: Inside the implementation you can do whatever
you want, all is allowed. Only rule is to visualize
the geometry defined by the Primitives.

This version does not need any buffer allocations to
render and is thus pretty fast (uses ID2D1Layer). It
also has no buffering, but that could easily be
added. The needed classes/implementations to buffer
system-dependent representations of data exist,
so doable fast for Bitmaps, Polygons and PolyPolygons.

It runs stable and fast, but still has errors, so
it is sometimes missing to render some stuff. I
would have to debug/finetune it further, but I see
this all as doable. It's far enough to be seen as
POC and example.

I also added a not-urgently-need-to-be-implemented
primitive, the UnifiedTransparencePrimitive2D, to
demonstrate how to do that: Add a handler for it
and render the defined geometry if you can do that
more direct/better than the decomposition.

The rough to-do list would be:
- add missing Primitives
  - InvertPrimitive2D
- add buffering of
  - Bitmaps
  - Polygons
  - PolyPolygons
- add TextRendering
  - using decompose to PolyPolygons currently, but
    looks reasonably good with PolyPolygon AA
- general
  - polishing
  - bug fixing
  - stabilization(s)
  - speedups by adding PrimitiveHandlers
- solve problem with TransparencePrimitive2D
  - had to use drawinglayer::createAlphaMask
    there, see comments

Made handling of TransparencePrimitive2D work, some fixes
and changes, too.
Still not happy with processTransparencePrimitive2D, it
uses drawinglayer tooling (createAlphaMask) to do it's
job. It works, but there must be a better way. It's
okay for demonstration/POV though

Tried hard in processTransparencePrimitive2D to directly
render the alpha channel to a Direct2D
ID2D1BitmapRenderTarget using DXGI_FORMAT_A8_UNORM.
It does work theoretically as it should, but I found
no way to directly paingt to the AlphaChannel. It
seems as if Direct2D *is* hard-wired to always
alpha-blend, there seems to be no control or mode
to *select* the BlendMode to be used. Since only that
small step is missing I keep that code in (see
bTryDirectPreparationOfAlphaAsBitmap).
NOTE: No idea yet, but testing shows that the direct
but not yet complete way is ca. 7 times faster.

I have now added PointArrayPrimitive2D, so only that
InvertPrimitive2D is missing.
I also added MarkerArrayPrimitive2D to make it more
efficient (marker bitmap gets converted only once)
and better looking (not AAed anymore).
With both added, grid visualization looks good and is
fast.

Added support for BackgroundColorPrimitive2D

Added BitmapBuffering for Direct2D. This is a little
bit more complicated, theoretically all ID2D1Bitmaps
are specific to the ID2D1RenderTarget they get created
for, so theoretically they have to be (re)created
every time the ID2D1RenderTarget aka OutputDevice
changes - argh.
There is CreateSharedBitmap though that
allows re-usage of already created bitmaps for a new
RenderTaget, but this leads to needing a LO-livetime
RenderTarget to create all the Bitmaps for.
So I implemented that and it works and is fast.

Added buffering for GeometryData, ID2D1PathGeometry.
I prepared this already using the
CreateTransformedGeometry functionality of Direct2D,
so the B2DPolygon/B2DPolyPolygon can get buffered
in an unchanged form, re-used as source for
creating a ID2D1PathGeometry by calling
CreateTransformedGeometry. This could also be done by
manipulating the current transformation, but is not
necessary.

Simplified buffering by directly using derivated
helper classes (from basegfx::SystemDependentData)
as data holders, thus they can reliably call
Release() at incarnated Direct2D instances without
the need to keep record of this outside.

Completely removed OutputDevice from the
D2DPixelProcessor2D, it was anyways only used in
the constructor.

Removed the need to hand over the pixel size of the
pixel target when constructing a D2DPixelProcessor2D,
instead get that values from HDC directly. Also made
D2DPixelProcessor2D exported from drawinglayer for
further experiments.

Checked if I can use higher-level Direct2D versions
by using MS's QueryInterface to see if involved
classes are higher-level ones. This worked and
allows to paint the alpha channel for
TransparencePrimitive2D now indeed using the
BlendMode that is missing in the initial D2D stuff,
so activated that (much faster).

Aded the environment variable (for Windows only)
TEST_SYSTEM_PRIMITIVE_RENDERER to allow easy tesing
of SystemPrimitiveRenderer. Since Skia enabled
does collide in quite some places (see above) I
added hat this also disables Skia in it's central
isVCLSkiaEnabled() method. That way it is easy to
compare/quickly change between versions.

Removed maCurrentTransformation, this is just not
needed for a pixel-only renderer, see comment in
VclProcessor2D's header regarding that.

Added snap-to-pixel functionality.

Added direct support for PolygonStrokePrimitive2D,
so all lines which
- are fat or thin
- have LineCap
- have LineJoin
- use dash
can be directly rendered by Direct2D. This is especially
good for dash since no decompositions will be created
for these cases.
There is an exception for our own rarely used style
B2DLineJoin::NONE, that still needs to be decomposed,
but could also be added to the impl if needed.
There were also quite some 'conditions' for supporting
B2DLineJoin::Miter in Direct2D, but I managed to solve
them all, so Miter is fully done in Direct2D in this
example.
I also added example debug code to demonstrate how
it is possible to simply add decompose paint and the
system-specific implementation to optically compare
and play around in a running office to identify
possible problems/differences.

Improved handling of TransparencePrimitive2D massively
to a more future-proof and more common methodology by
using the Direct2D mechanism ID2D1Effect and the
CLSID_D2D1LuminanceToAlpha effect. For details, see
comment in comitted code at implCreateAlpha_Direct.

As explained in refs/changes/87/141087/22 I did add
now a tooling derivate of D2DPixelProcessor2D that can
be used to render sub-content without having to deal
with patching the current internal state of the running
instance, called D2DBitmapPixelProcessor2D. It resides
in the cxx file (so being safe from other usages), has
and creates an own ID2D1BitmapRenderTarget to work on
and will come in handy for other occasions that need
to prepare a in-between result.

Made stuff in the renderer itself more private and
added access methods to protected section, use
those in tooling.

Change-Id: Ie5803f9afa3f62dbaa8fd2f1bac8fd30a23066b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141087
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-12-20 12:24:57 +00:00
Stephan Bergmann 160689897c New loplugin:crosscast
...inspired by 2fa426da15 "Fix dynamic_cast after
splitting OutputDevice and vcl::Window class hierarchies":

"Find uses of dynamic_cast that cast between unrelated classes, which is
suspicious and might indicate a bug.  The heuristic used to consider two classes
unrelated is that neither derives from the other (directly or indirectly) and
they do not both virtually derive (directly or indirectly) from a common third
class.  Additionally, class definitions can be attributed with
SAL_LOPLUGIN_ANNOTATE("crosscast") (from sal/types.h) to suppress false warnings
about known-good cases casting from or to such a class."
(quoting compilerplugins/clang/crosscast.cxx)

This found two additional errors, 7a82ea5c79 "Fix
presumed typo" and fc6aa9e499 "fix assert", and
one still-open case that looks like an error, see the TODO comment in
sw/source/core/unocore/unodraw.cxx.

In addition to that it flagged another 102 uses of dynamic_cast as suspicious,
which have all been addressed, at least for now, by marking certain classes as
SAL_LOPLUGIN_ANNOTATE("crosscast"), see below.  (Where this commit also adds
that generic SAL_LOPLUGIN_ANNOTATE mechanism to include/sal/types.h.)  However,
some of those annotations might benefit from further inspection and clean up
similar to recent 8858962ec0 "Introduce
ParagraphProeprtiesPropertyMap", 8467aa93e2
"Replace a dynamic_cast with UNO_QUERY",
a534361141 "Fold OldBasicPassword into
basic::SfxScriptLibraryContainer", and 589e03fb4c
"[PATCH] Replace some dynamic_cast with UNO_QUERY".

* canvas/source/cairo/cairo_repainttarget.hxx RepaintTarget:
> canvas/source/cairo/cairo_cachedbitmap.cxx:62:34: error: suspicious dynamic cross cast from 'com::sun::star::rendering::XCanvas *' to 'RepaintTarget *' [loplugin:crosscast]
>         RepaintTarget* pTarget = dynamic_cast< RepaintTarget* >(rTargetCanvas.get());
* canvas/source/cairo/cairo_surfaceprovider.hxx SurfaceProvider:
> canvas/source/cairo/cairo_canvashelper.cxx:301:45: error: suspicious dynamic cross cast from 'com::sun::star::rendering::XBitmap *' to 'SurfaceProvider *' [loplugin:crosscast]
>         SurfaceProvider* pSurfaceProvider = dynamic_cast<SurfaceProvider*>( xBitmap.get() );
* canvas/source/vcl/repainttarget.hxx RepaintTarget:
> canvas/source/vcl/cachedbitmap.cxx:73:34: error: suspicious dynamic cross cast from 'com::sun::star::rendering::XCanvas *' to 'RepaintTarget *' [loplugin:crosscast]
>         RepaintTarget* pTarget = dynamic_cast< RepaintTarget* >(rTargetCanvas.get());
* chart2/inc/ChartModel.hxx ChartModel:
> chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx:82:31: error: suspicious dynamic cross cast from 'com::sun::star::awt::XWindow *' to 'ChartModel *' [loplugin:crosscast]
>     ChartModel* pChartModel = dynamic_cast<ChartModel*>(rParent.get());
* chart2/source/controller/inc/TabPageNotifiable.hxx TabPageNotifiable:
> chart2/source/controller/dialogs/tp_RangeChooser.cxx:70:28: error: suspicious dynamic cross cast from 'weld::DialogController *' to 'TabPageNotifiable *' [loplugin:crosscast]
>     , m_pTabPageNotifiable(dynamic_cast<TabPageNotifiable*>(pController))
> chart2/source/controller/dialogs/tp_DataSource.cxx:171:28: error: suspicious dynamic cross cast from 'weld::DialogController *' to 'TabPageNotifiable *' [loplugin:crosscast]
>     , m_pTabPageNotifiable(dynamic_cast<TabPageNotifiable*>(pController))
* include/drawinglayer/primitive2d/svggradientprimitive2d.hxx SvgGradientHelper:
> drawinglayer/source/primitive2d/svggradientprimitive2d.cxx:582:59: error: suspicious dynamic cross cast from 'const BasePrimitive2D *' to 'const SvgGradientHelper *' [loplugin:crosscast]
>             const SvgGradientHelper* pSvgGradientHelper = dynamic_cast< const SvgGradientHelper* >(&rPrimitive);
> drawinglayer/source/primitive2d/svggradientprimitive2d.cxx:819:59: error: suspicious dynamic cross cast from 'const BasePrimitive2D *' to 'const SvgGradientHelper *' [loplugin:crosscast]
>             const SvgGradientHelper* pSvgGradientHelper = dynamic_cast< const SvgGradientHelper* >(&rPrimitive);
* include/editeng/unotext.hxx SvxUnoTextRangeBase:
> writerfilter/source/dmapper/DomainMapper_Impl.cxx:7645:62: error: suspicious dynamic cross cast from 'com::sun::star::text::XTextCursor *' to 'SvxUnoTextRangeBase *' [loplugin:crosscast]
>                             SvxUnoTextRangeBase* pDrawText = dynamic_cast<SvxUnoTextRangeBase*>(xCrsr.get());
* include/embeddedobj/embeddedupdate.hxx EmbeddedUpdate:
> svtools/source/misc/embedhlp.cxx:932:35: error: suspicious dynamic cross cast from 'com::sun::star::embed::XEmbeddedObject *' to 'embed::EmbeddedUpdate *' [loplugin:crosscast]
>     embed::EmbeddedUpdate* pObj = dynamic_cast<embed::EmbeddedUpdate*> (GetObject().get());
* include/oox/core/contexthandler2.hxx ContextHandler2Helper:
> oox/source/core/contexthandler2.cxx:183:21: error: suspicious dynamic cross cast from 'const ContextHandler2Helper' to 'const ContextHandler &' [loplugin:crosscast]
>     ContextHandler( dynamic_cast< ContextHandler const & >( rParent ) ),
* include/oox/mathml/export.hxx FormulaExportBase:
> oox/source/export/shapes.cxx:2475:42: error: suspicious dynamic cross cast from 'com::sun::star::frame::XModel *' to 'oox::FormulaExportBase *' [loplugin:crosscast]
>     oox::FormulaExportBase *const pMagic(dynamic_cast<oox::FormulaExportBase*>(xMathModel.get()));
* include/oox/mathml/import.hxx FormulaImportBase:
> oox/source/drawingml/shape.cxx:1298:25: error: suspicious dynamic cross cast from 'com::sun::star::uno::XInterface *' to 'oox::FormulaImportBase *' [loplugin:crosscast]
>                         dynamic_cast<oox::FormulaImportBase*>(xMathModel.get()));
> writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:2287:38: error: suspicious dynamic cross cast from 'SfxBaseModel' to 'oox::FormulaImportBase &' [loplugin:crosscast]
>     oox::FormulaImportBase& import = dynamic_cast<oox::FormulaImportBase&>(dynamic_cast<SfxBaseModel&>(*component));
> writerfilter/source/rtftok/rtfdocumentimpl.cxx:2973:33: error: suspicious dynamic cross cast from 'SfxBaseModel' to 'oox::FormulaImportBase &' [loplugin:crosscast]
>                 auto& rImport = dynamic_cast<oox::FormulaImportBase&>(
> writerfilter/source/dmapper/DomainMapper_Impl.cxx:3000:53: error: suspicious dynamic cross cast from 'com::sun::star::uno::XInterface *' to 'oox::FormulaImportBase *' [loplugin:crosscast]
>         if( oox::FormulaImportBase* formulaimport = dynamic_cast< oox::FormulaImportBase* >( xInterface.get()))
* include/sfx2/Metadatable.hxx Metadatable:
> sw/source/core/doc/docbm.cxx:1837:17: error: suspicious dynamic cross cast from 'const IBookmark *const' to 'const ::sfx2::Metadatable *' [loplugin:crosscast]
>                 dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
> sw/source/core/doc/docbm.cxx:1924:13: error: suspicious dynamic cross cast from '::sw::mark::IBookmark *const' to '::sfx2::Metadatable *' [loplugin:crosscast]
>             dynamic_cast< ::sfx2::Metadatable* >(pBookmark));
> sw/source/core/doc/DocumentContentOperationsManager.cxx:342:21: error: suspicious dynamic cross cast from 'const sw::mark::IMark *const' to 'const ::sfx2::Metadatable *' [loplugin:crosscast]
>                     dynamic_cast< ::sfx2::Metadatable const* >(pMark));
> sw/source/core/doc/DocumentContentOperationsManager.cxx:344:21: error: suspicious dynamic cross cast from '::sw::mark::IMark *const' to '::sfx2::Metadatable *' [loplugin:crosscast]
>                     dynamic_cast< ::sfx2::Metadatable      * >(pNewMark));
> sw/source/core/unocore/unobkm.cxx:381:12: error: suspicious dynamic cross cast from '::sw::mark::IMark *' to '::sfx2::Metadatable *' [loplugin:crosscast]
>     return dynamic_cast< ::sfx2::Metadatable* >(m_pImpl->m_pRegisteredBookmark);
> sw/source/core/undo/rolbck.cxx:635:13: error: suspicious dynamic cross cast from 'const ::sw::mark::IBookmark *const' to 'const ::sfx2::Metadatable *' [loplugin:crosscast]
>             dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
> sw/source/core/undo/rolbck.cxx:713:13: error: suspicious dynamic cross cast from '::sw::mark::IBookmark *const' to '::sfx2::Metadatable *' [loplugin:crosscast]
>             dynamic_cast< ::sfx2::Metadatable* >(pBookmark));
* include/sfx2/digitalsignatures.hxx DigitalSignatures:
> sfx2/source/doc/docfile.cxx:3999:25: error: suspicious dynamic cross cast from 'com::sun::star::security::XDocumentDigitalSignatures *' to 'sfx2::DigitalSignatures *' [loplugin:crosscast]
>     auto xModelSigner = dynamic_cast<sfx2::DigitalSignatures*>(xSigner.get());
* include/sfx2/sidebar/IContextChangeReceiver.hxx IContextChangeReceiver:
> sfx2/source/sidebar/SidebarPanelBase.cxx:105:11: error: suspicious dynamic cross cast from 'pointer' (aka 'PanelLayout *') to 'IContextChangeReceiver *' [loplugin:crosscast]
>         = dynamic_cast<IContextChangeReceiver*>(mxControl.get());
* include/sfx2/sidebar/ILayoutableWindow.hxx ILayoutableWindow:
> sfx2/source/sidebar/SidebarPanelBase.cxx:164:44: error: suspicious dynamic cross cast from 'pointer' (aka 'PanelLayout *') to 'ILayoutableWindow *' [loplugin:crosscast]
>     ILayoutableWindow* pLayoutableWindow = dynamic_cast<ILayoutableWindow*>(mxControl.get());
* include/sfx2/sidebar/SidebarModelUpdate.hxx SidebarModelUpdate:
> sfx2/source/sidebar/SidebarPanelBase.cxx:189:40: error: suspicious dynamic cross cast from 'pointer' (aka 'PanelLayout *') to 'SidebarModelUpdate *' [loplugin:crosscast]
>     SidebarModelUpdate* pModelUpdate = dynamic_cast<SidebarModelUpdate*>(mxControl.get());
* include/sfx2/xmldump.hxx XmlDump:
> svtools/source/misc/embedhlp.cxx:290:27: error: suspicious dynamic cross cast from 'com::sun::star::util::XCloseable *' to 'sfx2::XmlDump *' [loplugin:crosscast]
>         auto pComponent = dynamic_cast<sfx2::XmlDump*>(mxObj->getComponent().get());
* include/svl/stylesheetuser.hxx StyleSheetUser:
> sd/source/core/stlsheet.cxx:294:48: error: suspicious dynamic cross cast from 'SfxListener *' to 'svl::StyleSheetUser *' [loplugin:crosscast]
>         const svl::StyleSheetUser* const pUser(dynamic_cast<svl::StyleSheetUser*>(pListener));
* include/svl/undo.hxx SfxRepeatTarget:
> starmath/source/action.cxx:45:5: error: suspicious dynamic cross cast from 'SfxRepeatTarget' to 'SmDocShell &' [loplugin:crosscast]
>     dynamic_cast< SmDocShell & >(rDocSh).SetFormat(aNewFormat);
* include/svx/ipolypolygoneditorcontroller.hxx IPolyPolygonEditorController:
> sd/source/ui/view/drbezob.cxx:127:22: error: suspicious dynamic cross cast from 'sd::SmartTag *' to 'IPolyPolygonEditorController *' [loplugin:crosscast]
>             pIPPEC = dynamic_cast< IPolyPolygonEditorController* >( mpView->getSmartTags().getSelected().get() );
> sd/source/ui/view/drbezob.cxx:216:26: error: suspicious dynamic cross cast from 'sd::SmartTag *' to 'IPolyPolygonEditorController *' [loplugin:crosscast]
>                 pIPPEC = dynamic_cast< IPolyPolygonEditorController* >( mpView->getSmartTags().getSelected().get() );
* include/vcl/IContext.hxx IContext:
> vcl/source/window/builder.cxx:3650:54: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IContext *' [loplugin:crosscast]
>                     vcl::IContext* pContextControl = dynamic_cast<vcl::IContext*>(pCurrentChild.get());
* include/vcl/ITiledRenderable.hxx ITiledRenderable:
> In file included from test/source/a11y/swaccessibletestbase.cxx:10:
> In file included from include/test/a11y/swaccessibletestbase.hxx:22:
> include/test/a11y/accessibletestbase.hxx:54:15: error: suspicious dynamic cross cast from 'com::sun::star::lang::XComponent *' to 'vcl::ITiledRenderable *' [loplugin:crosscast]
>             = dynamic_cast<vcl::ITiledRenderable*>(mxDocument.get());
* include/vcl/NotebookbarContextControl.hxx NotebookbarContextControl:
> vcl/source/control/notebookbar.cxx:113:33: error: suspicious dynamic cross cast from 'vcl::Window *' to 'NotebookbarContextControl *' [loplugin:crosscast]
>             pContextContainer = dynamic_cast<NotebookbarContextControl*>(m_pUIBuilder->get<Window>(OUStringToOString(aName, RTL_TEXTENCODING_UTF8)));
* include/vcl/gdimetafiletools.hxx MetafileAccessor:
> vcl/source/gdi/impgraph.cxx:716:61: error: suspicious dynamic cross cast from 'drawinglayer::primitive2d::BasePrimitive2D *' to 'const MetafileAccessor *' [loplugin:crosscast]
>                 const MetafileAccessor* pMetafileAccessor = dynamic_cast< const MetafileAccessor* >(pUnoPrimitive->getBasePrimitive2D().get());
* include/vcl/syswin.hxx VclBuilderContainer:
> vcl/source/app/salvtables.cxx:7465:11: error: suspicious dynamic cross cast from 'vcl::Window *' to 'VclBuilderContainer *' [loplugin:crosscast]
>         = dynamic_cast<VclBuilderContainer*>(m_aOwnedToplevel.get()))
* include/vcl/toolkit/field.hxx NumericFormatter:
> vcl/source/window/builder.cxx:583:37: error: suspicious dynamic cross cast from 'vcl::Window *' to 'NumericFormatter *' [loplugin:crosscast]
>         NumericFormatter *pTarget = dynamic_cast<NumericFormatter*>(get(elem.m_sID));
* include/vcl/transfer.hxx DragSourceHelper:
> svx/source/sdr/contact/sdrmediawindow.cxx:163:47: error: suspicious dynamic cross cast from 'vcl::Window *' to 'DragSourceHelper *' [loplugin:crosscast]
>         DragSourceHelper* pDragSourceHelper = dynamic_cast< DragSourceHelper* >( pWindow );
* include/vcl/transfer.hxx DropTargetHelper:
> svx/source/sdr/contact/sdrmediawindow.cxx:126:47: error: suspicious dynamic cross cast from 'vcl::Window *' to 'DropTargetHelper *' [loplugin:crosscast]
>         DropTargetHelper* pDropTargetHelper = dynamic_cast< DropTargetHelper* >( pWindow );
> svx/source/sdr/contact/sdrmediawindow.cxx:145:47: error: suspicious dynamic cross cast from 'vcl::Window *' to 'DropTargetHelper *' [loplugin:crosscast]
>         DropTargetHelper* pDropTargetHelper = dynamic_cast< DropTargetHelper* >( pWindow );
* include/vcl/wizardmachine.hxx IWizardPageController:
> vcl/source/control/wizardmachine.cxx:1274:46: error: suspicious dynamic cross cast from 'BuilderPage *' to 'IWizardPageController *' [loplugin:crosscast]
>         IWizardPageController* pController = dynamic_cast<IWizardPageController*>(pCurrentPage);
* include/xmloff/settingsstore.hxx DocumentSettingsSerializer:
> xmloff/source/draw/sdxmlimp.cxx:540:15: error: suspicious dynamic cross cast from 'com::sun::star::beans::XPropertySet *' to 'DocumentSettingsSerializer *' [loplugin:crosscast]
>     pFilter = dynamic_cast<DocumentSettingsSerializer *>(xProps.get());
> xmloff/source/draw/sdxmlexp.cxx:2474:41: error: suspicious dynamic cross cast from 'com::sun::star::beans::XPropertySet *' to 'DocumentSettingsSerializer *' [loplugin:crosscast]
>     DocumentSettingsSerializer *pFilter(dynamic_cast<DocumentSettingsSerializer *>(xProps.get()));
* include/xmloff/xmlimp.hxx SvXMLImport:
> sdext/source/pdfimport/sax/emitcontext.cxx:45:37: error: suspicious dynamic cross cast from 'com::sun::star::xml::sax::XDocumentHandler *' to 'SvXMLImport *' [loplugin:crosscast]
>     if (SvXMLImport *pFastHandler = dynamic_cast<SvXMLImport*>(m_xDocHdl.get()))
> writerperfect/source/common/DocumentHandler.cxx:118:37: error: suspicious dynamic cross cast from 'com::sun::star::xml::sax::XDocumentHandler *' to 'SvXMLImport *' [loplugin:crosscast]
>     if (SvXMLImport* pFastHandler = dynamic_cast<SvXMLImport*>(mxHandler.get()))
* reportdesign/inc/RptObject.hxx OObjectBase:
> reportdesign/source/ui/report/ViewsWindow.cxx:843:53: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>                             OObjectBase* pObjBase = dynamic_cast<OObjectBase*>(pObj);
> reportdesign/source/core/sdr/ReportUndoFactory.cxx:30:25: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>     OObjectBase* pObj = dynamic_cast<OObjectBase*>(&rObject);
> reportdesign/source/core/sdr/RptPage.cxx:62:29: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>         OObjectBase* pObj = dynamic_cast<OObjectBase*>(GetObj(i));
> reportdesign/source/core/sdr/RptPage.cxx:77:30: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>         OObjectBase* pBase = dynamic_cast<OObjectBase*>(GetObj(nPos));
> reportdesign/source/core/sdr/RptPage.cxx:116:28: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>     OObjectBase* pObject = dynamic_cast< OObjectBase* >(SdrObject::getSdrObjectFromXShape( _xObject ));
> reportdesign/source/core/sdr/RptPage.cxx:184:32: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>     OObjectBase* pObjectBase = dynamic_cast< OObjectBase* >( pObj );
> reportdesign/source/core/sdr/ReportDrawPage.cxx:60:29: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>     OObjectBase* pBaseObj = dynamic_cast<OObjectBase*>(pObj);
> reportdesign/source/ui/report/dlgedfunc.cxx:455:25: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>     OObjectBase* pObj = dynamic_cast<OObjectBase*>(_pOverlappedObj);
> reportdesign/source/ui/report/SectionView.cxx:177:37: error: suspicious dynamic cross cast from 'SdrObject' to 'OObjectBase &' [loplugin:crosscast]
>             OObjectBase& rBaseObj = dynamic_cast<OObjectBase&>(*pObj);
> reportdesign/source/ui/report/ReportSection.cxx:338:29: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>         OObjectBase* pObj = dynamic_cast<OObjectBase*>(pSdrObject);
> reportdesign/source/ui/report/ReportSection.cxx:513:38: error: suspicious dynamic cross cast from 'SdrObject' to 'OObjectBase &' [loplugin:crosscast]
>                 OObjectBase& rBase = dynamic_cast<OObjectBase&>(*pObject);
> reportdesign/source/ui/report/ReportSection.cxx:644:33: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>             OObjectBase* pObj = dynamic_cast<OObjectBase*>(pDlgEdObj);
> reportdesign/source/ui/report/ReportSection.cxx:663:35: error: suspicious dynamic cross cast from 'const SdrObject *' to 'const OObjectBase *' [loplugin:crosscast]
>         const OObjectBase* pObj = dynamic_cast<const OObjectBase*>(pDlgEdObj);
> reportdesign/source/ui/report/propbrw.cxx:286:33: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>             OObjectBase* pObj = dynamic_cast<OObjectBase*>(pCurrent);
> reportdesign/source/ui/report/ViewsWindow.cxx:843:53: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast]
>                             OObjectBase* pObjBase = dynamic_cast<OObjectBase*>(pObj);
* sc/source/ui/inc/IAnyRefDialog.hxx IAnyRefDialog:
> sc/source/ui/app/scmod.cxx:1607:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast]
>                 IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get());
> sc/source/ui/app/scmod.cxx:1646:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast]
>                 IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get());
> sc/source/ui/app/scmod.cxx:1697:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast]
>                 IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get());
> sc/source/ui/app/scmod.cxx:1766:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast]
>                 IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get());
> sc/source/ui/app/scmod.cxx:1813:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast]
>                 IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get());
> sc/source/ui/app/scmod.cxx:1853:38: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast]
>             IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get());
> sc/source/ui/view/tabview3.cxx:470:30: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast]
>     IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(xDlgController.get());
> sc/source/ui/view/tabview3.cxx:2053:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast]
>                 IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get());
> sc/source/ui/view/tabvwsh4.cxx:210:46: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast]
>                     IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pController.get());
* sd/source/filter/eppt/epptbase.hxx PPTExBulletProvider:
> sd/source/filter/eppt/pptx-epptbase.cxx:497:74: error: suspicious dynamic cross cast from 'PPTWriterBase *' to 'PPTExBulletProvider *' [loplugin:crosscast]
>         maStyleSheetList.emplace_back( new PPTExStyleSheet( nDefaultTab, dynamic_cast<PPTExBulletProvider*>(this) ) );
* sdext/source/presenter/PresenterViewFactory.hxx CachablePresenterView:
> sdext/source/presenter/PresenterViewFactory.cxx:218:36: error: suspicious dynamic cross cast from 'com::sun::star::drawing::framework::XResource *' to 'CachablePresenterView *' [loplugin:crosscast]
>     CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(rxView.get());
> sdext/source/presenter/PresenterViewFactory.cxx:274:23: error: suspicious dynamic cross cast from 'com::sun::star::drawing::framework::XView *' to 'CachablePresenterView *' [loplugin:crosscast]
>                     = dynamic_cast<CachablePresenterView*>(iView->second.first.get());
> sdext/source/presenter/PresenterViewFactory.cxx:325:40: error: suspicious dynamic cross cast from 'com::sun::star::drawing::framework::XView *' to 'CachablePresenterView *' [loplugin:crosscast]
>         CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(xView.get());
* slideshow/source/inc/cursormanager.hxx CursorManager:
> slideshow/source/engine/slide/userpaintoverlay.cxx:449:49: error: suspicious dynamic cross cast from 'CursorManager' to 'Slide &' [loplugin:crosscast]
>                                                 dynamic_cast<Slide&>(rContext.mrCursorManager),
* svx/source/inc/celltypes.hxx TableDesignUser:
> svx/source/table/tabledesign.cxx:267:38: error: suspicious dynamic cross cast from 'com::sun::star::util::XModifyListener *' to 'TableDesignUser *' [loplugin:crosscast]
>             TableDesignUser* pUser = dynamic_cast< TableDesignUser* >( it.next().get() );
* svx/source/inc/tablemodel.hxx ICellRange:
> svx/source/table/tablemodel.cxx:285:26: error: suspicious dynamic cross cast from 'com::sun::star::table::XCellRange *' to 'ICellRange *' [loplugin:crosscast]
>     ICellRange* pRange = dynamic_cast< ICellRange* >( rRange.get() );
* sw/inc/IDocumentUndoRedo.hxx IDocumentUndoRedo:
> sw/source/uibase/shells/drwtxtsh.cxx:585:38: error: suspicious dynamic cross cast from 'SfxUndoManager *' to 'IDocumentUndoRedo *' [loplugin:crosscast]
>                 auto* pUndoManager = dynamic_cast<IDocumentUndoRedo*>(GetUndoManager());
* sw/inc/IMark.hxx IFieldmark:
> sw/source/core/doc/docbm.cxx:1415:15: error: suspicious dynamic cross cast from 'sw::mark::MarkBase *const' to 'IFieldmark *' [loplugin:crosscast]
>             : dynamic_cast<IFieldmark*>(*pFieldmark);
> sw/source/core/doc/docbm.cxx:1437:16: error: suspicious dynamic cross cast from 'sw::mark::MarkBase *' to 'IFieldmark *' [loplugin:crosscast]
>         return dynamic_cast<IFieldmark*>(pFieldmark);
> sw/source/core/doc/docbm.cxx:1570:37: error: suspicious dynamic cross cast from 'sw::mark::MarkBase *' to 'IFieldmark *' [loplugin:crosscast]
>                 IFieldmark *pMark = dynamic_cast<IFieldmark*>(*aIter);
* sw/inc/calbck.hxx BroadcastingModify:
> sw/source/core/attr/swatrset.cxx:228:29: error: suspicious dynamic cross cast from 'const sw::BroadcastingModify *' to 'const sw::FormatDropDefiner *' [loplugin:crosscast]
>         auto pDropDefiner = dynamic_cast<const sw::FormatDropDefiner*>(pModify);
> sw/source/core/txtnode/OnlineAccessibilityCheck.cxx:38:28: error: suspicious dynamic cross cast from 'SwNode *' to 'sw::BroadcastingModify *' [loplugin:crosscast]
>         auto* pBroadcast = dynamic_cast<sw::BroadcastingModify*>(m_pNode);
* sw/inc/contentindex.hxx SwContentIndexReg:
> sw/source/core/doc/DocumentRedlineManager.cxx:56:20: error: suspicious dynamic cross cast from 'SwNode *' to 'SwContentIndexReg *' [loplugin:crosscast]
>             assert(dynamic_cast<SwContentIndexReg*>(&pPos->GetNode())
* sw/source/core/inc/flowfrm.hxx SwFlowFrame:
> sw/source/core/layout/frmtool.cxx:3044:35: error: suspicious dynamic cross cast from 'SwFrame *' to 'SwFlowFrame *' [loplugin:crosscast]
>         SwFlowFrame *pFlowFrame = dynamic_cast<SwFlowFrame*>(pSibling);
* sw/source/uibase/inc/FrameControl.hxx ISwFrameControl:
> sw/source/uibase/docvw/FrameControlsManager.cxx:283:15: error: suspicious dynamic cross cast from 'vcl::Window *' to 'ISwFrameControl *' [loplugin:crosscast]
>     mpIFace = dynamic_cast<ISwFrameControl *>( pWindow.get() );
* vcl/inc/IPrioritable.hxx IPrioritable:
> vcl/source/control/NotebookbarPopup.cxx:40:37: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IPrioritable *' [loplugin:crosscast]
>         vcl::IPrioritable* pChild = dynamic_cast<vcl::IPrioritable*>(GetChild(0));
> vcl/source/control/PriorityHBox.cxx:89:43: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IPrioritable *' [loplugin:crosscast]
>         vcl::IPrioritable* pPrioritable = dynamic_cast<vcl::IPrioritable*>(pChild);
> vcl/source/control/PriorityHBox.cxx:127:32: error: suspicious dynamic cross cast from 'vcl::IPrioritable *' to 'vcl::Window *' [loplugin:crosscast]
>         vcl::Window* pWindow = dynamic_cast<vcl::Window*>(pPrioritable);
> vcl/source/control/PriorityHBox.cxx:142:32: error: suspicious dynamic cross cast from 'vcl::IPrioritable *' to 'vcl::Window *' [loplugin:crosscast]
>         vcl::Window* pWindow = dynamic_cast<vcl::Window*>(*pChildR);
> vcl/source/control/PriorityHBox.cxx:186:43: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IPrioritable *' [loplugin:crosscast]
>         vcl::IPrioritable* pPrioritable = dynamic_cast<vcl::IPrioritable*>(pChild);
> vcl/source/window/NotebookBarAddonsMerger.cxx:128:19: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IPrioritable *' [loplugin:crosscast]
>                 = dynamic_cast<vcl::IPrioritable*>(pOptionalParent.get());
> ovcl/source/window/builder.cxx:3643:55: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IPrioritable *' [loplugin:crosscast]
>                     vcl::IPrioritable* pPrioritable = dynamic_cast<vcl::IPrioritable*>(pCurrentChild.get());
* vcl/inc/jsdialog/jsdialogbuilder.hxx BaseJSWidget:
> vcl/jsdialog/executor.cxx:41:26: error: suspicious dynamic cross cast from 'weld::Widget *' to 'BaseJSWidget *' [loplugin:crosscast]
>     if (auto pJSWidget = dynamic_cast<BaseJSWidget*>(pWidget))
> vcl/jsdialog/executor.cxx:49:26: error: suspicious dynamic cross cast from 'weld::Widget *' to 'BaseJSWidget *' [loplugin:crosscast]
>     if (auto pJSWidget = dynamic_cast<BaseJSWidget*>(pWidget))
> vcl/jsdialog/executor.cxx:155:49: error: suspicious dynamic cross cast from 'weld::MenuButton *' to 'BaseJSWidget *' [loplugin:crosscast]
>                     BaseJSWidget* pMenuButton = dynamic_cast<BaseJSWidget*>(pButton);
* vcl/inc/unx/x11/x11gdiimpl.h X11GraphicsImpl:
> vcl/unx/generic/gdi/salgdi.cxx:387:36: error: suspicious dynamic cross cast from 'pointer' (aka 'SalGraphicsImpl *') to 'X11GraphicsImpl *' [loplugin:crosscast]
>     if( X11GraphicsImpl* x11Impl = dynamic_cast< X11GraphicsImpl* >( mxImpl.get()))
* xmlsecurity/inc/certificate.hxx Certificate:
> xmlsecurity/source/helper/documentsignaturemanager.cxx:334:33: error: suspicious dynamic cross cast from 'com::sun::star::security::XCertificate *' to 'xmlsecurity::Certificate *' [loplugin:crosscast]
>         if (auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCert.get()))
> xmlsecurity/source/helper/documentsignaturemanager.cxx:381:33: error: suspicious dynamic cross cast from 'com::sun::star::security::XCertificate *' to 'xmlsecurity::Certificate *' [loplugin:crosscast]
>         if (auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCert.get()))
> xmlsecurity/source/component/documentdigitalsignatures.cxx:688:28: error: suspicious dynamic cross cast from 'com::sun::star::security::XCertificate *' to 'xmlsecurity::Certificate *' [loplugin:crosscast]
>             auto pAuthor = dynamic_cast<xmlsecurity::Certificate*>(xAuthor.get());
> xmlsecurity/source/component/documentdigitalsignatures.cxx:689:26: error: suspicious dynamic cross cast from 'com::sun::star::security::XCertificate *' to 'xmlsecurity::Certificate *' [loplugin:crosscast]
>             auto pCert = dynamic_cast<xmlsecurity::Certificate*>(xCert.get());
> xmlsecurity/qa/unit/signing/signing.cxx:130:29: error: suspicious dynamic cross cast from 'com::sun::star::security::XCertificate *' to 'xmlsecurity::Certificate *' [loplugin:crosscast]
>         auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCertificate.get());

Change-Id: If4f9efd8c012d0f650fe670450cf7ac0c8978036
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143458
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-29 18:07:23 +01:00
Michael Stahl 78681cd082 tdf#57423 drawinglayer: PDF/UA export: more Alt texts for SdrObjects
Currently /Alt texts are generated from ObjectInfoPrimitive2D, but this
is only evaluated in VclMetafileProcessor2D::processGraphicPrimitive2D()
so while it's created for every SdrObject, it's ignored in most cases.

There doesn't appear to be a reason why this is done in
processGraphicPrimitive2D() and not a more generic location, the special
conditions that are checked there don't have anything to do with Alt
texts, they effectively guard some optimisation done to bitmaps in
PageSyncData::PlaySyncPageAct().

There is another issue in that not every SdrObject gets a
StructureTagPrimitive2D, and even if there is a StructureTagPrimitive2D
it may be ignored if it's in the background.

The Alt text must only be produced if there is a structure element for
the same SdrObject, else it would end up on some unrelated structure
element.

Fix all this by moving processing to a new function which checks that
there is a current StructureTagPrimitive2D for a SdrObject in effect.

The only problem with this is that previously Writer images produced Alt
text, and now they don't - but Writer needs some fixing anyway.

Change-Id: I2a362e8a9cd93e5bc817c6eed546c46b46e14980
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143189
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-11-25 11:47:13 +01:00
Michael Stahl 6e5d59c2ca tdf#135638 drawinglayer,svx,sw: PDF/UA export: put SdrObjects on anchor
... frame in the structure tree.

The problem is that in sw, the anchored objects are painted
outside of the call to paint the page frame, which is what generates the
/Document structure element.

For Writer fly frames, this is handled via their SwFlyDrawObj painting,
where SwTaggedPDFHelper::CheckReopenTag() finds the anchor frame and
temporarily sets it as the structure parent, even if it's on a previous
page.

But all the SdrObjects on a page are painted by 2 calls to PaintLayer()
and there isn't a call back into Writer now.

Somehow this even causes a spurious line like "/Document<</MCID 7>>BDC"
to be emitted outside any PDF object, which looks clearly wrong.

Try to extend the SdrObjUserCall to get a way to retrieve the anchor
frame's structure element index.

Another option would be to extend ViewObjectContactRedirector to return
the PDF Id in its subclass SwViewObjectContactRedirector, and it seems
possible since its only one caller is
ViewObjectContact::getPrimitive2DSequence(), but Armin adivses that the
ViewObjectContactRedirector might go away in the future so it's better
to use SdrObjUserCall.

It's annoying that the mapping is a static members of
SwEnhancedPDFExportHelper; possibly it could be in OutputDevice's
PDFExtOutDevData instead?

Change-Id: Id61faae469aba4f0bd278ab2324aae06c1fdde64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143027
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-11-22 13:05:07 +01:00
Armin Le Grand (allotropia) 785aa638ac Turn around usage of TextHierarchyEditPrimitive2D
This primitive is created if a text edit is active
and contains it's current content, not from model
data itself.
Pixel renderers need to suppress that content, it
gets displayed by the active TextEdit in the EditView.
Suppression is done by decomposing to nothing by
default.
MetaFile renderers have to show it, so that the
edited text is part of the MetaFile, e.g. needed
for presentation previews and exports.
So take action here and process it's content.
Note: Former error was #i97628#

Change-Id: I32c83c0ad7883a79fc40f5a21ac6ed7b1055b7df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142910
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-11-18 20:59:47 +01:00
Noel Grandin 8011b16e05 Use BitmapEx in BitmapPrimitive2D
we no longer need to wrap it in the framework XBitmap
implemenation

Change-Id: I0dc56ad63364e2c5a4cedd5e70d4ae7ea7eae563
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142746
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-16 07:57:00 +01:00
Armin Le Grand (allotropia) 3aadb8a874 Prepare createAlphaMask to produce mask and alpha as needed
Change-Id: Ica799419ed628f94f134433ca5b37518c5698909
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142730
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-11-15 16:01:33 +01:00
Armin Le Grand (allotropia) 444bf8710d Update handling of AntiAliasing settings and processor2d
Currently SvtOptionsDrawinglayer::IsAntiAliasing() is used
in the constructor of the VCL based processor2Ds to decide
if AA is to be used or not. Using this inside the
constructors makes it currently impossible to use a
primitive renderer independent from these settings,
except when changing these settings temporarily what
may influence other renderings and is a hack.

The setting SvtOptionsDrawinglayer::IsAntiAliasing() is
intended to decide if LO shall use AA mode from user's
perspective, this means for the EditViews of the Apps
and some other occasions (previews, exports, conversions
to bitmap, ...).

This works currently since all visualizations for these
purposes use newly constructed primitive renderers. But
there is no way to use primitive renderers independent
from that setting. For future renderers which might be
used for other purposes this is not sufficient, there
has to be a method to create a renderer using e.g. AA
independent of the global setting.

To allow that, move the deciding flag to the already
used geometry::ViewInformation2D. To not change anything
initially, use the global flag for now to init that
default value at ViewInformation2D.

I took the opportunity to adapt ViewInformation2D to
no longer being read-only and not changeable, it uses
internally an impl class based on cow_wrapper already
anyways. Extending this would lead to the constructors
getting even bigger, when usually only 1-3 values
need to be changed and many usages want to copy an
existing instance and modify it. Adapted that usages
to a much smaller footprint.

Up to this point this does not change anything, but
move the usage of the SvtOptionsDrawinglayer to the
defaults (constructors) of the involved class
ViewInformation2D. Using this then in the primitive
rederers should be safe and will allow to use a
primitive renderer with or without AntiAliasing
independent of the user setting, so also for non-
EditView usages.

Also already added the PixelSnapHairline setting, this
will also be needed independent of user settings to
have full freedom of usage.

Unfortunately I cannot use SvtOptionsDrawinglayer
methods
    ::IsAntiAliasing() or
    ::IsSnapHorVerLinesToDiscrete
inside ViewInformation2D where I would need it. It's
now in drawinglayercore and thus not linked against
svtools (svt) anymore.
Thus I have to do some forwarding mechanisms to get
the correct values available in ViewInformation2D.
Not nice, caused by creating drawinglayercore...

Change-Id: I9f572ce67e5d86a242188bdc6d4ba7c9a12f6a9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142393
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-11-08 11:16:30 +01:00
Armin Le Grand (allotropia) a28f89581c Remove double functionality
There was processorfromoutputdevice.cxx|hxx containing
createBaseProcessor2DFromOutputDevice that does exactly
the same thing as createProcessor2DFromOutputDevice in
processor2dtools.cxx|hxx, so I removed one onf them
to make handling of future changes easier.

Change-Id: Id8d49d1572a1bc39f1d330a742d4697c8c030e75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142320
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-11-06 11:57:01 +01:00
Armin Le Grand (allotropia) 8304f44ce1 Improved code for PolygonStrokePrimitive2D::getB2DRange
For extended discussion & background information please refer
to the comments added to the code there.

Had to handle view-dependent parts like the hairline
different, do not buffer that case. It could be, but it's not
expensive and would require to remember and check against
the view-dependent part which was used to create the
B2DRange initially.

Change-Id: I10df46207990865c667d41f56aedb8f0956a1706
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142114
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-11-02 14:14:12 +01:00
Armin Le Grand (allotropia) 7614859e57 Make impBufferDevice faster again
When the Primitives for the Glow-Effects were added
(modified ShadowPrimitive2D, SoftEdgePrimitive2D and
GlowPrimitive2D) a modified version of impBufferDevice
was created and used. That lowered the speed for
drawing objects with transparence by about factor 2.5
and was unfortunately not only done for these
Primitives, but for transprent objects in general.

For the mentioned factor refer to:
  Patch to demonstrate former and now repaint differences
  https://gerrit.libreoffice.org/c/core/+/129301

After having reworked those Primitives to use another
mechanism and being decomposed so they will work in all
now and future renderers, it is possible to go back to
that easier and faster method to render Transparency.

For extended information, please take a look at the
added comments, mainly in vclhelperbufferdevice.hxx

Identified a still bad behaviour when objects use a
TransparenceGradient. Corrected that and added (at
this opportunity) a method 'createAlphaMask' along
with 'convertToBitmapEx' which is now used in the
GlowPrimitive2D & ShadowPrimitive2D which only need
the AlphaMask to do their job anyways (I had commented
there that thjis is possible before). That will
be faster for visualizing those Primitives.

Change-Id: Ieac880384de26960c2c4b8740a1dee1e15d7ac9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140022
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-09-19 09:56:19 +02:00
Armin Le Grand (allotropia) e735ad1c57 Rework of ShadowPrimitive2D
This is pretty much the same for ShadowPrimitive2D as the
change for GlowPrimitive2D and SoftEdgePrimitive2D, so for
more comments please refer to those commits:

 c2d1458723
 707b0c328a

There are some needed differences due to ShadowPrimitive2D
having existed longer and is used for non-blurred shadow
for a long time and is used as unchanged as possible.
Only for active glow of shadow is a buffering and local
decompose used.

Change-Id: I55e6516f59390079356ac16f24743b474e53fb05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139858
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-09-14 09:54:18 +02:00
Armin Le Grand (allotropia) 707b0c328a Rework of SoftEdgePrimitive2D
This is pretty much the same for SoftEdgePrimitive2D as the
change for GlowPrimitive2D, so for more comments please refer
to commit c2d1458723

Added suggested change of DoSaveForVisualControl mechanism

Change-Id: I28901e7a0b6e1823000d2aa6a335ce2fd80e6ce3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139585
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-09-08 13:33:58 +02:00
Andrea Gelmini 4c4f638b43 Fix typo
Change-Id: I562d9795efb48db690c0425a6f7048d10845ac45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139215
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-09-02 17:02:26 +02:00
Armin Le Grand (allotropia) 08e62dfbc1 Added BufferedDecompositionGroupPrimitive2D
...and adapted GlowPrimitive2D to it as a preparation to
use similar to BufferedDecompositionPrimitive2D, but for
primitives based on GroupPrimitive2D.

Change-Id: Ia1f9a09d4db09238ebbf6ad1303a4cdbdb8baedf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139099
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-09-01 12:39:27 +02:00
Luboš Luňák 0415aa11f6 fix limiting drawing of softedge effect (tdf#141981)
Apparently an empty viewport actually means everything should be drawn.

Change-Id: I55ae453a8f264d48222ade48a2953ab7d97c7f79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139125
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-09-01 12:01:07 +02:00
Armin Le Grand (allotropia) c2d1458723 Rework of GlowPrimitive2D
The new version does all needed stuff inside the GlowPrimitive2D
implementation. Advantages are:

- there is no need anymore to handle directly in the renderer
  implementations. That includes HitTest & future renderers, but
  also the currently existing fallback from MetafileRenderer
  to PixelRenderer

- the buffered B2Primitive can re-use the last, potentially
  expensively cerated pixelation result

- it checks for the possibility to do so using various
  aspects (see implementation, more would be possible)

- it no longer uses impBufferDevice in the not wanted
  double-vdev/alpha-channel mode from presentation engine

- it offers an example how to do all this with just a
  primitive (that can be replaced with another impl if
  needed without having to adapt any renderers). To
  support that, I added plenty of comments

The group of GlowPrimitive2D, SoftEdgePrimitive2D and
ShadowPrimitive2D use impBufferDevice in that much slower
and expensive mode (two VDevs, processor-based alpha
mixing). To get back to faster transparence rendering
in general this is a 1st step, we also will need to
re-work the other two mentioned primitives.
The reworked one is now more efficient.

Change-Id: I25c6fb970682b5311ce6f9ca4abf2702fb7c8862
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138973
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-08-31 12:12:37 +02:00
Khaled Hosny 3901e029bd tdf#104921: Cleanup Kashida insertion logic
Communicate Kashida insertion positions in an explicit way.

Rest of LibreOffice communicate adjustments to character widths (e.g.
for justification or spacing) using so-called DX array. DX array is an
array of absolute character positions (e.g. DX[n] is the position after
character n from the start of the lines, and its widths is DX[n] -
DX[n-1]).

This DX array is modified also when Kashidas are inserted after a given
character for Arabic justification, by expanding its width. VCL would
use this to know where to insert the Kashidas and how many ones.

But because DX array is used for both widths adjustments and kashida
insertion, this turns out to be a source of bugs since VCL has tosecond
guess the DX array to find which is pure width adjustment and which also
involves Kashida insertion, and the heuristics it uses are fragile.

This change adds a second array of booleans that records where Kashida
is inserted and communicates it all the way from where Kashida insertion
is decoded in Writer and down to VCL layout.

This change passes the Kashida array only when it seems necessary (e.g.
during drawing but not when measuring text since the DX array is enough
in this case). Hopefully no places where Kashida insertion needs to be
passed down were missed.

A couple of glyph and layout flags that were used for old heuristics and
no longer needed and are removed.

This also fixes:
tdf#87731
tdf#106309
tdf#108604
tdf#112849
tdf#114257
tdf#127176
tdf#145647
tdf#146199

Change-Id: I4ed0850ef2fdc3e9143341afac649e7e7d463c39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138068
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 21:10:24 +02:00
Armin Le Grand (Allotropia) 50394abcc3 tdf#128150 Implement/add SlideBackgroundFill visualization
React/interpret new SlideBackgroundFill mode for SdrObjects/
XShapes, defined by drawing::FillStyle_NONE and usage of
XFillUseSlideBackgroundItem as (true).

Do so by adding a detection, a mode to SdrFillAttribute,
reacting on it by creating a new implemented  B2DPrimitive:

SlideBackgroundFillPrimitive2D provides a Primitive2D for
the SlideBackgroundFill mode. It is capable of expressing
that state of fill and it's decomposition implements all
needed preparation/creation/collecting of the geometry
in an isolated and controllable space and way - the
B2DPrimitive way. It does so based on the given
ViewInformation2D, reacing out for all needed data/
geometry from this.
It clips & transforms/combines as needed, providing the
necessary visualization of the MasterPage content *over*
other objects on the Page/Slide. It is currently simple
buffered (due to being derived from
BufferedDecompositionPrimitive2D) and detects if
MasterPage changes. Still, more may be needed.

Change-Id: Ie11403c0b705fc2ecdfd7eb2fa5ae1a93a21b460
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135971
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-06-20 10:36:15 +02:00
Caolán McNamara 53786f02fd cid#1506305 Big parameter passed by value
and

cid#1506307 Big parameter passed by value

Change-Id: I7386eeea04f73a4ec9fe0fe09ff2981b2022be89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136079
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-06-18 15:23:53 +02:00
Noel Grandin dcb36da295 clang-tidy modernize-pass-by-value in drawinglayer
Change-Id: I8a3245c6a4d687edbc95cf28b2932d80c86a7b65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135828
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-15 09:24:47 +02:00
Noel Grandin a77b8b75f0 elide temporary vector in TextDecoratedPortionPrimitive2D
Change-Id: Ie3945d3a2e133d3ce527844f9c0d61a6541175e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135200
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-31 21:18:18 +02:00
Noel Grandin d286a820fa we can std::move the data out of TextBreakupHelper
and save some copying

Change-Id: I34cbc2edfd53fcc440d1765dba471fcbb05b2b7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135088
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-29 19:15:03 +02:00
Noel Grandin 8ec7b04808 simplify and improve maybeInvert
(*) we can move the data rather than copying
(*) it should definitely not be const
(*) we can use STL functions to do most of the work

Change-Id: I02b4cbbdeed0588d592f24942d31608f2119561c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135083
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-29 11:22:16 +02:00
Noel Grandin 7002caa97e new loplugin:trivialdestructor
look for potentially trivial destructors that can then be elided

Change-Id: I435c251bd4291b5864c20d68f88676faac7c43fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131318
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-11 09:06:06 +01:00
Noel Grandin e442352084 loplugin:unusedmethods
Change-Id: I922778e8ced0ad922d90a153b0eda47abbec94ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127868
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-03 06:49:18 +01:00
Noel Grandin e327bccf14 loplugin:unnecessaryvirtual
Change-Id: Ia7d68c07d44aaa9ce44fe4e7ed72987e96433269
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127866
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-02 19:36:19 +01:00
Noel Grandin 252dd254b5 new comphelper::WeakImplComponentHelper
to replace the cppu:: equivalent with a lightweight version
that uses std::mutex instead of osl::Mutex

Change-Id: I1b7873a0c2d9cda21f529e43a4ac2fa7574c91a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127335
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24 08:21:00 +01:00
Noel Grandin e3bd776e02 Split BasePrimitive2D UNO interface into separate object
Rather than make all the BasePrimitive2D classes bear the cost of being an UNO
object, we just wrap the top level BasePrimitive2D in this class when we need
to pass them over UNO.

This reduces the locking overhead when doing normal drawinglayer operations,
and reduces the size of drawinglayer objects and the cost of initialising
them, which shaves 5% off the load/display time of a large barchart.

Add new drawinglayer::convertPrimitive2DContainerToBitmapEx utility
method to avoid needing to convert to Sequence<XPrimitive2D>

Change-Id: I553eaa4c16ba016b098cb21f6c55f5008f0d9b53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126487
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-23 11:45:33 +01:00
Tomaž Vajngerl 24cc816e62 update PCHs
Change-Id: Ida2e859165e1698bf1837a6495d6df0f01b4a284
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127339
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-12-23 01:10:40 +01:00
Tomaž Vajngerl 7bd62c00c5 Separate core drawinglayer func. into drawinglayercore library
This separates the drawinglayer core functionallity into a
separate library, to keep a strict separation what is backend
dependent and what is not. More strict separation can be done
at a later date.

This will make it possible to push part of drawinglayer
(part of processor2d) directly into VCL.

Change-Id: Ibc26580067e50bf20d7cdd37fa0e44eb10200878
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127286
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-22 12:10:10 +01:00
Gabor Kelemen 6170522364 Remove transitional header drawinglayer/primitive2d/polygonprimitive2d.hxx
follow up to commit 1103727fb2

Change-Id: I227042f4703f3f4c18a8dc0355f044d2ad7dfb2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126838
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-16 08:58:04 +01:00