[Libreoffice-commits] core.git: svx/source

Noel Power noel.power at suse.com
Fri Apr 17 08:04:41 PDT 2015


 svx/source/tbxctrls/tbcontrl.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 4c24d41d9f44cbeafde6ffbdcdfdf15e20112357
Author: Noel Power <noel.power at suse.com>
Date:   Fri Apr 17 16:02:03 2015 +0100

    fdo#71797 strange font selection bug with font preview
    
    The dialog seems to be automatically in preview mode from the start
    (which seems wrong) That bogus mode of operation (which I failed to fix
    from the begining) is somewhat responsible for the behaviour we see.
    Adding here a further ugly hack to ensure we use GetText when not in
    drop down mode (this is when clicking on a cell or cycling through the
    font list with up/down keys) In dropdown mode sweeping with the mouse
    highlights fonts (and we preview the highlighted ones) Note: in this
    case the selected font and the highlighted font are different, we
    need to pick up the correct one.
    
    Change-Id: Id2ba96a57d2f8cfc9657bce8de3ac27588868eaf
    Signed-off-by: Noel Power <noel.power at suse.com>

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 88a6b93..ea648c8 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1040,8 +1040,17 @@ void SvxFontNameBox_Impl::UserDraw( const UserDrawEvent& rUDEvt )
     // or select
     if (  rUDEvt.GetItemId() == rUDEvt.GetStyle() )
     {
+        OUString fontName(GetText());
+        if (IsInDropDown())
+        {
+            /*
+             * when in dropdown mode the selected item should be
+             * used and not the current selection
+             */
+             fontName = GetEntry(rUDEvt.GetItemId());
+        }
         Sequence< PropertyValue > aArgs( 1 );
-        vcl::FontInfo aInfo( pFontList->Get( GetEntry( rUDEvt.GetItemId() ),
+        vcl::FontInfo aInfo( pFontList->Get( fontName,
             aCurFont.GetWeight(),
             aCurFont.GetItalic() ) );
 


More information about the Libreoffice-commits mailing list