include/vcl/filter/SvmReader.hxx | 1 + include/vcl/metaact.hxx | 2 ++ vcl/source/filter/svm/SvmReader.cxx | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-)
New commits: commit 4f2b7a74b065d3f548c47429d38a280264e49e27 Author: panoskorovesis <panoskorove...@outlook.com> AuthorDate: Thu Jul 15 11:06:38 2021 +0300 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Jul 19 17:19:02 2021 +0200 Add Handler for Transparent Read The handler separates MetaTransparentAction::Read from metaact.hxx Read implementation is now in SvmReader.hxx Change-Id: Icd044f6c4422222323a9898ef5d7f67732fbbc2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119170 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/include/vcl/filter/SvmReader.hxx b/include/vcl/filter/SvmReader.hxx index eda2a2547532..d1ee96872490 100644 --- a/include/vcl/filter/SvmReader.hxx +++ b/include/vcl/filter/SvmReader.hxx @@ -83,6 +83,7 @@ public: rtl::Reference<MetaAction> PushHandler(); rtl::Reference<MetaAction> PopHandler(); rtl::Reference<MetaAction> RasterOpHandler(); + rtl::Reference<MetaAction> TransparentHandler(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 2d1dde5e09b3..9de35c7ac271 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -1650,6 +1650,8 @@ public: const tools::PolyPolygon& GetPolyPolygon() const { return maPolyPoly; } sal_uInt16 GetTransparence() const { return mnTransPercent; } + void SetPolyPolygon(const tools::PolyPolygon& rPolyPoly) { maPolyPoly = rPolyPoly; } + void SetTransparence(const sal_uInt16 nTransPercent) { mnTransPercent = nTransPercent; } bool IsTransparent() const override { return true; } }; diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx index 633be2a96105..1e234669610a 100644 --- a/vcl/source/filter/svm/SvmReader.cxx +++ b/vcl/source/filter/svm/SvmReader.cxx @@ -299,7 +299,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData) return RasterOpHandler(); break; case MetaActionType::Transparent: - pAction = new MetaTransparentAction; + return TransparentHandler(); break; case MetaActionType::FLOATTRANSPARENT: pAction = new MetaFloatTransparentAction; @@ -1296,4 +1296,20 @@ rtl::Reference<MetaAction> SvmReader::RasterOpHandler() return pAction; } + +rtl::Reference<MetaAction> SvmReader::TransparentHandler() +{ + auto pAction = new MetaTransparentAction(); + + VersionCompatRead aCompat(mrStream); + tools::PolyPolygon aPolyPoly; + ReadPolyPolygon(mrStream, aPolyPoly); + sal_uInt16 nTransPercent; + mrStream.ReadUInt16(nTransPercent); + + pAction->SetPolyPolygon(aPolyPoly); + pAction->SetTransparence(nTransPercent); + + return pAction; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits