From dc23042b6adb62eb5b0963be04aa121d0cd66ff5 Mon Sep 17 00:00:00 2001 From: panoskorovesis Date: Thu, 5 Aug 2021 09:41:47 +0300 Subject: Add Handler for MaskScale Write MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- include/vcl/filter/SvmWriter.hxx | 1 + vcl/source/filter/svm/SvmWriter.cxx | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) 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(pAction); + MaskScaleHandler(pMetaAction); + } + break; + case MetaActionType::OVERLINECOLOR: { auto* pMetaAction = static_cast(pAction); @@ -691,6 +698,19 @@ void SvmWriter::MaskHandler(MetaMaskAction* pAction) } } +void SvmWriter::MaskScaleHandler(MetaMaskScaleAction* pAction) +{ + if (!pAction->GetBitmap().IsEmpty()) + { + mrStream.WriteUInt16(static_cast(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(pAction->GetType())); -- cgit