diff options
authorNoel Power <>2015-04-17 16:02:03 +0100
committerNoel Power <>2015-04-17 16:02:20 +0100
commit4c24d41d9f44cbeafde6ffbdcdfdf15e20112357 (patch)
parentba397fc65fa4a21742b62c5b3f796b3535263ef4 (diff)
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 <>
1 files changed, 10 insertions, 1 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 88a6b93f6139..ea648c8b6e98 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.GetItalic() ) );