[Libreoffice-commits] core.git: 4 commits - svtools/source svx/inc svx/source vcl/inc

Luboš Luňák l.lunak at suse.cz
Wed Feb 6 09:38:12 PST 2013


 svtools/source/control/ctrlbox.cxx |    1 
 svx/inc/svx/dialogs.hrc            |    2 +
 svx/source/tbxctrls/tbcontrl.cxx   |   43 ++++++++++++++++++++++++++++++++++++-
 svx/source/tbxctrls/tbcontrl.src   |   12 ++++++++++
 vcl/inc/vcl/combobox.hxx           |    4 +--
 5 files changed, 58 insertions(+), 4 deletions(-)

New commits:
commit 17d86df23e7be3ab0a161f69ff0f703728e0e135
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
    
    Change-Id: I68e31498aa4916e11e04c57171e32cf9b3204108

diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc
index 2ab14c7..8fe6bb5 100644
--- a/svx/inc/svx/dialogs.hrc
+++ b/svx/inc/svx/dialogs.hrc
@@ -277,6 +277,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 insert/overwrite mode
 #define RID_SVXSTR_INSERT_HELPTEXT          (RID_SVX_START + 210)
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 2f2812c..d827854 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -809,6 +809,7 @@ void SvxFontNameBox_Impl::CheckAndMarkUnknownFont( const OUString& fontname )
         {
             font.SetItalic( ITALIC_NONE );
             SetControlFont( font );
+            SetQuickHelpText( SVX_RESSTR( RID_SVXSTR_CHARFONTNAME ));
         }
     }
     else
@@ -817,6 +818,7 @@ void SvxFontNameBox_Impl::CheckAndMarkUnknownFont( const OUString& 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 678fec5..a438a2a 100644
--- a/svx/source/tbxctrls/tbcontrl.src
+++ b/svx/source/tbxctrls/tbcontrl.src
@@ -152,5 +152,17 @@ String RID_SVXSTR_TEXTCOLOR
 {
     Text [ en-US ] = "Font color";
 };
+
+// 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 445ad883611e4343e19174bfa1259f0477d3e788
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Tue Feb 5 17:17:00 2013 +0100

    remove unused variable
    
    Change-Id: Ie81d49f5aec6a4d87b2b49b015afbcaa94e12e50

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 01f0e5e..2f2812c 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1314,7 +1314,6 @@ void SvxFrameWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt )
 
 IMPL_LINK_NOARG(SvxFrameWindow_Impl, SelectHdl)
 {
-    ::Color             aColBlack( COL_BLACK );
     SvxBoxItem          aBorderOuter( SID_ATTR_BORDER_OUTER );
     SvxBoxInfoItem      aBorderInner( SID_ATTR_BORDER_INNER );
     SvxBorderLine       theDefLine;
commit 0376a4c13ccffa64c938c6361a337264ad8f2b67
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 the font combo
    
    Change-Id: Ia7d0de2c3017f450b9ace31753a351601ca6f1f0

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index d49fc25..01f0e5e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -191,6 +191,7 @@ private:
 
     void            ReleaseFocus_Impl();
     void            EnableControls_Impl();
+    void            CheckAndMarkUnknownFont( const OUString& fontname );
 
 protected:
     virtual void    Select();
@@ -208,6 +209,8 @@ public:
     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();
@@ -781,6 +784,43 @@ void SvxFontNameBox_Impl::FillList()
     SetSelection( aOldSel );
 }
 
+void SvxFontNameBox_Impl::SetText( const OUString& rStr )
+{
+    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;
+    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 )
diff --git a/vcl/inc/vcl/combobox.hxx b/vcl/inc/vcl/combobox.hxx
index 4994797..33a4382 100644
--- a/vcl/inc/vcl/combobox.hxx
+++ b/vcl/inc/vcl/combobox.hxx
@@ -123,8 +123,8 @@ public:
 
     void            EnableDDAutoWidth( sal_Bool b );
 
-    void            SetText( const OUString& rStr );
-    void            SetText( const OUString& rStr, const Selection& rNewSelection );
+    virtual void    SetText( const OUString& rStr );
+    virtual void    SetText( const OUString& rStr, const Selection& rNewSelection );
 
     sal_uInt16          InsertEntry( const XubString& rStr, sal_uInt16 nPos = COMBOBOX_APPEND );
     sal_uInt16          InsertEntry( const XubString& rStr, const Image& rImage, sal_uInt16 nPos = COMBOBOX_APPEND );
commit 624d46964215c1f066ded64ab684d6ccc98705d9
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Mon Feb 4 18:18:01 2013 +0100

    remove unused variable
    
    Change-Id: Iadc8b161c2742c1b92938c39c00c263b597693f5

diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 0b6d591..bb35ebc 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1296,7 +1296,6 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
         long nVertAdjust = nDesiredGap - aTextRect.Top();
         Point aPos( nX, aTopLeft.Y() + nVertAdjust );
         rUDEvt.GetDevice()->DrawText( aPos, sFontName );
-        Rectangle aHack(aPos.X(), aTopLeft.Y() + nH/2 - 5, aPos.X() + 40, aTopLeft.Y() + nH/2 + 5);
         long nTextX = aPos.X() + aTextRect.GetWidth() + GAPTOEXTRAPREVIEW;
 
         if (!bUsingCorrectFont)


More information about the Libreoffice-commits mailing list