dbaccess/source/ui/control/sqledit.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bc00beb99b62c8350e86f76d19367198ab979ea9
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Nov 12 12:23:05 2021 +0000
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Sun Nov 14 23:18:40 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/+/124981
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/dbaccess/source/ui/control/sqledit.cxx 
b/dbaccess/source/ui/control/sqledit.cxx
index c379ad5fcc32..92af2e8bd03b 100644
--- a/dbaccess/source/ui/control/sqledit.cxx
+++ b/dbaccess/source/ui/control/sqledit.cxx
@@ -89,7 +89,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();
     }
 

Reply via email to