include/vcl/filter/SvmWriter.hxx | 1 + vcl/source/filter/svm/SvmWriter.cxx | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+)
New commits: commit 04073bc1b53a8e2b7376c1a40c02c60adc69fde0 Author: panoskorovesis <panoskorove...@outlook.com> AuthorDate: Mon Aug 2 20:07:36 2021 +0300 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Tue Aug 3 04:50:33 2021 +0200 Add Handler for StretchText Write The handler separates MetaStretchTextAction::Write from metaact.hxx Write implementation is now in SvmWriter.hxx Change-Id: I1e5df474921796c064aa83406356b38bd2431451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119901 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 2b6f8f9db997..d42780b828af 100644 --- a/include/vcl/filter/SvmWriter.hxx +++ b/include/vcl/filter/SvmWriter.hxx @@ -53,4 +53,5 @@ public: void PolyPolygonHandler(MetaPolyPolygonAction* pAction); void TextHandler(MetaTextAction* pAction, ImplMetaWriteData* pData); void TextArrayHandler(MetaTextArrayAction* pAction, ImplMetaWriteData* pData); + void StretchTextHandler(MetaStretchTextAction* pAction, ImplMetaWriteData* pData); }; \ No newline at end of file diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx index e51ea797aceb..830013b357b4 100644 --- a/vcl/source/filter/svm/SvmWriter.cxx +++ b/vcl/source/filter/svm/SvmWriter.cxx @@ -176,6 +176,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData) } break; + case MetaActionType::STRETCHTEXT: + { + auto* pMetaAction = static_cast<MetaStretchTextAction*>(pAction); + StretchTextHandler(pMetaAction, pData); + } + break; + /* default case prevents test failure and will be removed once all the handlers are completed */ default: @@ -383,4 +390,19 @@ void SvmWriter::TextArrayHandler(MetaTextArrayAction* pAction, ImplMetaWriteData write_uInt16_lenPrefixed_uInt16s_FromOUString(mrStream, pAction->GetText()); // version 2 } + +void SvmWriter::StretchTextHandler(MetaStretchTextAction* pAction, ImplMetaWriteData* pData) +{ + mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType())); + + VersionCompatWrite aCompat(mrStream, 2); + TypeSerializer aSerializer(mrStream); + aSerializer.writePoint(pAction->GetPoint()); + mrStream.WriteUniOrByteString(pAction->GetText(), pData->meActualCharSet); + mrStream.WriteUInt32(pAction->GetWidth()); + mrStream.WriteUInt16(pAction->GetIndex()); + mrStream.WriteUInt16(pAction->GetLen()); + + write_uInt16_lenPrefixed_uInt16s_FromOUString(mrStream, pAction->GetText()); // version 2 +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */