dbaccess/source/ui/control/sqledit.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 942c8654648ab18a32b00eb686ce04d9ee668617 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Nov 12 12:23:05 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Nov 12 16:38:16 2021 +0100 insert special character in sql view in dbaccess using an arbitrary font The font to use in the editengine is set with the fallback list notation "Font1;Font2;Font3" and while SvxCharacterMap::SetCharFont explicitly has... { // first get the underlying info in order to get font names // like "Times New Roman;Times" resolved vcl::Font aTmp(m_xVirDev->GetFontMetric(rFont)); } which is supposed to resolve to what the physical font is, it appears that since the ancient merge of: commit 2f382d6c2579a25c68dbd121af7f1f5dc7ec9852 Date: Thu Mar 27 16:59:30 2003 +0000 MWS_SRX644: migrate branch mws_srx644 -> HEAD a change was included of: - // Fontdaten ermitteln und setzen - aMetric.SetName( pMetric->maName ); + // set aMetric with info from font + aMetric.SetName( maFont.GetName() ); which means that font names like "Times:Times New Roman" appear in the FontMetric for the font and not the font name of the physical font that the metric describes. That doesn't look right to me, but rather than get bogged down in changing that and the undoubtedly infinite chain of knock on problems that will trigger just start with a simple font name here not the fallback list. The font is "Liberation Mono;etc;etc" so the first one is certain to be available. Change-Id: I58809be8edb515d9823867c7a0bce5931dccbd27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125100 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index 7f86d8d01bc0..5ebb87152684 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -90,7 +90,7 @@ void SQLEditView::SetItemPoolFont(SfxItemPool* pItemPool) OUString sFontName(officecfg::Office::Common::Font::SourceViewFont::FontName::get().value_or(OUString())); if (sFontName.isEmpty()) { - vcl::Font aTmpFont(OutputDevice::GetDefaultFont(DefaultFontType::FIXED, Application::GetSettings().GetUILanguageTag().getLanguageType(), GetDefaultFontFlags::NONE)); + vcl::Font aTmpFont(OutputDevice::GetDefaultFont(DefaultFontType::FIXED, Application::GetSettings().GetUILanguageTag().getLanguageType(), GetDefaultFontFlags::OnlyOne)); sFontName = aTmpFont.GetFamilyName(); }