diff options
author | panoskorovesis <panoskorovesis@outlook.com> | 2021-08-02 20:07:36 +0300 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-08-03 04:50:33 +0200 |
commit | 04073bc1b53a8e2b7376c1a40c02c60adc69fde0 (patch) | |
tree | 29aaa7972bfc441ad3d0a89ead0afe1681c6ae98 /vcl | |
parent | 46377cb8abcc20fd083c981b2e14ebc4ba78804a (diff) |
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 <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/svm/SvmWriter.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
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: */ |