diff options
author | panoskorovesis <panoskorovesis@outlook.com> | 2021-07-15 10:15:25 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-07-19 10:01:28 +0200 |
commit | e6773aaa82a11485bf07c1e960f8c1df5f7f02d5 (patch) | |
tree | ab9c8bef7c0c24b2d854ad3e4da180c2f5f50006 /vcl | |
parent | a452a9180e5cdecf6fe4cb59c8658e11640bbb6e (diff) |
Add Handler for Font Read
The handler separates MetaFontAction::Read from metaact.hxx
Read implementation is now in SvmReader.hxx
Change-Id: Id301813ceb29e13488a472ab8e3b2dfd9287d624
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118979
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/svm/SvmReader.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx index 5f1947bffe76..7c1b101e925a 100644 --- a/vcl/source/filter/svm/SvmReader.cxx +++ b/vcl/source/filter/svm/SvmReader.cxx @@ -19,6 +19,7 @@ #include <vcl/filter/SvmReader.hxx> #include <sal/log.hxx> +#include <osl/thread.h> #include <tools/stream.hxx> #include <tools/vcompat.hxx> #include <vcl/dibtools.hxx> @@ -286,7 +287,7 @@ rtl::Reference<MetaAction> SvmReader::MetaActionHandler(ImplMetaReadData* pData) return MapModeHandler(); break; case MetaActionType::FONT: - pAction = new MetaFontAction; + return FontHandler(pData); break; case MetaActionType::PUSH: pAction = new MetaPushAction; @@ -1243,4 +1244,20 @@ rtl::Reference<MetaAction> SvmReader::MapModeHandler() return pAction; } + +rtl::Reference<MetaAction> SvmReader::FontHandler(ImplMetaReadData* pData) +{ + auto pAction = new MetaFontAction(); + + VersionCompatRead aCompat(mrStream); + vcl::Font aFont; + ReadFont(mrStream, aFont); + pData->meActualCharSet = aFont.GetCharSet(); + if (pData->meActualCharSet == RTL_TEXTENCODING_DONTKNOW) + pData->meActualCharSet = osl_getThreadTextEncoding(); + + pAction->SetFont(aFont); + + return pAction; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |