summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorpanoskorovesis <panoskorovesis@outlook.com>2021-08-02 20:01:32 +0300
committerTomaž Vajngerl <quikee@gmail.com>2021-08-03 04:49:32 +0200
commite3e0efb732b1f17ca9db50809d39eecc68961e0b (patch)
tree35c017605a0ea873aab1cb7a8125565d583253fb /vcl
parenta3848e4e6b433e251c5e51f1e29d3c28d54a257c (diff)
Add Handler for Text Write
The handler separates MetaTextAction::Write from metaact.hxx Write implementation is now in SvmWriter.hxx Change-Id: Ibc2b83802e74a2d7923ebfb45036751e9f012ede Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119899 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/svm/SvmWriter.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx
index fc4945274d6e..32c7144010b9 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -162,6 +162,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
}
break;
+ case MetaActionType::TEXT:
+ {
+ auto* pMetaAction = static_cast<MetaTextAction*>(pAction);
+ TextHandler(pMetaAction, pData);
+ }
+ break;
+
/* default case prevents test failure and will be
removed once all the handlers are completed */
default:
@@ -333,4 +340,18 @@ void SvmWriter::PolyPolygonHandler(MetaPolyPolygonAction* pAction)
}
}
}
+
+void SvmWriter::TextHandler(MetaTextAction* pAction, ImplMetaWriteData* pData)
+{
+ mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+
+ 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());
+
+ write_uInt16_lenPrefixed_uInt16s_FromOUString(mrStream, pAction->GetText()); // version 2
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */