[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 3 02:50:05 UTC 2021
include/vcl/filter/SvmWriter.hxx | 1 +
vcl/source/filter/svm/SvmWriter.cxx | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+)
New commits:
commit e3e0efb732b1f17ca9db50809d39eecc68961e0b
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Mon Aug 2 20:01:32 2021 +0300
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Aug 3 04:49:32 2021 +0200
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 at gmail.com>
diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index f4019899c5ce..0fd822e86c6a 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -51,4 +51,5 @@ public:
void PolyLineHandler(MetaPolyLineAction* pAction);
void PolygonHandler(MetaPolygonAction* pAction);
void PolyPolygonHandler(MetaPolyPolygonAction* pAction);
+ void TextHandler(MetaTextAction* 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 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: */
More information about the Libreoffice-commits
mailing list