path: root/basegfx/source/polygon/b2dpolypolygontools.cxx
AgeCommit message (Collapse)AuthorFilesLines
2022-02-06tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macroVaibhavMalik41871-1/+1
Change-Id: I4f5258ca5b37e9b1b4237c5d29e4a9e5362fa855 Reviewed-on: Reviewed-by: Arkadiy Illarionov <> Reviewed-by: Mike Kaganski <> Tested-by: Jenkins
2020-04-22tdf#42949 Simplify use of rtl::math::approxEqual in include/basegfx/Gabor Kelemen1-0/+1
Turns out we can save about 500Mb of preprocessor input if we use rtl_math_approxEqual from rtl/math.h instead of its C++ wrapper rtl::math::approxEqual from rtl/math.hxx and manage the fallout accordingly. Before: bin/includebloat.awk | head sum total bytes included (excluding system headers): 19017296671 After: $ bin/includebloat.awk | head sum total bytes included (excluding system headers): 18535432672 Change-Id: I1691171f3a309405a7099882ad9989d147f59118 Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
2020-04-19loplugin:flatten in basegfxNoel Grandin1-14/+14
Change-Id: Ic8bc586e1a4977322dcb371c0fff6411783df9d7 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2020-01-31new loplugin:namespaceindentationNoel Grandin1-2/+2
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: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2020-01-14clang-tidy modernize-concat-nested-namespace in basegfxNoel Grandin1-5/+2
Change-Id: I79b5b135c00b31152ff37de3485dcbb955ca1071 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2019-12-18sal_Char->char in avmedia..basicNoel Grandin1-1/+1
Change-Id: Ied1331d979539ef1183da64c55351b57d24f4a4f Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2019-05-14Revert "drawinglayer: avoid AA for hairline polygons built from ...Miklos Vajna1-18/+0
.. hori/vert lines only" This reverts commit f8b4d371eddd27594d549fb00294c01229a9bd24. Tomaz considers this ugly and it's no longer needed since commit 93abdf39b01bb7b404dc09ef37369a4350fb0d10 (sw lok: assume no windows in SwLayoutFrame::PaintSwFrame(), 2019-05-14). Conflicts: basegfx/test/B2DPolygonTest.cxx Change-Id: Ia9b29921ff3e5d82085e1abf9f39c172357a5e13 Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins
2019-05-09drawinglayer: avoid AA for hairline polygons built from hori/vert lines onlyMiklos Vajna1-0/+18
For one, it seems this was the intention already since commit 85c70f37b56299f6fa02312c0fb73cc55af084ef (CWS-TOOLING: integrate CWS aw063, 2009-03-04): "suppress AntiAliasing for pure horizontal or vertical lines". For another, this fixes the TileCacheTests::testTileWireIDHandling() testcase in online.git, which assumes that the indicators at the corners of the Writer body frame (paragraph marks hidden / default case) can be painted multiple times, producing pixel-by-pixel matching results. But in reality AA breaks that assumption, and we know these indicators are never diagonal lines. Change-Id: Ib74f823165799991296b64cee58ec106dbdcedcf Reviewed-on: Reviewed-by: Miklos Vajna <> Tested-by: Jenkins
2019-02-18tdf#42949 Fix IWYU warnings in basegfx/Gabor Kelemen1-1/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ic8476ddc7805546f2f6f253f282ac976bb3b7bd6 Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
2019-01-11Drop o3tl/clamp.hxx, use C++17 std::clamp insteadStephan Bergmann1-2/+3
Change-Id: I5043c787dcc3b78bc7fdff130564801194e39f46 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2018-12-31cppcheck: Consider using std::count_if algorithm instead of a raw loop.Tóth Attila1-9/+1
Change-Id: I994910cfba1d2ec63f48094f1ef5c52226ecf322 Reviewed-on: Reviewed-by: Tamás Zolnai <> Tested-by: Tamás Zolnai <>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin1-1/+1
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2018-10-15tdf#42949 Fix IWYU warnings in include/basegfx/*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ifd59a5d93cfe7dc232891a681002014cd825035a Reviewed-on: Tested-by: Jenkins Reviewed-by: Miklos Vajna <>
2018-09-09use more range based loopsJochen Nitschke1-82/+44
use references to B2DPolygon where loop index is needed Change-Id: I3b048072bac139e8e451331b832a03a1413bc9eb Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2018-08-17Consolidate: basegfx::clamp -> o3tl::clampStephan Bergmann1-1/+2
Change-Id: Iffd8b0a19d4479b6c70dc834c6f64499e87e01b1 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
2018-04-20loplugin:constantparamNoel Grandin1-3/+2
Change-Id: Ia58d8950b3b9e48bbe9f075b9fe1eed62d9abf0d Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Noel Grandin <>
2018-01-12More loplugin:cstylecast: basegfxStephan Bergmann1-4/+4
auto-rewrite with <> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: Ifa4a6643b41525c962cd6af5776e1bf10bddb71c
2017-11-01loplugin:constantparam in basegfxNoel Grandin1-14/+7
Change-Id: Ieabdd6f8d76cfc2ed75f2ec618def6591a9adc93 Reviewed-on: Reviewed-by: Noel Grandin <> Tested-by: Noel Grandin <>
2017-09-26Rename the basegfx::tools namespace to basegfx::utilsTor Lillqvist1-9/+9
Reduce potential confusion with the global tools namespace. Will hopefully make it possible to remove the annoying initial :: when referring to the global tools namespace. Unless we have even more tools subnamespaces somewhere. Thorsten said it was OK. Change-Id: Id088dfe8f4244cb79df9aa988995b31a1758c996 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Tor Lillqvist <>
2017-05-19loplugin:comparisonwithconstant in accessibility..basegfxNoel Grandin1-3/+3
re-running this plugin on these modules now that sberg has improved the plugin. Change-Id: I1818b1fa540cf62b81219a4f3ed2dcae8ff0e838 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Noel Grandin <>
2017-05-18loplugin:comparisonwithconstant in basegfxNoel Grandin1-4/+4
Change-Id: I6953640a1aa2e58fe2ea6555291c4f4a5271770f Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Noel Grandin <>
2017-02-15Drop :: prefix from std in [a-b]*/Tor Lillqvist1-2/+2
Change-Id: I0422aaf39bbce889c95ed9a81a0784cb03a1badd Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Tor Lillqvist <>
2016-10-11loplugin:constantfunctionNoel Grandin1-5/+0
update the plugin similarly to commit 3ee3b36ae0c064fb5c81268d8d63444309d1b970 Author: Stephan Bergmann <> Date: Fri Oct 7 12:05:49 2016 +0200 loplugin:staticmethods: Don't be fooled by decls starting with macros Change-Id: I98ac3216d5acf89a49a26feb089ae2fd34e6e510 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Noel Grandin <>
2016-10-06rtl::math::approxEqual(value,0.0) never yields true for value!=0.0Eike Rathke1-2/+2
... so replace with a simple value == 0.0 also in other modules than sc. Change-Id: Ie7316505a1cf9c15100114b45d300facceb03b7e Reviewed-on: Reviewed-by: Eike Rathke <> Tested-by: Jenkins <>
2016-07-30tdf#96505 get rid of "long" integer literals 'L'Asela Dasanayaka1-4/+4
Remove L from integer literals in module basegfx all 0L, 1L, and 2L Change-Id: Ia8a0d660033651f6d0a35392b74b67358b639fb3 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Markus Mohrhard <>
2016-03-31tdf#96505 Remove 0L occurences from avmedia and basegfx modulesslideon1-29/+29
No compiler warnings on my machine Change-Id: Ibd303c64f04f6f52272ac19c3069da2f14cb4e9a Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Michael Stahl <>
2016-01-22loplugin:fpcomparison in basegfxNoel Grandin1-3/+3
fix comparing of floating point values Change-Id: I54db66968cb999514747171eed82082612e0cac8 Reviewed-on: Reviewed-by: Armin Le Grand <> Tested-by: Jenkins <>
2016-01-21loplugin: unused return valuesNoel Grandin1-29/+0
Change-Id: I4eb1f0c9245c04058fd5e47046f043f8840a79c7 Reviewed-on: Reviewed-by: Noel Grandin <> Tested-by: Noel Grandin <>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-2/+2
Change-Id: Ib64fc63905cf44a0d32393d52ee587d0aa2d9dfa
2015-10-27loplugin:unusedmethodsNoel Grandin1-18/+0
Change-Id: I73180266c0af98dbd8d29bd3b11850996b94def9 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Thorsten Behrens <>
2015-07-20com::sun::star->css in basegfxNoel Grandin1-13/+13
Change-Id: I27f28e6a09e8bc9e90f0b60a7ac8519b2ab41860 Reviewed-on: Reviewed-by: Noel Grandin <> Tested-by: Noel Grandin <>
2015-06-04convert B2VectorOrientation to scoped enumNoel Grandin1-2/+2
Change-Id: Id7e444bc896ae5d52e5a0bd1b471679c4945afa4
2014-07-06remove unnecessary whitespaces in basegfxMarkus Mohrhard1-4/+0
Change-Id: Ia97fb3895e855e9fb970b0874fc100e2b900a8b7
2014-04-23Revert "Remove unused basegfx::tools::containsOnlyHorizontalAndVerticalEdges"Tor Lillqvist1-0/+18
Is used in vcl/win/source/gdi/salgdi.cxx. This reverts commit 34fa29ed4c0fa73d3e07e62cb6ca2577ee115b35. Conflicts: unusedcode.easy Change-Id: I0ee3c2bc0ec5649045ae415b44482f63da360634
2014-04-22Remove unused basegfx::tools::containsOnlyHorizontalAndVerticalEdgesMiklos Vajna1-18/+0
Change-Id: I8a8b7a5b47cd9e566c1b3154a527c78a8fcbd7df
2014-04-01coverity#984038 Uninitialized scalar variableCaolán McNamara1-1/+1
Change-Id: Ibab4b201d9412e0d32630957d4c85762c28974bc
2014-03-05Revert "remove unused code in basegfx"Noel Grandin1-0/+18
Some of this code is used by Windows. This reverts commit b96724560f119b1b9ab8b5e1ee1759fd9b2db203.
2014-03-05remove unused code in basegfxNoel Grandin1-18/+0
basegfx::tools::containsOnlyHorizontalAndVerticalEdges(basegfx::B2DPolyPolygon const&) basegfx::tools::equal(basegfx::B2DPolygon const&, basegfx::B2DPolygon const&, double const&) basegfx::tools::equal(basegfx::B3DPolyPolygon const&, basegfx::B3DPolyPolygon const&) Change-Id: Ia20358dca68e2240ca9eadd43a18fc6c1a3693a0
2014-02-25Remove visual noise from basegfxAlexander Wilms1-8/+8
Change-Id: I9a28405ab92605203ec380f89f5aee91f042d91a
2013-10-31Resolves: #i123433# Detect pseudo-vertices at svg import...Armin Le Grand1-1/+113
unify svg:d handling, correct svg:d import for relative sub-polygons in svg import; changed default for moveto writes for svg:d in ODF to absolute (cherry picked from commit f15874d8f976f3874bdbcb53429eeefa65c28841) Conflicts: basegfx/inc/basegfx/polygon/b2dpolygontools.hxx basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx basegfx/source/polygon/b2dpolypolygontools.cxx basegfx/source/polygon/b2dsvgpolypolygon.cxx basegfx/source/polygon/b3dpolypolygontools.cxx basegfx/source/tools/ basegfx/test/boxclipper.cxx basegfx/test/clipstate.cxx basegfx/test/genericclipper.cxx canvas/source/tools/surfaceproxy.cxx sdext/source/pdfimport/tree/drawtreevisiting.cxx sdext/source/pdfimport/tree/writertreevisiting.cxx xmloff/inc/xexptran.hxx xmloff/source/draw/XMLImageMapContext.cxx xmloff/source/draw/XMLImageMapExport.cxx xmloff/source/draw/shapeexport2.cxx xmloff/source/draw/shapeexport3.cxx xmloff/source/draw/xexptran.cxx xmloff/source/draw/ximp3dobject.cxx xmloff/source/draw/ximpshap.cxx xmloff/source/style/MarkerStyle.cxx xmloff/source/text/XMLTextFrameContext.cxx xmloff/source/text/txtparae.cxx Change-Id: I5171b4a3559ea116bea45152e1f2685666463635
2013-10-07Fix a warning, don't hand-calc static array size.Thorsten Behrens1-2/+2
Change-Id: Icc9ec9b3c04479ffe930859d600cd222b3003804
2013-10-07Add 7-segment display polygon generator to basegfx.Thorsten Behrens1-0/+133
Basegfx gets a basegfx::tools::number2PolyPolygon method that converts a number 0-9 into a 7-segment digit display polygon. Change-Id: I4d3326c9fe9e42d07a6248781127f19ac27d8b72
2013-08-14Resolves: #i122149# Corrected stuff around polygon-based clip regionsArmin Le Grand1-0/+17
do not use them where not needed (cherry picked from commit 4ccb1eb7d58005ab3b501b7c6ff128fadbcd5066) Conflicts: basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx basegfx/inc/basegfx/polygon/b2dpolygontools.hxx basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx basegfx/inc/basegfx/tuple/b2dtuple.hxx basegfx/inc/basegfx/tuple/b3dtuple.hxx sc/source/ui/inc/output.hxx sc/source/ui/view/gridwin.cxx sc/source/ui/view/output.cxx vcl/win/source/gdi/salgdi.cxx Change-Id: Ie265814a51180bffe3c821a3f2148cb3bb54ecad
2013-06-12Resolves: #i121267# added support for taking clipping into account...Armin Le Grand1-0/+20
for metafile-based exporters to vector formats (cherry picked from commit 229a79b97110c11ef21b7b99ffc768254ca01d96) Conflicts: basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx filter/source/flash/swfexporter.cxx filter/source/graphicfilter/eos2met/eos2met.cxx svtools/source/filter/wmf/wmf.cxx vcl/ Remove unused variable to prevent compile warnings. (cherry picked from commit 60d19c1602e4fec740624fd20a7bfd39707297e4) Change-Id: Iaeb02d7321bea2890cf4e969f1d45d58deef5584 106285f06a21f4f39f34c6755d12ac6cd4196a7f
2012-11-06re-base on ALv2 code. Includes (at least) relevant parts of:Michael Meeks1-23/+14
linecap: Reintegrating finished LineCap feature Patch contributed by Regina Henschel Patches contributed by Sven Jacobi impress212: #i81610# fixed animation export impress212: drawinglayer gbuild environment changes impress212: DffPropSet -> minor code improvements, removing table impress212: #158494# fixed excel import (text rotation) Patches contributed by Armin Le Grand Svg: Reintegrated Svg replacement from /branches/alg/svgreplavement #118728# changed indentifying definitions for Svg file detection #118838# LineGeometry creation for complicated cases optimized to create single Polygons #119176# corrected file type detection for SVG for svg files without xml header #118728# Extended Svg file detection #118529# solve break converters and convert commands for OLEs and images svg: added WaE changes from branch svgreplacement to trunc svg: corrected missing member initialization fix for #118525#: Using primitives for chart sub-geometry visualisation #118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert metafiles to bitmapEx ... fix for #118525#: removed no longer used variable maOriginalMapMode, one more exception eliminated #16758# Added buffering to the VDev usages of the VclProcessor2D derivates... #116758# Secured VDev buffer device to Vcl deinit #116758# added remembering allocated VDevs for VDevBuffer to be able to also delete these when vcl goes down; it should never happen, but You never know #118730# Changed SvgClipPathNode to use MaskPrimitive2D for primitive representation instead of TransparencePrimitive2D #118822# secured 3D geometry creation (slices) by subdividing the 2D source polyPolygon early #118829# enhanced Svg gradient quality, obstacles avoided #118834# Unified usage of TextBreakupHelper as single tooling class for i18n text primitive breakup #118853# added square pixel size limit to conversion of TransparencePrimitive2D to Metafile action #118824# coreccted mirroring and boundrect when the graphicmanager is used for bitmap output #115092# Corrected VclProcessor2D::RenderPolygonStrokePrimitive2D for various optimization scenarios #118783# Corrected errors in ID strings, corrected Svg line/fill export, corrected polygon close state #118796# corrected null-pointer usage in SVG text exporter #118729# Use GraphicStreamUrl and GraphicUrl to allow multi image import with linked graphics, too #118898# corrected error in GDIMetaFile::GetBoundRect in handling MetaFloatTransparentAction #118855# Corrected handling of possibly created empty clipRegions after PolyPolygon clipping #115962# Better (but not yet optimal, see comments in task) handling of MetaFloatTransparentAction in PDF export IP clearance: #118466# This patch removes librsvg, libcroco, libgsf, ... 118779# Added svg content streaming in/out to ImpGraphic stream operators linecap: correctons for WaE and mac drawing svg: uses current system Dpi for Svg replacement image creation Patches contributed by Mathias Bauer (and others) gnumake4 work variously Remove duplicate header includes. cws mba34issues01: #i117720#: convert assertion into warning 118485 - Styles for OLEs are not saved. Submitted by Armin Le Grand. cws mba34issues01: #i117714#: remove assertion Patch contributed by Jurgen Schmidt add some additional checks to ensure proper reading operations mostly prefer our stream / bounds checking work. Patches contributed by Herbert Duerr #i118816# add clarifying comment regarding Font::*Color*() methods extend macro->string handling for empty strings avoid magic constants for SALCOLOR_NONE initialize slant properly in ImplFontMetricData constructor (author=iorsh) #i118675# make check for extension updates more stable #a118617# remove VBasicEventListener.dll binary There are no known users depending on its CLSID Patches contributed by Ariel Constenla-Haile Fix build breaker on Linux/gcc Fix crash when trying to instantiate css.graphic.GraphicRasterizer_RSVG Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117962# - method <SwFlyFrm::IsPaint(..)> - consider instances of <SwFlyDrawObj> sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines gnumake4 work variously from Hans-Joachim Lankenau plus some amount of re-splitting of legacy headers. Patch contributed by Pavel Janik WaE: Remove unused variables. Patches contributed by Takashi Ono mingwport35: i#117795: MinGW port fix for vcl2gnumake mingwport35: i#117795: MinGW port fix for vcl2gnumake Patch contributed by Christian Lippka impress212: #i98044# re enable Text menu for outline and title shapes Patch contributed by Andre Fischer 118674: Made category B code optional and disabled by default. 118881: Ignore empty paragraphs after bullets. Patches contributed by Philipp Lohmann ooo340fixes: #i117780# use rtl allocator ooo34gsl02: #i117807# fix an off by one error (index actually inside the pfb section header) various cleanups, related compilation fixes, warning cleanups, re-working of obsolete stl template pieces to use boost instead, changed string classes, re-adapt KDE about data, about dialog, fixing warnings, and other fixes & improvements. Disable svg import / render for about/ branding code-paths for now. Restore full icon theme set. Remove OS/2 conditionals and sources. Remove conflicting gtk/full-screen monitors support. Retain existing svg rasterizer files - temporarily disabled. Standardize stringificaiton and fixup dllpostfix issues. Rename SvgGradientHelper::== to equalTo to avoid overloading issues. Use the flat GdiPlus API for LineCaps calls.
2012-08-07drop bogus eof linesThomas Arnhold1-3/+0
Change-Id: Idda2852c3e96ce15fde75d5a95369ec50a012410
2012-04-14Clean up basegfx's polygon tools codeGábor Stefanik1-21/+0
2012-02-25Remove unused code in basegfx, comphelperElton Chung1-22/+0
2012-02-20Remove unused codeElton Chung1-22/+0
2012-02-19Remove unused codeElton Chung1-26/+0