summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-10 10:02:21 +0200
committerNoel Grandin <noel@peralex.com>2013-09-11 09:45:38 +0200
commit6322b703ec64da03396e3802f4e76fc2e7da5509 (patch)
tree8432b3504d8028e1029ffd6c60d4a17b1c471874 /editeng
parenteaef61939bbefa059749ad7605dbe515d12cc265 (diff)
convert editeng/source/items/*.cxx from String to OUString
Change-Id: I981311701ce6f7f4571c098c9f48e51288a1608a
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/borderline.cxx9
-rw-r--r--editeng/source/items/bulitem.cxx2
-rw-r--r--editeng/source/items/frmitems.cxx14
-rw-r--r--editeng/source/items/numitem.cxx8
-rw-r--r--editeng/source/items/svxfont.cxx18
-rw-r--r--editeng/source/items/textitem.cxx10
6 files changed, 27 insertions, 34 deletions
diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index b086d0c1fcd4..6a61aadef48f 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -636,16 +636,13 @@ OUString SvxBorderLine::GetValueString( SfxMapUnit eSrcUnit,
RID_INSET
};
sal_uInt16 nResId = aStyleIds[m_nStyle];
- String aStr;
- aStr += sal_Unicode('(');
- aStr += ::GetColorString( aColor );
- aStr += cpDelim;
+ OUString aStr = "(" + ::GetColorString( aColor ) + OUString(cpDelim);
if ( nResId )
aStr += EE_RESSTR(nResId);
else
{
- String sMetric = EE_RESSTR(GetMetricId( eDestUnit ));
+ OUString sMetric = EE_RESSTR(GetMetricId( eDestUnit ));
aStr += GetMetricText( (long)GetInWidth(), eSrcUnit, eDestUnit, pIntl );
if ( bMetricStr )
aStr += sMetric;
@@ -658,7 +655,7 @@ OUString SvxBorderLine::GetValueString( SfxMapUnit eSrcUnit,
if ( bMetricStr )
aStr += sMetric;
}
- aStr += sal_Unicode(')');
+ aStr += ")";
return aStr;
}
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index 8264c0bf434c..5e1e37f71665 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -81,7 +81,7 @@ Font SvxBulletItem::CreateFont( SvStream& rStream, sal_uInt16 nVer )
rStream >> nTemp; aFont.SetItalic((FontItalic)nTemp);
// UNICODE: rStream >> aName; aFont.SetName( aName );
- String aName = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
+ OUString aName = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
aFont.SetName( aName );
if( nVer == 1 )
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 89b1532bd8e2..177c20d0b5db 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3519,12 +3519,12 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
if ( nDoLoad & LOAD_LINK )
{
// UNICODE: rStream >> aRel;
- String aRel = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
+ OUString aRel = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
// TODO/MBA: how can we get a BaseURL here?!
OSL_FAIL("No BaseURL!");
- String aAbs = INetURLObject::GetAbsURL( String(), aRel );
- DBG_ASSERT( aAbs.Len(), "Invalid URL!" );
+ OUString aAbs = INetURLObject::GetAbsURL( "", aRel );
+ DBG_ASSERT( aAbs.getLength(), "Invalid URL!" );
maStrLink = aAbs;
}
@@ -3711,10 +3711,8 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
else if( sLink.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
{
maStrLink = "";
- String sTmp( sLink );
- OString sId(OUStringToOString(sTmp.Copy(
- sizeof(UNO_NAME_GRAPHOBJ_URLPREFIX)-1),
- RTL_TEXTENCODING_ASCII_US));
+ OString sId(OUStringToOString(sLink.copy( sizeof(UNO_NAME_GRAPHOBJ_URLPREFIX)-1 ),
+ RTL_TEXTENCODING_ASCII_US));
GraphicObject *pOldGrfObj = pImpl->pGraphicObject;
pImpl->pGraphicObject = new GraphicObject( sId );
ApplyGraphicTransparency_Impl();
@@ -3916,7 +3914,7 @@ SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ )
{
OSL_FAIL("No BaseURL!");
// TODO/MBA: how to get a BaseURL?!
- String aRel = INetURLObject::GetRelURL( String(), maStrLink );
+ OUString aRel = INetURLObject::GetRelURL( "", maStrLink );
// UNICODE: rStream << aRel;
rStream.WriteUniOrByteString(aRel, rStream.GetStreamCharSet());
}
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index f740c0ad83c6..3dd4e0469109 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -241,7 +241,7 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
if(pConverter && pBulletFont)
{
cBullet = ConvertFontToSubsFontChar(pConverter, cBullet);
- String sFontName = GetFontToSubsFontName(pConverter);
+ OUString sFontName = GetFontToSubsFontName(pConverter);
pBulletFont->SetName(sFontName);
}
@@ -271,8 +271,7 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
// are present, so Brush save is forced
if(!pGraphicBrush->GetGraphicLink().isEmpty() && pGraphicBrush->GetGraphic())
{
- String aEmpty;
- pGraphicBrush->SetGraphicLink(aEmpty);
+ pGraphicBrush->SetGraphicLink("");
}
pGraphicBrush->Store(rStream, BRUSH_GRAPHIC_VERSION);
@@ -425,8 +424,7 @@ void SvxNumberFormat::SetGraphic( const OUString& rName )
return ;
delete pGraphicBrush;
- String sTmp;
- pGraphicBrush = new SvxBrushItem( rName, sTmp, GPOS_AREA, 0 );
+ pGraphicBrush = new SvxBrushItem( rName, "", GPOS_AREA, 0 );
pGraphicBrush->SetDoneLink( STATIC_LINK( this, SvxNumberFormat, GraphicArrived) );
if( eVertOrient == text::VertOrientation::NONE )
eVertOrient = text::VertOrientation::TOP;
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index ee2d9d1d65c1..c2b6507e3b73 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -203,25 +203,25 @@ void SvxDoCapitals::SetSpace() { }
void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
{
- const XubString &rTxt = rDo.GetTxt();
+ const OUString &rTxt = rDo.GetTxt();
const xub_StrLen nIdx = rDo.GetIdx();
- const xub_StrLen nLen = STRING_LEN == nPartLen ? rDo.GetLen() : nPartLen;
+ const sal_Int32 nLen = STRING_LEN == nPartLen ? rDo.GetLen() : nPartLen;
- const XubString aTxt( CalcCaseMap( rTxt ) );
- const sal_uInt16 nTxtLen = std::min( rTxt.Len(), nLen );
+ const OUString aTxt( CalcCaseMap( rTxt ) );
+ const sal_uInt16 nTxtLen = std::min( rTxt.getLength(), nLen );
sal_uInt16 nPos = 0;
sal_uInt16 nOldPos = nPos;
// #108210#
// Test if string length differ between original and CaseMapped
- sal_Bool bCaseMapLengthDiffers(aTxt.Len() != rTxt.Len());
+ sal_Bool bCaseMapLengthDiffers(aTxt.getLength() != rTxt.getLength());
const LanguageType eLang = LANGUAGE_DONTKNOW == GetLanguage()
? LANGUAGE_SYSTEM : GetLanguage();
LanguageTag aLanguageTag(eLang);
CharClass aCharClass( aLanguageTag );
- String aCharString;
+ OUString aCharString;
while( nPos < nTxtLen )
{
@@ -233,7 +233,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
while( nPos < nTxtLen )
{
- aCharString = rTxt.GetChar( nPos + nIdx );
+ aCharString = rTxt.copy( nPos + nIdx, 1 );
sal_Int32 nCharacterType = aCharClass.getCharacterType( aCharString, 0 );
if ( nCharacterType & ::com::sun::star::i18n::KCharacterType::LOWER )
break;
@@ -269,7 +269,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
if ( comphelper::string::equals(aCharString, CH_BLANK) )
break;
if( ++nPos < nTxtLen )
- aCharString = rTxt.GetChar( nPos + nIdx );
+ aCharString = rTxt.copy( nPos + nIdx, 1 );
}
if( nOldPos != nPos )
{
@@ -292,7 +292,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
}
// Now the blanks are<processed
while( nPos < nTxtLen && comphelper::string::equals(aCharString, CH_BLANK) && ++nPos < nTxtLen )
- aCharString = rTxt.GetChar( nPos + nIdx );
+ aCharString = rTxt.copy( nPos + nIdx, 1 );
if( nOldPos != nPos )
{
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index dc9332075d3b..eb304063a875 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -378,9 +378,9 @@ SvStream& SvxFontItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) co
rStrm << (sal_uInt8) GetFamily() << (sal_uInt8) GetPitch()
<< (sal_uInt8)(bToBats ? RTL_TEXTENCODING_SYMBOL : GetSOStoreTextEncoding(GetCharSet()));
- String aStoreFamilyName( GetFamilyName() );
+ OUString aStoreFamilyName( GetFamilyName() );
if( bToBats )
- aStoreFamilyName = String( "StarBats", sizeof("StarBats")-1, RTL_TEXTENCODING_ASCII_US );
+ aStoreFamilyName = "StarBats";
rStrm.WriteUniOrByteString(aStoreFamilyName, rStrm.GetStreamCharSet());
rStrm.WriteUniOrByteString(GetStyleName(), rStrm.GetStreamCharSet());
@@ -401,7 +401,7 @@ SvStream& SvxFontItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) co
SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const
{
sal_uInt8 _eFamily, eFontPitch, eFontTextEncoding;
- String aName, aStyle;
+ OUString aName, aStyle;
rStrm >> _eFamily;
rStrm >> eFontPitch;
rStrm >> eFontTextEncoding;
@@ -416,7 +416,7 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const
eFontTextEncoding = (sal_uInt8)GetSOLoadTextEncoding( eFontTextEncoding );
// at some point, the StarBats changes from ANSI font to SYMBOL font
- if ( RTL_TEXTENCODING_SYMBOL != eFontTextEncoding && aName.EqualsAscii("StarBats") )
+ if ( RTL_TEXTENCODING_SYMBOL != eFontTextEncoding && aName == "StarBats" )
eFontTextEncoding = RTL_TEXTENCODING_SYMBOL;
// Check if we have stored unicode
@@ -3686,7 +3686,7 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo
SvxFontItem* pItem = aItemArr[ n ];
pItem->SetFamily( aFont.GetFamily() );
pItem->SetFamilyName( aFont.GetName() );
- pItem->SetStyleName( String() );
+ pItem->SetStyleName( OUString() );
pItem->SetPitch( aFont.GetPitch());
pItem->SetCharSet(aFont.GetCharSet());
}