Hi,
I have submitted a patch for review:
    https://gerrit.libreoffice.org/2152
To pull it, you can do:
    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/52/2152/1
more reliable detecting of changes in the combobox lineedit
Change-Id: I3563a961c54e235fffe0c2ab1809f51882ba3831
---
M svx/source/tbxctrls/tbcontrl.cxx
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index d827854..61e23b8 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -191,7 +191,7 @@
 
     void            ReleaseFocus_Impl();
     void            EnableControls_Impl();
-    void            CheckAndMarkUnknownFont( const OUString& fontname );
+    DECL_DLLPRIVATE_LINK( CheckAndMarkUnknownFont, VclWindowEvent* );
 
 protected:
     virtual void    Select();
@@ -201,6 +201,7 @@
     SvxFontNameBox_Impl( Window* pParent, const Reference< XDispatchProvider >& 
rDispatchProvider,const Reference< XFrame >& _xFrame
         , WinBits nStyle = WB_SORT
         );
+    virtual ~SvxFontNameBox_Impl();
 
     void            FillList();
     void            Update( const SvxFontItem* pFontItem );
@@ -209,8 +210,6 @@
     void            Fill( const FontList* pList )
                         { FontNameBox::Fill( pList );
                           nFtCount = pList->GetFontNameCount(); }
-    virtual void    SetText( const OUString& rStr ) SAL_OVERRIDE;
-    virtual void    SetText( const OUString& rStr, const Selection& rNewSelection ) SAL_OVERRIDE;
     virtual long    PreNotify( NotifyEvent& rNEvt );
     virtual long    Notify( NotifyEvent& rNEvt );
     virtual Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
@@ -771,7 +770,14 @@
 {
     SetSizePixel(LogicToPixel( aLogicalSize, MAP_APPFONT ));
     EnableControls_Impl();
+    GetSubEdit()->AddEventListener( LINK( this, SvxFontNameBox_Impl, CheckAndMarkUnknownFont ));
 }
+
+SvxFontNameBox_Impl::~SvxFontNameBox_Impl()
+{
+    GetSubEdit()->RemoveEventListener( LINK( this, SvxFontNameBox_Impl, CheckAndMarkUnknownFont ));
+}
+
 // -----------------------------------------------------------------------
 
 void SvxFontNameBox_Impl::FillList()
@@ -784,22 +790,11 @@
     SetSelection( aOldSel );
 }
 
-void SvxFontNameBox_Impl::SetText( const OUString& rStr )
+IMPL_LINK( SvxFontNameBox_Impl, CheckAndMarkUnknownFont, VclWindowEvent*, event )
 {
-    CheckAndMarkUnknownFont( rStr );
-    return FontNameBox::SetText( rStr );
-}
-
-void SvxFontNameBox_Impl::SetText( const OUString& rStr, const Selection& rNewSelection )
-{
-    CheckAndMarkUnknownFont( rStr );
-    return FontNameBox::SetText( rStr, rNewSelection );
-}
-
-void SvxFontNameBox_Impl::CheckAndMarkUnknownFont( const OUString& fontname )
-{
-    if( fontname == GetText())
-        return;
+    if( event->GetId() != VCLEVENT_EDIT_MODIFY )
+        return 0;
+    OUString fontname = GetSubEdit()->GetText();
     GetDocFontList_Impl( &pFontList, this );
     // If the font is unknown, show it in italic.
     Font font = GetControlFont();
@@ -821,6 +816,7 @@
             SetQuickHelpText( SVX_RESSTR( RID_SVXSTR_CHARFONTNAME_NOTAVAILABLE ));
         }
     }
+    return 0;
 }
 
 // -----------------------------------------------------------------------
-- 
To view, visit https://gerrit.libreoffice.org/2152
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3563a961c54e235fffe0c2ab1809f51882ba3831
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Luboš Luňák <l.lunak@suse.cz>
Context
- [PATCH] more reliable detecting of changes in the combobox lineedit · via Code Review
 
   
 
  Privacy Policy |
  
Impressum (Legal Info) |
  
Copyright information: Unless otherwise specified, all text and images
  on this website are licensed under the
  
Creative Commons Attribution-Share Alike 3.0 License.
  This does not include the source code of LibreOffice, which is
  licensed under the Mozilla Public License (
MPLv2).
  "LibreOffice" and "The Document Foundation" are
  registered trademarks of their corresponding registered owners or are
  in actual use as trademarks in one or more countries. Their respective
  logos and icons are also subject to international copyright laws. Use
  thereof is explained in our 
trademark policy.