From 015a93d6b6ba88382ca5cb13a59dda3e47e08eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 30 Jan 2013 01:32:22 +0000 Subject: [PATCH] make basic XubString free Change-Id: Iea5c01fe902b052a55c86ca3b879bcca12c80690 --- basic/source/sbx/sbxvalue.cxx | 4 ++-- svx/source/accessibility/charmapacc.cxx | 8 ++++---- svx/source/inc/charmapacc.hxx | 4 ++-- svx/source/svdraw/svdattr.cxx | 3 +-- svx/source/table/svdotable.cxx | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 6b486669ac49..e4d9000ca11e 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -1420,7 +1420,7 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) case SbxSINGLE: { // Floats as ASCII - XubString aVal = read_lenPrefixed_uInt8s_ToOUString(r, + OUString aVal = read_lenPrefixed_uInt8s_ToOUString(r, RTL_TEXTENCODING_ASCII_US); double d; SbxDataType t; @@ -1436,7 +1436,7 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) case SbxDOUBLE: { // Floats as ASCII - XubString aVal = read_lenPrefixed_uInt8s_ToOUString(r, + OUString aVal = read_lenPrefixed_uInt8s_ToOUString(r, RTL_TEXTENCODING_ASCII_US); SbxDataType t; if( ImpScan( aVal, aData.nDouble, t, NULL ) != SbxERR_OK ) diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx index 46fabeb37bc3..2644acaba3d8 100644 --- a/svx/source/accessibility/charmapacc.cxx +++ b/svx/source/accessibility/charmapacc.cxx @@ -700,7 +700,7 @@ sal_Int16 SAL_CALL SvxShowCharSetItemAcc::getAccessibleRole() ensureAlive(); String sDescription = SVX_RESSTR( RID_SVXSTR_CHARACTER_CODE ); - sal_Unicode c = mpParent->maText.GetChar(0); + sal_Unicode c = mpParent->maText[0]; char buf[16] = "0x0000"; sal_Unicode c_Shifted = c; for( int i = 0; i < 4; ++i ) @@ -718,18 +718,18 @@ sal_Int16 SAL_CALL SvxShowCharSetItemAcc::getAccessibleRole() // ----------------------------------------------------------------------------- -::rtl::OUString SAL_CALL SvxShowCharSetItemAcc::getAccessibleName() +OUString SAL_CALL SvxShowCharSetItemAcc::getAccessibleName() throw (uno::RuntimeException) { OExternalLockGuard aGuard( this ); ensureAlive(); - String aRet; + OUString aRet; if( mpParent ) { aRet = mpParent->maText; - if( !aRet.Len() ) + if (aRet.isEmpty()) aRet = getAccessibleDescription(); } diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx index 881384a71203..d9abdb9a30cf 100644 --- a/svx/source/inc/charmapacc.hxx +++ b/svx/source/inc/charmapacc.hxx @@ -96,8 +96,8 @@ namespace svx struct SvxShowCharSetItem { SvxShowCharSet& mrParent; - sal_uInt16 mnId; - XubString maText; + sal_uInt16 mnId; + OUString maText; Rectangle maRect; SvxShowCharSetItemAcc* m_pItem; SvxShowCharSetAcc* m_pParent; diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 4ce0137669e0..534ffc6cf8c2 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -85,7 +85,6 @@ SdrItemPool::SdrItemPool( { // prepare some constants const Color aNullCol(RGB_Color(COL_BLACK)); - const XubString aEmptyStr; const sal_Int32 nDefEdgeDist(500L); // Defaulting hard for Draw (100TH_MM) currently. MapMode will have to be taken into account in the future. // init the non-persistent items @@ -96,7 +95,7 @@ SdrItemPool::SdrItemPool( // init own PoolDefaults mppLocalPoolDefaults[SDRATTR_SHADOW -SDRATTR_START]=new SdrShadowItem; - mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR -SDRATTR_START]=new SdrShadowColorItem(aEmptyStr,aNullCol); + mppLocalPoolDefaults[SDRATTR_SHADOWCOLOR -SDRATTR_START]=new SdrShadowColorItem(OUString(),aNullCol); mppLocalPoolDefaults[SDRATTR_SHADOWXDIST -SDRATTR_START]=new SdrShadowXDistItem; mppLocalPoolDefaults[SDRATTR_SHADOWYDIST -SDRATTR_START]=new SdrShadowYDistItem; mppLocalPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrShadowTransparenceItem; diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 9bf226865958..d0e34eb1f8e0 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1841,9 +1841,9 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl) if(nParaAnz == 1) { // if its only one paragraph, check if it is empty - XubString aStr(rOutl.GetText(p1stPara)); + OUString aStr(rOutl.GetText(p1stPara)); - if(!aStr.Len()) + if(aStr.isEmpty()) { // gotcha! nParaAnz = 0;