summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-11-19 21:42:16 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-11-20 12:29:17 +0100
commit99f2ae505d2d2dd104842c2133488210c354f731 (patch)
tree59f420fba2b04f8dcb56459262f7fec328af9d03 /include
parent4fc0184aede43a48b458d1ecd2b9d07e8aa80d25 (diff)
tools::Polygon::Clip() is broken with bezier curves (tdf#137068)
It preserves the points, but not the flags. Work this around by temporarily converting to B2DPolygon, where it works. Change-Id: I120264fbc4c7c508386f23a06435891199565aae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106188 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/tools/poly.hxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx
index de03619eaf31..9caec8bbe210 100644
--- a/include/tools/poly.hxx
+++ b/include/tools/poly.hxx
@@ -262,6 +262,36 @@ public:
explicit PolyPolygon(const ::basegfx::B2DPolyPolygon& rPolyPolygon);
};
+template< typename charT, typename traits >
+inline std::basic_ostream<charT, traits> & operator <<(
+ std::basic_ostream<charT, traits> & stream, const Polygon& poly )
+{
+ stream << "<" << poly.GetSize() << ":";
+ for (sal_uInt16 i = 0; i < poly.GetSize(); i++)
+ {
+ if (i > 0)
+ stream << "--";
+ stream << poly.GetPoint(i);
+ }
+ stream << ">";
+ return stream;
+}
+
+template< typename charT, typename traits >
+inline std::basic_ostream<charT, traits> & operator <<(
+ std::basic_ostream<charT, traits> & stream, const PolyPolygon& poly )
+{
+ stream << "[" << poly.Count() << ":";
+ for (sal_uInt16 i = 0; i < poly.Count(); i++)
+ {
+ if (i > 0)
+ stream << ",";
+ stream << poly.GetObject(i);
+ }
+ stream << "]";
+ return stream;
+}
+
} /* namespace tools */
typedef std::vector< tools::PolyPolygon > PolyPolyVector;