[Libreoffice-commits] core.git: include/vcl vcl/source
panoskorovesis (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 3 22:54:22 UTC 2021
include/vcl/filter/SvmWriter.hxx | 1 +
vcl/source/filter/svm/SvmWriter.cxx | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
New commits:
commit e31b6f6aced8588cefe5d72292403a87c6dd2a73
Author: panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Tue Aug 3 09:53:58 2021 +0300
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed Aug 4 00:53:48 2021 +0200
Add Handler for Font Write
The handler separates MetaFontAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx
Change-Id: Ib80f60afc355fd38729eb2505069851d26328101
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119923
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 dcd28b812803..f437ee7eff46 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -59,4 +59,5 @@ public:
void OverlineColorHandler(MetaOverlineColorAction* pAction);
void TextAlignHandler(MetaTextAlignAction* pAction);
void MapModeHandler(MetaMapModeAction* pAction);
+ void FontHandler(MetaFontAction* 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 7ed7df861b76..96509316d1c5 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -22,6 +22,8 @@
#include <tools/vcompat.hxx>
+#include <osl/thread.h>
+
SvmWriter::SvmWriter(SvStream& rIStm)
: mrStream(rIStm)
{
@@ -218,6 +220,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData)
}
break;
+ case MetaActionType::FONT:
+ {
+ auto* pMetaAction = static_cast<MetaFontAction*>(pAction);
+ FontHandler(pMetaAction, pData);
+ }
+ break;
+
/* default case prevents test failure and will be
removed once all the handlers are completed */
default:
@@ -492,4 +501,14 @@ void SvmWriter::MapModeHandler(MetaMapModeAction* pAction)
TypeSerializer aSerializer(mrStream);
aSerializer.writeMapMode(pAction->GetMapMode());
}
+
+void SvmWriter::FontHandler(MetaFontAction* pAction, ImplMetaWriteData* pData)
+{
+ mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType()));
+ VersionCompatWrite aCompat(mrStream, 1);
+ WriteFont(mrStream, pAction->GetFont());
+ pData->meActualCharSet = pAction->GetFont().GetCharSet();
+ if (pData->meActualCharSet == RTL_TEXTENCODING_DONTKNOW)
+ pData->meActualCharSet = osl_getThreadTextEncoding();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list