[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 3 02:50:33 UTC 2021
include/vcl/filter/SvmWriter.hxx | 1 +
vcl/source/filter/svm/SvmWriter.cxx | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
New commits:
commit 46377cb8abcc20fd083c981b2e14ebc4ba78804a
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Mon Aug 2 20:05:21 2021 +0300
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Aug 3 04:50:00 2021 +0200
Add Handler for TextArray Write
The handler separates MetaTextArrayAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx
Change-Id: I5543957d01c5f2c7d2bf4a56a8a51f9d0330e07d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119900
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 0fd822e86c6a..2b6f8f9db997 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -52,4 +52,5 @@ public:
void PolygonHandler(MetaPolygonAction* pAction);
void PolyPolygonHandler(MetaPolyPolygonAction* pAction);
void TextHandler(MetaTextAction* pAction, ImplMetaWriteData* pData);
+ void TextArrayHandler(MetaTextArrayAction* pAction, ImplMetaWriteData* pData);
};
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index 32c7144010b9..e51ea797aceb 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -169,6 +169,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
}
break;
+ case MetaActionType::TEXTARRAY:
+ {
+ auto* pMetaAction = static_cast<MetaTextArrayAction*>(pAction);
+ TextArrayHandler(pMetaAction, pData);
+ }
+ break;
+
/* default case prevents test failure and will be
removed once all the handlers are completed */
default:
@@ -354,4 +361,26 @@ void SvmWriter::TextHandler(MetaTextAction* pAction, ImplMetaWriteData* pData)
write_uInt16_lenPrefixed_uInt16s_FromOUString(mrStream, pAction->GetText()); // version 2
}
+
+void SvmWriter::TextArrayHandler(MetaTextArrayAction* pAction, ImplMetaWriteData* pData)
+{
+ mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+
+ tools::Long* aArray = pAction->GetDXArray();
+
+ const sal_Int32 nAryLen = aArray ? pAction->GetLen() : 0;
+
+ VersionCompatWrite aCompat(mrStream, 2);
+ TypeSerializer aSerializer(mrStream);
+ aSerializer.writePoint(pAction->GetPoint());
+ mrStream.WriteUniOrByteString(pAction->GetText(), pData->meActualCharSet);
+ mrStream.WriteUInt16(pAction->GetIndex());
+ mrStream.WriteUInt16(pAction->GetLen());
+ mrStream.WriteInt32(nAryLen);
+
+ for (sal_Int32 i = 0; i < nAryLen; ++i)
+ mrStream.WriteInt32(aArray[i]);
+
+ write_uInt16_lenPrefixed_uInt16s_FromOUString(mrStream, pAction->GetText()); // version 2
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list