basegfx/source/range/b2dpolyrange.cxx | 12 +++++++++ basegfx/source/tools/b2dclipstate.cxx | 13 ++++++++++ include/basegfx/range/b2dpolyrange.hxx | 3 ++ include/basegfx/tools/b2dclipstate.hxx | 3 ++ vcl/qa/cppunit/graphicfilter/data/emf/fail/slow-moveclip-1.emf |binary vcl/source/filter/wmf/winmtf.cxx | 9 +----- 6 files changed, 33 insertions(+), 7 deletions(-)
New commits: commit d9262e19c942f2719bfa7de3a5059e4f6e0039c6 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Mar 1 10:35:31 2017 +0000 ofz: timeout loading emf with move clip record Change-Id: Id5d60f0037873598e1447b063e66e9c29840587c Reviewed-on: https://gerrit.libreoffice.org/34740 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/basegfx/source/range/b2dpolyrange.cxx b/basegfx/source/range/b2dpolyrange.cxx index 25117cb..3b86f4f 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<B2DRange> 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 db09324..5ce779c 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 f3494c1..bfd3630 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 dab598e..865bdd7 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 index 0000000..ef4c6a0 Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/emf/fail/slow-moveclip-1.emf differ diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index d51db44..028495d 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -78,14 +78,9 @@ void WinMtfClipPath::setClipPath( const tools::PolyPolygon& rPolyPolygon, sal_In void WinMtfClipPath::moveClipRegion( const Size& rSize ) { - // what a weird concept. emulate, don't want this in B2DClipState - // API - basegfx::B2DPolyPolygon aCurrClip=maClip.getClipPoly(); basegfx::B2DHomMatrix aTranslate; aTranslate.translate(rSize.Width(), rSize.Height()); - - aCurrClip.transform(aTranslate); - maClip = basegfx::tools::B2DClipState( aCurrClip ); + maClip.transform(aTranslate); } void WinMtfClipPath::setDefaultClipPath() @@ -902,7 +897,7 @@ void WinMtfOutput::UpdateClipRegion() { //this makes cases like tdf#45820 work in reasonable time, and I feel in theory should //be just fine. In practice I see the output is different so needs work before its the - //default, but for file fuzzing it should good enough + //default, but for file fuzzing it should be good enough if (mbComplexClip) { mpGDIMetaFile->AddAction(
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits