diff options
author | panoskorovesis <panoskorovesis@outlook.com> | 2021-07-28 11:31:16 +0300 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-07-31 08:47:37 +0200 |
commit | 7c18bfa1709147562ad045729d8a0a1a9b1f67ab (patch) | |
tree | 08b0cb294713dedead0d94087ea7ccfee5584bb8 | |
parent | 858176c120b82f626aa8625fbb87dd23c4391c03 (diff) |
Add Handler for Point Write
The handler separates MetaPointAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx
Change-Id: I771f7abbcf21ec34aae46d7232ca352de4ba75a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119591
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 | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx index c3502e3979c5..3273e12e7fe2 100644 --- a/include/vcl/filter/SvmWriter.hxx +++ b/include/vcl/filter/SvmWriter.hxx @@ -40,4 +40,5 @@ public: void MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData); void ActionHandler(MetaAction* pAction); void PixelHandler(MetaPixelAction* pAction); + void PointHandler(MetaPointAction* pAction); };
\ No newline at end of file diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx index 37720b5d385e..c8abf09115f9 100644 --- a/vcl/source/filter/svm/SvmWriter.cxx +++ b/vcl/source/filter/svm/SvmWriter.cxx @@ -85,6 +85,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData) } break; + case MetaActionType::POINT: + { + auto pMetaAction = static_cast<MetaPointAction*>(pAction); + PointHandler(pMetaAction); + } + break; + /* default case prevents test failure and will be removed once all the handlers are completed */ default: @@ -105,4 +112,12 @@ void SvmWriter::PixelHandler(MetaPixelAction* pAction) aSerializer.writePoint(pAction->GetPoint()); WriteColor(pAction->GetColor()); } + +void SvmWriter::PointHandler(MetaPointAction* pAction) +{ + mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType())); + VersionCompatWrite aCompat(mrStream, 1); + TypeSerializer aSerializer(mrStream); + aSerializer.writePoint(pAction->GetPoint()); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |