[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - cui/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jul 20 09:54:34 UTC 2018


 cui/source/dialogs/cuicharmap.cxx |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit a32d9ec1fa48296ffba713bc4593cad45a1c83ad
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 19 12:20:47 2018 +0100
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Fri Jul 20 11:54:11 2018 +0200

    tdf#118304 reselect current glyph on changing font
    
    preview glyph will rerender the glyph if its there, or the glyph description
    changes to "missing glyph" if its not there anymore. Don't auto select
    first entry of the subset when font changes, leave it as unselected and
    let the glyph determine what's ends up there
    
    Change-Id: I33d7dd3a071100175ac9bc7c7e9d44684a1aff28
    Reviewed-on: https://gerrit.libreoffice.org/57724
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit e8bf2cb72dbe55f4e9ac7ace48e644a934cfc503)
    Reviewed-on: https://gerrit.libreoffice.org/57764
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index d65ec3fe1926..7837e6fa6f5d 100755
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -471,6 +471,8 @@ void SvxCharacterMap::init()
     else if (m_xFontLB->get_count() )
         m_xFontLB->set_active(0);
     FontSelectHdl(*m_xFontLB);
+    if (m_xSubsetLB->get_count())
+        m_xSubsetLB->set_active(0);
 
     m_xFontLB->connect_changed(LINK( this, SvxCharacterMap, FontSelectHdl));
     m_xSubsetLB->connect_changed(LINK( this, SvxCharacterMap, SubsetSelectHdl));
@@ -603,6 +605,8 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont )
     m_xFontLB->set_active_text(aTmp.GetFamilyName());
     aFont = aTmp;
     FontSelectHdl(*m_xFontLB);
+    if (m_xSubsetLB->get_count())
+        m_xSubsetLB->set_active(0);
 }
 
 void SvxCharacterMap::fillAllSubsets(weld::ComboBoxText& rListBox)
@@ -680,14 +684,10 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl, weld::ComboBoxText&, void)
         pSubsetMap = new SubsetMap( xFontCharMap );
 
         // update subset listbox for new font's unicode subsets
-        bool bFirst = true;
         for (auto const& subset : pSubsetMap->GetSubsetMap())
         {
             m_xSubsetLB->append(OUString::number(reinterpret_cast<sal_uInt64>(&subset)), subset.GetName());
             // NOTE: subset must live at least as long as the selected font
-            if (bFirst)
-                m_xSubsetLB->set_active(0);
-            bFirst = false;
         }
 
         if (m_xSubsetLB->get_count() <= 1)
@@ -696,6 +696,9 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl, weld::ComboBoxText&, void)
 
     m_xSubsetText->set_sensitive(bNeedSubset);
     m_xSubsetLB->set_sensitive(bNeedSubset);
+
+    // tdf#118304 reselect current glyph to see if its still there in new font
+    selectCharByCode(Radix::hexadecimal);
 }
 
 void SvxCharacterMap::toggleSearchView(bool state)
@@ -999,14 +1002,11 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void)
             m_xSubsetLB->set_active(-1);
     }
 
-    if(m_xShowSet->HasFocus() || m_xHexCodeText->has_focus() || m_xDecimalCodeText->has_focus() )
-    {
-        m_aShowChar.SetText( aText );
-        m_aShowChar.SetFont( aFont );
-        m_aShowChar.Invalidate();
+    m_aShowChar.SetText( aText );
+    m_aShowChar.SetFont( aFont );
+    m_aShowChar.Invalidate();
 
-        setFavButtonState(aText, aFont.GetFamilyName());
-    }
+    setFavButtonState(aText, aFont.GetFamilyName());
 }
 
 IMPL_LINK_NOARG(SvxCharacterMap, SearchCharHighlightHdl, SvxShowCharSet*, void)


More information about the Libreoffice-commits mailing list