[Libreoffice-commits] .: cui/source cui/uiconfig

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 20 13:23:32 PST 2012


 cui/source/inc/chardlg.hxx      |    4 -
 cui/source/tabpages/chardlg.cxx |   43 ++++++++++--
 cui/uiconfig/ui/charnamepage.ui |  135 +++++++++++++++++++++++++++++++++++-----
 3 files changed, 157 insertions(+), 25 deletions(-)

New commits:
commit 94f21050aefc56769e49022c6444fd8cd8a4f37d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 20 20:30:03 2012 +0000

    Resolves: fdo#58325 give each font category a separate info label
    
    Change-Id: I1cc38341c2a9d28ab275765e488e5dac334ca0fa

diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index 587161d..ce08f42 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -48,7 +48,6 @@ class SvxCharBasePage : public SfxTabPage
 {
 protected:
     SvxFontPrevWindow*  m_pPreviewWin;
-    FixedText*          m_pFontTypeFT;
 
     sal_Bool                m_bPreviewBackgroundToCharacter;
 
@@ -88,6 +87,7 @@ private:
     FontSizeBox*        m_pWestFontSizeLB;
     FixedText*          m_pWestFontLanguageFT;
     SvxLanguageBox*     m_pWestFontLanguageLB;
+    FixedText*          m_pWestFontTypeFT;
 
     VclContainer*       m_pEastFrame;
     FixedText*          m_pEastFontNameFT;
@@ -98,6 +98,7 @@ private:
     FontSizeBox*        m_pEastFontSizeLB;
     FixedText*          m_pEastFontLanguageFT;
     SvxLanguageBox*     m_pEastFontLanguageLB;
+    FixedText*          m_pEastFontTypeFT;
 
     VclContainer*       m_pCTLFrame;
     FixedText*          m_pCTLFontNameFT;
@@ -108,6 +109,7 @@ private:
     FontSizeBox*        m_pCTLFontSizeLB;
     FixedText*          m_pCTLFontLanguageFT;
     SvxLanguageBox*     m_pCTLFontLanguageLB;
+    FixedText*          m_pCTLFontTypeFT;
 
     SvxCharNamePage_Impl*   m_pImpl;
 
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index f412fd3..598edbc 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -301,6 +301,7 @@ SvxCharNamePage::SvxCharNamePage( Window* pParent, const SfxItemSet& rInSet )
 
         get(m_pWestFontLanguageFT, "westlangft-cjk");
         get(m_pWestFontLanguageLB, "westlanglb-cjk");
+        get(m_pWestFontTypeFT, "westfontinfo-cjk");
     }
     else
     {
@@ -314,6 +315,7 @@ SvxCharNamePage::SvxCharNamePage( Window* pParent, const SfxItemSet& rInSet )
 
         get(m_pWestFontLanguageFT, "westlangft-nocjk");
         get(m_pWestFontLanguageLB, "westlanglb-nocjk");
+        get(m_pWestFontTypeFT, "westfontinfo-nocjk");
     }
 
     get(m_pEastFrame, "asian");
@@ -325,6 +327,7 @@ SvxCharNamePage::SvxCharNamePage( Window* pParent, const SfxItemSet& rInSet )
     get(m_pEastFontSizeLB, "eastsizelb");
     get(m_pEastFontLanguageFT, "eastlangft");
     get(m_pEastFontLanguageLB, "eastlanglb");
+    get(m_pEastFontTypeFT, "eastfontinfo");
 
     get(m_pCTLFrame, "ctl");
     get(m_pCTLFontNameFT, "ctlfontnameft");
@@ -335,6 +338,7 @@ SvxCharNamePage::SvxCharNamePage( Window* pParent, const SfxItemSet& rInSet )
     get(m_pCTLFontSizeLB, "ctlsizelb");
     get(m_pCTLFontLanguageFT, "ctllangft");
     get(m_pCTLFontLanguageLB, "ctllanglb");
+    get(m_pCTLFontTypeFT, "ctlfontinfo");
 
     //In MacOSX the standard dialogs name font-name, font-style as
     //Family, Typeface
@@ -365,7 +369,6 @@ SvxCharNamePage::SvxCharNamePage( Window* pParent, const SfxItemSet& rInSet )
     m_pCTLFrame->Show(bShowCTL);
 
     get(m_pPreviewWin, "preview");
-    get(m_pFontTypeFT, "fontinfo");
 
     m_pWestFontLanguageLB->SetLanguageList(LANG_LIST_WESTERN, sal_True, sal_False, sal_True);
     m_pEastFontLanguageLB->SetLanguageList(LANG_LIST_CJK, sal_True, sal_False, sal_True);
@@ -538,15 +541,25 @@ void SvxCharNamePage::UpdatePreview_Impl()
     // Font
     const FontList* pFontList = GetFontList();
 
-    FontInfo aFontInfo =
-        calcFontInfo(rFont,this,m_pWestFontNameLB,m_pWestFontStyleLB,m_pWestFontSizeLB,m_pWestFontLanguageLB,pFontList,GetWhich( SID_ATTR_CHAR_FONT ),GetWhich( SID_ATTR_CHAR_FONTHEIGHT ));
+    FontInfo aWestFontInfo = calcFontInfo(rFont, this, m_pWestFontNameLB,
+        m_pWestFontStyleLB, m_pWestFontSizeLB, m_pWestFontLanguageLB,
+        pFontList, GetWhich(SID_ATTR_CHAR_FONT),
+        GetWhich(SID_ATTR_CHAR_FONTHEIGHT));
+    m_pWestFontTypeFT->SetText(pFontList->GetFontMapText(aWestFontInfo));
 
-    calcFontInfo(rCJKFont,this,m_pEastFontNameLB,m_pEastFontStyleLB,m_pEastFontSizeLB,m_pEastFontLanguageLB,pFontList,GetWhich( SID_ATTR_CHAR_CJK_FONT ),GetWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT ));
+    FontInfo aEastFontInfo = calcFontInfo(rCJKFont, this, m_pEastFontNameLB,
+        m_pEastFontStyleLB, m_pEastFontSizeLB, m_pEastFontLanguageLB,
+        pFontList, GetWhich(SID_ATTR_CHAR_CJK_FONT),
+        GetWhich(SID_ATTR_CHAR_CJK_FONTHEIGHT));
+    m_pEastFontTypeFT->SetText(pFontList->GetFontMapText(aEastFontInfo));
 
-    calcFontInfo(rCTLFont,this,m_pCTLFontNameLB,m_pCTLFontStyleLB,m_pCTLFontSizeLB,m_pCTLFontLanguageLB,pFontList,GetWhich( SID_ATTR_CHAR_CTL_FONT ),GetWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT ));
+    FontInfo aCTLFontInfo = calcFontInfo(rCTLFont,
+        this, m_pCTLFontNameLB, m_pCTLFontStyleLB, m_pCTLFontSizeLB,
+        m_pCTLFontLanguageLB, pFontList, GetWhich(SID_ATTR_CHAR_CTL_FONT),
+        GetWhich(SID_ATTR_CHAR_CTL_FONTHEIGHT));
+    m_pCTLFontTypeFT->SetText(pFontList->GetFontMapText(aCTLFontInfo));
 
     m_pPreviewWin->Invalidate();
-    m_pFontTypeFT->SetText( pFontList->GetFontMapText( aFontInfo ) );
 }
 
 // -----------------------------------------------------------------------
@@ -822,9 +835,21 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
         }
     }
 
-    if ( Western == eLangGrp )
-        m_pFontTypeFT->SetText( pFontList->GetFontMapText(
-            pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) ) );
+    OUString sMapText(pFontList->GetFontMapText(
+        pFontList->Get(pNameBox->GetText(), pStyleBox->GetText())));
+
+    switch (eLangGrp)
+    {
+        case Western:
+            m_pWestFontTypeFT->SetText(sMapText);
+            break;
+        case Asian:
+            m_pEastFontTypeFT->SetText(sMapText);
+            break;
+        case Ctl:
+            m_pCTLFontTypeFT->SetText(sMapText);
+            break;
+    }
 
     // save these settings
     pNameBox->SaveValue();
diff --git a/cui/uiconfig/ui/charnamepage.ui b/cui/uiconfig/ui/charnamepage.ui
index 6a1dcef..88202b6 100644
--- a/cui/uiconfig/ui/charnamepage.ui
+++ b/cui/uiconfig/ui/charnamepage.ui
@@ -80,7 +80,7 @@
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
-                    <property name="top_attach">2</property>
+                    <property name="top_attach">3</property>
                     <property name="width">1</property>
                     <property name="height">1</property>
                   </packing>
@@ -93,7 +93,7 @@
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
-                    <property name="top_attach">3</property>
+                    <property name="top_attach">4</property>
                     <property name="width">1</property>
                     <property name="height">1</property>
                   </packing>
@@ -139,6 +139,45 @@
                   </packing>
                 </child>
                 <child>
+                  <object class="GtkLabel" id="label1">
+                    <property name="height_request">6</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">2</property>
+                    <property name="width">3</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label2">
+                    <property name="height_request">6</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">5</property>
+                    <property name="width">3</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="westfontinfo-nocjk">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">6</property>
+                    <property name="width">3</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
                   <placeholder/>
                 </child>
                 <child>
@@ -302,6 +341,32 @@
                     <property name="height">1</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkLabel" id="label3">
+                    <property name="height_request">6</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">2</property>
+                    <property name="width">4</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="westfontinfo-cjk">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">3</property>
+                    <property name="width">4</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
               </object>
             </child>
           </object>
@@ -454,6 +519,32 @@
                     <property name="height">1</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkLabel" id="label7">
+                    <property name="height_request">6</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">2</property>
+                    <property name="width">4</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="eastfontinfo">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">3</property>
+                    <property name="width">4</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
               </object>
             </child>
           </object>
@@ -606,6 +697,32 @@
                     <property name="height">1</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkLabel" id="label8">
+                    <property name="height_request">6</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">2</property>
+                    <property name="width">4</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="ctlfontinfo">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">3</property>
+                    <property name="width">4</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
               </object>
             </child>
           </object>
@@ -628,18 +745,6 @@
       </packing>
     </child>
     <child>
-      <object class="GtkLabel" id="fontinfo">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="xalign">0</property>
-      </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">4</property>
-      </packing>
-    </child>
-    <child>
       <object class="GtkFrame" id="frame4">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
@@ -675,7 +780,7 @@
         <property name="expand">False</property>
         <property name="fill">True</property>
         <property name="pack_type">end</property>
-        <property name="position">5</property>
+        <property name="position">4</property>
       </packing>
     </child>
   </object>


More information about the Libreoffice-commits mailing list