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

Szymon KÅ‚os eszkadev at gmail.com
Wed Sep 24 12:08:59 PDT 2014


 cui/source/dialogs/cuicharmap.cxx    |   31 ----
 cui/source/inc/cuicharmap.hxx        |    6 
 cui/uiconfig/ui/specialcharacters.ui |  247 ++++++++++++++---------------------
 3 files changed, 103 insertions(+), 181 deletions(-)

New commits:
commit 16ea2665cdfa0b3d7b0d7abcdaae8d60f7654d24
Author: Szymon KÅ‚os <eszkadev at gmail.com>
Date:   Wed Sep 24 10:30:32 2014 +0200

    fdo#64302: Writer’s Special Character dialog could be simpler
    
    Change-Id: Ia321a9df77a8741245378e5b995b3bc6922266e8
    Reviewed-on: https://gerrit.libreoffice.org/11621
    Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
    Tested-by: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>

diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index ca9ca03..5227bcf 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -53,8 +53,6 @@ SvxCharacterMap::SvxCharacterMap( vcl::Window* pParent, bool bOne_, const SfxIte
     m_pShowChar->SetCentered(true);
     get(m_pShowText, "showtext");
     get(m_pOKBtn, "ok");
-    get(m_pDeleteBtn, "delete");
-    get(m_pDeleteLastBtn, "deletelast");
     get(m_pFontText, "fontft");
     get(m_pFontLB, "fontlb");
     m_pFontLB->SetStyle(m_pFontLB->GetStyle() | WB_SORT);
@@ -67,8 +65,6 @@ SvxCharacterMap::SvxCharacterMap( vcl::Window* pParent, bool bOne_, const SfxIte
     //lock the size request of this widget to the width of the original .ui string
     m_pCharCodeText->set_width_request(m_pCharCodeText->get_preferred_size().Width());
     get(m_pSymbolText, "symboltext");
-    //lock the size request of this widget to double the height of the label
-    m_pShowText->set_height_request(m_pSymbolText->get_preferred_size().Height() * 3);
 
     SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, FN_PARAM_1, false );
     if ( pItem )
@@ -318,8 +314,6 @@ void SvxCharacterMap::init()
     {
         m_pSymbolText->Hide();
         m_pShowText->Hide();
-        m_pDeleteBtn->Hide();
-        m_pDeleteLastBtn->Hide();
     }
 
     OUString aDefStr( aFont.GetName() );
@@ -368,8 +362,6 @@ void SvxCharacterMap::init()
     m_pShowSet->SetSelectHdl( LINK( this, SvxCharacterMap, CharSelectHdl ) );
     m_pShowSet->SetHighlightHdl( LINK( this, SvxCharacterMap, CharHighlightHdl ) );
     m_pShowSet->SetPreSelectHdl( LINK( this, SvxCharacterMap, CharPreSelectHdl ) );
-    m_pDeleteLastBtn->SetClickHdl( LINK( this, SvxCharacterMap, DeleteLastHdl ) );
-    m_pDeleteBtn->SetClickHdl( LINK( this, SvxCharacterMap, DeleteHdl ) );
 
     if( SvxShowCharSet::getSelectedChar() == ' ')
         m_pOKBtn->Disable();
@@ -526,7 +518,6 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharSelectHdl)
 
     }
     m_pOKBtn->Enable();
-    m_pDeleteLastBtn->Enable();
     return 0;
 }
 
@@ -586,26 +577,4 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharPreSelectHdl)
     return 0;
 }
 
-
-
-IMPL_LINK_NOARG(SvxCharacterMap, DeleteLastHdl)
-{
-    OUString aCurrentText = m_pShowText->GetText();
-    m_pShowText->SetText( aCurrentText.copy( 0, aCurrentText.getLength() - 1 ) );
-    if ( m_pShowText->GetText() == "" )
-    {
-        m_pOKBtn->Disable();
-        m_pDeleteLastBtn->Disable();
-    }
-    return 0;
-}
-
-IMPL_LINK_NOARG(SvxCharacterMap, DeleteHdl)
-{
-    m_pShowText->SetText( OUString() );
-    m_pOKBtn->Disable();
-    m_pDeleteLastBtn->Disable();
-    return 0;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index a4d9527..ebc6df7 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -69,10 +69,8 @@ private:
     void            init();
 
     SvxShowCharSet* m_pShowSet;
-    SvxShowText*    m_pShowText;
+    Edit*           m_pShowText;
     OKButton*       m_pOKBtn;
-    PushButton*     m_pDeleteLastBtn;
-    PushButton*     m_pDeleteBtn;
     FixedText*      m_pFontText;
     ListBox*        m_pFontLB;
     FixedText*      m_pSubsetText;
@@ -91,8 +89,6 @@ private:
     DECL_LINK(CharSelectHdl, void *);
     DECL_LINK(CharHighlightHdl, void *);
     DECL_LINK(CharPreSelectHdl, void *);
-    DECL_LINK(DeleteLastHdl, void *);
-    DECL_LINK(DeleteHdl, void *);
 
     void fillAllSubsets(ListBox &rListBox);
 
diff --git a/cui/uiconfig/ui/specialcharacters.ui b/cui/uiconfig/ui/specialcharacters.ui
index 961021f..edfbc30 100644
--- a/cui/uiconfig/ui/specialcharacters.ui
+++ b/cui/uiconfig/ui/specialcharacters.ui
@@ -59,35 +59,6 @@
                 <property name="position">2</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkButton" id="deletelast">
-                <property name="label" translatable="yes">Delete _Last</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">3</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="delete">
-                <property name="label">gtk-delete</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-                <property name="image_position">bottom</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">4</property>
-              </packing>
-            </child>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -97,80 +68,26 @@
           </packing>
         </child>
         <child>
-          <object class="GtkBox" id="box1">
+          <object class="GtkGrid" id="grid1">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="orientation">vertical</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">6</property>
             <child>
-              <object class="GtkGrid" id="grid1">
+              <object class="GtkGrid" id="grid2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
-                <property name="vexpand">True</property>
-                <property name="row_spacing">6</property>
-                <property name="column_spacing">6</property>
+                <property name="column_spacing">12</property>
                 <child>
-                  <object class="GtkGrid" id="grid2">
+                  <object class="GtkLabel" id="fontft">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="hexpand">True</property>
-                    <property name="column_spacing">12</property>
-                    <child>
-                      <object class="GtkLabel" id="fontft">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Font</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">fontlb</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="subsetft">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Subset</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">subsetlb</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBox" id="fontlb">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="hexpand">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBox" id="subsetlb">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="hexpand">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">3</property>
-                        <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
+                    <property name="label" translatable="yes">Font</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">fontlb</property>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
@@ -180,57 +97,66 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkGrid" id="grid3">
+                  <object class="GtkLabel" id="subsetft">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Subset</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">subsetlb</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">2</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="fontlb">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
-                    <property name="vexpand">True</property>
-                    <child>
-                      <object class="GtkLabel" id="charcodeft">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="hexpand">True</property>
-                        <property name="label" translatable="no">    U+FFFF(65535)    </property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="cuilo-SvxShowText" id="showchar">
-                        <property name="width_request">100</property>
-                        <property name="height_request">150</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="hexpand">True</property>
-                        <property name="vexpand">True</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
-                    <property name="top_attach">1</property>
+                    <property name="top_attach">0</property>
                     <property name="width">1</property>
                     <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="svxlo-SvxShowCharSet" id="showcharset">
-                    <property name="width_request">400</property>
-                    <property name="height_request">250</property>
+                  <object class="GtkComboBox" id="subsetlb">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
+                    <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
-                    <property name="vexpand">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">3</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkGrid" id="grid3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <child>
+                  <object class="GtkLabel" id="charcodeft">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="label">    U+FFFF(65535)    </property>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
@@ -240,13 +166,43 @@
                   </packing>
                 </child>
                 <child>
-                  <placeholder/>
+                  <object class="cuilo-SvxShowText" id="showchar">
+                        <property name="width_request">100</property>
+                        <property name="height_request">150</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                      </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">0</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
                 </child>
               </object>
               <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="svxlo-SvxShowCharSet" id="showcharset">
+                <property name="width_request">400</property>
+                <property name="height_request">250</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -268,27 +224,29 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="cuilo-SvxShowText" id="showtext">
+                  <object class="GtkEntry" id="showtext">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can_focus">True</property>
                     <property name="valign">center</property>
+                    <property name="invisible_char">•</property>
                   </object>
                   <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
               </object>
               <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
           </object>
           <packing>
-            <property name="expand">True</property>
+            <property name="expand">False</property>
             <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
@@ -299,7 +257,6 @@
       <action-widget response="0">ok</action-widget>
       <action-widget response="0">cancel</action-widget>
       <action-widget response="0">help</action-widget>
-      <action-widget response="0">delete</action-widget>
     </action-widgets>
   </object>
 </interface>


More information about the Libreoffice-commits mailing list