include/vcl/filter/SvmReader.hxx | 1 + include/vcl/metaact.hxx | 2 ++ vcl/source/filter/svm/SvmReader.cxx | 19 ++++++++++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-)
New commits: commit 9eed620ab1ea4ad67598b6026132d964e2e430bd Author: panoskorovesis <panoskorove...@outlook.com> AuthorDate: Tue Jul 13 13:54:37 2021 +0300 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Jul 14 08:52:04 2021 +0200 Add Handler for GradientEx Read The handler separates MetaGradientExAction::Read metaact.hxx Read implementation is now in SvmReader.hxx Change-Id: I01f0de7ab62cf658bc88cf2232622197b127cc9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118834 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 c4c3080b7af6..1bd6628bb165 100644 --- a/include/vcl/filter/SvmReader.hxx +++ b/include/vcl/filter/SvmReader.hxx @@ -66,6 +66,7 @@ public: rtl::Reference<MetaAction> MaskScaleHandler(); rtl::Reference<MetaAction> MaskScalePartHandler(); rtl::Reference<MetaAction> GradientHandler(); + rtl::Reference<MetaAction> GradientExHandler(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 958807d5126c..28470520fe09 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -1099,6 +1099,8 @@ public: const tools::PolyPolygon& GetPolyPolygon() const { return maPolyPoly; } const Gradient& GetGradient() const { return maGradient; } + void SetPolyPolygon(tools::PolyPolygon& rPolyPoly) { maPolyPoly = rPolyPoly; } + void SetGradient(Gradient& rGradient) { maGradient = rGradient; } }; class SAL_DLLPUBLIC_RTTI MetaHatchAction final : public MetaAction diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx index 70105cf517a9..3cfe762de652 100644 --- a/vcl/source/filter/svm/SvmReader.cxx +++ b/vcl/source/filter/svm/SvmReader.cxx @@ -241,7 +241,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData) return GradientHandler(); break; case MetaActionType::GRADIENTEX: - pAction = new MetaGradientExAction; + return GradientExHandler(); break; case MetaActionType::HATCH: pAction = new MetaHatchAction; @@ -1043,4 +1043,21 @@ rtl::Reference<MetaAction> SvmReader::GradientHandler() return pAction; } + +rtl::Reference<MetaAction> SvmReader::GradientExHandler() +{ + auto pAction = new MetaGradientExAction(); + + VersionCompatRead aCompat(mrStream); + tools::PolyPolygon aPolyPoly; + ReadPolyPolygon(mrStream, aPolyPoly); + TypeSerializer aSerializer(mrStream); + Gradient aGradient; + aSerializer.readGradient(aGradient); + + pAction->SetGradient(aGradient); + pAction->SetPolyPolygon(aPolyPoly); + + 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