diff options
author | panoskorovesis <panoskorovesis@outlook.com> | 2021-08-05 09:54:02 +0300 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-08-11 09:23:08 +0200 |
commit | 79522b8e63c6435331f3cbf623c25f0849d7fd43 (patch) | |
tree | 983c380c014c22b1e5057298991394ac0b0c9ea3 | |
parent | 33243f20831f6efac14047f38d3e7d987aa632e0 (diff) |
Add Handler for GradientEx Write
The handler separates MetaGradientExAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx
Change-Id: I984e21b7d4b19b16432cabe9709d41f07187f268
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120263
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | include/vcl/filter/SvmWriter.hxx | 1 | ||||
-rw-r--r-- | vcl/source/filter/svm/SvmWriter.cxx | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx index c1dccf57525b..c52b7387d79a 100644 --- a/include/vcl/filter/SvmWriter.hxx +++ b/include/vcl/filter/SvmWriter.hxx @@ -66,6 +66,7 @@ public: void MaskScaleHandler(MetaMaskScaleAction* pAction); void MaskScalePartHandler(MetaMaskScalePartAction* pAction); void GradientHandler(MetaGradientAction* pAction); + void GradientExHandler(MetaGradientExAction* pAction); void OverlineColorHandler(MetaOverlineColorAction* pAction); void TextAlignHandler(MetaTextAlignAction* pAction); void MapModeHandler(MetaMapModeAction* pAction); diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx index 3296221d6f11..8e9972e08a0d 100644 --- a/vcl/source/filter/svm/SvmWriter.cxx +++ b/vcl/source/filter/svm/SvmWriter.cxx @@ -270,6 +270,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData) } break; + case MetaActionType::GRADIENTEX: + { + auto* pMetaAction = static_cast<MetaGradientExAction*>(pAction); + GradientExHandler(pMetaAction); + } + break; + case MetaActionType::OVERLINECOLOR: { auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction); @@ -750,6 +757,20 @@ void SvmWriter::GradientHandler(MetaGradientAction* pAction) aSerializer.writeGradient(pAction->GetGradient()); } +void SvmWriter::GradientExHandler(MetaGradientExAction* pAction) +{ + mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType())); + VersionCompatWrite aCompat(mrStream, 1); + + // #i105373# see comment at MetaTransparentAction::Write + tools::PolyPolygon aNoCurvePolyPolygon; + pAction->GetPolyPolygon().AdaptiveSubdivide(aNoCurvePolyPolygon); + + WritePolyPolygon(mrStream, aNoCurvePolyPolygon); + TypeSerializer aSerializer(mrStream); + aSerializer.writeGradient(pAction->GetGradient()); +} + void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction) { mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType())); |