From d9262e19c942f2719bfa7de3a5059e4f6e0039c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 1 Mar 2017 10:35:31 +0000 Subject: [PATCH] ofz: timeout loading emf with move clip record MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id5d60f0037873598e1447b063e66e9c29840587c Reviewed-on: https://gerrit.libreoffice.org/34740 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- basegfx/source/range/b2dpolyrange.cxx | 12 ++++++++++++ basegfx/source/tools/b2dclipstate.cxx | 13 +++++++++++++ include/basegfx/range/b2dpolyrange.hxx | 3 +++ include/basegfx/tools/b2dclipstate.hxx | 3 +++ .../data/emf/fail/slow-moveclip-1.emf | Bin 0 -> 8700 bytes vcl/source/filter/wmf/winmtf.cxx | 9 ++------- 6 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 vcl/qa/cppunit/graphicfilter/data/emf/fail/slow-moveclip-1.emf diff --git a/basegfx/source/range/b2dpolyrange.cxx b/basegfx/source/range/b2dpolyrange.cxx index 25117cb5dbd1..3b86f4fd8c0c 100644 --- a/basegfx/source/range/b2dpolyrange.cxx +++ b/basegfx/source/range/b2dpolyrange.cxx @@ -87,6 +87,13 @@ namespace basegfx return tools::solveCrossovers(maRanges,maOrient); } + void transform(const basegfx::B2DHomMatrix& rTranslate) + { + maBounds.transform(rTranslate); + for (auto &a : maRanges) + a.transform(rTranslate); + } + private: B2DRange maBounds; std::vector maRanges; @@ -148,6 +155,11 @@ namespace basegfx return mpImpl->overlaps(rRange); } + void B2DPolyRange::transform(const basegfx::B2DHomMatrix& rTranslate) + { + mpImpl->transform(rTranslate); + } + B2DPolyPolygon B2DPolyRange::solveCrossovers() const { return mpImpl->solveCrossovers(); diff --git a/basegfx/source/tools/b2dclipstate.cxx b/basegfx/source/tools/b2dclipstate.cxx index db0932494626..5ce779c94a03 100644 --- a/basegfx/source/tools/b2dclipstate.cxx +++ b/basegfx/source/tools/b2dclipstate.cxx @@ -173,6 +173,13 @@ namespace tools addPolyPolygon(rPolyPoly,XOR); } + void transform(const basegfx::B2DHomMatrix& rTranslate) + { + maPendingRanges.transform(rTranslate); + maPendingPolygons.transform(rTranslate); + maClipPoly.transform(rTranslate); + } + B2DPolyPolygon const & getClipPoly() const { commitPendingRanges(); @@ -481,6 +488,12 @@ namespace tools return mpImpl->getClipPoly(); } + void B2DClipState::transform(const basegfx::B2DHomMatrix& rTranslate) + { + return mpImpl->transform(rTranslate); + } + + } // end of namespace tools } // end of namespace basegfx diff --git a/include/basegfx/range/b2dpolyrange.hxx b/include/basegfx/range/b2dpolyrange.hxx index f3494c177b6d..bfd36303a16c 100644 --- a/include/basegfx/range/b2dpolyrange.hxx +++ b/include/basegfx/range/b2dpolyrange.hxx @@ -30,6 +30,7 @@ namespace basegfx class B2DTuple; class B2DRange; class B2DPolyPolygon; + class B2DHomMatrix; class ImplB2DPolyRange; /** Multiple ranges in one object. @@ -84,6 +85,8 @@ namespace basegfx */ B2DPolyPolygon solveCrossovers() const; + void transform(const B2DHomMatrix& rTranslate); + private: o3tl::cow_wrapper< ImplB2DPolyRange > mpImpl; }; diff --git a/include/basegfx/tools/b2dclipstate.hxx b/include/basegfx/tools/b2dclipstate.hxx index dab598edd2a4..865bdd74c765 100644 --- a/include/basegfx/tools/b2dclipstate.hxx +++ b/include/basegfx/tools/b2dclipstate.hxx @@ -31,6 +31,7 @@ namespace basegfx class B2DPolyRange; class B2DPolygon; class B2DPolyPolygon; + class B2DHomMatrix; namespace tools { @@ -85,6 +86,8 @@ namespace basegfx void xorRange(const B2DRange& ); void xorPolyPolygon(const B2DPolyPolygon& ); + void transform(const B2DHomMatrix& ); + B2DPolyPolygon getClipPoly() const; }; } diff --git a/vcl/qa/cppunit/graphicfilter/data/emf/fail/slow-moveclip-1.emf b/vcl/qa/cppunit/graphicfilter/data/emf/fail/slow-moveclip-1.emf new file mode 100644 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