[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jul 31 06:48:52 UTC 2021
include/vcl/filter/SvmWriter.hxx | 1 +
vcl/source/filter/svm/SvmWriter.cxx | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+)
New commits:
commit dd8c7dc5083c83e5b3ad6fb19905c6187af14260
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Wed Jul 28 11:33:42 2021 +0300
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Jul 31 08:48:20 2021 +0200
Add Handler for Line Write
The handler separates MetaLineAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx
Change-Id: I34f7781426177b5a1d36260df55128591db4a894
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119592
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 3273e12e7fe2..b767eee5c94d 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -41,4 +41,5 @@ public:
void ActionHandler(MetaAction* pAction);
void PixelHandler(MetaPixelAction* pAction);
void PointHandler(MetaPointAction* pAction);
+ void LineHandler(MetaLineAction* pAction);
};
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index c8abf09115f9..c0eeb443877e 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -92,6 +92,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
}
break;
+ case MetaActionType::LINE:
+ {
+ auto* pMetaAction = static_cast<MetaLineAction*>(pAction);
+ LineHandler(pMetaAction);
+ }
+ break;
+
/* default case prevents test failure and will be
removed once all the handlers are completed */
default:
@@ -120,4 +127,18 @@ void SvmWriter::PointHandler(MetaPointAction* pAction)
TypeSerializer aSerializer(mrStream);
aSerializer.writePoint(pAction->GetPoint());
}
+
+void SvmWriter::LineHandler(MetaLineAction* pAction)
+{
+ mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+
+ VersionCompatWrite aCompat(mrStream, 2);
+
+ // Version 1
+ TypeSerializer aSerializer(mrStream);
+ aSerializer.writePoint(pAction->GetStartPoint());
+ aSerializer.writePoint(pAction->GetEndPoint());
+ // Version 2
+ WriteLineInfo(mrStream, pAction->GetLineInfo());
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list