diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-12 10:57:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-12 11:20:10 +0100 |
commit | 63483b882c80d656dff4279e5be8a59a664a06fe (patch) | |
tree | ab3f0f06b1ddbbb8eeaba973da1e964aefcfba49 /svtools | |
parent | 59a5dcb2065c93e2b4bc95207f7f4e362ce3ee08 (diff) |
XubString->OUString
Change-Id: Ibcb2dd5861ad14e286596999b757ca5c41137626
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/ivctrl.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/svtabbx.cxx | 70 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 12 | ||||
-rw-r--r-- | svtools/source/control/filectrl2.cxx | 4 | ||||
-rw-r--r-- | svtools/source/control/stdmenu.cxx | 4 | ||||
-rw-r--r-- | svtools/source/dialogs/prnsetup.cxx | 8 |
6 files changed, 48 insertions, 52 deletions
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index 6ce18460d7ba..298981c149bf 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -86,7 +86,7 @@ SvtIconChoiceCtrl::~SvtIconChoiceCtrl() delete _pImp; } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags ) +SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const OUString& rText, const Image& rImage, sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags ) { SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( rText, rImage, nFlags); diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index 9120444cb993..00f157a49d24 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -76,9 +76,9 @@ void SvTabListBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rColl, const Image& rExp, SvLBoxButtonKind eButtonKind) { SvTreeListBox::InitEntry(pEntry, rStr, rColl, rExp, eButtonKind); - XubString aToken; + OUString aToken; - const sal_Unicode* pCurToken = aCurEntry.GetBuffer(); + const sal_Unicode* pCurToken = aCurEntry.getStr(); sal_uInt16 nCurTokenLen; const sal_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen ); sal_uInt16 nCount = nTabCount; nCount--; @@ -87,7 +87,7 @@ void SvTabListBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, if( pCurToken && nCurTokenLen ) aToken = OUString(pCurToken, nCurTokenLen); else - aToken.Erase(); + aToken = OUString(); SvLBoxString* pStr = new SvLBoxString( pEntry, 0, aToken ); pEntry->AddItem( pStr ); pCurToken = pNextToken; @@ -184,7 +184,7 @@ void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit ) } } -SvTreeListEntry* SvTabListBox::InsertEntry( const XubString& rText, SvTreeListEntry* pParent, +SvTreeListEntry* SvTabListBox::InsertEntry( const OUString& rText, SvTreeListEntry* pParent, sal_Bool /*bChildrenOnDemand*/, sal_uLong nPos, void* pUserData, SvLBoxButtonKind ) @@ -192,7 +192,7 @@ SvTreeListEntry* SvTabListBox::InsertEntry( const XubString& rText, SvTreeListEn return InsertEntryToColumn( rText, pParent, nPos, 0xffff, pUserData ); } -SvTreeListEntry* SvTabListBox::InsertEntry( const XubString& rText, +SvTreeListEntry* SvTabListBox::InsertEntry( const OUString& rText, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent, @@ -207,26 +207,25 @@ SvTreeListEntry* SvTabListBox::InsertEntry( const XubString& rText, SvTreeListEntry* SvTabListBox::InsertEntryToColumn(const OUString& rStr,SvTreeListEntry* pParent,sal_uLong nPos,sal_uInt16 nCol, void* pUser ) { - XubString aStr; + OUString aStr; if( nCol != 0xffff ) { while( nCol ) { - aStr += '\t'; + aStr += "\t"; nCol--; } } aStr += rStr; - XubString aFirstStr( aStr ); - sal_uInt16 nEnd = aFirstStr.Search( '\t' ); - if( nEnd != STRING_NOTFOUND ) + OUString aFirstStr( aStr ); + sal_Int32 nEnd = aFirstStr.indexOf( '\t' ); + if( nEnd != -1 ) { - aFirstStr.Erase( nEnd ); - aCurEntry = aStr; - aCurEntry.Erase( 0, ++nEnd ); + aFirstStr = aFirstStr.copy(0, nEnd); + aCurEntry = aStr.copy(++nEnd); } else - aCurEntry.Erase(); + aCurEntry = OUString(); return SvTreeListBox::InsertEntry( aFirstStr, pParent, sal_False, nPos, pUser ); } @@ -234,26 +233,25 @@ SvTreeListEntry* SvTabListBox::InsertEntryToColumn( const OUString& rStr, const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp, SvTreeListEntry* pParent,sal_uLong nPos,sal_uInt16 nCol, void* pUser ) { - XubString aStr; + OUString aStr; if( nCol != 0xffff ) { while( nCol ) { - aStr += '\t'; + aStr += "\t"; nCol--; } } aStr += rStr; - XubString aFirstStr( aStr ); - sal_uInt16 nEnd = aFirstStr.Search( '\t' ); - if( nEnd != STRING_NOTFOUND ) + OUString aFirstStr( aStr ); + sal_Int32 nEnd = aFirstStr.indexOf('\t'); + if (nEnd != -1) { - aFirstStr.Erase( nEnd ); - aCurEntry = aStr; - aCurEntry.Erase( 0, ++nEnd ); + aFirstStr = aFirstStr.copy(0, nEnd); + aCurEntry = aStr.copy(++nEnd); } else - aCurEntry.Erase(); + aCurEntry = OUString(); return SvTreeListBox::InsertEntry( aFirstStr, @@ -267,15 +265,15 @@ SvTreeListEntry* SvTabListBox::InsertEntryToColumn( const OUString& rStr, sal_uL return InsertEntryToColumn( rStr,0,nPos, nCol, pUser ); } -String SvTabListBox::GetEntryText( SvTreeListEntry* pEntry ) const +OUString SvTabListBox::GetEntryText( SvTreeListEntry* pEntry ) const { return GetEntryText( pEntry, 0xffff ); } -String SvTabListBox::GetEntryText( SvTreeListEntry* pEntry, sal_uInt16 nCol ) const +OUString SvTabListBox::GetEntryText( SvTreeListEntry* pEntry, sal_uInt16 nCol ) const { DBG_ASSERT(pEntry,"GetEntryText:Invalid Entry"); - XubString aResult; + OUString aResult; if( pEntry ) { sal_uInt16 nCount = pEntry->ItemCount(); @@ -287,8 +285,8 @@ String SvTabListBox::GetEntryText( SvTreeListEntry* pEntry, sal_uInt16 nCol ) co { if( nCol == 0xffff ) { - if( aResult.Len() ) - aResult += '\t'; + if (!aResult.isEmpty()) + aResult += "\t"; aResult += static_cast<const SvLBoxString*>(pStr)->GetText(); } else @@ -304,7 +302,7 @@ String SvTabListBox::GetEntryText( SvTreeListEntry* pEntry, sal_uInt16 nCol ) co return aResult; } -String SvTabListBox::GetEntryText( sal_uLong nPos, sal_uInt16 nCol ) const +OUString SvTabListBox::GetEntryText( sal_uLong nPos, sal_uInt16 nCol ) const { SvTreeListEntry* pEntry = GetEntryOnPos( nPos ); return GetEntryText( pEntry, nCol ); @@ -373,11 +371,11 @@ void SvTabListBox::SetEntryText(const OUString& rStr, SvTreeListEntry* pEntry, s delete pData; } -String SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const +OUString SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const { SvTreeListEntry* pEntry = GetEntryOnPos( nPos ); DBG_ASSERT( pEntry, "SvTabListBox::GetCellText(): Invalid Entry" ); - XubString aResult; + OUString aResult; if (pEntry && pEntry->ItemCount() > static_cast<size_t>(nCol+1)) { const SvLBoxItem* pStr = pEntry->GetItem( nCol + 1 ); @@ -387,13 +385,13 @@ String SvTabListBox::GetCellText( sal_uLong nPos, sal_uInt16 nCol ) const return aResult; } -sal_uLong SvTabListBox::GetEntryPos( const XubString& rStr, sal_uInt16 nCol ) +sal_uLong SvTabListBox::GetEntryPos( const OUString& rStr, sal_uInt16 nCol ) { sal_uLong nPos = 0; SvTreeListEntry* pEntry = First(); while( pEntry ) { - XubString aStr( GetEntryText( pEntry, nCol )); + OUString aStr( GetEntryText( pEntry, nCol )); if( aStr == rStr ) return nPos; pEntry = Next( pEntry ); @@ -449,7 +447,7 @@ String SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const { SvTreeListEntry* pEntry = SvTreeListBox::GetEntry( nPos ); DBG_ASSERT( pEntry, "GetTabEntryText(): Invalid entry " ); - XubString aResult; + OUString aResult; if ( pEntry ) { sal_uInt16 nCount = pEntry->ItemCount(); @@ -461,8 +459,8 @@ String SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const { if ( nCol == 0xffff ) { - if ( aResult.Len() ) - aResult += '\t'; + if (!aResult.isEmpty()) + aResult += "\t"; aResult += static_cast<const SvLBoxString*>(pStr)->GetText(); } else diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 779837941fa0..ef0625ea6907 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -1768,7 +1768,7 @@ void SvTreeListBox::InitEntry(SvTreeListEntry* pEntry, pEntry->AddItem( pString ); } -String SvTreeListBox::GetEntryText(SvTreeListEntry* pEntry) const +OUString SvTreeListBox::GetEntryText(SvTreeListEntry* pEntry) const { DBG_CHKTHIS(SvTreeListBox,0); DBG_ASSERT( pEntry, "SvTreeListBox::GetEntryText(): no entry" ); @@ -1777,7 +1777,7 @@ String SvTreeListBox::GetEntryText(SvTreeListEntry* pEntry) const return pItem->GetText(); } -String SvTreeListBox::SearchEntryText( SvTreeListEntry* pEntry ) const +OUString SvTreeListBox::SearchEntryText( SvTreeListEntry* pEntry ) const { DBG_CHKTHIS(SvTreeListBox,0); DBG_ASSERT( pEntry, "SvTreeListBox::SearchEntryText(): no entry" ); @@ -1826,7 +1826,7 @@ IMPL_LINK_INLINE_START( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pDa IMPL_LINK_INLINE_END( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData ) SvTreeListEntry* SvTreeListBox::InsertEntry( - const XubString& aText, + const OUString& rText, SvTreeListEntry* pParent, sal_Bool bChildrenOnDemand, sal_uLong nPos, void* pUser, @@ -1844,7 +1844,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( SvTreeListEntry* pEntry = CreateEntry(); pEntry->SetUserData( pUser ); - InitEntry( pEntry, aText, rDefColBmp, rDefExpBmp, eButtonKind ); + InitEntry( pEntry, rText, rDefColBmp, rDefExpBmp, eButtonKind ); pEntry->EnableChildrenOnDemand( bChildrenOnDemand ); if( !pParent ) @@ -1860,7 +1860,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( return pEntry; } -SvTreeListEntry* SvTreeListBox::InsertEntry( const XubString& aText, +SvTreeListEntry* SvTreeListBox::InsertEntry( const OUString& rText, const Image& aExpEntryBmp, const Image& aCollEntryBmp, SvTreeListEntry* pParent, sal_Bool bChildrenOnDemand, sal_uLong nPos, void* pUser, SvLBoxButtonKind eButtonKind ) @@ -1873,7 +1873,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( const XubString& aText, SvTreeListEntry* pEntry = CreateEntry(); pEntry->SetUserData( pUser ); - InitEntry( pEntry, aText, aCollEntryBmp, aExpEntryBmp, eButtonKind ); + InitEntry( pEntry, rText, aCollEntryBmp, aExpEntryBmp, eButtonKind ); pEntry->EnableChildrenOnDemand( bChildrenOnDemand ); diff --git a/svtools/source/control/filectrl2.cxx b/svtools/source/control/filectrl2.cxx index 120975ade5a6..0e1bd931ac0f 100644 --- a/svtools/source/control/filectrl2.cxx +++ b/svtools/source/control/filectrl2.cxx @@ -35,8 +35,6 @@ void FileControl::ImplBrowseFile( ) { try { - XubString aNewText; - Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); Reference < dialogs::XFilePicker3 > xFilePicker = dialogs::FilePicker::createWithMode( xContext, dialogs::TemplateDescription::FILEOPEN_SIMPLE ); // transform the system notation text into a file URL @@ -59,7 +57,7 @@ void FileControl::ImplBrowseFile( ) if ( aPathSeq.getLength() ) { - aNewText = aPathSeq[0]; + OUString aNewText = aPathSeq[0]; INetURLObject aObj( aNewText ); if ( aObj.GetProtocol() == INET_PROT_FILE ) aNewText = aObj.PathToFileName(); diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx index a7b3067cfb36..09b041281526 100644 --- a/svtools/source/control/stdmenu.cxx +++ b/svtools/source/control/stdmenu.cxx @@ -67,9 +67,9 @@ void FontNameMenu::Fill( const FontList* pList ) // more than 100 fonts reduces the speed of opening the menu. // So only the first 100 fonts will be displayed. sal_uInt16 nFontCount = ::std::min( pList->GetFontNameCount(), static_cast< sal_uInt16 >(100) ); - for ( sal_uInt16 i = 0; i < nFontCount; i++ ) + for (sal_uInt16 i = 0; i < nFontCount; ++i) { - const XubString& rName = pList->GetFontName( i ).GetName(); + const OUString& rName = pList->GetFontName( i ).GetName(); // sort with the I18nHelper sal_uInt16 j = GetItemCount(); diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx index 1a311bc3b3d1..498680e43aee 100644 --- a/svtools/source/dialogs/prnsetup.cxx +++ b/svtools/source/dialogs/prnsetup.cxx @@ -93,7 +93,7 @@ Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn, Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinter ) { - XubString aPrnName; + OUString aPrnName; if ( pTempPrinter ) aPrnName = pTempPrinter->GetName(); else @@ -123,7 +123,7 @@ void ImplPrnDlgUpdateQueueInfo( ListBox* pBox, QueueInfo& rInfo ) // ----------------------------------------------------------------------- -static void ImplPrnDlgAddString( XubString& rStr, const XubString& rAddStr ) +static void ImplPrnDlgAddString( XubString& rStr, const OUString& rAddStr ) { if ( rStr.Len() ) rStr.AppendAscii( "; " ); @@ -206,7 +206,7 @@ OUString ImplPrnDlgGetStatusText( const QueueInfo& rInfo ) if ( nJobs && (nJobs != QUEUE_JOBS_DONTKNOW) ) { XubString aJobStr( SVT_RESSTR( STR_SVT_PRNDLG_JOBCOUNT ) ); - XubString aJobs( OUString::number( nJobs ) ); + OUString aJobs( OUString::number( nJobs ) ); aJobStr.SearchAndReplaceAscii( "%d", aJobs ); ImplPrnDlgAddString( aStr, aJobStr ); } @@ -269,7 +269,7 @@ void PrinterSetupDialog::ImplSetInfo() } else { - XubString aTempStr; + OUString aTempStr; m_pFiType->SetText( aTempStr ); m_pFiLocation->SetText( aTempStr ); m_pFiComment->SetText( aTempStr ); |