diff options
author | panoskorovesis <panoskorovesis@outlook.com> | 2021-07-26 10:23:00 +0300 |
---|---|---|
committer | panoskorovesis <panoskorovesis@outlook.com> | 2021-07-26 10:24:22 +0300 |
commit | 212fba1c1871f1d4b81cb21169e2451bba004888 (patch) | |
tree | 941871b0e564d9e0a25a73074f527b8edc082c0b /vcl/source/filter/svm/SvmWriter.cxx | |
parent | 0d7afd98e1838480f0f922e31f9ed4718209485b (diff) |
Simplify SvmWriter Codefeature/gsoc-svm-writer
There is no need to call ActionHandler for each metaact derived class.
Change-Id: Ieaf6834c246e674845cb52fe4025ccbe827fa0a4
Diffstat (limited to 'vcl/source/filter/svm/SvmWriter.cxx')
-rw-r--r-- | vcl/source/filter/svm/SvmWriter.cxx | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx index 8733e493b254..89dbe3dfb3a7 100644 --- a/vcl/source/filter/svm/SvmWriter.cxx +++ b/vcl/source/filter/svm/SvmWriter.cxx @@ -68,51 +68,52 @@ SvStream& SvmWriter::Write(GDIMetaFile& rMetaFile) return mrStream; } -void SvmWriter::MetaActionHandler(MetaAction* pAct, ImplMetaWriteData* pData) +void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData) { - MetaActionType nType = static_cast<MetaActionType>(pAct->GetType()); + MetaActionType nType = static_cast<MetaActionType>(pAction->GetType()); switch (nType) { case MetaActionType::NONE: { - ActionHandler(pAct->GetType()); + auto* pMetaAction = static_cast<MetaAction*>(pAction); + ActionHandler(pMetaAction); } break; case MetaActionType::PIXEL: { - auto* pMetaAction = static_cast<MetaPixelAction*>(pAct); + auto* pMetaAction = static_cast<MetaPixelAction*>(pAction); PixelHandler(pMetaAction); } break; case MetaActionType::POINT: { - auto pMetaAction = static_cast<MetaPointAction*>(pAct); + auto pMetaAction = static_cast<MetaPointAction*>(pAction); PointHandler(pMetaAction); } break; default: - pAct->Write(mrStream, pData); + pAction->Write(mrStream, pData); } } -void SvmWriter::ActionHandler(MetaActionType nType) +void SvmWriter::ActionHandler(MetaAction* pAction) { - mrStream.WriteUInt16(static_cast<sal_uInt16>(nType)); + mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType())); } -void SvmWriter::PixelHandler(MetaPixelAction* pAct) +void SvmWriter::PixelHandler(MetaPixelAction* pAction) { - ActionHandler(pAct->GetType()); + mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType())); VersionCompatWrite aCompat(mrStream, 1); TypeSerializer aSerializer(mrStream); - aSerializer.writePoint(pAct->GetPoint()); - WriteColor(pAct->GetColor()); + aSerializer.writePoint(pAction->GetPoint()); + WriteColor(pAction->GetColor()); } void SvmWriter::PointHandler(MetaPointAction* pAct) { - ActionHandler(pAct->GetType()); + mrStream.WriteUInt16(static_cast<sal_uInt16>(pAct->GetType())); VersionCompatWrite aCompat(mrStream, 1); TypeSerializer aSerializer(mrStream); aSerializer.writePoint(pAct->GetPoint()); |