[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Fri Aug 6 23:00:47 UTC 2021
include/vcl/filter/SvmWriter.hxx | 1 +
vcl/source/filter/svm/SvmWriter.cxx | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
New commits:
commit f41a03960933fba0e3177ea0463c5c9ec361bc96
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Wed Aug 4 13:02:37 2021 +0300
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat Aug 7 01:00:05 2021 +0200
Add Handler for Comment Write
The handler separates MetaCommentAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx
Change-Id: I2967b1f66c2467b622980ba3b65199ff8045d1b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120109
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 ae2a690079c4..d1466c60a334 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -67,4 +67,5 @@ public:
void FloatTransparentHandler(MetaFloatTransparentAction* pAction);
void EPSHandler(MetaEPSAction* pAction);
void RefPointHandler(MetaRefPointAction* pAction);
+ void CommentHandler(MetaCommentAction* pAction);
};
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index eb2ea4835282..afddcf80bb67 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -276,6 +276,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
}
break;
+ case MetaActionType::COMMENT:
+ {
+ auto* pMetaAction = static_cast<MetaCommentAction*>(pAction);
+ CommentHandler(pMetaAction);
+ }
+ break;
+
/* default case prevents test failure and will be
removed once all the handlers are completed */
default:
@@ -640,4 +647,15 @@ void SvmWriter::RefPointHandler(MetaRefPointAction* pAction)
aSerializer.writePoint(pAction->GetRefPoint());
mrStream.WriteBool(pAction->IsSetting());
}
+
+void SvmWriter::CommentHandler(MetaCommentAction* pAction)
+{
+ mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+ VersionCompatWrite aCompat(mrStream, 1);
+ write_uInt16_lenPrefixed_uInt8s_FromOString(mrStream, pAction->GetComment());
+ mrStream.WriteInt32(pAction->GetValue()).WriteUInt32(pAction->GetDataSize());
+
+ if (pAction->GetDataSize())
+ mrStream.WriteBytes(pAction->GetData(), pAction->GetDataSize());
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list