From f8847233c5b935d7ad1ea82bd464868d2bc3f69e Mon Sep 17 00:00:00 2001 From: panoskorovesis Date: Thu, 15 Jul 2021 11:29:04 +0300 Subject: Add Handler for EPS Read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The handler separates MetaEPSAction::Read from metaact.hxx Read implementation is now in SvmReader.hxx Change-Id: I9a56e447865643bbd6e02f9b9da3be715172fe35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119192 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/vcl/filter/SvmReader.hxx | 1 + include/vcl/metaact.hxx | 4 ++++ vcl/source/filter/svm/SvmReader.cxx | 25 ++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx index ca8b9008a733..d19922cf774d 100644 --- a/include/vcl/filter/SvmReader.hxx +++ b/include/vcl/filter/SvmReader.hxx @@ -85,6 +85,7 @@ public: rtl::Reference RasterOpHandler(); rtl::Reference TransparentHandler(); rtl::Reference FloatTransparentHandler(ImplMetaReadData* pData); + rtl::Reference EPSHandler(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index fabe6f7c750a..1914c31c192e 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -1729,6 +1729,10 @@ public: const GDIMetaFile& GetSubstitute() const { return maSubst; } const Point& GetPoint() const { return maPoint; } const Size& GetSize() const { return maSize; } + void SetLink(const GfxLink& rGfxLink) { maGfxLink = rGfxLink; } + void SetSubstitute(const GDIMetaFile& rSubst) { maSubst = rSubst; } + void SetPoint(const Point& rPoint) { maPoint = rPoint; } + void SetSize(const Size& rSize) { maSize = rSize; } }; class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaRefPointAction final : public MetaAction diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx index daed6b7cca72..44c6705007b3 100644 --- a/vcl/source/filter/svm/SvmReader.cxx +++ b/vcl/source/filter/svm/SvmReader.cxx @@ -305,7 +305,7 @@ rtl::Reference SvmReader::MetaActionHandler(ImplMetaReadData* pData) return FloatTransparentHandler(pData); break; case MetaActionType::EPS: - pAction = new MetaEPSAction; + return EPSHandler(); break; case MetaActionType::REFPOINT: pAction = new MetaRefPointAction; @@ -1336,4 +1336,27 @@ rtl::Reference SvmReader::FloatTransparentHandler(ImplMetaReadData* return pAction; } + +rtl::Reference SvmReader::EPSHandler() +{ + auto pAction = new MetaEPSAction(); + + VersionCompatRead aCompat(mrStream); + TypeSerializer aSerializer(mrStream); + GfxLink aGfxLink; + aSerializer.readGfxLink(aGfxLink); + Point aPoint; + aSerializer.readPoint(aPoint); + Size aSize; + aSerializer.readSize(aSize); + GDIMetaFile aSubst; + Read(aSubst); + + pAction->SetLink(aGfxLink); + pAction->SetPoint(aPoint); + pAction->SetSize(aSize); + pAction->SetSubstitute(aSubst); + + return pAction; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit