diff options
author | Chr. Rossmanith <ChrRossmanith@gmx.de> | 2013-01-21 14:32:09 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-01-21 20:48:35 +0000 |
commit | e3f11c10d8cc759d01afa4b8fd8bd98c81a03119 (patch) | |
tree | 36191c6d90da559009161a1199d1176cf6a2bbba /svtools/source/control | |
parent | 87f9d7da00857c649784a7d9eca046bf6e71ae3c (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/control')
-rw-r--r-- | svtools/source/control/filectrl.cxx | 4 | ||||
-rw-r--r-- | svtools/source/control/fmtfield.cxx | 24 | ||||
-rw-r--r-- | svtools/source/control/inettbc.cxx | 10 | ||||
-rw-r--r-- | svtools/source/control/tabbar.cxx | 2 |
4 files changed, 20 insertions, 20 deletions
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; } |