path: root/basegfx/source/polygon/b2dpolypolygoncutter.cxx
AgeCommit message (Collapse)AuthorFilesLines
2022-03-21ofz#45878 add a way to set some limit on hugely complex clipsCaolán McNamara1-4/+4
Change-Id: I6bbf7c6068560e3bb656560fb5c6cc2ed72cecd4 Reviewed-on: Tested-by: Jenkins Reviewed-by: Caolán McNamara <>
2021-11-12improve mergeToSinglePolyPolygonNoel Grandin1-39/+35
spotted by llunak. No need to take param by &&, since mergeToSinglePol does not actually need to modify it. Also flatten it a little. Change-Id: I2f5ade347db756e21ecb0a88c3935805268f5072 Reviewed-on: Reviewed-by: Luboš Luňák <> Tested-by: Jenkins
2021-10-10loplugin:moveparam in basegfxNoel Grandin1-2/+2
Change-Id: I73414e94358114ff0d475f13855db8c4c493b6f5 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2021-02-02tdf#139002 dont hang opening pathological SVGsNoel Grandin1-0/+7
This is a workaround, but (a) this contains several pathological SVGs, which have clearly been very badly created eg. an svg path with 2699660320 elements. (b) the diagrams all look fine to me, so clearly the winding-rule change is not that critical in this case Change-Id: I48aac512e2de2ae4e63a4d1816c3d4d5901b3bf0 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2020-04-19loplugin:flatten in basegfxNoel Grandin1-72/+72
Change-Id: Ic8bc586e1a4977322dcb371c0fff6411783df9d7 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2020-03-04tdf#130150 Improve clipping in PDF exportArmin.Le.Grand (CIB)1-0/+36
For more info and discusson please have a look at the task. It reverts the change from tdf#99680 which did a wrong paradigm change in how clip in Region(s) is defined and tries to fix the underlying error in a more correct way. This includes problems noted in tdf#44388 and tdf#113449. This is a decent improvement, but - due to dealing with numerical problems - not yet the whole healing. Still thinking about how to solve this for good. Adapted PdfExportTest::testTdf99680() and PdfExportTest::testTdf99680_2() as needed, empty clip regions are allowed again. Added comments, too. Had to change solvePolygonOperationAnd to work on ranges if both inputs *are* ranges. The AND-case is then completely solvable. Also increased geometry for transformations of clip geometries - may help later. Change-Id: I2370447597faa6efb81d58ee31c63654e304262e Reviewed-on: Tested-by: Jenkins Reviewed-by: Thorsten Behrens <>
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-08-19loplugin:constvars in accessibility..basegfxNoel Grandin1-1/+1
Change-Id: Id6a0b48c3440be394419e87bd7a4f63bd0a1e758 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2019-04-01Fix typoAndrea Gelmini1-1/+1
Change-Id: Ib38d3dd25f15ce403ee9ff461a94331a4a7c24ac Reviewed-on: Tested-by: Jenkins Reviewed-by: Jens Carl <>
2018-11-24Fix typoAndrea Gelmini1-2/+2
Change-Id: I041e0d04dd5a57602fd6139a2a854db243435bed Reviewed-on: Reviewed-by: Julien Nabet <> Tested-by: Jenkins
2018-10-23clang-tidy performance-unnecessary-copy-initialization inNoel Grandin1-9/+9
basctl..basic Change-Id: I4009282869cd8a2f269093564bd4fafccab80ec3 Reviewed-on: Tested-by: Jenkins Reviewed-by: Noel Grandin <>
2018-01-12More loplugin:cstylecast: basegfxStephan Bergmann1-2/+2
auto-rewrite with <> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: Ifa4a6643b41525c962cd6af5776e1bf10bddb71c
2017-12-19inline use-once typedefsNoel Grandin1-2/+2
Change-Id: I5c3ffc03c26b3428f1f336e6ecba7838a1cf1157 Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Noel Grandin <>
2017-09-26Rename the basegfx::tools namespace to basegfx::utilsTor Lillqvist1-22/+22
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-09-08clang-tidy modernize-use-emplace in b*Noel Grandin1-2/+2
Change-Id: I51e0369ba2e1fe0b7c934531f71d3bda95ba09ec Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Noel Grandin <>
2017-05-19loplugin:comparisonwithconstant in accessibility..basegfxNoel Grandin1-2/+2
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-10/+10
Change-Id: I6953640a1aa2e58fe2ea6555291c4f4a5271770f Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Noel Grandin <>
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke1-1/+0
with command > git grep -l osl/diagnose.h *.cxx | xargs grep -L -w 'OSL_\w*' | xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d' headers need more work Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab Reviewed-on: Tested-by: Jochen Nitschke <> Reviewed-by: Michael Stahl <>
2017-02-26loplugin:loopvartoosmallStephan Bergmann1-3/+4
Change-Id: I085d409f3271c5a4d8237fa3e3c4a74bed296acb
2017-02-15Drop :: prefix from std in [a-b]*/Tor Lillqvist1-10/+10
Change-Id: I0422aaf39bbce889c95ed9a81a0784cb03a1badd Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Tor Lillqvist <>
2016-10-03Fix typosAndrea Gelmini1-1/+1
Change-Id: Ie44267e7c9f92eb1920f05235826abff761251f1 Reviewed-on: Reviewed-by: jan iversen <> Tested-by: jan iversen <>
2016-07-30tdf#96505 get rid of "long" integer literals 'L'Asela Dasanayaka1-5/+5
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-04-21clang-tidy modernize-loop-convert in b*Noel Grandin1-2/+2
Change-Id: I8ac6eb59e213eafa78e3dc4578738b53e8adef5b
2016-03-31tdf#96505 Remove 0L occurences from avmedia and basegfx modulesslideon1-9/+9
No compiler warnings on my machine Change-Id: Ibd303c64f04f6f52272ac19c3069da2f14cb4e9a Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Michael Stahl <>
2015-08-11loplugin: defaultparamsNoel Grandin1-3/+3
Change-Id: I29ef505ee77965df33677f8051ec39398ef0c74e
2015-07-04Fix typosAndrea Gelmini1-1/+1
Change-Id: I75b4ad61785bf0ba1cb07735d938c0977356b8cc Reviewed-on: Tested-by: Jenkins <> Reviewed-by: Samuel Mehrbrodt <>
2015-06-04convert B2VectorOrientation to scoped enumNoel Grandin1-8/+8
Change-Id: Id7e444bc896ae5d52e5a0bd1b471679c4945afa4
2015-05-28new clang plugin: loopvartoosmallNoel Grandin1-2/+2
Idea from bubli - look for loops where the index variable is of such size that it cannot cover the range revealed by examining the length part of the condition. So far, I have only run the plugin up till the VCL module. Also the plugin deliberately excludes anything more complicated than a straightforward incrementing for loop. Change-Id: Ifced18b01c03ea537c64168465ce0b8287a42015
2015-03-27loplugin:staticfunctionNoel Grandin1-1/+1
Change-Id: I982ba552579019e4902ae59fddf14a6b34ba5954
2014-11-10basegfx: Solve crossovers even if there is only one polygon in the polypolygonLouis-Francis Ratté-Boulianne1-1/+1
Change-Id: If4fcb8a2c6ac40a4d694522ce4ed020bcb4466b8
2014-07-06remove unnecessary whitespaces in basegfxMarkus Mohrhard1-30/+0
Change-Id: Ia97fb3895e855e9fb970b0874fc100e2b900a8b7
2014-02-25Remove visual noise from basegfxAlexander Wilms1-16/+16
Change-Id: I9a28405ab92605203ec380f89f5aee91f042d91a
2014-01-10Use boolStephan Bergmann1-2/+2
Change-Id: I703bd28163f4ca1a6c8a4e818b0472aa809bdbad
2013-08-15warning C4701: potentially uninitialized local variable 'bChanged' usedMichael Stahl1-1/+1
Change-Id: Ic8f60c7b04956a3b097ec3636b5561d2dd1f56b3
2013-08-14Resolves: #i122149# Corrected stuff around polygon-based clip regionsArmin Le Grand1-3/+74
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
2012-11-06re-base on ALv2 code. Includes (at least) relevant parts of:Michael Meeks1-27/+114
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-07-03sprinkle explicit over constructorsDavid Tardon1-2/+2
Change-Id: I6599147a74e5c99f964b08935ec7c77f2d4cadef
2012-06-06Some cppcheck cleaningJulien Nabet1-2/+2
Change-Id: I7a5f34715faecd689900b5d41eae9c782e99b47b
2012-05-31targetted minor size vs. empty reversionMichael Meeks1-2/+2
Change-Id: I35aef43b4dd023440509faaa8c73a0e5a45d37a7
2012-02-25Remove unused code in basegfx, comphelperElton Chung1-8/+0
2012-02-21WaE: duplicateBranchThomas Arnhold1-22/+2
2012-01-06Fix "Same expression on both sides of '&&'" (reported by cppcheck)Julien Nabet1-2/+2
2011-11-05precompiled_basegfx.hxx is empty, so don't include it.Joseph Powers1-2/+0
2011-04-22cppcheck inefficient checking for emptinessKayo Hamid1-2/+2
From cppcheck: Using xxxx.empty() instead of xxxx.size() can be faster. xxxx.size() can take linear time but xxxx.empty() is guaranteed to take constant time
2010-10-14Add vim/emacs modelines to all source filesSebastian Spaeth1-0/+3
Fixes #fdo30794 Based on bin/add-modelines script (originally posted in mail Signed-off-by: Sebastian Spaeth <>
2010-02-12changefileheader2: #i109125#: change source file copyright notice from Sun ↵Jens-Heiner Rechtien1-4/+1
Microsystems to Oracle; remove CVS style keywords (RCSfile, Revision)
2009-07-27CWS-TOOLING: integrate CWS aw073Jens-Heiner Rechtien1-0/+79
2009-07-16 11:21:19 +0200 aw r274036 : corrections after resync 2009-07-15 13:34:18 +0200 aw r274009 : CWS-TOOLING: rebase CWS aw073 to trunk@273858 (milestone: DEV300:m52) 2009-07-01 20:04:27 +0200 aw r273613 : CWS-TOOLING: rebase CWS aw073 to trunk@273468 (milestone: DEV300:m51) 2009-06-24 11:51:03 +0200 aw r273324 : #i102062# added using statement for solaris compiler 2009-06-23 12:53:50 +0200 aw r273278 : #i100158# force filled polygons to closed state 2009-06-23 12:28:33 +0200 aw r273276 : #i100158#, #i102371# corrected all (mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) shortcuts to support line/fill and to be not used when FillMode is not overpaint 2009-06-23 12:15:14 +0200 aw r273274 : #i100158# added PolyPolygon support for snapPointsOfHorizontalOrVerticalEdges helper 2009-06-22 17:28:33 +0200 aw r273244 : #i101508# added taking care of cell's distance-to-border values for cell text primitive creation 2009-06-22 12:59:10 +0200 aw r273218 : #i102253# applied patch from OD (see task) 2009-06-18 17:00:52 +0200 aw r273125 : #i102251# added EE_CNTRL_ONLINESPELLING switch off at DrawOutliner during GraphicExporter::GetGraphic 2009-06-18 14:35:57 +0200 aw r273120 : #i102241# added mergeToSinglePolyPolygon usage to SdrObject::ImpConvertToContourObj 2009-06-18 14:35:20 +0200 aw r273119 : #i102241# improved PolygonStrokePrimitive2D::createLocalDecomposition 2009-06-18 14:34:49 +0200 aw r273118 : #i102241# Made B2DCubicBezier::testAndSolveTrivialBezier() numerically more stable 2009-06-17 16:11:21 +0200 aw r273078 : #i102062# added compare support for OutlireParaObject's WrongList in an extra method; using in primitive comparators 2009-06-16 19:10:18 +0200 aw r273037 : #i101957# corrected: offset needs to be added before rotation and shear 2009-06-16 18:58:43 +0200 aw r273035 : #i101957# added needed offset by object width to SdrTextObj::impDecomposeStretchTextPrimitive for vertical texts 2009-06-16 18:35:55 +0200 aw r273034 : #i101941# corrected object initialisation for 3D Scenes on Clone operator 2009-06-16 16:07:30 +0200 aw r273024 : #i101811# extended renderChartPrimitive2D to create a correct embedding in a new MapMode 2009-06-12 19:38:07 +0200 aw r272940 : #i101734# added test code to experiment on demand with more complex transformations for virtual objects than only translations 2009-06-12 19:37:07 +0200 aw r272939 : #i101734# corrected SvtGraphicStroke preparation in MetaFile renderer (AFAP) 2009-06-12 16:31:55 +0200 aw r272931 : #i101648# re-enabled object creation with objecttype OBJ_NONE for SW Frame creation 2009-06-12 13:59:05 +0200 aw r272917 : #i101598# supported AAed single line paint in VCL 2009-06-12 11:34:25 +0200 aw r272907 : #i101598# adapted Graphic::GetBitmap() usage 2009-06-10 16:34:19 +0200 aw r272830 : #i101598# added VCL_DLLPUBLIC to parameter class 2009-06-10 16:30:27 +0200 aw r272829 : #i101598# extended calls to Graphic::GetBitmap/Ex where conversions to Bitmap objects is needed to user defined parameters like AntiAlisasing 2009-06-10 16:28:44 +0200 aw r272828 : #i101598# extended Graphic::GetBitmap/Ex interfaces to transport raster conversion parameters since these calls potentially need to rasterconvert a contained MetaFile 2009-06-09 16:26:40 +0200 aw r272781 : #i100945# checked in proposed patch for now 2009-06-08 18:01:42 +0200 aw r272742 : #i101239# teached BinTextObject to register at EditEngineItemPool sub-pool, not on given pool directly
2008-08-19INTEGRATION: CWS aw033 (1.9.2); FILE MERGEDVladimir Glazounov1-612/+578
2008/06/24 15:26:48 aw #i39532# corrections 2008/05/27 14:08:45 aw #i39532# changes DEV300 m12 resync corrections 2008/05/14 14:40:58 aw RESYNC: (1.15-1.16); FILE MERGED 2008/03/14 13:55:21 cl RESYNC: (1.14-1.15); FILE MERGED 2007/12/17 09:52:16 aw #i39532# minor primitive corrections 2007/12/12 13:15:27 aw #i39532# clipping changes 2007/12/12 13:13:33 aw #i39532# clipping changes 2007/12/03 13:53:24 aw #i39532# checkin for resync 2007/08/09 22:04:27 aw RESYNC: (1.13-1.14); FILE MERGED 2006/09/26 14:50:13 aw RESYNC: (1.11-1.13); FILE MERGED 2006/05/12 14:35:32 aw RESYNC: (1.9-1.11); FILE MERGED 2005/10/28 11:24:15 aw #i39532#