summaryrefslogtreecommitdiff
path: root/drawinglayer
AgeCommit message (Collapse)Author
2021-07-31drawinglayer: extract Prop. Value conversion from ViewInformation2DTomaž Vajngerl
ViewInformation2D doesn't need to know anything about the Sequence of PropertyValue that is used for parameters when constructing it through UNO API. This can be done outside of ViewInfromation2D and it doesn't need to be responsible for that internally inside the ViewInformation2D. With this we get ViewInformation2D, which is much simpler and isn't prone to YAGNI. Change-Id: I3836237a1d26e38145b52136c3204931ae7c6b79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119721 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-07-31drawinglayer: remove extendedInformation from ViewInformation2DTomaž Vajngerl
We actually never use extended information when normally using the ViewInformation2D. The exception here is when we construct it from property values, where the unknown property values are then stored into the extended information sequence and then later reconstructed when we convert it back to a sequence of property values. Just for that case we don't neeed to expose the extended information to the outside and create it, as that is then a implementation detail for the UNO use case. I am also not convinced we need it when creating ViewInformation2D with the sequence of property values - it certantly not expected that we need to preserve the property values at all, but that is something that needs to be checked. Change-Id: I3b8d533cd412aac8b89ca2921738d6487be5cf45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119720 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-07-30convert TextAlign to scoped enumCaolán McNamara
Change-Id: Id2c466eacb44f0ea6adba75a0ac0be8be8e7ed4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119682 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-25use officecfg for drawing optionsNoel Grandin
Change-Id: Idba40d9816f29c0e4bc4a468b8c0a2cbb74d09d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119481 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-22flatten vcl::LazyDeleteNoel Grandin
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-13EMF+ tdf#142941 Fixes SrcRect implementation in DrawImage recordBartosz Kosiorek
Change-Id: Ice82518d50c50fa6eff8bbcc111fcf287d34d77c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118363 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-07-03Purge out when safe rtl::math ( isValidArcArg / sin / cos )BaiXiaochun
/** If a value is a valid argument for sin(), cos(), tan(). IEEE 754 specifies that absolute values up to 2^64 (=1.844e19) for the radian must be supported by trigonometric functions. Unfortunately, at least on x86 architectures, the FPU doesn't generate an error pattern for values >2^64 but produces erroneous results instead and sets only the "invalid operation" (IM) flag in the status word :-( Thus the application has to handle it itself. */ chart2/source/tools/RelativePositionHelper.cxx Function name: RelativePositionHelper::getCenterOfAnchoredObject From here: suppose it's related to the orientation of the chart << 2^64 chart2/source/view/main/LabelPositionHelper.cxx LabelPositionHelper::LabelPositionHelper Suppose: setup label position. There won't be angles grater than 360º. chart2/source/view/main/PlottingPositionHelper.cxx PolarPlottingPositionHelper::transformUnitCircleToScene Suppose: maybe disc chart orientation? Internal angle should be safe. chart2/source/view/main/ShapeFactory.cxx ShapeFactory::getSizeAfterRotation Suppose: rotate shape Internal angle should be safe. drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx Constant 100% safe sc/source/core/data/documen4.cxx bool ScDocument::Solver Suppose: the tangent is being used as numerical derivative (Regula falsi algorithm) So no impossible angles scaddins/source/analysis/bessel.cxx Filtered it out as bad imput Change-Id: Ib348cca6ce13263d087b6731f93f58d8a15cc725 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118193 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2021-07-03EMF+ tdf#142941 Fixes for SrcRect in DrawImagePointsBartosz Kosiorek
The SrcRect could be specified outside of source bitmap. In such cases the Destination bitmap should be displayed as shifted (eg. if position is negative), and scaled properly. Change-Id: Ied6d339703999faaae061802ef6a28e190d5a176 Change-Id: Ia9772ced282684c2c94a261d97d30b53921d6171 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118345 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-07-02Fix code style for primitive2dxmldump.cxxBartosz Kosiorek
Because the primitive2dxmldump.cxx file has already code style similar to desired (76 lines out of 631 need mofication), with this commit I enabled clang-format on drawinglayer/source/tools/primitive2dxmldump.cxx It will allow to keep the same code style in all LO components. Change-Id: I76fbd704ab51fd685bf400d71d24a7abe48049d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118247 Tested-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-07-01EMF+ tdf#142995 tdf#142997 tdf#143076 Add alignment support for DrawStringBartosz Kosiorek
With this commit, real size of the text is used to make proper horizontal alignment. Additionally vertical alignment is added and fix for Center alignment was applied Change-Id: I17d9fd7de7f00f5e69f99c5b09061eb6059be67e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117794 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-23EMF+ tdf#142975 Add brush support to DrawString recordBartosz Kosiorek
Change-Id: Icfcb4199dcd755fb20e14a8166571b6d6e763f2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117671 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-23move BufferedDecompositionPrimitive2D impl. into its own fileTomaž Vajngerl
Change-Id: I180ed5378765237f69ccf721448dd799df2b457b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117666 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-21drawinglayer: put BufferedDecompositionPrimitive2D in its own fileTomaž Vajngerl
And fix includes all over the place... Change-Id: I6e2696bbeeac6ab7467cac70545fa7209aa981a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117528 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-20drawinglayer: remove ImplPrimitive2DIDBlock macroTomaž Vajngerl
We can just implement the simple getPrimitive2DID method in all primitives. The ImplPrimitive2DIDBlock macro doesn't save us anything. Change-Id: I02f44d4891d7b340220890bf52a7ebfc8e41850a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117509 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-17EMF+ WMF Update the variable names and add additional TODO warningsBartosz Kosiorek
Change-Id: I78b05fe3c293494195bdd37c3030147b1f21228e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117148 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-11"drawinglayer" -> "drawinglayer.emf" log area for some emf codeLuboš Luňák
Change-Id: I83fa2d40225f83b82cea7f8934f4afdee181abe3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117000 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-06-09WMF tdf#55058 tdf#142722 Add implementation of BitBlt and StretchBltBartosz Kosiorek
With previous implementation, only BitBlt record with 1 bit color depth was supported and StretchBlt was not implemented at all. With this commit the support for 1 bit, 24 bit and 32 bit, for both BitBlt and StretchBlt were added. Change-Id: I061b2beae8c2f143ddff9c8c8bb64bf52f4cf502 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116873 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-05WMF Change the sign of read fields in BITBLT and DIB recordsBartosz Kosiorek
Additionally the names of variables were improved, and additional checks were added for unsupported cases Change-Id: Id84ef1218c5c2a40c8d01f2d40857d892badbb9f Change-Id: I1b8571d0a627827bc1e67c2bfc6c1932d58c5233 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116744 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-04sw HTML export: fix pixel size of shapesMiklos Vajna
- the twips logic size was set, but it was consumed as mm100 logic size, so the pixel size was about half of the correct one - the HTML export didn't write a logic size ("CSS pixels size") for shapes Change-Id: I37f6b4acde9d1298fae81f9975e9db95485631ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116691 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-06-02fix: extend the primitive dump, with information about line cap and jointBartosz Kosiorek
Change-Id: I5c67d360236ec67c41bc45a9018f0ff0d0ec1d3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116611 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-05-30no need to allocate this separatelyNoel Grandin
Change-Id: I78260d3e6ad8ce96db4353fede18d5e3a6808402 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116400 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-21properly draw only parts of FillGradientPrimitive2D (tdf#139000)Luboš Luňák
The size of the whole gradient is getDefinitionRange(), while getOutputRange() gives the area of it to draw. Change-Id: I85dd7fe51bcc9c332a6fb0e6748d5ac89266b910 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115923 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-05-18loplugin:unusedfieldsNoel Grandin
Change-Id: Ib574403a7f7f8b11c6263c9c19ec6b65c8374ddd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115753 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-11drawinglayer: move converter.hxx to public includeTomaž Vajngerl
Change-Id: I71a15c532ba161d69585bd47631b3a8e2f6ddd66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115304 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-06add a unittest for impress drawing a dotted line in tdf#136957Luboš Luňák
Change-Id: Icabe039df29e9b3b9155656863120e3df7ef650b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115118 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-05-01fix dashed line info conversion for metafile (tdf#136957)Luboš Luňák
My previous change had two problems: - It didn't handle correctly the case when something repeated, such as dash-dot-dot. - The rounding when setting lengths was a left-over from my first attempt when LineInfo used integers and not floats. Change-Id: I914241590b1ddec22df04c05dfe65e76e921ee52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114940 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-04-29do not apply line dashing in drawinglayer (tdf#136957)Luboš Luňák
basegfx::utils::applyLineDashing() is not as good as the actual VCL backend dashing, and there are some rounding errors because of all the canvas transformation matrices or whatever, which leads to the drawing problem. So use LineInfo to carry the dashing information. As a part of this change, also make LineInfo use doubles instead of ints. The use of transformation matrices means that the values may be fractional and less than one. Change-Id: Ia5ac7d266cab344b7137052c81fbd96c1ce28003 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114710 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-04-29remove support for BITMASK in vcl backendsNoel Grandin
Rather use a proper alpha channel if we need transparency. This is another small step towards merged alpha in our vcl layer. I suspect the intent in a lot of this code was to save memory. Which have been a thing way back then, but these days our backends mostly end up doing a copy-and-convert to a real alpha channel anyway, so the existing code is actually now a pessimisation. Change-Id: I4a2bcbb2f76b841f05bc00580f364492829c69de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114808 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-28createPixelProcessor2DFromOutputDevice won't return nullCaolán McNamara
nor will createProcessor2DFromOutputDevice Change-Id: I1e0359ef2f94eeaf2da9a89d9e9dfb615587d3da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114814 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-27loplugin:moveoptNoel Grandin
An attempt that did not find anything convincing enough to finish it up and make it permanently active. So just leave it in /store for now. Change-Id: I1750e177655a4a510da100f880ba81bf762be277 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114742 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-26drop mask from BitmapExNoel Grandin
So that we have fewer cases to deal with when we transition to 32-bit bitmaps. (*) rename maMask to maAlphaMask, since now it is only being used for alpha duties. (*) drop mbAlpha and mbTransparent to simplify state management, the only thing we need to check for alpha is if maAlphaMask is non-empty. Change-Id: I06252e38e950e846a94b4c2ba8ea763be17801fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111679 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-17loplugin:constantparamNoel Grandin
Change-Id: I1d518bef47c838d03d8526a6a8fffd36d2ee68d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-12update PCHsCaolán McNamara
Change-Id: Id3728ac0011d3deed7e56081e3a854c7fa5336f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113959 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-08update PCHsLuboš Luňák
Change-Id: Ia9d04447f927e270a55500e7f35723a729bc01dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113801 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein
Previously, all of the README files have been renamed to README.md and now, the contents of these files were changed to use Markdown format. Other than format inconsistency, some README.md files lacked information about modules, or were out of date. By using LibreOffice / OpenOffice wiki and other documentation websites, these files were updated. Now every README.md file has a title, and some description. The top-level README.md file is changed to add links to the modules. The result of processing the Markdown format README.md files can be seen at: https://docs.libreoffice.org/ Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-04-06update pchesCaolán McNamara
Change-Id: I835c8fcc237ece5cf9d7a3b261645139d022e9b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113652 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-03tdf#37281 tdf#45820 tdf#48916 tdf#55058 EMF Implement complex clippingBartosz Kosiorek
As the visual glitches were resolved with: https://gerrit.libreoffice.org/c/core/+/113423 It is time for enabling complex clipping. Change-Id: I12edc88fc9a55c8deedf3d87faeb50cfe0067a01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113520 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-04-02vcl: remove GetBitCount and GetColorCount from Bitmap{Ex}Tomaž Vajngerl
We can cast the PixelFormat enum to int for the same information and we can use the enum to reduce ambiguity when possible. Change-Id: I6ea648139465568cdeb12e5f5f75c7b609365bf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113188 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-03-28drop operator bool and operator! from Bitmap and BitmapExNoel
IRC chat: <quikee[m]> noelgrandin: doesn't adding operator bool to Bitmap has the same problem as Graphic and the reason why you dropped that commit 7334034ae93b49fc93b5859a3c047a319d138282 "drop Graphic::operator bool" <noelgrandin> quikee[m], hmmm, good point <noelgrandin> maybe I should just drop both operator bool and operator! in favor of IsEmpty <quikee[m]> noelgrandin: I don't remember what the problem is I just remembered we dropped it Graphic :) sure, dropping everything for IsEmpty is probably the best Change-Id: Ieae289cda64f0b8d8fdecd5ea9e6f2bb874ff4cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113163 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-26create operator bool for BitmapNoel
so we can use a more natural syntax than "!!" Change-Id: I8152a0d3ce37115fc83d332a26725ca1d28d959a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113147 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-26vcl: add initializer_list constructor to BitmapPalette and use itTomaž Vajngerl
Change-Id: Ib24266e435765bd5e05193aea5cee61d7a9346b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113133 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-03-25const OUString -> const OUStringLiteralMike Kaganski
Mostly automated rewrite Change-Id: Ie020a083f898bc126b8fb039d4ecb2e687172da1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112965 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein
Renaming all README files for all top level modules to README.md, applying no content change at this stage to be able to track history of the files. These files should be edited to use correct Markdown syntax later. Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-21update pchesCaolán McNamara
Change-Id: I60e61133c305673bb305e41957f5414820c7c358 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112790 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-19silence coverity unchecked return value from library on xmlText* functionsCaolán McNamara
Change-Id: I651abb00d8ae1bdbf758a6a0176fd8912531a585 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112753 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-14loplugin:unusedmethodsNoel
Change-Id: I851eba4ca80eac9ee5896df53fbcd0f5ad125763 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112433 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-13add PixelFormat enum that replaces bit count in Bitmap/BitmapExTomaž Vajngerl
Bit count for the image is a numeric value (sal_uInt16) but only a handful of values make sense - namely 1,4,8,24 and 32. This replaces the numeric value with an enum, which only accepts those values and checks the correct values are used at compile time. Change-Id: I0fc137c62bce3b0d021f05019a1648da628521bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112408 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-03-13update pchesJulien Nabet
Change-Id: Id6dfae9fb97fbe3fc89b9f2e083d7a3d5c1d36d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112411 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-03-11use VCLUnoHelper::GetWindowCaolán McNamara
instead of directly using VCLXWindow Change-Id: I886525169834d24b6c060fb4722e1afda23dbc26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112346 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-10use VCL API rather than manually apply numeric alpha changeLuboš Luňák
Change-Id: I500b3ad3d8229b792b7394a9e1b2f51fa9b1af2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112251 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>