summaryrefslogtreecommitdiff
path: root/drawinglayer
AgeCommit message (Collapse)Author
2020-03-12tdf#124424 Corrections at SvgGradientHelper for EMF+Armin Le Grand
Change-Id: Ibda3568887de5df2bc45a9bc8cb424ba7658a768 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90382 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-03-11tdf#124424 Enhanced SvgGradientHelper for EMF+Armin Le Grand
Added support for repeat modes in GDI+ support and saw that the SVG primitive gradient helpers are not capable to support these completely, so had to do some quite complex adaptions which OTOH will be useful for more complex gradients anyways Change-Id: Ib9a9e4a55115834a4fb00300b05abe17ae36d105 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90329 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2020-03-09get rid of ImplPrimitive2DIDBlock in polypolygonprimitive2d.cxxTomaž Vajngerl
Change-Id: I052f5823a4b040c477995f7f64787121f510e97d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90195 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-03-09Fix typoAndrea Gelmini
Change-Id: I988f7c11560128bb5b6aeb8931b574226a91e3af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90225 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-03-09drawinglayer: move getRandomColorRange to be private to GeoTexSvxTomaž Vajngerl
Change-Id: I9b306277a67b793ffd065d40446909ac59da0641 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90190 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-03-07clean-up namespaces viewinformation2d.{cxx,hxx}Tomaž Vajngerl
Change-Id: Ib9fb6e66402187fd2d3461af9b8c0ec7c4b16e95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90149 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-03-07remove viewinformation2d.{cxx,hxx} from clang-format blacklistTomaž Vajngerl
Change-Id: I48db10a10157db11cc4de6b9ec4b66e6d3e3c444 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90148 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-03-07convert static functions for property names to constexpr consts.Tomaž Vajngerl
Change-Id: I9ae41a8f539c270f49b1e8a1a7b0ae443a046c52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90147 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-03-06cid#1460477 Result is not floating-pointCaolán McNamara
warnings is about aRange.getMinX()-nRadius/2 " CID 1460477 (#1 of 1): Result is not floating-point (UNINTENDED_INTEGER_DIVISION) integer_division: Dividing integer expressions 5 and 2, and then converting the integer quotient to type double. Any remainder, or fractional part of the quotient, is ignored. To compute and use a non-integer quotient, change or cast either operand to type double. If integer division is intended, consider indicating that by casting the result to type int " Change-Id: I600d909c52b9e86f5193806d42cfd0421d8fc2cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90132 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-03-06tdf#124848 partial refactor hairline logicArmin Le Grand
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-03-03tdf#101181 Implement glow effect on shapesTamas Bunth
Glow effect is a color-blurred outline outside of the shape. In ooxml document it is specified with the <a:glow> element. The commit contains the following: - Add support for importing and exporting <a:glow> from ooxml documents. - Assign new properties to XShape which stores glow-related attributes. - A new 2D primitive is introduced in module 'drawinglayer' which is responsible for representing the glow primitive which is to be rendered. + A glow primitive is a clone of the original shape which has been scaled up slightly and a new color has been assigned to it. The radius of the glow effect and the color is defined in the <a:glow> element being imported. - A blur algorithm is introduced in module 'vcl', which is called during rendering the primitive. + The blur algorithm works on a bitmap. + Since the algorithm is CPU-intensive, the result is cached in the processor and it is recalculated only if needed. - Add support for importing and exporting glow effect to ODF format. For that, new attributes of element <style:graphic-properties> has been added: + loext:glow, which can have the values "visible" or "hidden" + loext:glow-radius: which holds the radius of the glow effect in cm. + loext:glow-color: holds the color of the glow effect - Tests have been added to assert properties after pptx import and export. Change-Id: I836aeb5e0f24e2c8d5725834c8c0f98083bc82e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89125 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2020-02-17tdf#129675: This should be EmfPlusPenDataDashedLineXisco Fauli
else if (pen->penDataFlags & 0x00000100) was changed to else if (pen->penDataFlags & EmfPlusPenDataMiterLimit) where EmfPlusPenDataMiterLimit = 0x00000010 See https://bugs.documentfoundation.org/show_bug.cgi?id=129675#c20 Regression from 1bd303a4c38a1bc04c3cf7bf0e7a44ac0fdb209d Change-Id: I01ba4272aaa665a2fb0ab7ce9c05bb882db77d3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88878 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-11remove graphicprimitive2d.{cxx,hxx} from clang-format blacklistTomaž Vajngerl
Change-Id: Ice9a6813743e4238d28d6007bb0092c69685a9fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88241 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-02-09Fix typoAndrea Gelmini
Change-Id: Ic81a620a8a2ac4bb6ab710f57d68dd2b9faa1ecc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88308 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-02-07tdf#130478 Enhance Dashed line drawing on all systemsArmin Le Grand (Collabora)
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>
2020-02-03remove bitmapprimitive2d.{cxx,hxx} from clang-format blacklistTomaž Vajngerl
Change-Id: I9d9d7cd8bba489c71a5c1ac0b23755d572696e10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87904 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-02-01make update_pch also consider files in <module>/src/**/incLuboš Luňák
With --enable-pch=full there's not much difference between a "public" header in <module>/inc and a private one in <module>/src/somewhere/inc . And since the script searches recursively, this apparently helps to find even more headers for lower pch levels. Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-01-31clang-tidy modernize-concat-nested-namespaceNoel Grandin
Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-31new loplugin:namespaceindentationNoel Grandin
check indentation of braces in namespace decls, and the comments that often appear with them. This is my penance for messing up the indentation with clang-tidy-modernize-namespaces. As such I have limited it to new-style namespaces for now, and the check is off by default. Change-Id: I4db7f10a81c79bc0eece8f8e3ee564da8bc7f168 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-28New loplugin:unsignedcompareStephan Bergmann
"Find explicit casts from signed to unsigned integer in comparison against unsigned integer, where the cast is presumably used to avoid warnings about signed vs. unsigned comparisons, and could thus be replaced with o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx) o3tl::make_unsigned requires its argument to be non-negative, and there is a chance that some original code like static_cast<sal_uInt32>(n) >= c used the explicit cast to actually force a (potentially negative) value of sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the cast to avoid a false "signed vs. unsigned comparison" warning in a case where n is known to be non-negative. It appears that restricting this plugin to non- equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=) is a useful heuristic to avoid such false positives. The only remainging false positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast from sal_Int32 to sal_uInt32". But which of course does not mean that there were no further false positivies that I missed. So this commit may accidentally introduce some false hits of the assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan --enable-dbgutil) `make check && make screenshot`. It is by design that o3tl::make_unsigned only accepts signed integer parameter types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in include/oox/helper/helper.hxx is used with both signed and unsigned types, so needs a little oox::detail::make_unsigned helper function for now. (The ultimate fix being to get rid of the macro in the first place.) Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-24loplugin:makeshared in drawinglayer..fpickerNoel Grandin
Change-Id: Ib20fec3a7b6bfe2f94c6f5f2f9fa0be6f7c21e97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87320 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-20clang-tidy modernize-concat-nested-namespace in drawinglayerNoel Grandin
Change-Id: If2644743ab0d9b78d42d1d2fe6fa22c83472d2c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87065 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15tweak GetBitmap methods in BitmapExNoel Grandin
so we return a const& for the normal case, just like other methods, which reduces copying. This revealed that CreateDisplayBitmap in Bitmap can be const. Change-Id: I9f9b9ff0c52d7e95eaae62af152218be8847dd63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-09Improve loplugin:redundantcast for sal_Int... vs. ::sal_Int...Stephan Bergmann
Change-Id: I1548a76fdc03afee68f1e5c01bc665e616f2edf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86501 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-07Fix typoAndrea Gelmini
Change-Id: Icccda9c310153e6e1d1696ab094afc3a894d4075 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86298 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-01-07Fix typoAndrea Gelmini
Change-Id: I9646220221d3efe7bcd99253245a1044dbed7d40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86299 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-01-06tdf#124176: Use pragma once instead of include guardsElzem Atay
Change-Id: I9f8637ba0bf34fa2a9f0778db42249775a75636a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86219 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-04cid#1456609 Operands don't affect resultCaolán McNamara
2.2.2.37 EmfPlusPointR Object has... "X (variable) This value MUST be specified by either an EmfPlusInteger7 object or an EmfPlusInteger15 object." and the same for Y. where variable is variable length. I think ReadInt32 isn't the right choice here and we need to read either one or two bytes, using the highbit of the first byte to determine if we need to read another byte. Change-Id: I60c0687403ff58dc393bd55a22f37c89357f60c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86207 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2020-01-04drawinglayer: extract classes from baseprimitive2d.hxx to own filesTomaž Vajngerl
This extracts Primitive2DContainer class to its own file, common typedefs for PrimitiveReference, Primitive2DSequence to own file CommonTypes.hxx, some commonly used and independent functions to Tools.hxx. But for not BufferedDecompositionPrimitive2D class is left as it is. Change-Id: Ia55bafd32fb95eba945d091e2c2ae89b160140d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86086 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-01-03cid#1456603 Uninitialized scalar fieldCaolán McNamara
Change-Id: Ic4d93a07bb42bbbf3370bd13e3425b0ecbb46e5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86179 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2020-01-03drawinglayer: simplify namespaces in BasePrimitive filesTomaž Vajngerl
Non-functional change Change-Id: I2ef0012274a0ad3b6e576eeab1fa923ef7bd8b6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86079 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-01-01drawinglayer: clang-format BasePrimitive2D + remove from blacklistTomaž Vajngerl
No functional change was made, only formatting of the code. The code was formatted with clang-format and moves the files baseprimitve2d.{cxx,hxx} out of blacklist so it will be auto formatted with every change from now on. Change-Id: If49ec94f91e58825f7aa94dc54cff8374467aa30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86078 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-12-28drawinglayer: improve logging for PenDataCompoundLine recordChris Sherlock
Change-Id: Ibc89724ceb52d5ad964767e844c4807d85f639c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84839 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-27tdf#125901: apply color modifiers when drawing hatchAndrés Maldonado
With this fix, the shadow of a shape with a Hatching fill is no longer the same color as the hatching (in full screen mode) Change-Id: I979866e748b5caf2ccafc8a6084ffdb46bc8122c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/73964 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-26use more TOOLS_WARN_EXCEPTIONNoel Grandin
so we get more useful log messages when stuff goes wrong Change-Id: Ia55db7ab1a4d79b0f281673fbbb06c61745fa89e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85829 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-23drawinglayer: rename PenDataNonCenter to PenAlignment, use PenAlignmentToStringChris Sherlock
Change-Id: I700f1b164e065b42928b05a4ead493c8ce2c57c2 Reviewed-on: https://gerrit.libreoffice.org/84838 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-23drawinglayer: read EmfPlusPointR points in EmfPlusPath recordChris Sherlock
Change-Id: Iecb0fbd85fd5ceb1d9d9904a6a5482385f8d8622 Reviewed-on: https://gerrit.libreoffice.org/84842 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-23drawinglayer: improve logging - DashedLineCapTypeToString()Chris Sherlock
Change-Id: I9d7250980b833b8f45bef337c83b3592ca52ae3c Reviewed-on: https://gerrit.libreoffice.org/84837 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-22drawinglayer: improve logging - LineJoinTypeToString()Chris Sherlock
Change-Id: Ib6ae6350fe61b3c0d787ad19ff55baa6487d63da Reviewed-on: https://gerrit.libreoffice.org/84835 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-22drawinglayer: improve logging - LineCapTypeToString()Chris Sherlock
Change-Id: If8314cab56a44b6045501490ed027f8c88bd6619 Reviewed-on: https://gerrit.libreoffice.org/84834 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-20drawinglayer: better logging for brushes in EmfPlusRecordTypeDrawStringChris Sherlock
Change-Id: I8ac039fd81767a52593721f211f3887276230ccf Reviewed-on: https://gerrit.libreoffice.org/84841 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-20drawinglayer: improve pen object loggingChris Sherlock
Change-Id: Iaae081ddee8097346000b7c2d987a2321d5e98cd Reviewed-on: https://gerrit.libreoffice.org/84833 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-20drawinglayer: improve more EMF+ loggingChris Sherlock
- Fixed logging of objects - Fixed indenting in log statements Change-Id: If29dc2a0d781f9d4c3fd2c810aa29fe607f0a9c9 Reviewed-on: https://gerrit.libreoffice.org/84467 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-19tdf#129188 drawinglayer: implement EMF+ SetTextContrastChris Sherlock
Change-Id: I5e249d5ba85df020ab90c6e543c0d8aefe0b572f Reviewed-on: https://gerrit.libreoffice.org/84455 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-12-19Fix typoAndrea Gelmini
Change-Id: If8c7f4476a948de40577f7c489e586870cb56edd Reviewed-on: https://gerrit.libreoffice.org/85484 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-19Fix typoAndrea Gelmini
Change-Id: I6e533b12d41b605207ef2bc83d93821f63f649af Reviewed-on: https://gerrit.libreoffice.org/85485 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-19sal_Char->char in desktop..dtransNoel Grandin
Change-Id: I6ad7d6acf081c16f904eb1b2506b545a88046c48 Reviewed-on: https://gerrit.libreoffice.org/85470 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-18Fix debug build after 7732444c5d4e79ae0218932afe85bcc4b56a00a4Mike Kaganski
UnitTypeToString was defined static in emfphelperdata.cxx, and was absent in any header included in emfpfont.cxx, so it's unclear how could it pass all the build tests. Change-Id: I87f966d3cde5d04ab3d364ee0d583adbdc2cc2c0 Reviewed-on: https://gerrit.libreoffice.org/85355 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-12-18tdf#129459 drawinglayer: fill shapes with solid color brushChris Sherlock
EMF+ shapes were not filling when the brush style is a solid color. This patch fixes this issue. Change-Id: I6a2b12e514af9a85f50198dceee642fac8df2f1b Reviewed-on: https://gerrit.libreoffice.org/85343 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-18drawinglayer: improve logging for fontsChris Sherlock
Change-Id: I5b430360894dc1738445820679ceaf09edfeef55 Reviewed-on: https://gerrit.libreoffice.org/84840 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>