summaryrefslogtreecommitdiff
path: root/cui/source/dialogs
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2013-04-18 12:46:36 -0700
committerAndras Timar <atimar@suse.com>2013-04-18 12:47:23 -0700
commitab7776e1bc0687b6e42ffa6e837435800b4a58af (patch)
treecc07ef94d79f0401bec2d29b86ab7b90688687e8 /cui/source/dialogs
parentd636dcc64065fa280688dc26aecb2bb78792eaef (diff)
fdo#63503 add 'Delete Last' button to Special Characters dialog
Change-Id: I7f14564f6b28e0b480b503394e0e078ed28f9150
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r--cui/source/dialogs/cuicharmap.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index ed42c14c9931..fdc4a25528c2 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;
}