summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-11 13:15:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-06-11 14:46:46 +0100
commit8f5629fd5aafc85e509a4160a11a285b0a66e7c0 (patch)
tree143883c85467b5ce9f5c665338e0f8a25067a0cd /sfx2/source/dialog
parent2106d8e648449d34b195068eef5f672a14ea64a8 (diff)
remove EraseLeadingChars and EraseTrailingChars
Change-Id: Ib9797fe97cd008cc6508ce8cec47dc5373416892
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx6
-rw-r--r--sfx2/source/dialog/mailmodel.cxx6
-rw-r--r--sfx2/source/dialog/mgetempl.cxx7
-rw-r--r--sfx2/source/dialog/srchdlg.cxx2
4 files changed, 11 insertions, 10 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index ba0d0c29d4a6..d96b6d048135 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -68,6 +68,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/docfile.hxx>
#include <comphelper/storagehelper.hxx>
+#include <comphelper/string.hxx>
#include <sfx2/sfx.hrc>
#include "dinfdlg.hrc"
@@ -193,9 +194,8 @@ String ConvertDateTime_Impl( const String& rName,
String aStr( rWrapper.getDate( aD ) );
aStr += pDelim;
aStr += rWrapper.getTime( aT, sal_True, sal_False );
- String aAuthor = rName;
- aAuthor.EraseLeadingChars();
- if ( aAuthor.Len() )
+ rtl::OUString aAuthor = comphelper::string::stripStart(rName, ' ');
+ if (!aAuthor.isEmpty())
{
aStr += pDelim;
aStr += aAuthor;
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 1cf9a2a3ee0d..79a4671c5e3a 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -972,12 +972,12 @@ sal_Bool CreateFromAddress_Impl( String& rFrom )
{
if ( aFirstName.Len() )
{
- rFrom = TRIM( aFirstName );
+ rFrom = comphelper::string::strip(aFirstName, ' ');
if ( aName.Len() )
rFrom += ' ';
}
- rFrom += TRIM( aName );
+ rFrom += comphelper::string::strip(aName, ' ');
// remove illegal characters
rFrom = comphelper::string::remove(rFrom, '<');
rFrom = comphelper::string::remove(rFrom, '>');
@@ -993,7 +993,7 @@ sal_Bool CreateFromAddress_Impl( String& rFrom )
{
if ( rFrom.Len() )
rFrom += ' ';
- ( ( rFrom += '<' ) += TRIM( aEmailName ) ) += '>';
+ ( ( rFrom += '<' ) += comphelper::string::strip(aEmailName, ' ') ) += '>';
}
else
rFrom.Erase();
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index d51ce3a8c693..7d7926df6824 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -26,6 +26,7 @@
*
************************************************************************/
+#include <comphelper/string.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/field.hxx>
#include <svl/eitem.hxx>
@@ -362,7 +363,7 @@ IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
*/
{
- aBuf = pEdit->GetText().EraseLeadingChars();
+ aBuf = comphelper::string::stripStart(pEdit->GetText(), ' ');
return 0;
}
IMPL_LINK_INLINE_END( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
@@ -379,7 +380,7 @@ IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit )
*/
{
- const String aStr( pEdit->GetText().EraseLeadingChars() );
+ const String aStr(comphelper::string::stripStart(pEdit->GetText(), ' '));
pEdit->SetText( aStr );
// Update the Listbox of the base template if possible
if ( aStr != aBuf )
@@ -579,7 +580,7 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
if ( aNameEd.HasFocus() )
LoseFocusHdl( &aNameEd );
- if ( !pStyle->SetName( aNameEd.GetText().EraseLeadingChars() ) )
+ if (!pStyle->SetName(comphelper::string::stripStart(aNameEd.GetText(), ' ')))
{
InfoBox aBox( this, SfxResId( MSG_TABPAGE_INVALIDNAME ) );
aBox.Execute();
diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx
index 0d5528a7398b..b84a1bb6f490 100644
--- a/sfx2/source/dialog/srchdlg.cxx
+++ b/sfx2/source/dialog/srchdlg.cxx
@@ -127,7 +127,7 @@ void SearchDialog::SaveConfig()
sUserData += m_aSearchEdit.GetEntry(i);
sUserData += '\t';
}
- sUserData.EraseTrailingChars( '\t' );
+ sUserData = comphelper::string::stripStart(sUserData, '\t');
sUserData += ';';
sUserData += String::CreateFromInt32( m_aWholeWordsBox.IsChecked() ? 1 : 0 );
sUserData += ';';