[Libreoffice-commits] core.git: Branch 'distro/suse/suse-3.6' - 2 commits - svx/inc svx/source

Luboš Luňák l.lunak at suse.cz
Thu Feb 7 09:39:57 PST 2013


 svx/inc/svx/dialogs.hrc          |    2 +
 svx/source/tbxctrls/tbcontrl.cxx |   42 +++++++++++++++++++++++++++++++++++++++
 svx/source/tbxctrls/tbcontrl.src |   12 +++++++++++
 3 files changed, 56 insertions(+)

New commits:
commit 90e132ad6c9d5adde29ad14e3a30dd743338f8ed
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Wed Feb 6 18:31:14 2013 +0100

    also change the font combo tooltip to say font is not available (fate#308255)
    
    (cherry picked from commit 17d86df23e7be3ab0a161f69ff0f703728e0e135)
    
    Conflicts:
    	svx/source/tbxctrls/tbcontrl.src
    
    Change-Id: I68e31498aa4916e11e04c57171e32cf9b3204108

diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc
index 0c56983..bf68808 100644
--- a/svx/inc/svx/dialogs.hrc
+++ b/svx/inc/svx/dialogs.hrc
@@ -397,6 +397,8 @@
 #define RID_SVXSTR_EXTRAS_CHARBACKGROUND    (RID_SVX_START + 196)
 #define RID_SVXSTR_CLEARFORM                (RID_SVX_START + 197)
 #define RID_SVXSTR_MORE                     (RID_SVX_START + 198)
+#define RID_SVXSTR_CHARFONTNAME_NOTAVAILABLE (RID_SVX_START + 199)
+#define RID_SVXSTR_CHARFONTNAME             (RID_SVX_START + 200)
 
 
 // Strings for the UndoTbxControls
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 34a7859..2eb46cc 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -672,6 +672,7 @@ void SvxFontNameBox_Impl::CheckAndMarkUnknownFont( const XubString& fontname )
         {
             font.SetItalic( ITALIC_NONE );
             SetControlFont( font );
+            SetQuickHelpText( SVX_RESSTR( RID_SVXSTR_CHARFONTNAME ));
         }
     }
     else
@@ -680,6 +681,7 @@ void SvxFontNameBox_Impl::CheckAndMarkUnknownFont( const XubString& fontname )
         {
             font.SetItalic( ITALIC_NORMAL );
             SetControlFont( font );
+            SetQuickHelpText( SVX_RESSTR( RID_SVXSTR_CHARFONTNAME_NOTAVAILABLE ));
         }
     }
 }
diff --git a/svx/source/tbxctrls/tbcontrl.src b/svx/source/tbxctrls/tbcontrl.src
index b75f35c..d12a94e 100644
--- a/svx/source/tbxctrls/tbcontrl.src
+++ b/svx/source/tbxctrls/tbcontrl.src
@@ -163,5 +163,17 @@ String RID_SVXSTR_TEXTCOLOR
     Text [ en-US ] = "Font color";
 };
 //-----IAccessibility2 Implementation 2009
+
+// This is duplicated in GenericCommands.xcu in officecfg.
+String RID_SVXSTR_CHARFONTNAME
+{
+    Text [ en-US ] = "Font Name";
+};
+
+String RID_SVXSTR_CHARFONTNAME_NOTAVAILABLE
+{
+    Text [ en-US ] = "Font Name. The current font is not available and will be substituted.";
+};
+
 // ********************************************************************** EOF
 
commit 00914dc9248760d62bea373f1fb4b78eece77dd7
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Tue Feb 5 16:40:29 2013 +0100

    if a font is not available, show its name in italic in font combo(fate#308255)
    
    (cherry picked from commit 0376a4c13ccffa64c938c6361a337264ad8f2b67)
    
    Conflicts:
    	vcl/inc/vcl/combobox.hxx
    
    Change-Id: Ia7d0de2c3017f450b9ace31753a351601ca6f1f0

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 3e80d55..34a7859 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -198,6 +198,7 @@ private:
 
     void            ReleaseFocus_Impl();
     void            EnableControls_Impl();
+    void            CheckAndMarkUnknownFont( const XubString& fontname );
 
 protected:
     virtual void    Select();
@@ -215,6 +216,8 @@ public:
     void            Fill( const FontList* pList )
                         { FontNameBox::Fill( pList );
                           nFtCount = pList->GetFontNameCount(); }
+    virtual void    SetText( const XubString& rStr );
+    virtual void    SetText( const XubString& rStr, const Selection& rNewSelection );
     virtual long    PreNotify( NotifyEvent& rNEvt );
     virtual long    Notify( NotifyEvent& rNEvt );
     virtual Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
@@ -644,6 +647,43 @@ void SvxFontNameBox_Impl::FillList()
     SetSelection( aOldSel );
 }
 
+void SvxFontNameBox_Impl::SetText( const XubString& rStr )
+{
+    CheckAndMarkUnknownFont( rStr );
+    return FontNameBox::SetText( rStr );
+}
+
+void SvxFontNameBox_Impl::SetText( const XubString& rStr, const Selection& rNewSelection )
+{
+    CheckAndMarkUnknownFont( rStr );
+    return FontNameBox::SetText( rStr, rNewSelection );
+}
+
+void SvxFontNameBox_Impl::CheckAndMarkUnknownFont( const XubString& fontname )
+{
+    if( fontname == GetText())
+        return;
+    GetDocFontList_Impl( &pFontList, this );
+    // If the font is unknown, show it in italic.
+    Font font = GetControlFont();
+    if( pFontList != NULL && pFontList->IsAvailable( fontname ))
+    {
+        if( font.GetItalic() != ITALIC_NONE )
+        {
+            font.SetItalic( ITALIC_NONE );
+            SetControlFont( font );
+        }
+    }
+    else
+    {
+        if( font.GetItalic() != ITALIC_NORMAL )
+        {
+            font.SetItalic( ITALIC_NORMAL );
+            SetControlFont( font );
+        }
+    }
+}
+
 // -----------------------------------------------------------------------
 
 void SvxFontNameBox_Impl::Update( const SvxFontItem* pFontItem )


More information about the Libreoffice-commits mailing list