summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorChr. Rossmanith <ChrRossmanith@gmx.de>2013-01-21 14:32:09 +0100
committerMichael Stahl <mstahl@redhat.com>2013-01-21 20:48:35 +0000
commite3f11c10d8cc759d01afa4b8fd8bd98c81a03119 (patch)
tree36191c6d90da559009161a1199d1176cf6a2bbba /svtools/source
parent87f9d7da00857c649784a7d9eca046bf6e71ae3c (diff)
Changed SetText() / GetText() to take/return OUString
replaced lots of Len() with isEmpty() Change-Id: I6b82d48245ee2a0782e05a326f7934e9357227d0 Reviewed-on: https://gerrit.libreoffice.org/1795 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx6
-rw-r--r--svtools/source/contnr/DocumentInfoPreview.cxx2
-rw-r--r--svtools/source/contnr/treelistbox.cxx2
-rw-r--r--svtools/source/control/filectrl.cxx4
-rw-r--r--svtools/source/control/fmtfield.cxx24
-rw-r--r--svtools/source/control/inettbc.cxx10
-rw-r--r--svtools/source/control/tabbar.cxx2
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx2
-rw-r--r--svtools/source/dialogs/wizardmachine.cxx7
-rw-r--r--svtools/source/edit/editsyntaxhighlighter.cxx2
-rw-r--r--svtools/source/uno/unoiface.cxx2
11 files changed, 31 insertions, 32 deletions
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index 718eb6768b5a..fa081b743ad0 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -98,7 +98,7 @@ namespace svt
case KEY_RIGHT:
{
Selection aSel = rBox.GetSelection();
- return !aSel && aSel.Max() == rBox.GetText().Len();
+ return !aSel && aSel.Max() == rBox.GetText().getLength();
}
case KEY_HOME:
case KEY_LEFT:
@@ -129,7 +129,7 @@ namespace svt
//------------------------------------------------------------------
sal_Bool ComboBoxCellController::IsModified() const
{
- return GetComboBox().GetSavedValue() != GetComboBox().GetText();
+ return OUString(GetComboBox().GetSavedValue()) != GetComboBox().GetText();
}
//------------------------------------------------------------------
@@ -488,7 +488,7 @@ namespace svt
case KEY_RIGHT:
{
Selection aSel = GetSpinWindow().GetSelection();
- bResult = !aSel && aSel.Max() == GetSpinWindow().GetText().Len();
+ bResult = !aSel && aSel.Max() == GetSpinWindow().GetText().getLength();
} break;
case KEY_HOME:
case KEY_LEFT:
diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx b/svtools/source/contnr/DocumentInfoPreview.cxx
index aa7783b803fc..0f2177aad7b3 100644
--- a/svtools/source/contnr/DocumentInfoPreview.cxx
+++ b/svtools/source/contnr/DocumentInfoPreview.cxx
@@ -126,7 +126,7 @@ void ODocumentInfoPreview::fill(
void ODocumentInfoPreview::insertEntry(
rtl::OUString const & title, rtl::OUString const & value)
{
- if (m_pEditWin.GetText().Len() != 0) {
+ if (!m_pEditWin.GetText().isEmpty()) {
m_pEditWin.InsertText(rtl::OUString("\n\n"));
}
rtl::OUString caption(title + rtl::OUString(":\n"));
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index eddb6022534e..a8e3b14e39a5 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -268,7 +268,7 @@ void SvInplaceEdit2::CallCallBackHdl_Impl()
}
}
-String SvInplaceEdit2::GetText() const
+OUString SvInplaceEdit2::GetText() const
{
return pEdit->GetText();
}
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index 0de2f577074f..1365975a15bb 100644
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -79,7 +79,7 @@ FileControl::~FileControl()
// -----------------------------------------------------------------------
-void FileControl::SetText( const XubString& rStr )
+void FileControl::SetText( const OUString& rStr )
{
maEdit.SetText( rStr );
if ( mnFlags & FILECTRL_RESIZEBUTTONBYPATHLEN )
@@ -88,7 +88,7 @@ void FileControl::SetText( const XubString& rStr )
// -----------------------------------------------------------------------
-XubString FileControl::GetText() const
+OUString FileControl::GetText() const
{
return maEdit.GetText();
}
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index 181bc7166dc6..b8b67748b315 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -368,7 +368,7 @@ FormattedField::~FormattedField()
}
//------------------------------------------------------------------------------
-void FormattedField::SetText(const XubString& rStr)
+void FormattedField::SetText(const OUString& rStr)
{
DBG_CHKTHIS(FormattedField, NULL);
@@ -377,7 +377,7 @@ void FormattedField::SetText(const XubString& rStr)
}
//------------------------------------------------------------------------------
-void FormattedField::SetText( const XubString& rStr, const Selection& rNewSelection )
+void FormattedField::SetText( const OUString& rStr, const Selection& rNewSelection )
{
DBG_CHKTHIS(FormattedField, NULL);
@@ -397,7 +397,7 @@ void FormattedField::SetTextFormatted(const OUString& rStr)
m_sCurrentTextValue = rStr;
- String sFormatted;
+ OUString sFormatted;
double dNumber = 0.0;
// IsNumberFormat changes the format key parameter
sal_uInt32 nTempFormatKey = static_cast< sal_uInt32 >( m_nFormatKey );
@@ -419,8 +419,8 @@ void FormattedField::SetTextFormatted(const OUString& rStr)
Selection aSel(GetSelection());
Selection aNewSel(aSel);
aNewSel.Justify();
- sal_uInt16 nNewLen = sFormatted.Len();
- sal_uInt16 nCurrentLen = GetText().Len();
+ sal_Int32 nNewLen = sFormatted.getLength();
+ sal_Int32 nCurrentLen = GetText().getLength();
if ((nNewLen > nCurrentLen) && (aNewSel.Max() == nCurrentLen))
{ // the new text is longer and the cursor was behind the last char (of the old text)
if (aNewSel.Min() == 0)
@@ -514,7 +514,7 @@ void FormattedField::Modify()
}
//------------------------------------------------------------------------------
-void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel)
+void FormattedField::ImplSetTextImpl(const OUString& rNew, Selection* pNewSel)
{
DBG_CHKTHIS(FormattedField, NULL);
@@ -533,8 +533,8 @@ void FormattedField::ImplSetTextImpl(const XubString& rNew, Selection* pNewSel)
Selection aSel(GetSelection());
aSel.Justify();
- sal_uInt16 nNewLen = rNew.Len();
- sal_uInt16 nCurrentLen = GetText().Len();
+ sal_Int32 nNewLen = rNew.getLength();
+ sal_Int32 nCurrentLen = GetText().getLength();
if ((nNewLen > nCurrentLen) && (aSel.Max() == nCurrentLen))
{ // new new text is longer and the cursor is behind the last char
@@ -782,7 +782,7 @@ void FormattedField::FormatChanged( FORMAT_CHANGE_TYPE _nWhat )
void FormattedField::Commit()
{
// remember the old text
- String sOld( GetText() );
+ OUString sOld( GetText() );
// do the reformat
ReFormat();
@@ -799,7 +799,7 @@ void FormattedField::Commit()
//------------------------------------------------------------------------------
void FormattedField::ReFormat()
{
- if (!IsEmptyFieldEnabled() || GetText().Len())
+ if (!IsEmptyFieldEnabled() || !GetText().isEmpty())
{
if (TreatingAsNumber())
{
@@ -856,7 +856,7 @@ long FormattedField::Notify(NotifyEvent& rNEvt)
if (rNEvt.GetType() == EVENT_LOSEFOCUS)
{
// Sonderbehandlung fuer leere Texte
- if (GetText().Len() == 0)
+ if (GetText().isEmpty())
{
if (!IsEmptyFieldEnabled())
{
@@ -925,7 +925,7 @@ void FormattedField::EnableEmptyField(sal_Bool bEnable)
return;
m_bEnableEmptyField = bEnable;
- if (!m_bEnableEmptyField && GetText().Len()==0)
+ if (!m_bEnableEmptyField && GetText().isEmpty())
ImplSetValue(m_dCurrentValue, sal_True);
}
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 6c0ce2a16bf5..37736054fa1e 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -907,7 +907,7 @@ sal_Bool SvtURLBox::ProcessKey( const KeyCode& rKey )
}
KeyCode aCode( rKey.GetCode() );
- if ( aCode == KEY_RETURN && GetText().Len() )
+ if ( aCode == KEY_RETURN && !GetText().isEmpty() )
{
// wait for completion of matching thread
::osl::MutexGuard aGuard( theSvtMatchContextMutex::get() );
@@ -943,7 +943,7 @@ sal_Bool SvtURLBox::ProcessKey( const KeyCode& rKey )
ClearModifyFlag();
return bHandled;
}
- else if ( aCode == KEY_RETURN && !GetText().Len() && GetOpenHdl().IsSet() )
+ else if ( aCode == KEY_RETURN && GetText().isEmpty() && GetOpenHdl().IsSet() )
{
// for file dialog
bAutoCompleteMode = sal_False;
@@ -1000,7 +1000,7 @@ long SvtURLBox::PreNotify( NotifyEvent& rNEvt )
Selection aSelection( GetSelection() );
sal_uInt16 nLen = (sal_uInt16)aSelection.Min();
GetSubEdit()->KeyInput( rEvent );
- SetSelection( Selection( nLen, GetText().Len() ) );
+ SetSelection( Selection( nLen, GetText().getLength() ) );
return sal_True;
}
@@ -1008,7 +1008,7 @@ long SvtURLBox::PreNotify( NotifyEvent& rNEvt )
{
// set the selection so a key stroke will overwrite
// the placeholder rather than edit it
- SetSelection( Selection( 0, GetText().Len() ) );
+ SetSelection( Selection( 0, GetText().getLength() ) );
}
}
@@ -1039,7 +1039,7 @@ long SvtURLBox::Notify( NotifyEvent &rEvt )
}
else if ( EVENT_LOSEFOCUS == rEvt.GetType() )
{
- if( !GetText().Len() )
+ if( GetText().isEmpty() )
ClearModifyFlag();
if ( pCtx.is() )
{
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 4438779af611..046cf5f0a271 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -2356,7 +2356,7 @@ sal_Bool TabBar::StartEditMode( sal_uInt16 nPageId )
mpEdit->SetControlForeground( aForegroundColor );
mpEdit->SetControlBackground( aBackgroundColor );
mpEdit->GrabFocus();
- mpEdit->SetSelection( Selection( 0, mpEdit->GetText().Len() ) );
+ mpEdit->SetSelection( Selection( 0, mpEdit->GetText().getLength() ) );
mpEdit->Show();
return sal_True;
}
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 3d85f3e1e4df..b42d81b52b42 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -1175,7 +1175,7 @@ void AssignmentPersistentData::Commit()
// -------------------------------------------------------------------
IMPL_LINK(AddressBookSourceDialog, OnComboLoseFocus, ComboBox*, _pBox)
{
- if (_pBox->GetSavedValue() != _pBox->GetText())
+ if (OUString(_pBox->GetSavedValue()) != _pBox->GetText())
{
if (_pBox == &m_aDatasource)
resetTables();
diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx
index 9ffc5f086428..38775201b5ae 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -227,14 +227,13 @@ namespace svt
//---------------------------------------------------------------------
void OWizardMachine::implUpdateTitle()
{
- String sCompleteTitle(m_pImpl->sTitleBase);
+ OUString sCompleteTitle(m_pImpl->sTitleBase);
// append the page title
TabPage* pCurrentPage = GetPage(getCurrentState());
- if ( pCurrentPage && pCurrentPage->GetText().Len() )
+ if ( pCurrentPage && !pCurrentPage->GetText().isEmpty() )
{
- sCompleteTitle += rtl::OUString(" - ");
- sCompleteTitle += pCurrentPage->GetText();
+ sCompleteTitle += (" - " + pCurrentPage->GetText());
}
SetText(sCompleteTitle);
diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx
index 64853117fe48..af68d0515a40 100644
--- a/svtools/source/edit/editsyntaxhighlighter.cxx
+++ b/svtools/source/edit/editsyntaxhighlighter.cxx
@@ -42,7 +42,7 @@ MultiLineEditSyntaxHighlight::~MultiLineEditSyntaxHighlight()
{
}
-void MultiLineEditSyntaxHighlight::SetText(const String& rNewText)
+void MultiLineEditSyntaxHighlight::SetText(const OUString& rNewText)
{
MultiLineEdit::SetText(rNewText);
UpdateData();
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index 91885b23562f..49edf88dd409 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -1246,7 +1246,7 @@ void SVTXFormattedField::SetTreatAsNumber(sal_Bool bSet)
}
else
{
- if (pField->GetText().Len()) // empty wird erst mal standardmaessig als void nach draussen gereicht
+ if (!pField->GetText().isEmpty()) // empty wird erst mal standardmaessig als void nach draussen gereicht
aReturn <<= pField->GetValue();
}