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

Andras Timar atimar at suse.com
Thu Apr 18 12:46:56 PDT 2013


 cui/source/dialogs/cuicharmap.cxx    |   17 +++++++++++++++++
 cui/source/inc/cuicharmap.hxx        |    2 ++
 cui/uiconfig/ui/specialcharacters.ui |   16 +++++++++++++++-
 3 files changed, 34 insertions(+), 1 deletion(-)

New commits:
commit ab7776e1bc0687b6e42ffa6e837435800b4a58af
Author: Andras Timar <atimar at suse.com>
Date:   Thu Apr 18 12:46:36 2013 -0700

    fdo#63503 add 'Delete Last' button to Special Characters dialog
    
    Change-Id: I7f14564f6b28e0b480b503394e0e078ed28f9150

diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index ed42c14..fdc4a25 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -54,6 +54,7 @@ SvxCharacterMap::SvxCharacterMap( Window* pParent, sal_Bool bOne_, const SfxItem
     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);
@@ -321,6 +322,7 @@ void SvxCharacterMap::init()
         m_pSymbolText->Hide();
         m_pShowText->Hide();
         m_pDeleteBtn->Hide();
+        m_pDeleteLastBtn->Hide();
     }
 
     OUString aDefStr( aFont.GetName() );
@@ -369,6 +371,7 @@ 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() == ' ')
@@ -521,6 +524,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharSelectHdl)
 
     }
     m_pOKBtn->Enable();
+    m_pDeleteLastBtn->Enable();
     return 0;
 }
 
@@ -582,10 +586,23 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharPreSelectHdl)
 
 // -----------------------------------------------------------------------
 
+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( String() );
     m_pOKBtn->Disable();
+    m_pDeleteLastBtn->Disable();
     return 0;
 }
 
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index 27b0d0f..410e6aa 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -71,6 +71,7 @@ private:
     SvxShowCharSet* m_pShowSet;
     SvxShowText*    m_pShowText;
     OKButton*       m_pOKBtn;
+    PushButton*     m_pDeleteLastBtn;
     PushButton*     m_pDeleteBtn;
     FixedText*      m_pFontText;
     ListBox*        m_pFontLB;
@@ -90,6 +91,7 @@ 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 c35b52a..c634b25 100644
--- a/cui/uiconfig/ui/specialcharacters.ui
+++ b/cui/uiconfig/ui/specialcharacters.ui
@@ -60,6 +60,20 @@
               </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>
@@ -71,7 +85,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">3</property>
+                <property name="position">4</property>
               </packing>
             </child>
           </object>


More information about the Libreoffice-commits mailing list