summaryrefslogtreecommitdiff
path: root/vcl/source/outdev/textline.cxx
AgeCommit message (Collapse)AuthorFilesLines
8 daysDrop FRound, and use generalized basegfx::froundMike Kaganski1-2/+2
Change-Id: I7447e649dc3ef4e51242f69c7486a3e84e103d2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166159 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
11 daysUse more o3tl::convertMike Kaganski1-4/+4
Change-Id: I8a3c5d0e1a29219ab27bde75809ca9d8dce7e093 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166059 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-30move IsFuzzing to comphelperCaolán McNamara1-3/+3
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-10-03ofz: Timeout, reduce limitCaolán McNamara1-1/+1
Change-Id: Id14418dc382c0d11554817fc37990e3f3cba3a05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157514 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-07-25Convert internal vcl bitmap formats transparency->alpha (II)Noel Grandin1-2/+2
(Second attempt at landing this) Image formats and graphics APIs use alpha, not transparency, so change our internal formats and data structures to work directly with alpha, so we don't need to modify data before we push it to graphics APIs. Add a couple of new Color constants to make the intention of the vcl code clearer. Notes (*) On macOS, tweaking the logic in CreateWithSalBitmapAndMask to more accurately reflect the requirements of the CGImageCreateWithMask function seems to fix some tests. (*) The vcl code does not properly support gradients with transparency. So the previous code was wrong, and this change is going to result in slightly different wrongness. Change-Id: I9e21c2e98d88ecfdc5f75db13bd1ffff7c38db98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114168 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-23vcl: Drop now unneeded DevicePoint typedefKhaled Hosny1-4/+4
It has been always typedef'd to basegfx::B2DPoint since: commit 5e218b5c51f7d9cd10bd9db832879efca41b9c75 Date: Wed Jan 12 21:19:32 2022 +0000 always use B2DPoint for DevicePoint Change-Id: I9f5202d5a71c77dd79f1759923917c26bf68a9af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154632 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-23vcl: Use GetTextArray() when drawing mnemonicsKhaled Hosny1-2/+0
Instead of using a different function to get the character width, use the same function used for getting the character widths elsewhere. Change-Id: I21428f34bb0f3a60fa17f5e8ecc3420545356337 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154609 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-23vcl: Use double for width in OutputDevice::ImplDrawTextLine()Khaled Hosny1-6/+5
Change-Id: Ia6bde62b20e87d7ce3c15b0e915a0c6ecc02c393 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154607 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-10Revert "tdf#151968: Fix vertical position of RTL spelling wavy line"خالد حسني1-11/+10
This reverts commit 5899b27e71430e490c2d3a6b87ae52c10f383ba7. Reason for revert: tdf#155001 Change-Id: I95d21689a50f6413a7b5c126d6eb6b2c8802fbc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152752 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-05-02ofz#57493 TimeoutCaolán McNamara1-1/+1
Change-Id: I2a61016c771012f23415e753ca91bf254584131a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151293 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-30ofz#57493 TimeoutCaolán McNamara1-1/+1
Change-Id: I7d4776d77385dc46f496b873c75e2be25840f86b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149774 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-05ofz#56551 TimeoutCaolán McNamara1-1/+1
Change-Id: I491ef30362a56bf954233c3bc1e58549f9d2d5f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148286 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-22tdf#151968: Fix vertical position of RTL spelling wavy lineKhaled Hosny1-10/+11
The code was guessing orientation based on the start and end points and mistakenly considered Arabic text to be 180° rotated which ended up raising the wavy line above baseline and covering the RTL text. Use font orientation instead of guessing it. Caching wavy line seems broken with RTL text as well (it was skipped for RTL before because of the wrong guessed orientation, so probably never worked), so we skip it explicitly as well for now. Change-Id: I4b0f5c4d6be2c6e3d33ea79b917b14927374acfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147488 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
2023-02-07ofz#55771 TimeoutCaolán McNamara1-0/+8
Change-Id: If10047bc9da297c70c6f0457680e84e788b7c438 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146644 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-07improve readability of VirtualDevice constructorNoel Grandin1-2/+1
(a) It is not obvious what DeviceFormat::DEFAULT means (b) There are two parameters (each with two states), but only really 2 possible overall states So (1) use more useful names (2) combine the two parameters into one enum Change-Id: Ic0595b39e032cc9e019b88326389d055b977da00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-04ofz#55620 TimeoutCaolán McNamara1-1/+1
Change-Id: I3d18e67a39523e508475b5f8586d92373be4f8b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146552 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-11rename BitmapEx::GetAlpha to GetAlphaMaskNoel Grandin1-1/+1
to ease the reading of code related to an upcoming patch to convert transparency to alpha, since there is already a GetAlpha in Color. Change-Id: I1af0f8f6dd94acfe4673c8556c7aff6c20da3f7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145209 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-16ofz#54334 Timeout on 8192 width/height font and underlineCaolán McNamara1-1/+9
Change-Id: Ib746c28804b0181fe306d53f3f16f70cc36520b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144318 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-12-01vcl: remove unnecessary includesChris Sherlock1-11/+8
Change-Id: I41cb0b38857ddeef7cb7f82c1b523a9c7fcf2413 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143324 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-11-29SalLayout::mnUnitsPerPixel is always 1Caolán McNamara1-2/+2
since commit 368de904974b18dc5a8d237e046c0ed005f7c85d Date: Thu Nov 24 09:21:56 2016 +0200 Kill PspFontLayout removed the last SetUnitsPerPixel Change-Id: I60db3d9eb4c42f3f0372b5f063a912b7addfde90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143456 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-09-30vcl: Use the same underline sizes for overlinesKhaled Hosny1-1/+1
It makes no since to have overline of different sizes than underlines, and in fonts with big ascenders (like Amiri), we end up calculating much thicker overline than underline. Change-Id: I97e9818c94e815b2eb57813ab22329bc833fd34c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140804 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
2022-04-25ofz#46905 Null-dereferenceCaolán McNamara1-0/+2
Change-Id: I26427ee1e010ce79e40c550459d9f53598570a7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133360 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-04-09no public data members in GlyphItemLuboš Luňák1-1/+1
Change-Id: Ib5911a8ad33aefffa972f583c2b5fc7d42a2b9bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132746 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-01-16tdf#146439 retain precise base start pos when using ResolutionIndependentLayoutCaolán McNamara1-6/+6
Change-Id: I16a585abf4805d87a2eeb4e3e9d9bd9f2697b838 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128472 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-01-12keep positions as DeviceCoordinate within SalLayoutCaolán McNamara1-5/+5
Change-Id: I20bbb0e252ffd09901f587599430e715dbe977b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128300 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19Drop F_PI1800/F_PI18000, and unify deg2rad/rad2deg conversionsMike Kaganski1-2/+2
Change-Id: Ib89b00c3dc8cd440e8a88906eea133becd1cef64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125509 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2021-11-18Drop F_PI180Mike Kaganski1-2/+1
Change-Id: I36783d6fd6f439a71bc46959cd859b48d65ee30f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125449 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-12Resolves tdf#70519 - Make wavy lines depend on zoom factorHeiko Tietze1-3/+1
Solves accessibility issue of too faint spellchecking indicators Change-Id: Ic5bc9e205981e90c8f4ee12aa52dde723da1e7aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125038 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2021-09-28vcl: rename OutDevState to StackChris Sherlock1-3/+3
I have moved the header file to include/vcl/rendercontext as this will eventually be part of the RenderContext split from OutputDevice. State and associated enums have also been moved to the vcl namespace. I have also moved ComplexTextLayoutFlags into the vcl::text namespace. Change-Id: I0abbf560e75b45a272854b267e948c240cd69091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121524 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-15No need to check for x = 0 in atan2 hereMike Kaganski1-2/+1
The guarantee is that either x or y argument is non-0. It was this way ever since "initial import" commit 8ab086b6cc054501bfbf7ef6fa509c393691e860. Change-Id: I2f5ccbbc9a4f00aafef151ef3dd008eddeef0e78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122114 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-15Related: tdf#143831 the svp aliased case ends up overly washed outCaolán McNamara1-1/+11
as seen under gtk3 Change-Id: I0bcea49f8c24e9f773b357483cea78e58bb07e15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122099 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-15Related: tdf#143831 add guards to ImplDrawWaveLineBezierCaolán McNamara1-0/+14
seeing as the mpAlphaVDev ImplDrawWaveLineBezier sub call is not protected otherwise now that it can be called from the outer case Change-Id: I66f0fea134aa177bd7493720670c4724311752a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122098 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-15tdf#143831 fix black background appearing on spellchecking wavy linesCaolán McNamara1-4/+5
SetBackground() doesn't fill the outputdevice automatically, Erase() has to be called to do that. Then the way the horrible transparency split 24bit rgb + 8bit alpha thing works is that the same thing has to be drawn into the 24bit surface and the 8bit surface with black used as the line/fill color in the 8bit surface. OutputDevice::SetAntialiasing only mirrors its arg to the secondary mpAlphaVDev if it exists, and it doesn't exist until the size is set so move that call down a bit (this is probably another preexisting bug maybe worth following up on to set that when mpAlphaVDev is created) Change-Id: I39f71def6b51d78746b41ed2e30a36dc150370bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122097 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-02tdf#74702 vcl: make helper funcs for ImplDrawWaveLine() and ImplDrawWavePixel()Chris Sherlock1-39/+56
Unit tests written for Printer and OutputDevice, note that I might have uncovered a bug. Change-Id: Ic8e6e02ce0df349fc6fb6a3334105c1e6dfa3f36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113563 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-24vcl: create drawmode functionsChris Sherlock1-50/+3
Change-Id: I3cb0325dc16db84ad58de28aa9110e9c7a0b9697 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115372 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-10use o3tl::hash_combineCaolán McNamara1-3/+3
Change-Id: I0d6cd4313652669939cdbdc8e4ae7c62dae3022b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120280 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-22flatten vcl::LazyDeleteNoel Grandin1-1/+1
we can allocate the stored value in-line and avoid some pointer-chasing Change-Id: I828814b127923cdcec1bf57b3b64dffab4cffaaf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119298 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-07Cache a static wavy line as bitmap and reuse itmerttumer1-3/+100
DrawWaveLine is cpu costly so render it as big as possible so we can only crop it Edit: 1) Moved the Cache class to textline.cxx file as it is local to that 2) Provided a custom hash method for the unordered_map to avoid double hashing the key. Used boost:hash_combine for hashing. 3) changed unordered_map to o3tl::lru_map Change-Id: I0ab191f7bb72ccd5074c78858de9831c1a462b7b Signed-off-by: merttumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117362 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117969 Tested-by: Jenkins
2021-03-21cid#1473858 silence bogus Dereference after null checkCaolán McNamara1-0/+1
Change-Id: Iec344c1194e34538bedd5aa5bb8df3e6b233dfee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112850 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-01DrawPolyLine/DrawPolyPolygon never called with null OutputDevice*Caolán McNamara1-1/+1
so we can remove some redundant nullptr checks, maybe making this a tiny less confusing Change-Id: Icba4ea1edd5b4883a294f52e0facaab631d94aed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106860 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-28drawOutDevDirect always passed a non-null OutputDevice*Caolán McNamara1-9/+9
likewise: DrawOutDevDirectProcess ImplDrawWavePixel DrawOutDevDirectCheck and various members of SalGraphics dropping redundant nullptr checks Change-Id: Iaa1ab7c8a605361a7c9cce0aeee974eec9ff246e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106788 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-21new tools::Degree10 strong typedefNoel Grandin1-5/+5
partly to flush some use of "long" out the codebase, but also to make it obvious which units are being used for angle values. Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-19use tools::Long in vclNoel1-86/+86
Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-04loplugin:flatten in vclNoel Grandin1-170/+170
Change-Id: I271cc67ecf34acbf0edbda960e33315fb6a1f9dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100041 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-05fix line width in DrawPolyLine() with matrix (tdf#132498)Luboš Luňák1-2/+1
For backends that do the object-to-device coordinates transformation directly, it's necessary to also convert the size of line width. But simply multiplying it with the matrix can also rotate the line width "vector", making it e.g. negative. So don't use just the X coordinate, use vector length for the transformation, which is ok. In fact it doesn't even make sense to treat width as a vector, because a width simply is not a vector (and for this reason it's also not actually used). Change-Id: I1241c9cb29155df105170d568a879ebc32b11a5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93203 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins
2020-03-06tdf#124848 partial refactor hairline logicArmin Le Grand1-1/+2
With the handover of transformations to line draw calls it is no longer feasible to detect and prepare LineWidth stuff when the old office definition for hairlnes is used, a line width of zero. It was managed in the system-independent part, but now may have to be prepared in logic and not discrete (pixel) coordinates. To do so, find and cleanup all places where 1/1.0 was used as hairline line width. Adapt all seven graphic subsystems to handle the line width == 0/0.0 cases accordingly. Test as good as possible. Change-Id: I2badc045474dcd51612e50597b8406a55d9dc863 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90057 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-02-07tdf#130478 Enhance Dashed line drawing on all systemsArmin Le Grand (Collabora)1-3/+10
For more info and explanation including state of process information and discussion(s) see task please. Adding corrections for gerrit build Change-Id: Ie10fb8093a86459dee80db5ab4355b47e46c1f8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88130 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2019-08-28tdf#42949 Fix IWYU warnings in vcl/source/[o-w]*/Gabor Kelemen1-4/+0
Plus a quick recheck for files in vcl/source/[a-g]*/ Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ia1ae951047be2e034da5f3b0422613ddb0a091ad Reviewed-on: https://gerrit.libreoffice.org/78065 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-07-01Improve the looks of a wave line by draw it with bezier curvesTomaž Vajngerl1-22/+34
This adds drawing the wave line (typically used to underline the wrongly spelled words) with bezier curves. Previously the wave lines were drawn with drawing pixels, which didn't look that good, especially on HiDPI display, so the looks of wave lines now is therefor much better. The creation of the wave line as a polygon has been added to the basegfx module, so it can be reused if needed. In addition, everytime we draw the waveline, we have to enable antialiasing, to have a much better quality of the curves. By default the antialiasing is disabled for some reason. This also adds ScopedStates.hxx file which currently includes ScopedAntialiasing, which sets the antialiasing to a certain state for the time the object is in scope, and then sets it back to the original state. Change-Id: I4b866fc5d69725eb7f6f78a1acf4176b1205aa73 Reviewed-on: https://gerrit.libreoffice.org/74810 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-06-05Linguistic: new underlining styles for grammar checkersOlivier R1-3/+4
This patch adds two new underlining styles: - BOLDWAVE: a thicker version of the default WAVE style - BOLD: a thick straight line No default setting changed. It's up to the grammar checkers to specify the underlining style they want. This contribution to LibreOffice is licensed under the MPLv2/LGPLv3+ dual license. modified : include/vcl/outdev.hxx modified : offapi/com/sun/star/text/TextMarkupDescriptor.idl modified : sw/source/core/inc/wrong.hxx modified : sw/source/core/txtnode/fntcache.cxx modified : vcl/source/outdev/textline.cxx modified : vcl/workben/outdevgrind.cxx Change-Id: I5629253905ba40c51cc748a7ceeb84170ef5d94c Reviewed-on: https://gerrit.libreoffice.org/73412 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>