include/vcl/filter/SvmWriter.hxx | 1 + vcl/source/filter/svm/SvmWriter.cxx | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+)
New commits: commit dc23042b6adb62eb5b0963be04aa121d0cd66ff5 Author: panoskorovesis <panoskorove...@outlook.com> AuthorDate: Thu Aug 5 09:41:47 2021 +0300 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Wed Aug 11 09:19:38 2021 +0200 Add Handler for MaskScale Write The handler separates MetaMaskScaleAction::Write from metaact.hxx Write implementation is now in SvmWriter.hxx Change-Id: I1fee84e7c79da96755d20611a36b58f92349585f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120257 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx index b1dae51ef845..4ec64cf9142f 100644 --- a/include/vcl/filter/SvmWriter.hxx +++ b/include/vcl/filter/SvmWriter.hxx @@ -63,6 +63,7 @@ public: void BmpExScaleHandler(MetaBmpExScaleAction* pAction); void BmpExScalePartHandler(MetaBmpExScalePartAction* pAction); void MaskHandler(MetaMaskAction* pAction); + void MaskScaleHandler(MetaMaskScaleAction* 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 dbe813b9c663..4f045d710d32 100644 --- a/vcl/source/filter/svm/SvmWriter.cxx +++ b/vcl/source/filter/svm/SvmWriter.cxx @@ -249,6 +249,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData) } break; + case MetaActionType::MASKSCALE: + { + auto* pMetaAction = static_cast<MetaMaskScaleAction*>(pAction); + MaskScaleHandler(pMetaAction); + } + break; + case MetaActionType::OVERLINECOLOR: { auto* pMetaAction = static_cast<MetaOverlineColorAction*>(pAction); @@ -691,6 +698,19 @@ void SvmWriter::MaskHandler(MetaMaskAction* pAction) } } +void SvmWriter::MaskScaleHandler(MetaMaskScaleAction* pAction) +{ + if (!pAction->GetBitmap().IsEmpty()) + { + mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType())); + VersionCompatWrite aCompat(mrStream, 1); + WriteDIB(pAction->GetBitmap(), mrStream, false, true); + TypeSerializer aSerializer(mrStream); + aSerializer.writePoint(pAction->GetPoint()); + aSerializer.writeSize(pAction->GetSize()); + } +} + void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction) { mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));