From 8550b42a1d304054ee878c9c6debae0a10b0bf39 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 17 Mar 2012 10:06:47 +0000 Subject: remove extra string casts --- basctl/source/basicide/baside2.hxx | 2 +- basctl/source/basicide/baside2b.cxx | 2 +- basctl/source/basicide/moduldl2.cxx | 17 +++++++---------- basctl/source/basicide/moduldlg.cxx | 4 ++-- basctl/source/basicide/moduldlg.hxx | 4 ++-- 5 files changed, 13 insertions(+), 16 deletions(-) (limited to 'basctl') diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index 5dbc4be5dec6..2267914c33f8 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -217,7 +217,7 @@ class WatchTreeListBox : public SvHeaderTabListBox protected: virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& rSel ); - virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ); + virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewText ); sal_Bool ImplBasicEntryEdited( SvLBoxEntry* pEntry, const String& rResult ); SbxBase* ImplGetSBXForEntry( SvLBoxEntry* pEntry, bool& rbArrayElement ); diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 67c2a75e9fda..efe352ff4c14 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1966,7 +1966,7 @@ sal_Bool WatchTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& ) return bEdit; } -sal_Bool WatchTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ) +sal_Bool WatchTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewText ) { WatchItem* pItem = (WatchItem*)pEntry->GetUserData(); String aVName( pItem->maName ); diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 96545f649d51..913de2d326e5 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -326,24 +326,21 @@ sal_Bool BasicCheckBox::EditingEntry( SvLBoxEntry* pEntry, Selection& ) //---------------------------------------------------------------------------- -sal_Bool BasicCheckBox::EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ) +sal_Bool BasicCheckBox::EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewName ) { - sal_Bool bValid = ( rNewText.Len() <= 30 ) && BasicIDE::IsValidSbxName( rNewText ); - String aCurText( GetEntryText( pEntry, 0 ) ); - if ( bValid && ( aCurText != rNewText ) ) + sal_Bool bValid = ( rNewName.getLength() <= 30 ) && BasicIDE::IsValidSbxName( rNewName ); + rtl::OUString aOldName( GetEntryText( pEntry, 0 ) ); + if ( bValid && ( aOldName != rNewName ) ) { try { - ::rtl::OUString aOldName( aCurText ); - ::rtl::OUString aNewName( rNewText ); - Reference< script::XLibraryContainer2 > xModLibContainer( m_aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); if ( xModLibContainer.is() ) - xModLibContainer->renameLibrary( aOldName, aNewName ); + xModLibContainer->renameLibrary( aOldName, rNewName ); Reference< script::XLibraryContainer2 > xDlgLibContainer( m_aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY ); if ( xDlgLibContainer.is() ) - xDlgLibContainer->renameLibrary( aOldName, aNewName ); + xDlgLibContainer->renameLibrary( aOldName, rNewName ); BasicIDE::MarkDocumentModified( m_aDocument ); SfxBindings* pBindings = BasicIDE::GetBindingsPtr(); @@ -367,7 +364,7 @@ sal_Bool BasicCheckBox::EditedEntry( SvLBoxEntry* pEntry, const String& rNewText if ( !bValid ) { - if ( rNewText.Len() > 30 ) + if ( rNewName.getLength() > 30 ) ErrorBox( this, WB_OK | WB_DEF_OK, ResId::toString( IDEResId( RID_STR_LIBNAMETOLONG ) ) ).Execute(); else ErrorBox( this, WB_OK | WB_DEF_OK, ResId::toString( IDEResId( RID_STR_BADSBXNAME ) ) ).Execute(); diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 657c3c8cff6c..c86089ef8ff1 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -89,7 +89,7 @@ sal_Bool ExtBasicTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& ) return bRet; } -sal_Bool ExtBasicTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ) +sal_Bool ExtBasicTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewText ) { sal_Bool bValid = BasicIDE::IsValidSbxName( rNewText ); if ( !bValid ) @@ -98,7 +98,7 @@ sal_Bool ExtBasicTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const String& rN return sal_False; } - String aCurText( GetEntryText( pEntry ) ); + rtl::OUString aCurText( GetEntryText( pEntry ) ); if ( aCurText == rNewText ) // nothing to do return sal_True; diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx index 0626bab789ff..c83b2941c5fe 100644 --- a/basctl/source/basicide/moduldlg.hxx +++ b/basctl/source/basicide/moduldlg.hxx @@ -108,7 +108,7 @@ class ExtBasicTreeListBox : public BasicTreeListBox { protected: virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& rSel ); - virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ); + virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewText ); virtual DragDropMode NotifyStartDrag( TransferDataContainer& rData, SvLBoxEntry* pEntry ); virtual sal_Bool NotifyAcceptDrop( SvLBoxEntry* pEntry ); @@ -148,7 +148,7 @@ public: virtual void InitEntry( SvLBoxEntry*, const XubString&, const Image&, const Image&, SvLBoxButtonKind eButtonKind ); virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& rSel ); - virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const String& rNewText ); + virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const rtl::OUString& rNewText ); void SetDocument( const ScriptDocument& rDocument ) { m_aDocument = rDocument; } -- cgit