From c878a2227192021eeabb1143b0f374df43d32a56 Mon Sep 17 00:00:00 2001 From: panoskorovesis Date: Sat, 31 Jul 2021 13:46:39 +0300 Subject: Add Handler for Arc Write MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The handler separates MetaArcAction::Write from metaact.hxx Write implementation is now in SvmWriter.hxx Change-Id: I141ba52e591ba38880f67669a2fb38e8c3e57f45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119734 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- vcl/source/filter/svm/SvmWriter.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'vcl') diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx index fcc79a81a958..c9f0bb6f6e3e 100644 --- a/vcl/source/filter/svm/SvmWriter.cxx +++ b/vcl/source/filter/svm/SvmWriter.cxx @@ -120,6 +120,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData) } break; + case MetaActionType::ARC: + { + auto* pMetaAction = static_cast(pAction); + ArcHandler(pMetaAction); + } + break; + /* default case prevents test failure and will be removed once all the handlers are completed */ default: @@ -190,4 +197,15 @@ void SvmWriter::EllipseHandler(MetaEllipseAction* pAction) TypeSerializer aSerializer(mrStream); aSerializer.writeRectangle(pAction->GetRect()); } + +void SvmWriter::ArcHandler(MetaArcAction* pAction) +{ + mrStream.WriteUInt16(static_cast(pAction->GetType())); + + VersionCompatWrite aCompat(mrStream, 1); + TypeSerializer aSerializer(mrStream); + aSerializer.writeRectangle(pAction->GetRect()); + aSerializer.writePoint(pAction->GetStartPoint()); + aSerializer.writePoint(pAction->GetEndPoint()); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit