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 /sfx2 | |
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 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/controlwrapper.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/progress.hxx | 3 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sfxdlg.hxx | 4 | ||||
-rw-r--r-- | sfx2/inc/sfx2/titledockwin.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/impldde.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/appl/lnkbase2.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/bastyp/progress.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/dialog/passwd.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/srchdlg.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/titledockwin.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/versdlg.cxx | 4 |
13 files changed, 27 insertions, 29 deletions
diff --git a/sfx2/inc/sfx2/controlwrapper.hxx b/sfx2/inc/sfx2/controlwrapper.hxx index c6fb432d3012..0a429b906638 100644 --- a/sfx2/inc/sfx2/controlwrapper.hxx +++ b/sfx2/inc/sfx2/controlwrapper.hxx @@ -580,7 +580,7 @@ void NumericFieldWrapper< ValueT >::SetControlValue( ValueT nValue ) template< typename ValueT > bool MetricFieldWrapper< ValueT >::IsControlDontKnow() const { - return this->GetControl().GetText().Len() == 0; + return this->GetControl().GetText().isEmpty(); } template< typename ValueT > diff --git a/sfx2/inc/sfx2/progress.hxx b/sfx2/inc/sfx2/progress.hxx index 124e2293e01f..285360272d30 100644 --- a/sfx2/inc/sfx2/progress.hxx +++ b/sfx2/inc/sfx2/progress.hxx @@ -24,6 +24,7 @@ #include "sal/types.h" #include <tools/solar.h> #include <tools/link.hxx> +#include <rtl/ustring.hxx> class String; class SfxObjectShell; @@ -46,7 +47,7 @@ public: sal_Bool bWait = sal_True ); virtual ~SfxProgress(); - virtual void SetText( const String& rText ); + virtual void SetText( const OUString& rText ); sal_Bool SetStateText( sal_uIntPtr nVal, const String &rVal, sal_uIntPtr nNewRange = 0 ); virtual sal_Bool SetState( sal_uIntPtr nVal, sal_uIntPtr nNewRange = 0 ); sal_uIntPtr GetState() const { return nVal; } diff --git a/sfx2/inc/sfx2/sfxdlg.hxx b/sfx2/inc/sfx2/sfxdlg.hxx index d119eb772216..2f69d442495b 100644 --- a/sfx2/inc/sfx2/sfxdlg.hxx +++ b/sfx2/inc/sfx2/sfxdlg.hxx @@ -59,8 +59,8 @@ class SfxAbstractDialog : virtual public VclAbstractDialog { public: virtual const SfxItemSet* GetOutputItemSet() const = 0; - virtual void SetText( const XubString& rStr ) = 0; - virtual String GetText() const = 0; + virtual void SetText( const OUString& rStr ) = 0; + virtual OUString GetText() const = 0; }; class SfxAbstractTabDialog : virtual public SfxAbstractDialog diff --git a/sfx2/inc/sfx2/titledockwin.hxx b/sfx2/inc/sfx2/titledockwin.hxx index 923583e3404c..00131fcedd61 100644 --- a/sfx2/inc/sfx2/titledockwin.hxx +++ b/sfx2/inc/sfx2/titledockwin.hxx @@ -98,7 +98,7 @@ namespace sfx2 virtual void Resize(); virtual void StateChanged( StateChangedType i_nType ); virtual void DataChanged( const DataChangedEvent& i_rDataChangedEvent ); - virtual void SetText( const String& i_rText ); + virtual void SetText( const OUString& i_rText ); // DockingWindow overridables void EndDocking( const Rectangle& rRect, sal_Bool bFloatMode ); @@ -129,7 +129,7 @@ namespace sfx2 void impl_scheduleLayout(); private: - String m_sTitle; + OUString m_sTitle; ToolBox m_aToolbox; Window m_aContentWindow; diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index d81367d170fb..3c1dc236a823 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -110,9 +110,9 @@ String SvDDELinkEditDialog::GetCmd() const IMPL_STATIC_LINK( SvDDELinkEditDialog, EditHdl_Impl, Edit *, pEdit ) { (void)pEdit; // unused variable - pThis->aOKButton1.Enable( pThis->aEdDdeApp.GetText().Len() && - pThis->aEdDdeTopic.GetText().Len() && - pThis->aEdDdeItem.GetText().Len() ); + pThis->aOKButton1.Enable( !pThis->aEdDdeApp.GetText().isEmpty() && + !pThis->aEdDdeTopic.GetText().isEmpty() && + !pThis->aEdDdeItem.GetText().isEmpty() ); return 0; } diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 755e6d6f50e2..9cbd3b254e0a 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -356,9 +356,9 @@ void SvBaseLink::_GetRealObject( sal_Bool bConnect) if( OBJECT_CLIENT_DDE == nObjType ) { - String sServer; + OUString sServer; if( pImpl->m_pLinkMgr->GetDisplayNames( this, &sServer ) && - sServer == GetpApp()->GetAppName() ) // internal Link !!! + sServer == OUString(GetpApp()->GetAppName()) ) // internal Link !!! { // so that the Internal link can be created! nObjType = OBJECT_INTERN; diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 0eca0918af27..34a53e7b1949 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1201,7 +1201,7 @@ String SearchTabPage_Impl::GetSelectEntry() const void SearchTabPage_Impl::ClearPage() { ClearSearchResults(); - aSearchED.SetText( String() ); + aSearchED.SetText( OUString() ); } // ----------------------------------------------------------------------- diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx index 0313fa255f2e..09345fe94626 100644 --- a/sfx2/source/bastyp/progress.cxx +++ b/sfx2/source/bastyp/progress.cxx @@ -213,10 +213,7 @@ void SfxProgress::Stop() // ----------------------------------------------------------------------- -void SfxProgress::SetText -( - const String& /* new Text */ -) +void SfxProgress::SetText( const OUString& /* new Text */) /* [Description] diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index b50198744a09..bef196a7ac6c 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -762,13 +762,13 @@ SfxDocumentPage::SfxDocumentPage(Window* pParent, const SfxItemSet& rItemSet) get(m_pFileValFt, "showlocation"); get(m_pShowSizeFT, "showsize"); m_aUnknownSize = m_pShowSizeFT->GetText(); - m_pShowSizeFT->SetText(OUString("")); + m_pShowSizeFT->SetText(OUString()); get(m_pCreateValFt, "showcreate"); get(m_pChangeValFt, "showmodify"); get(m_pSignedValFt, "showsigned"); m_aMultiSignedStr = m_pSignedValFt->GetText(); - m_pSignedValFt->SetText(OUString("")); + m_pSignedValFt->SetText(OUString()); get(m_pSignatureBtn, "signature"); get(m_pPrintValFt, "showprint"); get(m_pTimeLogValFt, "showedittime"); @@ -968,7 +968,7 @@ sal_Bool SfxDocumentPage::FillItemSet( SfxItemSet& rSet ) } } - if ( m_pNameED->IsModified() && m_pNameED->GetText().Len() ) + if ( m_pNameED->IsModified() && !m_pNameED->GetText().isEmpty() ) { rSet.Put( SfxStringItem( ID_FILETP_TITLE, m_pNameED->GetText() ) ); bRet = sal_True; @@ -1415,7 +1415,7 @@ int SfxInternetPage::DeactivatePage( SfxItemSet* /*pSet*/ ) { int nRet = LEAVE_PAGE; - if ( eState == S_Forward && !m_pEDForwardURL->GetText().Len() ) + if ( eState == S_Forward && m_pEDForwardURL->GetText().isEmpty() ) { ErrorBox aErrBox( this, WB_OK, aForwardErrorMessg ); aErrBox.Execute(); diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index 39b4096138b0..b02eaad1c579 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -53,9 +53,9 @@ IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, pEdit ) } } - bool bEnable = mpPassword1ED->GetText().Len() >= mnMinLen; + bool bEnable = mpPassword1ED->GetText().getLength() >= mnMinLen; if( mpPassword2ED->IsVisible() ) - bEnable = (bEnable && (mpPassword2ED->GetText().Len() >= mnMinLen)); + bEnable = (bEnable && (mpPassword2ED->GetText().getLength() >= mnMinLen)); mpOKBtn->Enable( bEnable ); return 0; } @@ -73,7 +73,7 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl) { ErrorBox aBox( this, SfxResId( MSG_ERROR_WRONG_CONFIRM ) ); aBox.Execute(); - mpConfirm1ED->SetText( String() ); + mpConfirm1ED->SetText( OUString() ); mpConfirm1ED->GrabFocus(); } else diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx index d69b21c0020e..4f6fe256d60c 100644 --- a/sfx2/source/dialog/srchdlg.cxx +++ b/sfx2/source/dialog/srchdlg.cxx @@ -154,7 +154,7 @@ IMPL_LINK_NOARG(SearchDialog, ToggleHdl) void SearchDialog::SetFocusOnEdit() { - Selection aSelection( 0, m_aSearchEdit.GetText().Len() ); + Selection aSelection( 0, m_aSearchEdit.GetText().getLength() ); m_aSearchEdit.SetSelection( aSelection ); m_aSearchEdit.GrabFocus(); } diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx index f711b5061a01..02d7446e7ee9 100644 --- a/sfx2/source/dialog/titledockwin.cxx +++ b/sfx2/source/dialog/titledockwin.cxx @@ -88,10 +88,10 @@ namespace sfx2 } //------------------------------------------------------------------------------------------------------------------ - void TitledDockingWindow::SetText( const String& i_rText ) + void TitledDockingWindow::SetText( const OUString& i_rText ) { SfxDockingWindow::SetText( i_rText ); - if ( m_sTitle.Len() == 0 ) + if ( m_sTitle.isEmpty() ) // our text is used as title, too => repaint Invalidate(); } @@ -222,7 +222,7 @@ namespace sfx2 //------------------------------------------------------------------------------------------------------------------ String TitledDockingWindow::impl_getTitle() const { - return m_sTitle.Len() ? m_sTitle : GetText(); + return !m_sTitle.isEmpty() ? m_sTitle : GetText(); } //------------------------------------------------------------------------------------------------------------------ diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 784b5701798c..9aa0901c0b77 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -449,8 +449,8 @@ SfxViewVersionDialog_Impl::SfxViewVersionDialog_Impl ( Window *pParent, SfxVersi FreeResource(); const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); - aDateTimeText.SetText( aDateTimeText.GetText().Append(ConvertDateTime_Impl( pInfo->aCreationDate, rLocaleWrapper )) ); - aSavedByText.SetText( aSavedByText.GetText().Append(pInfo->aAuthor) ); + aDateTimeText.SetText( aDateTimeText.GetText() + ConvertDateTime_Impl( pInfo->aCreationDate, rLocaleWrapper ) ); + aSavedByText.SetText( aSavedByText.GetText() + pInfo->aAuthor ); aEdit.SetText( rInfo.aComment ); aCloseButton.SetClickHdl ( LINK( this, SfxViewVersionDialog_Impl, ButtonHdl ) ); |