summaryrefslogtreecommitdiff
path: root/chart2/source/tools
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-01-04 18:50:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-06 07:15:48 +0100
commit0b0934056b47485527442b6366d7fd3274a4601f (patch)
treea997a63ebdd694ad0d22a989a476a757ad11e64c /chart2/source/tools
parentea545653e17e687c9069543897975b3726dc6a2b (diff)
bypass SvxShape when creating rectangles in chart2
Change-Id: I461449959fffa8948bf4321a6c3114505d87a149 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127997 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools')
-rw-r--r--chart2/source/tools/CommonConverters.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx
index 2695d2da3418..43069cd40ad3 100644
--- a/chart2/source/tools/CommonConverters.cxx
+++ b/chart2/source/tools/CommonConverters.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
#include <osl/diagnose.h>
#include <basegfx/matrix/b3dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
#include <limits>
@@ -345,6 +346,33 @@ drawing::PointSequenceSequence PolyToPointSequence(
return aRet;
}
+basegfx::B2DPolyPolygon PolyToB2DPolyPolygon(
+ const drawing::PolyPolygonShape3D& rPolyPolygon )
+{
+ basegfx::B2DPolyPolygon aRetval;
+
+ for(sal_Int32 nN = 0; nN < rPolyPolygon.SequenceX.getLength(); nN++)
+ {
+ basegfx::B2DPolygon aNewPolygon;
+ sal_Int32 nInnerLength = rPolyPolygon.SequenceX[nN].getLength();
+ if(nInnerLength)
+ {
+ aNewPolygon.reserve(nInnerLength);
+ for( sal_Int32 nM = 0; nM < nInnerLength; nM++)
+ {
+ auto X = static_cast<sal_Int32>(rPolyPolygon.SequenceX[nN][nM]);
+ auto Y = static_cast<sal_Int32>(rPolyPolygon.SequenceY[nN][nM]);
+ aNewPolygon.append(basegfx::B2DPoint(X, Y));
+ }
+ // check for closed state flag
+ basegfx::utils::checkClosed(aNewPolygon);
+ }
+ aRetval.append(std::move(aNewPolygon));
+ }
+
+ return aRetval;
+}
+
void appendPointSequence( drawing::PointSequenceSequence& rTarget
, drawing::PointSequenceSequence& rAdd )
{