summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-08-05 10:02:19 +0300
committerTomaž Vajngerl <quikee@gmail.com>2021-08-11 09:23:40 +0200
commitb50ea6333e31757ab7fb365299351d6aabe4c101 (patch)
tree342ce3ddac50704978bd10fd2fad75a9531134ce /vcl
parent79522b8e63c6435331f3cbf623c25f0849d7fd43 (diff)
Add Handler for Hatch Write
The handler separates MetaHatchAction::Write from metaact.hxx Write implementation is now in SvmWriter.hxx Change-Id: I29587d4a9e9129c5425792e2f8873ee7414bdaa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120264 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/svm/SvmWriter.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index 8e9972e08a0d..93f0c2b2baa6 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -277,6 +277,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
}
break;
+ case MetaActionType::HATCH:
+ {
+ auto* pMetaAction = static_cast<MetaHatchAction*>(pAction);
+ HatchHandler(pMetaAction);
+ }
+ break;
+
case MetaActionType::OVERLINECOLOR:
{
auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction);
@@ -771,6 +778,19 @@ void SvmWriter::GradientExHandler(MetaGradientExAction* pAction)
aSerializer.writeGradient(pAction->GetGradient());
}
+void SvmWriter::HatchHandler(MetaHatchAction* 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);
+ WriteHatch(mrStream, pAction->GetHatch());
+}
+
void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
{
mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));