summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-19 11:36:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-06-19 14:11:50 +0100
commit447e5b4b36271b197660a9383a0f88c2761896c6 (patch)
treedfbdfcfacf2e890fe51db57684927f345c1a4acb
parentreduce amount of static Strings (diff)
downloadcore-447e5b4b36271b197660a9383a0f88c2761896c6.tar.gz
core-447e5b4b36271b197660a9383a0f88c2761896c6.zip
death to some UniStrings
Change-Id: I0fa0c60e12c418d25f8bd96cc04c6abd74b1a608
-rw-r--r--cppcanvas/source/mtfrenderer/emfplus.cxx2
-rw-r--r--editeng/source/misc/svxacorr.cxx5
-rw-r--r--sc/source/ui/docshell/docsh.cxx4
-rw-r--r--sot/source/sdstor/stgelem.cxx4
-rw-r--r--svl/source/misc/inettype.cxx5
-rw-r--r--svtools/source/contnr/svtabbx.cxx7
-rw-r--r--svtools/source/edit/syntaxhighlight.cxx2
-rw-r--r--svtools/source/filter/wmf/enhwmf.cxx2
-rw-r--r--svtools/source/svhtml/parhtml.cxx10
-rw-r--r--svx/source/dialog/ctredlin.cxx2
-rw-r--r--tools/source/inet/inetmime.cxx2
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx13
-rwxr-xr-xunusedcode.easy1
-rw-r--r--vcl/source/control/field2.cxx2
-rw-r--r--vcl/source/gdi/outdev3.cxx6
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx2
-rw-r--r--vcl/unx/generic/app/i18n_cb.cxx2
17 files changed, 33 insertions, 38 deletions
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 82df0516d4f1..b99a53fa9873 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -1180,7 +1180,7 @@ namespace cppcanvas
}
// create and add the text action
- XubString text( chars, stringLength );
+ rtl::OUString text(chars, stringLength);
delete[] chars;
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index fa9c7af48f1d..7f8da77cd122 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1030,8 +1030,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc,
// check on the basis of the exception list
if( pExceptStt )
{
- sWord = String(
- pStr, sal::static_int_cast< xub_StrLen >( pExceptStt - pStr + 1 ) );
+ sWord = rtl::OUString(pStr, pExceptStt - pStr + 1);
if( FindInCplSttExceptList(eLang, sWord) )
return sal_False;
@@ -1725,7 +1724,7 @@ static const SvxAutocorrWord* lcl_SearchWordsInList(
( nCalcStt < rStt &&
IsWordDelim( rTxt.GetChar(nCalcStt - 1 ) ))) )
{
- String sWord( rTxt.GetBuffer() + nCalcStt, rChk.Len() );
+ rtl::OUString sWord(rTxt.GetBuffer() + nCalcStt, rChk.Len());
if( rCmp.isEqual( rChk, sWord ))
{
rStt = nCalcStt;
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index d465d8bb4f99..e70cf2de6862 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -214,8 +214,8 @@ void ScDocShell::FillClass( SvGlobalName* pClassName,
{
*pClassName = SvGlobalName( SO3_SC_CLASSID_60 );
*pFormat = bTemplate ? SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE : SOT_FORMATSTR_ID_STARCALC_8;
- *pFullTypeName = String( RTL_CONSTASCII_USTRINGPARAM("calc8") );
- *pShortTypeName = String( ScResId( SCSTR_SHORT_SCDOC_NAME ) );
+ *pFullTypeName = rtl::OUString("calc8");
+ *pShortTypeName = ScResId(SCSTR_SHORT_SCDOC_NAME).toString();
}
else
{
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index e8eb0e59db45..1a212a780a81 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -293,7 +293,7 @@ void StgEntry::GetName( String& rName ) const
sal_uInt16 n = nNameLen;
if( n )
n = ( n >> 1 ) - 1;
- rName = String( nName, n );
+ rName = rtl::OUString(nName, n);
}
// Compare two entries. Do this case-insensitive.
@@ -350,7 +350,7 @@ sal_Bool StgEntry::Load( const void* pFrom )
return sal_False;
}
- aName = String( nName, n );
+ aName = rtl::OUString( nName, n );
// I don't know the locale, so en_US is hopefully fine
aName = ToUpperUnicode( aName );
aName.Erase( nMaxLegalStr );
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index edf11cbdcb17..fac059bff228 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -958,7 +958,7 @@ bool INetContentTypes::parse(UniString const & rMediaType,
}
if (p == pToken)
return false;
- rType = UniString(pToken, sal::static_int_cast< xub_StrLen >(p - pToken));
+ rType = rtl::OUString(pToken, p - pToken);
if (bDowncase)
rType.ToLowerAscii();
@@ -976,8 +976,7 @@ bool INetContentTypes::parse(UniString const & rMediaType,
}
if (p == pToken)
return false;
- rSubType = UniString(
- pToken, sal::static_int_cast< xub_StrLen >(p - pToken));
+ rSubType = rtl::OUString(pToken, p - pToken);
if (bDowncase)
rSubType.ToLowerAscii();
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index 497bd20cdb79..ad14ca314194 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -91,8 +91,7 @@ void SvTabListBox::InitEntry( SvLBoxEntry* pEntry, const XubString& rStr,
for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ )
{
if( pCurToken && nCurTokenLen )
- // aToken.Assign( pCurToken, nCurTokenLen );
- aToken = XubString( pCurToken, nCurTokenLen );
+ aToken = rtl::OUString(pCurToken, nCurTokenLen);
else
aToken.Erase();
SvLBoxString* pStr = new SvLBoxString( pEntry, 0, aToken );
@@ -339,7 +338,7 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, sal
if( nCol == 0xffff )
{
if( pCurToken )
- aTemp = XubString( pCurToken, nCurTokenLen );
+ aTemp = rtl::OUString(pCurToken, nCurTokenLen);
else
aTemp.Erase(); // delete all columns without a token
((SvLBoxString*)pStr)->SetText( pEntry, aTemp );
@@ -350,7 +349,7 @@ void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry, sal
{
if( !nCol )
{
- aTemp = XubString( pCurToken, nCurTokenLen );
+ aTemp = rtl::OUString(pCurToken, nCurTokenLen);
((SvLBoxString*)pStr)->SetText( pEntry, aTemp );
if( !pNextToken )
break;
diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx
index 2bf3d0204a7e..a366c03dc6f4 100644
--- a/svtools/source/edit/syntaxhighlight.cxx
+++ b/svtools/source/edit/syntaxhighlight.cxx
@@ -423,7 +423,7 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if( bCanBeKeyword )
{
- String aKWString(rpStartPos, sal::static_int_cast< xub_StrLen >(nCount) );
+ rtl::OUString aKWString(rpStartPos, nCount);
rtl::OString aByteStr = rtl::OUStringToOString(aKWString,
RTL_TEXTENCODING_ASCII_US).toAsciiLowerCase();
if ( bsearch( aByteStr.getStr(), ppListKeyWords, nKeyWordCount, sizeof( char* ),
diff --git a/svtools/source/filter/wmf/enhwmf.cxx b/svtools/source/filter/wmf/enhwmf.cxx
index cadb5e2cea98..f19c8f19a2a8 100644
--- a/svtools/source/filter/wmf/enhwmf.cxx
+++ b/svtools/source/filter/wmf/enhwmf.cxx
@@ -1180,7 +1180,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
*pTmp = nTmp;
}
#endif
- aText = String( pBuf, (xub_StrLen)nLen );
+ aText = rtl::OUString(pBuf, nLen);
delete[] pBuf;
}
}
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 5427d86e521d..5d94f12a4040 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -519,7 +519,7 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
if( IsParserWorking() && !rInput.IsEof() )
{
- String sEntity( sEntityBuffer.getStr(), nPos );
+ rtl::OUString sEntity(sEntityBuffer.getStr(), nPos);
cChar = GetHTMLCharName( sEntity );
// not found ( == 0 ): plain text
@@ -533,8 +533,8 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
{
nNextCh = sEntityBuffer[i];
sEntityBuffer.setLength( i );
- sEntity.Assign( sEntityBuffer.getStr(), i );
- cChar = GetHTMLCharName( sEntity );
+ sEntity = rtl::OUString(sEntityBuffer.getStr(), i);
+ cChar = GetHTMLCharName( sEntity );
if( cChar )
{
rInput.SeekRel( -(long)
@@ -896,9 +896,7 @@ int HTMLParser::_GetNextRawToken()
nNextCh = GetNextChar();
}
- String aTok( sTmpBuffer.getStr(),
- sal::static_int_cast< xub_StrLen >(
- sTmpBuffer.getLength()) );
+ String aTok( sTmpBuffer.toString() );
aTok.ToUpperAscii();
bool bDone = false;
if( bReadScript || aEndToken.Len() )
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 10c5aa856040..5d7775e90d9f 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -469,7 +469,7 @@ void SvxRedlinTable::InitEntry( SvLBoxEntry* pEntry, const XubString& rStr,
for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ )
{
if( pCurToken && nCurTokenLen )
- aToken = XubString( pCurToken, nCurTokenLen );
+ aToken = rtl::OUString(pCurToken, nCurTokenLen);
else
aToken.Erase();
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index 531d5fc3c3c1..7a458085ce7c 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -344,7 +344,7 @@ bool parseParameters(ParameterList const & rInput,
bBadEncoding = true;
break;
}
- aValue += UniString(pUnicode, static_cast< xub_StrLen >(nSize));
+ aValue += rtl::OUString(pUnicode, static_cast<sal_Int32>(nSize));
delete[] pUnicode;
pNext = pNext->m_pNext;
}
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 698a457d6724..f4714b64d966 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -1458,17 +1458,17 @@ rtl::OUString LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper
// day of month
nVal = rCal.getValue( CalendarFieldIndex::DAY_OF_MONTH );
pBuf = ImplAdd2UNum( aBuf, nVal, bDayOfMonthWithLeadingZero );
- String aDay( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
+ rtl::OUString aDay(aBuf, pBuf-aBuf);
// month of year
nVal = rCal.getValue( CalendarFieldIndex::MONTH );
- String aMonth( rCal.getDisplayName( CalendarDisplayIndex::MONTH, nVal, nDisplayMonth ) );
+ rtl::OUString aMonth( rCal.getDisplayName( CalendarDisplayIndex::MONTH, nVal, nDisplayMonth ) );
// year
nVal = rCal.getValue( CalendarFieldIndex::YEAR );
if ( bTwoDigitYear )
pBuf = ImplAddUNum( aBuf, nVal % 100, 2 );
else
pBuf = ImplAddUNum( aBuf, nVal );
- String aYear( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
+ rtl::OUString aYear(aBuf, pBuf-aBuf);
// concatenate
switch ( getLongDateFormat() )
{
@@ -1524,7 +1524,7 @@ rtl::OUString LocaleDataWrapper::getDuration( const Time& rTime, sal_Bool bSec,
}
}
- return String( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
+ return rtl::OUString(aBuf, pBuf-aBuf);
}
@@ -1554,14 +1554,13 @@ rtl::OUString LocaleDataWrapper::getNum( sal_Int64 nNumber, sal_uInt16 nDecimals
sal_Unicode* pBuf = ImplAddFormatNum( pBuffer, nNumber, nDecimals,
bUseThousandSep, bTrailingZeros );
- String aStr( pBuffer, (xub_StrLen)(sal_uLong)(pBuf-pBuffer) );
+ rtl::OUString aStr(pBuffer, pBuf-pBuffer);
if ( pBuffer != aBuf )
delete [] pBuffer;
return aStr;
}
-
rtl::OUString LocaleDataWrapper::getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
const rtl::OUString& rCurrencySymbol, sal_Bool bUseThousandSep ) const
{
@@ -1753,7 +1752,7 @@ rtl::OUString LocaleDataWrapper::getCurr( sal_Int64 nNumber, sal_uInt16 nDecimal
}
}
- String aNumber( pBuffer, (xub_StrLen)(sal_uLong)(pBuf-pBuffer) );
+ rtl::OUString aNumber(pBuffer, pBuf-pBuffer);
if ( pBuffer != aBuf )
delete [] pBuffer;
diff --git a/unusedcode.easy b/unusedcode.easy
index da7c66401ce9..d23ad1bf294d 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -70,6 +70,7 @@ SrchAttrItemList::Replace(SearchAttrItem const&, unsigned short)
SrchAttrItemList::Replace(SearchAttrItem const*, unsigned short, unsigned short)
SrchAttrItemList::_ForEach(unsigned short, unsigned short, unsigned char (*)(SearchAttrItem const&, void*), void*)
StgCache::Pos2Page(int)
+String::String(rtl::OString const&, unsigned short, unsigned int)
String::String(unsigned short const*)
SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, unsigned char)
SvPtrarr::Replace(void* const*, unsigned short, unsigned short)
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 4ed66e5f1325..e7f915aa7cdf 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1333,7 +1333,7 @@ XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
}
}
- return String( aBuf, (xub_StrLen)(sal_uLong)(pBuf-aBuf) );
+ return rtl::OUString(aBuf, pBuf-aBuf);
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 06d04cc6fa23..daddd9096e64 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -4079,7 +4079,7 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
xub_Unicode aChars[nMaxStrikeStrLen+1]; // +1 for valgrind...
for( int i = 0; i < nTestStrLen; ++i)
aChars[i] = cStrikeoutChar;
- const String aStrikeoutTest( aChars, nTestStrLen );
+ const rtl::OUString aStrikeoutTest(aChars, nTestStrLen);
// calculate approximation of strikeout atom size
long nStrikeoutWidth = 0;
@@ -4099,7 +4099,7 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
// build the strikeout string
for( int i = nTestStrLen; i < nStrikeStrLen; ++i)
aChars[i] = cStrikeoutChar;
- const String aStrikeoutText( aChars, xub_StrLen(nStrikeStrLen) );
+ const rtl::OUString aStrikeoutText(aChars, nStrikeStrLen);
if( mpFontEntry->mnOrientation )
ImplRotatePos( 0, 0, nDistX, nDistY, mpFontEntry->mnOrientation );
@@ -6370,7 +6370,7 @@ xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
xub_StrLen nRetVal = sal::static_int_cast<xub_StrLen>(pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor ));
// calculate hyphenated break position
- String aHyphenatorStr( &nHyphenatorChar, 1 );
+ rtl::OUString aHyphenatorStr(nHyphenatorChar);
xub_StrLen nTempLen = 1;
SalLayout* pHyphenatorLayout = ImplLayout( aHyphenatorStr, 0, nTempLen );
if( pHyphenatorLayout )
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 72201bab2fa1..5d7873ca7360 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2375,7 +2375,7 @@ PDFSalLayout::PDFSalLayout( PDFWriterImpl& rPDFWriterImpl,
bool PDFSalLayout::LayoutText( ImplLayoutArgs& rArgs )
{
- const String aText( rArgs.mpStr+rArgs.mnMinCharPos, sal::static_int_cast<xub_StrLen>(rArgs.mnEndCharPos-rArgs.mnMinCharPos) );
+ const rtl::OUString aText(rArgs.mpStr+rArgs.mnMinCharPos, rArgs.mnEndCharPos-rArgs.mnMinCharPos);
SetText( aText );
SetUnitsPerPixel( 1000 );
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx
index 40818d08e3a4..d3c3c6b8a8b9 100644
--- a/vcl/unx/generic/app/i18n_cb.cxx
+++ b/vcl/unx/generic/app/i18n_cb.cxx
@@ -392,7 +392,7 @@ PreeditDrawCallback(XIC ic, XPointer client_data,
pPreeditData->aInputEv.mpTextAttr = Preedit_FeedbackToSAL(
pPreeditData->aText.pCharStyle, pPreeditData->aText.nLength, pPreeditData->aInputFlags);
pPreeditData->aInputEv.mnCursorPos = call_data->caret;
- pPreeditData->aInputEv.maText = String (pPreeditData->aText.pUnicodeBuffer,
+ pPreeditData->aInputEv.maText = rtl::OUString(pPreeditData->aText.pUnicodeBuffer,
pPreeditData->aText.nLength);
pPreeditData->aInputEv.mnCursorFlags = 0; // default: make cursor visible
pPreeditData->aInputEv.mnDeltaStart = 0; // call_data->chg_first;