summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei@libreoffice.org>2023-09-01 16:44:51 -0400
committerKohei Yoshida <kohei@libreoffice.org>2023-09-02 02:31:29 +0200
commit78d9d0d8dccb6fd8952435b8a13d525c7606f467 (patch)
tree0e30c0df2b36671b6aec1f6f187d38eecb523053 /sc
parent03bc5199f92e70b6168e4f79600ac288aa7b26ec (diff)
Apply font names and sizes to formatted strings via orcus
Change-Id: I6809a184652b278eb66ee104558af19ea4a22ed7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156459 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/orcus/interface.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index c2c784a5a016..b349016355b7 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -1357,12 +1357,23 @@ void ScOrcusSharedStrings::set_segment_italic(bool b)
maCurFormat.Put(SvxPostureItem(eItalic, EE_CHAR_ITALIC));
}
-void ScOrcusSharedStrings::set_segment_font_name(std::string_view /*s*/)
+void ScOrcusSharedStrings::set_segment_font_name(std::string_view s)
{
+ OUString aName = toOUString(s);
+ maCurFormat.Put(
+ SvxFontItem(
+ FAMILY_DONTKNOW, aName, aName, PITCH_DONTKNOW,
+ mrFactory.getGlobalSettings().getTextEncoding(),
+ EE_CHAR_FONTINFO
+ )
+ );
}
-void ScOrcusSharedStrings::set_segment_font_size(double /*point*/)
+void ScOrcusSharedStrings::set_segment_font_size(double point)
{
+ // points to 100th of millimeters
+ tools::Long nMM = o3tl::convert(point, o3tl::Length::pt, o3tl::Length::mm100);
+ maCurFormat.Put(SvxFontHeightItem(nMM, 100, EE_CHAR_FONTHEIGHT));
}
void ScOrcusSharedStrings::set_segment_font_color(