summaryrefslogtreecommitdiff
path: root/drawinglayer
AgeCommit message (Collapse)Author
2024-04-22tdf#160773: handle 0-size font heightMike Kaganski
Regression from commit cc3663bbaed4f65d64154e5f9abb51a5f622f710 (tdf#160702: improve text positioning, 2024-04-20), where I didn't know yet that this was possible :-) Change-Id: I1316db48b8acbacd077eeb4a8989c3dbf7e4a7b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166425 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-22use more OUString literalNoel Grandin
convert some functions which merely create an OUString on the fly from a char literal to 'constexpr OUString' literals Change-Id: I617490baf2d976291b324cc991b59cd18f4b242c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-22tdf#160726, tdf#48062: Simplify how BitmapExs are createdXisco Fauli
In my initial approach, I tranformed the primitive2DContainers before converting them to BitmapEx. This caused circles like https://bugs.documentfoundation.org/attachment.cgi?id=193790 not to be displayed. Simplify how BitmapExs are created by just using the range both primitive2DContainers have in common. This way, DrawBitmapInRect can be dropped now Change-Id: I2401dc87b98e04b9cf9f5ebade2b5622d884fc3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166391 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-20tdf#160702: improve text positioningMike Kaganski
Opening an SVG with text in different elements (e.g., tspans) in the same text element performs calculations to position the parts properly (i.e., the next part will start where the previous part ended, unless the position in overridden explicitly). These calculations require to know the text widths. The first problem leas here: the text width was calculated for a typically small text size (numerically equal to the pixel size defined in the SVG), but these calculations aren't truly linear, because font rendering may change depending on font height. Additionally, the rounding gives much higher error in smaller sizes than in larger. There was already a workaround for a similar problem in ViewRedirector::createRedirectedPrimitive2DSequence, where a large font (with 100 times greater height) was used to increase correctness. This was also used here, with the same large height (50000) used as a reference. Then, at the time of wrawing the text at different zoom levels, the code in VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D creates a font of a calculated size, and uses it to output the text. But the font is always created with an integral height, which means, that for a wanted height of 2.5 (in a zoomed out view), the really used height will be 3, which is 20% larger; or for wanted height of 2.4, the actual height will be 2 (20% smaller). This resulted in odd jumps of the text widths, when the text may overlap the following part, or conversely, create a big gap before the next gap. To try to mitigate that, the function now takes the difference between the wanted and the actual font size into account, and adjusts the MapMode accordingly. This doesn't fix the jumping completely (e.g., because of the mentioned special handling of small font sizes in the fonts thenselves, like hinting), but still makes the calculations much more stable, decreasing the amount of jumping. Similar changes are made in TextLayouterDevice. Use of the functions that return text size as a double, not rounded value, should additionally help improving stability. Change-Id: I455845d8ca43ee9c06a0fc980947f35d8a25797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166238 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-20Return double from OutputDevice::GetTextArrayMike Kaganski
And introduce GetTextWidth / GetTextHeight variants returning double. It allows to avoid premature rounding. At least in one case - testTdf145111_anchor_in_Fontwork - it allowed to make the test DPI-independent (at least in my testing on Windows, using 125, 150, and 175% UI scaling). Change-Id: I973d2c729ec6bb7114b4f99b9027f1ead7c1d061 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166237 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-19tdf#160622: Let SalLayout::GetBoundRect return basegfx::B2DRectangleMike Kaganski
This avoids premature rounding in TextLayouterDevice::getTextBoundRect. The box in D2DWriteTextOutRenderer::performRender needs to be expanded to allow room for the line width (which now will be guaranteed on all sides; previously, the rounding could happen to give no room on some side, even prior to commit 8962141a12c966b2d891829925e6203bf8d51852). Fixes some lines partially cut off in smaller text (or zoomed out). Change-Id: I07335136021f894cf045363b4d736bfab06c64d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166236 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-18tdf#160084 Simplify comparing with zero when using fToolsRMZeroFour
As part of the efforts in #160084 to simplify parts of the codebase by replacing basegfx::fTools::more/less calls with direct comparisions against zero, this commit performs the changes in a few files in the drawinglayer/ module. PS-2: Fix wrong identifier, courtesy of an accidental backspace press... Change-Id: I52a183dda5ae11989f8ffc8b26ff16ac77d6ebb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165600 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-15Generalize basegfx::fround for templated return typeMike Kaganski
And use it when assigning to tools::Long Change-Id: I0814d7bac9cdd48191ba69c64e3b12a4973b3417 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166071 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-13Use more o3tl::convertMike Kaganski
Change-Id: Ia525e051b53dd6082f2f11ff884677c8b8c6a20c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166051 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-04loplugin:unusedenumconstantsNoel Grandin
Change-Id: I889b4f63e098fecf22ffd4fb98937d62dbdd70b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-01tdf#146619 Drop unused 'using namespace' in: drawinglayer/Gabor Kelemen
Change-Id: I6d034b6c191885b25ad34f0d75ed870970b5fd77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165527 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-28Simplify a comparisonMike Kaganski
Similar to commit 860548e23e2ae737d7bd5840f71f776b1239f997 (Simplify a comparison, 2024-03-07). Change-Id: Ia2ae4a9d23558842626b6e52a13bc1582bc35741 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165422 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-27tdf#160084 Simplify comparison for basegfx::fToolsBogdan Buzea
Change-Id: I853cab70d24e4813d979f507dc5b66049cbca53b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165316 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-21ITEM: Enable MultiThreaded 3D renderingArmin Le Grand (allotropia)
Change-Id: I3155b075b150f04d0dc93833ab9b6f57eefe71db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165130 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-03-21Disable EditViewActive when Metafile outputArmin Le Grand (allotropia)
This was missing in the mechanism to suppress EditView exclusive content, so it is now also suppressed in PDF export. Also changed TextHierarchyEditPrimitive2D to also decide inside it's local get2DDecomposition implementation, so it does not need to be# supported in PrimitiveProcessors (and cannot be forgotten in future implementations). Also added support for EditView exclusive Primitive's name in idToString (missed that). Change-Id: I61efc9dddb7d6f0190c7b1fb4b0acf98ab5767f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165109 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-03-21Provide tooling for EditView exclusive PrimitivesArmin Le Grand (allotropia)
We have the case that e.g. a placeholder Graphic/Text shall only be processed/shown in the EditView of the application, but not in any other Primitive-based usages, including exports, SlideSHow, etc. I already thought about that when initially converting Draw/Impress to Primitives, but always found other solutions, mainly because full XShapes/SdrObjects had to be taken into account, that can be handled in VC/VOC/OC implementation. But here we have varying visualisations of one shape. Thus I implemented a helper Primitive called ExclusiveEditViewPrimitive2D. Anything you embed there will only be processed when the switch to do so is active in the ViewInformation2D. And that switch is only set in the EditView paint. Change-Id: I307f4b0fe7f8faf98789787f216cac7be86a0515 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165066 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-03-11tdf#159094 sc: fix failure when exporting media files to PDFTibor Nagy
Change-Id: I948190b31f45cf05ba24d1fbc4a84dfe91eb3876 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164557 Tested-by: Jenkins Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de>
2024-03-07Simplify some rtl::math::approxEqual callsNoel Grandin
Comparing with zero is simple - the implementation special-zases zero. Change-Id: Ia2fe8a1100941f72023a74955ebfbb4f5f25b90d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-07Simplify some basegfx::fTools::*orEqual callsNoel Grandin
Comparing with zero is simple - the implementation of basegfx::fTools::moreOrEqual calls rtl_math_approxEqual eventually, which special-zases zero. Change-Id: I62f10f63f103d91a201dfeb20e5b3f9010f377c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-04tdf#159515 rename impGetTransparence() to impGetAlpha()Patrick Luby
Commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 makes impGetTransparence() return alpha instead of transparence. So, rename the function and skip reverting the result to obtain the alpha value. Change-Id: Ied3bf8ae4a0de2ae36074dba9f78ccc93480b15a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164322 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Tested-by: Patrick Luby <guibomacdev@gmail.com>
2024-02-23optimize the text drawing, that's what we do most ofCaolán McNamara
maybe the alternative branch should be dropped, turned into a debugging option because it is obscure and presumably doesn't result in better results that using the platform text rendering Change-Id: Ief6882f7acf8737ca64b10e74e5d94aade60d71a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163791 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-22IASS: Re-define Text suppression for TextEditArmin Le Grand (allotropia)
The current version suppressed text for Objects in edit mode for the paint in the view since that text is painted/visualized by the EditEngine/Overlay while it is being edited, so that would be displayed twice - and in different states. That is correct, but e.g. also suppressed display for e.g. an opened second Window for the Document or in a running SlideShow. The mechanism uses embedding the Text in case it gets edited to a simple Primitive that then can be suppressed by the view rendering it. It decomposed to empty, thus to visualize it a renderer had to actively identify and process it. I now turnedd this around - it is a normal GroupPrimitive2D and decomposes to the text content, so will be visualized by all renderers that do not actively suppress it. To actively suppress it I added a get/setTextEditActive marker to ViewInformation2D that will be used by the ObjectContactOfPageView to signal exactly that and to suppress in the pixel based VCLRenderer in that case. This is important e.g. for 2nd view window, but also for PDF export with active TextEdit (yes, happens) and SlideShow. There was also support missing for an up-to-now empty/new object (no text yet) so that text from the active TextEdit was not provided, corrected that. Change-Id: I0d8befdb023028d78ce341091331e9a83a0173bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163773 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-02-22split TextAsPolygonExtractor2D for more general reuseCaolán McNamara
Change-Id: I102ccab2a423c38b0414c9565fec349aa6ffb5af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163725 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-19crashtesting: bump refcount during setBuffered2DDecompositionCaolán McNamara
otherwise if another thread drops the refcounf to 0 while setBuffered2DDecomposition is in flight the object goes away underneath us. Change-Id: I65d458306bee0c4f2e80fd2925d22cf121920fc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163591 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-12make BufferedDecompositionPrimitive2D store a Primitive2DReference..Noel Grandin
.. instead of a Primitive2DContainer. The container very frequently contains only a single item, since the decomposition method often sticks only a single top-level node in there, so it turns out to be a net loss overall, memory consumption-wise. Also, if we return a single Primitive2DReference from a BufferedDecomposition, that maximises the sharing of data between the BufferedDecomposition objects at the bottom of the decomposed tree, and objects higher up. Change-Id: Iaf272e60e2997299cc35a1bd209c51b6b79e9a8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162976 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-07these casts are no longer necessaryNoel Grandin
Change-Id: Ife51f47d95e286e0fec165882377c31b1a664241 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163058 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-07simplify some Primitive2DContainer constructionNoel Grandin
Change-Id: Iced31da6891a5d218d63e9b59d48fb2645f39203 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163071 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-07simplify some Primitive2DContainer accessesNoel Grandin
Change-Id: I217489db2f66049dfb0908f2f2a07a2f585302ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163070 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-07can std::move these Primitive2DContainer valuesNoel Grandin
Change-Id: Id40fdc3915107575eec734de704a52c5fb3715f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-06flatten some drawinglayer codeNoel Grandin
Change-Id: I2d7fd0da565e4cddb37ae2053c686d8e6befcf83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163039 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-05tdf#108037 Reduce time and memory consumed exporting to PDFNoel Grandin
by avoiding making multiple copies of the Primitive2D container that we pass to TransformPrimitive2D. Instead, make TransformPrimitive2D store its children using a GroupPrimitive2D, which means we can share the GroupPrimitive2D among all the TransformPrimitive2D instances we create. Change-Id: I8a4398f9db6a6ab013ee24ad53836975fba6f3df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-04Move mnTransparenceForShadow down to SdrCellPrimitive2DNoel Grandin
where it belongs. It appears it was only put into BufferedDecompositionPrimitive2D so that it can be accessed by Primitive2DXmlDump, so fix that by creating an extended version of the dumper for use in svx. Change-Id: Idb0b849c4fa538bbede882e48c2d090669c2325a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-19tdf#159067 drawinglayer: fix untagged form control (PDF/UA export)Tibor Nagy
If the form object is marked as decorative, the form control should be exported as "Artifact" Change-Id: I615d308ae966bf3d0f156899a0b4fad2d5a7c492 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162268 Tested-by: Jenkins Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de>
2024-01-17tdf#145538 use std::equal in place of for loopachintya
Change-Id: Ie262b36a5ad1be9b2c4d5e8acffc58895e795910 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161273 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-01-16chart2: Make automatic area coloring for charts work for tiled renderingofftkp
Charts now get a temporary colored applied to the area property set if their color was set to automatic, which is done by default in tiled rendering mode. Change-Id: Ic6bd19b97d2a0ffa2a1ad516cfa202e2f4921db7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160659 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-01-10cid#1546141 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546004 COPY_INSTEAD_OF_MOVE cid#1545934 COPY_INSTEAD_OF_MOVE cid#1545563 COPY_INSTEAD_OF_MOVE cid#1545533 COPY_INSTEAD_OF_MOVE cid#1545529 COPY_INSTEAD_OF_MOVE cid#1545502 COPY_INSTEAD_OF_MOVE cid#1545499 COPY_INSTEAD_OF_MOVE cid#1545479 COPY_INSTEAD_OF_MOVE cid#1545344 COPY_INSTEAD_OF_MOVE cid#1545324 COPY_INSTEAD_OF_MOVE cid#1545313 COPY_INSTEAD_OF_MOVE cid#1545252 COPY_INSTEAD_OF_MOVE cid#1545186 COPY_INSTEAD_OF_MOVE Change-Id: I44a783876699f88c769f239ae84eb5cae44d5f07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161879 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-08cid#1545370 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545364 COPY_INSTEAD_OF_MOVE cid#1545363 COPY_INSTEAD_OF_MOVE cid#1545344 COPY_INSTEAD_OF_MOVE cid#1545299 COPY_INSTEAD_OF_MOVE cid#1545287 COPY_INSTEAD_OF_MOVE cid#1545267 COPY_INSTEAD_OF_MOVE cid#1545256 COPY_INSTEAD_OF_MOVE cid#1545226 COPY_INSTEAD_OF_MOVE cid#1545500 COPY_INSTEAD_OF_MOVE cid#1545538 COPY_INSTEAD_OF_MOVE cid#1545618 COPY_INSTEAD_OF_MOVE cid#1545681 COPY_INSTEAD_OF_MOVE cid#1545750 COPY_INSTEAD_OF_MOVE cid#1545778 COPY_INSTEAD_OF_MOVE cid#1545785 COPY_INSTEAD_OF_MOVE cid#1545799 COPY_INSTEAD_OF_MOVE cid#1545847 COPY_INSTEAD_OF_MOVE cid#1545958 COPY_INSTEAD_OF_MOVE cid#1545963 COPY_INSTEAD_OF_MOVE cid#1545990 COPY_INSTEAD_OF_MOVE cid#1546013 COPY_INSTEAD_OF_MOVE cid#1546029 COPY_INSTEAD_OF_MOVE cid#1546079 COPY_INSTEAD_OF_MOVE cid#1546104 COPY_INSTEAD_OF_MOVE cid#1546127 COPY_INSTEAD_OF_MOVE cid#1546133 COPY_INSTEAD_OF_MOVE cid#1546155 COPY_INSTEAD_OF_MOVE cid#1546190 COPY_INSTEAD_OF_MOVE cid#1546216 COPY_INSTEAD_OF_MOVE cid#1546273 COPY_INSTEAD_OF_MOVE cid#1546315 COPY_INSTEAD_OF_MOVE cid#1546326 COPY_INSTEAD_OF_MOVE cid#1546387 COPY_INSTEAD_OF_MOVE accept some reasonable suggestions Change-Id: I7b004086d490c7618d8fe7a21a53cfa8ac1f8408 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161748 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-02tdf#158913 secure Primitive 'visit' using mutexArmin Le Grand (allotropia)
See text in tdf task for detailed description. Change-Id: I4677c9f2ecfdcb760d05fe916a2aa2dd25ad40b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161543 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-01-02Add flush mechanism to buffered Primitives IVArmin Le Grand (allotropia)
Now trying not to delete a LocalCallbackTimer if it gets used - no limitation since this only happens when a time is given (maCallbackSeconds). Also added to reset callback ptr (clearCallback()) to nullptr and make onShot dependent of that, hope is that destruction of LocalCallbackTimer in ~BufferedDecompositionPrimitive2D gets safer that way, excluding race conditions. Change-Id: Id474962bdae14631afc42d2d92db635408fb67d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161434 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-12-30move IsFuzzing to comphelperCaolán McNamara
and try something a bit more generic Change-Id: I1d8256576cd02f0a589df350ba7b53059dd586a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161250 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-29tdf#158743 use maCurrentTransformation for embeddingArmin Le Grand (allotropia)
Seems to be an error in the preparation to Bitmap conversion in VclMetafileProcessor2D::processTransparencePrimitive2D. While for calculating the LogicRange maCurrentTransformation is used (and that is correct) it is *not* used in the embedding for calling convertToBitmapEx. It is correct to get back to logic/world coordinates for calculating the embedding, but maCurrentTransformation is needed to define the correct full embedding. I might have overlooked that in the original change because maCurrentTransformation is local to the VclMetafileProcessor2D in action right at that moment and is usually empty for simple cases, but - as can be seen - not always. Change-Id: Ib2deaa2c8328655ecc80964ba2e23e67964ac3ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161409 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-12-29Typo: opertator->operator (drawinglayer)Julien Nabet
Change-Id: I20128a8e0068e6eb29af9e7114100fb437e9e079 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161407 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-23cid#1546006 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545999 COPY_INSTEAD_OF_MOVE cid#1545995 COPY_INSTEAD_OF_MOVE cid#1545994 COPY_INSTEAD_OF_MOVE cid#1545989 COPY_INSTEAD_OF_MOVE cid#1545982 COPY_INSTEAD_OF_MOVE cid#1545977 COPY_INSTEAD_OF_MOVE cid#1545970 COPY_INSTEAD_OF_MOVE cid#1545856 COPY_INSTEAD_OF_MOVE cid#1545845 COPY_INSTEAD_OF_MOVE cid#1545838 COPY_INSTEAD_OF_MOVE cid#1545776 COPY_INSTEAD_OF_MOVE cid#1545774 COPY_INSTEAD_OF_MOVE cid#1545744 COPY_INSTEAD_OF_MOVE cid#1545719 COPY_INSTEAD_OF_MOVE cid#1545716 COPY_INSTEAD_OF_MOVE cid#1545687 COPY_INSTEAD_OF_MOVE cid#1545648 COPY_INSTEAD_OF_MOVE cid#1545643 COPY_INSTEAD_OF_MOVE cid#1545641 COPY_INSTEAD_OF_MOVE cid#1545604 COPY_INSTEAD_OF_MOVE cid#1545531 COPY_INSTEAD_OF_MOVE cid#1545530 COPY_INSTEAD_OF_MOVE cid#1545524 COPY_INSTEAD_OF_MOVE cid#1545516 COPY_INSTEAD_OF_MOVE cid#1545501 COPY_INSTEAD_OF_MOVE cid#1545486 COPY_INSTEAD_OF_MOVE Change-Id: Idcf3e27bb9e81b6a77d5ef75c9376eb1d6aff8c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161245 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-23Related: tdf#158807 mutex must be locked when disposing a VirtualDevicePatrick Luby
If the following .ppt document is opened in a debug build and the document is left open for a minute or two without changing any content, this destructor will be called on a non-main thread with the mutex unlocked: https://bugs.documentfoundation.org/attachment.cgi?id=46801 This hits an assert in VirtualDevice::ReleaseGraphics() so explicitly lock the mutex and explicitly dispose and clear the VirtualDevice instances variables. Change-Id: I5d371a4e99fca4aae2b6edc8b53eca10cb143aef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161243 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@libreoffice.org>
2023-12-21Add flush mechanism to buffered Primitives IIArmin Le Grand (allotropia)
As sberg mentioned in previous change this might be responsible for heap-use-after-free problems. I took a look and it seems to be possible that the timer calls back while deletion of the helper is in progress, so I try now to first stop the timer and then delete so that it cannot trigger. Will see if that works - if not I might have to use another lock... Change-Id: I1ae27d9ed890f352904cab18c3292b449659a3ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161128 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-12-19Drop some wrapper methods from SvtOptionsDrawinglayerGabor Kelemen
just use the wrapped officecfg methods instead of: IsSolidDragCreate IsRenderDecoratedTextDirect IsRenderSimpleTextDirect GetQuadratic3DRenderLimit GetQuadraticFormControlRenderLimit IsTransparentSelection Change-Id: Ie0f3ec0f8fdbbf08facfff1a372c666c8a0c8979 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160654 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-12-19Add flush mechanism to buffered PrimitivesArmin Le Grand (allotropia)
There are the classes BufferedDecompositionPrimitive2D and BufferedDecompositionGroupPrimitive2D that offer a unified mechanism to preserve/buffer the decomposition of a Primitive, independent of the complexity. This may include e.g. the pixel representation of a 3D Scene, for Charts/CustomShapes and others. Until now these were refreshed when the objects change, or when the buffered decomposition decides that it is necessary, but there was no general mechanism in place to clean these up while the Primitive owning them was alive/used. This is not a big thing in Draw/Impress since this would only be relevant when zooming deep into a SdrPage, so the non-vislible parts would still hold data that would not be needed. But for Calc and Writer this is more relevant: A 3D Chart on the 1st page of a Writer document would be held buffered all the time a user would work on pages below that. This is good for guaranteeing fast re-visualization when scrolling up again, but until then would just block memory. So I added this general mechanism that allows activating flushing timer-based, on Seconds. The default is null seconds, thus deactivated. It should only be used for Primitives that can get expensive, not for all. NOTE: I checked activating for all Primitives to be on the safe side, works. It is now (initially) activated for: - GlowPrimitive2D - GraphicPrimitive2D - MetafilePrimitive2D - ScenePrimitive2D - ShadowPrimitive2D (softShadow) - SoftEdgePrimitive2D - SdrCustomShapePrimitive2D - SdrGrafPrimitive2D These are the usual suspects that may use some memory to buffer their decomposition (for good reasons, each repaint uses it). Other Primitives which may show need to be treated this way can easily be added, just by calling setCallbackSeconds(s) in their constructor. This is true for all Primitives derived from the two classes mentioned above. NOTE: Too short buffering times are *not* useful - e.g. for a expensive-to-be-recreated 3D chart representation this may not pay out, so I chose times in a way that try to respect this. NOTE: This change needs 7397fa7cdfc33f5a079df42e4d6cfa59ae9e062d to work correctly (thanks to sberg for this). Without this the office hangs/does not terminate regularly in trying to destroy the 'TimerManager'. Change-Id: Id4802afcb6d12480bb2935cc1ef67fe443b3b788 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160926 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-12-16cid#1545970 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545957 COPY_INSTEAD_OF_MOVE cid#1545944 COPY_INSTEAD_OF_MOVE cid#1545939 COPY_INSTEAD_OF_MOVE cid#1545931 COPY_INSTEAD_OF_MOVE cid#1545926 COPY_INSTEAD_OF_MOVE cid#1545909 COPY_INSTEAD_OF_MOVE cid#1545899 COPY_INSTEAD_OF_MOVE cid#1545896 COPY_INSTEAD_OF_MOVE cid#1545894 COPY_INSTEAD_OF_MOVE cid#1545858 COPY_INSTEAD_OF_MOVE cid#1545823 COPY_INSTEAD_OF_MOVE cid#1545820 COPY_INSTEAD_OF_MOVE cid#1545819 COPY_INSTEAD_OF_MOVE cid#1545772 COPY_INSTEAD_OF_MOVE cid#1545749 COPY_INSTEAD_OF_MOVE cid#1545743 COPY_INSTEAD_OF_MOVE cid#1545739 COPY_INSTEAD_OF_MOVE cid#1545635 COPY_INSTEAD_OF_MOVE cid#1545603 COPY_INSTEAD_OF_MOVE cid#1545602 COPY_INSTEAD_OF_MOVE cid#1545592 COPY_INSTEAD_OF_MOVE cid#1545544 COPY_INSTEAD_OF_MOVE cid#1545532 COPY_INSTEAD_OF_MOVE cid#1545520 COPY_INSTEAD_OF_MOVE cid#1545512 COPY_INSTEAD_OF_MOVE cid#1545490 COPY_INSTEAD_OF_MOVE cid#1545483 COPY_INSTEAD_OF_MOVE cid#1545467 COPY_INSTEAD_OF_MOVE cid#1545461 COPY_INSTEAD_OF_MOVE cid#1545458 COPY_INSTEAD_OF_MOVE cid#1545428 COPY_INSTEAD_OF_MOVE cid#1545394 COPY_INSTEAD_OF_MOVE cid#1545385 COPY_INSTEAD_OF_MOVE cid#1545383 COPY_INSTEAD_OF_MOVE cid#1545366 COPY_INSTEAD_OF_MOVE cid#1545357 COPY_INSTEAD_OF_MOVE Change-Id: I76224326977b4067b94ca3176cad1ca6de17930a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160847 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-16cid#1546456 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1546450 COPY_INSTEAD_OF_MOVE cid#1546430 COPY_INSTEAD_OF_MOVE cid#1546401 COPY_INSTEAD_OF_MOVE cid#1546313 COPY_INSTEAD_OF_MOVE cid#1546302 COPY_INSTEAD_OF_MOVE cid#1546301 COPY_INSTEAD_OF_MOVE cid#1546299 COPY_INSTEAD_OF_MOVE cid#1546280 COPY_INSTEAD_OF_MOVE cid#1546233 COPY_INSTEAD_OF_MOVE cid#1546217 COPY_INSTEAD_OF_MOVE cid#1546215 COPY_INSTEAD_OF_MOVE cid#1546204 COPY_INSTEAD_OF_MOVE Change-Id: Iaab419509ad4a0bea9cae3665723af0e99c60ee4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160849 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-14cid#1545211 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545218 COPY_INSTEAD_OF_MOVE cid#1545232 COPY_INSTEAD_OF_MOVE cid#1545243 COPY_INSTEAD_OF_MOVE cid#1545246 COPY_INSTEAD_OF_MOVE cid#1545251 COPY_INSTEAD_OF_MOVE cid#1545260 COPY_INSTEAD_OF_MOVE cid#1545261 COPY_INSTEAD_OF_MOVE cid#1545276 COPY_INSTEAD_OF_MOVE cid#1545295 COPY_INSTEAD_OF_MOVE cid#1545297 COPY_INSTEAD_OF_MOVE cid#1545301 COPY_INSTEAD_OF_MOVE cid#1545302 COPY_INSTEAD_OF_MOVE Change-Id: I97ba935a4a2b8715b55ebbf6e853a66260b2eb90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160686 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>