diff options
author | panoskorovesis <panoskorovesis@outlook.com> | 2021-07-28 10:06:35 +0300 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-07-31 08:46:51 +0200 |
commit | 858176c120b82f626aa8625fbb87dd23c4391c03 (patch) | |
tree | 791662c0bcec33b73117e7ca6bddd60739ed6f58 /vcl | |
parent | 5e020c43668c9e11188ba48bf57de4bd7e9cc501 (diff) |
Add Handler for Pixel Write
The handler separates MetaPixelAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx
Change-Id: I042bc7ae50319c7bf2a75716b4cf968675670e70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119580
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/svm/SvmWriter.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx index 8c07bffe5d53..37720b5d385e 100644 --- a/vcl/source/filter/svm/SvmWriter.cxx +++ b/vcl/source/filter/svm/SvmWriter.cxx @@ -27,6 +27,11 @@ SvmWriter::SvmWriter(SvStream& rIStm) { } +void SvmWriter::WriteColor(::Color aColor) +{ + mrStream.WriteUInt32(static_cast<sal_uInt32>(aColor)); +} + SvStream& SvmWriter::Write(GDIMetaFile& rMetaFile) { const SvStreamCompressFlags nStmCompressMode = mrStream.GetCompressMode(); @@ -73,6 +78,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData) } break; + case MetaActionType::PIXEL: + { + auto* pMetaAction = static_cast<MetaPixelAction*>(pAction); + PixelHandler(pMetaAction); + } + break; + /* default case prevents test failure and will be removed once all the handlers are completed */ default: @@ -84,4 +96,13 @@ void SvmWriter::ActionHandler(MetaAction* pAction) { mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType())); } + +void SvmWriter::PixelHandler(MetaPixelAction* pAction) +{ + mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType())); + VersionCompatWrite aCompat(mrStream, 1); + TypeSerializer aSerializer(mrStream); + aSerializer.writePoint(pAction->GetPoint()); + WriteColor(pAction->GetColor()); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |