summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-08-20 16:09:10 +0200
committerNoel Grandin <noel@peralex.com>2013-08-22 10:49:31 +0200
commitbe8d43651ee2356de8074b026e48ceb2a83b8ea3 (patch)
tree68455f12d9c5ea23674c82eee9c16a2b05cc53c7 /svtools
parent7776178974c09790f4c454ad8dc8c89fc25a2a00 (diff)
convert svtools/source/misc/* from String to OUString
Change-Id: I32592a9fb2110ccc3ac7424a18e43238722849ca
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/ehdl.cxx12
-rw-r--r--svtools/source/misc/embedhlp.cxx2
-rw-r--r--svtools/source/misc/embedtransfer.cxx2
-rw-r--r--svtools/source/misc/imagemgr.cxx89
-rw-r--r--svtools/source/misc/imap.cxx4
-rw-r--r--svtools/source/misc/imap2.cxx68
-rw-r--r--svtools/source/misc/langtab.cxx7
-rw-r--r--svtools/source/misc/templatefoldercache.cxx24
-rw-r--r--svtools/source/misc/transfer.cxx2
9 files changed, 104 insertions, 106 deletions
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 470e18e8cbbd..59470e9129a3 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -81,12 +81,12 @@ static sal_uInt16 aWndFunc(
break;
}
- String aErr(SvtResId(STR_ERR_HDLMESS).toString());
- String aAction(rAction);
- if ( aAction.Len() )
- aAction += OUString(":\n");
- aErr.SearchAndReplace(OUString("$(ACTION)"), aAction);
- aErr.SearchAndReplace(OUString("$(ERROR)"), rErr);
+ OUString aErr(SvtResId(STR_ERR_HDLMESS).toString());
+ OUString aAction(rAction);
+ if ( !aAction.isEmpty() )
+ aAction += ":\n";
+ aErr = aErr.replaceAll("$(ACTION)", aAction);
+ aErr = aErr.replaceAll("$(ERROR)", rErr);
MessBox* pBox;
switch ( nFlags & 0xf000 )
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 651a27e8c352..fb5f3f2e1ccc 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -531,7 +531,7 @@ void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream
if ( pGraphicStream )
{
GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
- rGF.ImportGraphic( *mpImpl->pGraphic, String(), *pGraphicStream, GRFILTER_FORMAT_DONTKNOW );
+ rGF.ImportGraphic( *mpImpl->pGraphic, "", *pGraphicStream, GRFILTER_FORMAT_DONTKNOW );
mpImpl->mnGraphicVersion++;
if ( mpImpl->pContainer )
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index 3c87d03144e3..7ccbfe5c274c 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -240,7 +240,7 @@ void SvEmbedTransferHelper::FillTransferableObjectDescriptor( TransferableObject
rDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapMode( MAP_100TH_MM ) );
rDesc.maDragStartPos = Point();
- rDesc.maDisplayName = String();
+ rDesc.maDisplayName = "";
rDesc.mbCanLink = sal_False;
}
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index 0eea288eac17..57ec73689295 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -194,18 +194,18 @@ static SvtFactory2ExtensionMapping_Impl const Fac2ExtMap_Impl[] =
//****************************************************************************
-static String GetImageExtensionByFactory_Impl( const String& rURL )
+static OUString GetImageExtensionByFactory_Impl( const OUString& rURL )
{
INetURLObject aObj( rURL );
- String aPath = aObj.GetURLPath( INetURLObject::NO_DECODE );
- String aExtension;
+ OUString aPath = aObj.GetURLPath( INetURLObject::NO_DECODE );
+ OUString aExtension;
- if ( aPath.Len() )
+ if ( !aPath.isEmpty() )
{
sal_uInt16 nIndex = 0;
while ( Fac2ExtMap_Impl[ nIndex ]._pFactory )
{
- if ( aPath.EqualsAscii( Fac2ExtMap_Impl[ nIndex ]._pFactory ) )
+ if ( aPath.equalsAscii( Fac2ExtMap_Impl[ nIndex ]._pFactory ) )
{
// extension found
aExtension = OUString::createFromAscii(Fac2ExtMap_Impl[ nIndex ]._pExtension);
@@ -242,7 +242,7 @@ static String GetImageExtensionByFactory_Impl( const String& rURL )
if ( ( rProp.Value >>= aExtensions ) && aExtensions.getLength() > 0 )
{
const OUString* pExtensions = aExtensions.getConstArray();
- aExtension = String( pExtensions[0] );
+ aExtension = OUString( pExtensions[0] );
break;
}
}
@@ -261,17 +261,16 @@ static String GetImageExtensionByFactory_Impl( const String& rURL )
return aExtension;
}
-static sal_uInt16 GetIndexOfExtension_Impl( const String& rExtension )
+static sal_uInt16 GetIndexOfExtension_Impl( const OUString& rExtension )
{
sal_uInt16 nRet = NO_INDEX;
- if ( rExtension.Len() )
+ if ( !rExtension.isEmpty() )
{
sal_uInt16 nIndex = 0;
- String aExt = rExtension;
- aExt.ToLowerAscii();
+ OUString aExt = rExtension.toAsciiLowerCase();
while ( ExtensionMap_Impl[ nIndex ]._pExt )
{
- if ( aExt.EqualsAscii( ExtensionMap_Impl[ nIndex ]._pExt ) )
+ if ( aExt.equalsAscii( ExtensionMap_Impl[ nIndex ]._pExt ) )
{
nRet = nIndex;
break;
@@ -283,10 +282,10 @@ static sal_uInt16 GetIndexOfExtension_Impl( const String& rExtension )
return nRet;
}
-static sal_uInt16 GetImageId_Impl( const String& rExtension )
+static sal_uInt16 GetImageId_Impl( const OUString& rExtension )
{
sal_uInt16 nImage = IMG_FILE;
- if ( rExtension.Len() != NO_INDEX )
+ if ( rExtension.getLength() != NO_INDEX )
{
sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension );
if ( nIndex != NO_INDEX )
@@ -324,7 +323,7 @@ static sal_Bool GetVolumeProperties_Impl( ::ucbhelper::Content& rContent, svtool
return bRet;
}
-static sal_uInt16 GetFolderImageId_Impl( const String& rURL )
+static sal_uInt16 GetFolderImageId_Impl( const OUString& rURL )
{
sal_uInt16 nRet = IMG_FOLDER;
::svtools::VolumeInfo aVolumeInfo;
@@ -356,28 +355,28 @@ static sal_uInt16 GetFolderImageId_Impl( const String& rURL )
static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder )
{
- String aExt, sURL = rObject.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aExt, sURL = rObject.GetMainURL( INetURLObject::NO_DECODE );
sal_uInt16 nImage = IMG_FILE;
if ( rObject.GetProtocol() == INET_PROT_PRIVATE )
{
- String aURLPath = sURL.Copy( URL_PREFIX_PRIV_SOFFICE_LEN );
- String aType = aURLPath.GetToken( 0, INET_PATH_TOKEN );
- if ( aType == String( RTL_CONSTASCII_USTRINGPARAM("factory") ) )
+ OUString aURLPath = sURL.copy( URL_PREFIX_PRIV_SOFFICE_LEN );
+ OUString aType = aURLPath.getToken( 0, INET_PATH_TOKEN );
+ if ( aType == "factory" )
{
// detect an image id for our "private:factory" urls
aExt = GetImageExtensionByFactory_Impl( sURL );
- if ( aExt.Len() > 0 )
+ if ( !aExt.isEmpty() )
nImage = GetImageId_Impl( aExt );
return nImage;
}
- else if ( aType == String( RTL_CONSTASCII_USTRINGPARAM("image") ) )
- nImage = (sal_uInt16)aURLPath.GetToken( 1, INET_PATH_TOKEN ).ToInt32();
+ else if ( aType == "image" )
+ nImage = (sal_uInt16)aURLPath.getToken( 1, INET_PATH_TOKEN ).toInt32();
}
else
{
aExt = rObject.getExtension();
- if ( aExt.EqualsAscii( "vor" ) )
+ if ( aExt == "vor" )
{
SotStorageRef aStorage = new SotStorage( sURL, STREAM_STD_READ );
sal_uInt16 nId = IMG_WRITERTEMPLATE;
@@ -399,21 +398,21 @@ static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, sal_Bool bDetec
}
}
- if ( nImage == IMG_FILE && sURL.Len() )
+ if ( nImage == IMG_FILE && !sURL.isEmpty() )
{
if ( bDetectFolder && CONTENT_HELPER::IsFolder( sURL ) )
nImage = GetFolderImageId_Impl( sURL );
- else if ( aExt.Len() > 0 )
+ else if ( !aExt.isEmpty() )
nImage = GetImageId_Impl( aExt );
}
return nImage;
}
-static sal_uInt16 GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbShowExt )
+static sal_uInt16 GetDescriptionId_Impl( const OUString& rExtension, sal_Bool& rbShowExt )
{
sal_uInt16 nId = 0;
- if ( rExtension.Len() != NO_INDEX )
+ if ( rExtension.getLength() != NO_INDEX )
{
sal_uInt16 nIndex = GetIndexOfExtension_Impl( rExtension );
if ( nIndex != NO_INDEX )
@@ -426,24 +425,24 @@ static sal_uInt16 GetDescriptionId_Impl( const String& rExtension, sal_Bool& rbS
return nId;
}
-static String GetDescriptionByFactory_Impl( const String& rFactory )
+static OUString GetDescriptionByFactory_Impl( const OUString& rFactory )
{
sal_uInt16 nResId = 0;
- if ( rFactory.EqualsIgnoreCaseAscii( "swriter", 0, 7 ) )
+ if ( rFactory.startsWithIgnoreAsciiCase( "swriter" ) )
nResId = STR_DESCRIPTION_FACTORY_WRITER;
- else if ( rFactory.EqualsIgnoreCaseAscii( "scalc", 0, 5 ) )
+ else if ( rFactory.startsWithIgnoreAsciiCase( "scalc" ) )
nResId = STR_DESCRIPTION_FACTORY_CALC;
- else if ( rFactory.EqualsIgnoreCaseAscii( "simpress", 0, 8 ) )
+ else if ( rFactory.startsWithIgnoreAsciiCase( "simpress" ) )
nResId = STR_DESCRIPTION_FACTORY_IMPRESS;
- else if ( rFactory.EqualsIgnoreCaseAscii( "sdraw", 0, 5 ) )
+ else if ( rFactory.startsWithIgnoreAsciiCase( "sdraw" ) )
nResId = STR_DESCRIPTION_FACTORY_DRAW;
- else if ( rFactory.EqualsIgnoreCaseAscii( "swriter/web", 0, 11 ) )
+ else if ( rFactory.startsWithIgnoreAsciiCase( "swriter/web" ) )
nResId = STR_DESCRIPTION_FACTORY_WRITERWEB;
- else if ( rFactory.EqualsIgnoreCaseAscii( "swriter/globaldocument", 0, 22 ) )
+ else if ( rFactory.startsWithIgnoreAsciiCase( "swriter/globaldocument" ) )
nResId = STR_DESCRIPTION_FACTORY_GLOBALDOC;
- else if ( rFactory.EqualsIgnoreCaseAscii( "smath", 0, 5 ) )
+ else if ( rFactory.startsWithIgnoreAsciiCase( "smath" ) )
nResId = STR_DESCRIPTION_FACTORY_MATH;
- else if ( rFactory.EqualsIgnoreCaseAscii( "sdatabase", 0, 9 ) )
+ else if ( rFactory.startsWithIgnoreAsciiCase( "sdatabase" ) )
nResId = STR_DESCRIPTION_FACTORY_DATABASE;
if ( nResId )
@@ -454,7 +453,7 @@ static String GetDescriptionByFactory_Impl( const String& rFactory )
return OUString();
}
-static sal_uInt16 GetFolderDescriptionId_Impl( const String& rURL )
+static sal_uInt16 GetFolderDescriptionId_Impl( const OUString& rURL )
{
sal_uInt16 nRet = STR_DESCRIPTION_FOLDER;
svtools::VolumeInfo aVolumeInfo;
@@ -525,7 +524,7 @@ static Image GetImageFromList_Impl( sal_uInt16 nImageId, sal_Bool bBig )
OUString SvFileInformationManager::GetDescription_Impl( const INetURLObject& rObject, sal_Bool bDetectFolder )
{
OUString sExtension(rObject.getExtension());
- String sDescription, sURL( rObject.GetMainURL( INetURLObject::NO_DECODE ) );
+ OUString sDescription, sURL( rObject.GetMainURL( INetURLObject::NO_DECODE ) );
sal_uInt16 nResId = 0;
sal_Bool bShowExt = sal_False, bDetected = sal_False, bOnlyFile = sal_False;
sal_Bool bFolder = bDetectFolder ? CONTENT_HELPER::IsFolder( sURL ) : sal_False;
@@ -535,11 +534,11 @@ OUString SvFileInformationManager::GetDescription_Impl( const INetURLObject& rOb
{
if ( rObject.GetProtocol() == INET_PROT_PRIVATE )
{
- String aURLPath = sURL.Copy( URL_PREFIX_PRIV_SOFFICE_LEN );
- String aType = aURLPath.GetToken( 0, INET_PATH_TOKEN );
- if ( aType == String( RTL_CONSTASCII_USTRINGPARAM("factory") ) )
+ OUString aURLPath = sURL.copy( URL_PREFIX_PRIV_SOFFICE_LEN );
+ OUString aType = aURLPath.getToken( 0, INET_PATH_TOKEN );
+ if ( aType == "factory" )
{
- sDescription = GetDescriptionByFactory_Impl( aURLPath.Copy( aURLPath.Search( INET_PATH_TOKEN ) + 1 ) );
+ sDescription = GetDescriptionByFactory_Impl( aURLPath.copy( aURLPath.indexOf( INET_PATH_TOKEN ) + 1 ) );
bDetected = sal_True;
}
}
@@ -571,19 +570,19 @@ OUString SvFileInformationManager::GetDescription_Impl( const INetURLObject& rOb
bShowExt = sal_False;
sExtension = sExtension.toAsciiUpperCase();
sDescription = sExtension;
- sDescription += '-';
+ sDescription += "-";
}
SolarMutexGuard aGuard;
sDescription += SvtResId(nResId).toString();
}
- DBG_ASSERT( sDescription.Len() > 0, "file without description" );
+ DBG_ASSERT( !sDescription.isEmpty(), "file without description" );
if ( bShowExt )
{
- sDescription += String( RTL_CONSTASCII_USTRINGPARAM(" (") );
+ sDescription += " (";
sDescription += sExtension;
- sDescription += ')';
+ sDescription += ")";
}
return sDescription;
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index 583978a2f693..7efa9caf7733 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -638,7 +638,7 @@ void ImageMap::ClearImageMap()
delete maList[ i ];
maList.clear();
- aName = String();
+ aName = "";
}
@@ -940,7 +940,7 @@ void ImageMap::ImpReadImageMap( SvStream& rIStm, size_t nCount, const OUString&
void ImageMap::Write( SvStream& rOStm, const OUString& rBaseURL ) const
{
IMapCompat* pCompat;
- String aImageName( GetName() );
+ OUString aImageName( GetName() );
sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
sal_uInt16 nCount = (sal_uInt16) GetIMapObjectCount();
const rtl_TextEncoding eEncoding = osl_getThreadTextEncoding(); //vomit!
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index f9ff161bc997..79eddbbc6285 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -273,19 +273,19 @@ void ImageMap::ImpReadCERNLine( const OString& rLine, const OUString& rBaseURL
{
const Point aTopLeft( ImpReadCERNCoords( &pStr ) );
const Point aBottomRight( ImpReadCERNCoords( &pStr ) );
- const String aURL( ImpReadCERNURL( &pStr, rBaseURL ) );
+ const OUString aURL( ImpReadCERNURL( &pStr, rBaseURL ) );
const Rectangle aRect( aTopLeft, aBottomRight );
- IMapRectangleObject* pObj = new IMapRectangleObject( aRect, aURL, String(), String(), String(), String() );
+ IMapRectangleObject* pObj = new IMapRectangleObject( aRect, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
else if ( ( aToken == "circle" ) || ( aToken == "circ" ) )
{
const Point aCenter( ImpReadCERNCoords( &pStr ) );
const long nRadius = ImpReadCERNRadius( &pStr );
- const String aURL( ImpReadCERNURL( &pStr, rBaseURL ) );
+ const OUString aURL( ImpReadCERNURL( &pStr, rBaseURL ) );
- IMapCircleObject* pObj = new IMapCircleObject( aCenter, nRadius, aURL, String(), String(), String(), String() );
+ IMapCircleObject* pObj = new IMapCircleObject( aCenter, nRadius, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
else if ( ( aToken == "polygon" ) || ( aToken == "poly" ) )
@@ -293,14 +293,14 @@ void ImageMap::ImpReadCERNLine( const OString& rLine, const OUString& rBaseURL
const sal_uInt16 nCount = comphelper::string::getTokenCount(aStr,
'(') - 1;
Polygon aPoly( nCount );
- String aURL;
+ OUString aURL;
for ( sal_uInt16 i = 0; i < nCount; i++ )
aPoly[ i ] = ImpReadCERNCoords( &pStr );
aURL = ImpReadCERNURL( &pStr, rBaseURL );
- IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, String(), String(), String(), String() );
+ IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
}
@@ -308,10 +308,10 @@ void ImageMap::ImpReadCERNLine( const OString& rLine, const OUString& rBaseURL
Point ImageMap::ImpReadCERNCoords( const char** ppStr )
{
- String aStrX;
- String aStrY;
- Point aPt;
- char cChar = *(*ppStr)++;
+ OUStringBuffer aStrX;
+ OUStringBuffer aStrY;
+ Point aPt;
+ char cChar = *(*ppStr)++;
while( NOTEOL( cChar ) && ( ( cChar < '0' ) || ( cChar > '9' ) ) )
cChar = *(*ppStr)++;
@@ -320,7 +320,7 @@ Point ImageMap::ImpReadCERNCoords( const char** ppStr )
{
while( NOTEOL( cChar ) && ( cChar >= '0' ) && ( cChar <= '9' ) )
{
- aStrX += cChar;
+ aStrX.append( cChar );
cChar = *(*ppStr)++;
}
@@ -331,7 +331,7 @@ Point ImageMap::ImpReadCERNCoords( const char** ppStr )
while( NOTEOL( cChar ) && ( cChar >= '0' ) && ( cChar <= '9' ) )
{
- aStrY += cChar;
+ aStrY.append( cChar );
cChar = *(*ppStr)++;
}
@@ -339,7 +339,7 @@ Point ImageMap::ImpReadCERNCoords( const char** ppStr )
while( NOTEOL( cChar ) && ( cChar != ')' ) )
cChar = *(*ppStr)++;
- aPt = Point( aStrX.ToInt32(), aStrY.ToInt32() );
+ aPt = Point( aStrX.makeStringAndClear().toInt32(), aStrY.makeStringAndClear().toInt32() );
}
}
@@ -348,8 +348,8 @@ Point ImageMap::ImpReadCERNCoords( const char** ppStr )
long ImageMap::ImpReadCERNRadius( const char** ppStr )
{
- String aStr;
- char cChar = *(*ppStr)++;
+ OUStringBuffer aStr;
+ char cChar = *(*ppStr)++;
while( NOTEOL( cChar ) && ( ( cChar < '0' ) || ( cChar > '9' ) ) )
cChar = *(*ppStr)++;
@@ -358,12 +358,12 @@ long ImageMap::ImpReadCERNRadius( const char** ppStr )
{
while( NOTEOL( cChar ) && ( cChar >= '0' ) && ( cChar <= '9' ) )
{
- aStr += cChar;
+ aStr.append( cChar );
cChar = *(*ppStr)++;
}
}
- return aStr.ToInt32();
+ return aStr.makeStringAndClear().toInt32();
}
OUString ImageMap::ImpReadCERNURL( const char** ppStr, const OUString& rBaseURL )
@@ -413,36 +413,36 @@ void ImageMap::ImpReadNCSALine( const OString& rLine, const OUString& rBaseURL )
{
if ( aToken == "rect" )
{
- const String aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
+ const OUString aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
const Point aTopLeft( ImpReadNCSACoords( &pStr ) );
const Point aBottomRight( ImpReadNCSACoords( &pStr ) );
const Rectangle aRect( aTopLeft, aBottomRight );
- IMapRectangleObject* pObj = new IMapRectangleObject( aRect, aURL, String(), String(), String(), String() );
+ IMapRectangleObject* pObj = new IMapRectangleObject( aRect, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
else if ( aToken == "circle" )
{
- const String aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
+ const OUString aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
const Point aCenter( ImpReadNCSACoords( &pStr ) );
const Point aDX( aCenter - ImpReadNCSACoords( &pStr ) );
long nRadius = (long) sqrt( (double) aDX.X() * aDX.X() +
(double) aDX.Y() * aDX.Y() );
- IMapCircleObject* pObj = new IMapCircleObject( aCenter, nRadius, aURL, String(), String(), String(), String() );
+ IMapCircleObject* pObj = new IMapCircleObject( aCenter, nRadius, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
else if ( aToken == "poly" )
{
const sal_uInt16 nCount = comphelper::string::getTokenCount(aStr,
',') - 1;
- const String aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
+ const OUString aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
Polygon aPoly( nCount );
for ( sal_uInt16 i = 0; i < nCount; i++ )
aPoly[ i ] = ImpReadNCSACoords( &pStr );
- IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, String(), String(), String(), String() );
+ IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
}
@@ -450,8 +450,8 @@ void ImageMap::ImpReadNCSALine( const OString& rLine, const OUString& rBaseURL )
OUString ImageMap::ImpReadNCSAURL( const char** ppStr, const OUString& rBaseURL )
{
- String aStr;
- char cChar = *(*ppStr)++;
+ OUStringBuffer aStr;
+ char cChar = *(*ppStr)++;
while( NOTEOL( cChar ) && ( ( cChar == ' ' ) || ( cChar == '\t' ) ) )
cChar = *(*ppStr)++;
@@ -460,20 +460,20 @@ OUString ImageMap::ImpReadNCSAURL( const char** ppStr, const OUString& rBaseURL
{
while( NOTEOL( cChar ) && ( cChar != ' ' ) && ( cChar != '\t' ) )
{
- aStr += cChar;
+ aStr.append( cChar );
cChar = *(*ppStr)++;
}
}
- return INetURLObject::GetAbsURL( rBaseURL, aStr );
+ return INetURLObject::GetAbsURL( rBaseURL, aStr.makeStringAndClear() );
}
Point ImageMap::ImpReadNCSACoords( const char** ppStr )
{
- String aStrX;
- String aStrY;
- Point aPt;
- char cChar = *(*ppStr)++;
+ OUStringBuffer aStrX;
+ OUStringBuffer aStrY;
+ Point aPt;
+ char cChar = *(*ppStr)++;
while( NOTEOL( cChar ) && ( ( cChar < '0' ) || ( cChar > '9' ) ) )
cChar = *(*ppStr)++;
@@ -482,7 +482,7 @@ Point ImageMap::ImpReadNCSACoords( const char** ppStr )
{
while( NOTEOL( cChar ) && ( cChar >= '0' ) && ( cChar <= '9' ) )
{
- aStrX += cChar;
+ aStrX.append( cChar );
cChar = *(*ppStr)++;
}
@@ -493,11 +493,11 @@ Point ImageMap::ImpReadNCSACoords( const char** ppStr )
while( NOTEOL( cChar ) && ( cChar >= '0' ) && ( cChar <= '9' ) )
{
- aStrY += cChar;
+ aStrY.append( cChar );
cChar = *(*ppStr)++;
}
- aPt = Point( aStrX.ToInt32(), aStrY.ToInt32() );
+ aPt = Point( aStrX.makeStringAndClear().toInt32(), aStrY.makeStringAndClear().toInt32() );
}
}
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 96a46c7f0adf..7ddf25fcad6c 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -41,7 +41,7 @@ SVT_DLLPUBLIC const OUString ApplyLreOrRleEmbedding( const OUString &rText )
{
const sal_Int32 nLen = rText.getLength();
if (nLen == 0)
- return String();
+ return OUString();
const sal_Unicode cLRE_Embedding = 0x202A; // the start char of an LRE embedding
const sal_Unicode cRLE_Embedding = 0x202B; // the start char of an RLE embedding
@@ -103,11 +103,10 @@ SVT_DLLPUBLIC const OUString ApplyLreOrRleEmbedding( const OUString &rText )
cStart = cRLE_Embedding; // then use RLE embedding
// add embedding start and end chars to the text if the direction could be determined
- String aRes( rText );
+ OUString aRes( rText );
if (bFound)
{
- aRes.Insert( cStart, 0 );
- aRes.Insert( cPopDirectionalFormat );
+ aRes = OUString(cStart) + aRes + OUString(cPopDirectionalFormat);
}
return aRes;
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 9866c95211d5..447b3b52d905 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -123,7 +123,7 @@ namespace svt
private:
INetURLObject m_aURL;
- String m_sLocalName; // redundant - last segment of m_aURL
+ OUString m_sLocalName; // redundant - last segment of m_aURL
util::DateTime m_aLastModified; // date of last modification as reported by UCP
TemplateFolderContent m_aSubContents; // sorted (by name) list of the children
@@ -141,8 +141,8 @@ namespace svt
TemplateContent( const INetURLObject& _rURL );
// attribute access
- inline String getName( ) const { return m_sLocalName; }
- inline String getURL( ) const { return m_aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ); }
+ inline OUString getName( ) const { return m_sLocalName; }
+ inline OUString getURL( ) const { return m_aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ); }
inline void setModDate( const util::DateTime& _rDate ) { m_aLastModified = _rDate; }
inline const util::DateTime& getModDate( ) const { return m_aLastModified; }
@@ -282,12 +282,12 @@ namespace svt
//---------------------------------------------------------------------
/// functor which allows storing a string
struct StoreString
- :public ::std::unary_function< String, void >
+ :public ::std::unary_function< OUString, void >
,public StorageHelper
{
StoreString( SvStream& _rStorage ) : StorageHelper( _rStorage ) { }
- void operator() ( const String& _rString ) const
+ void operator() ( const OUString& _rString ) const
{
m_rStorage.WriteUniOrByteString( _rString, m_rStorage.GetStreamCharSet() );
}
@@ -326,7 +326,7 @@ namespace svt
void operator() ( const ::rtl::Reference< TemplateContent >& _rxContent ) const
{
// use the base class operator with the local name of the content
- String sURL = _rxContent->getURL();
+ OUString sURL = _rxContent->getURL();
// #116281# Keep office installtion relocatable. Never store
// any direct references to office installation directory.
sURL = m_xOfficeInstDirs->makeRelocatableURL( sURL );
@@ -414,7 +414,7 @@ namespace svt
// initialize them with their (local) names
while ( nChildren-- )
{
- String sURL = m_rStorage.ReadUniOrByteString(m_rStorage.GetStreamCharSet());
+ OUString sURL = m_rStorage.ReadUniOrByteString(m_rStorage.GetStreamCharSet());
sURL = m_xOfficeInstDirs->makeAbsoluteURL( sURL );
INetURLObject aChildURL( sURL );
rChildren.push_back( new TemplateContent( aChildURL ) );
@@ -473,7 +473,7 @@ namespace svt
/// read the current state of the dirs
sal_Bool readCurrentState();
- String implParseSmart( const String& _rPath );
+ OUString implParseSmart( const OUString& _rPath );
sal_Bool implReadFolder( const ::rtl::Reference< TemplateContent >& _rxRoot );
@@ -581,7 +581,7 @@ namespace svt
}
//---------------------------------------------------------------------
- String TemplateFolderCacheImpl::implParseSmart( const String& _rPath )
+ OUString TemplateFolderCacheImpl::implParseSmart( const OUString& _rPath )
{
INetURLObject aParser;
aParser.SetSmartProtocol( INET_PROT_FILE );
@@ -688,7 +688,7 @@ namespace svt
sal_Int32 nIndex = 0;
do
{
- String sTemplatePath( aDirs.getToken(0, ';', nIndex) );
+ OUString sTemplatePath( aDirs.getToken(0, ';', nIndex) );
sTemplatePath = aPathOptions.ExpandMacros( sTemplatePath );
// Make sure excess ".." path segments (from expanding bootstrap
@@ -742,7 +742,7 @@ namespace svt
m_aPreviousState.reserve( nRootDirectories );
while ( nRootDirectories-- )
{
- String sURL = m_pCacheStream->ReadUniOrByteString(m_pCacheStream->GetStreamCharSet());
+ OUString sURL = m_pCacheStream->ReadUniOrByteString(m_pCacheStream->GetStreamCharSet());
// #116281# Keep office installtion relocatable. Never store
// any direct references to office installation directory.
sURL = getOfficeInstDirs()->makeAbsoluteURL( sURL );
@@ -772,7 +772,7 @@ namespace svt
closeCacheStream( );
// get the storage directory
- String sStorageURL = implParseSmart( SvtPathOptions().GetStoragePath() );
+ OUString sStorageURL = implParseSmart( SvtPathOptions().GetStoragePath() );
INetURLObject aStorageURL( sStorageURL );
if ( INET_PROT_NOT_VALID == aStorageURL.GetProtocol() )
{
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index 463b99e92b1f..a86e5cf5513a 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -2181,7 +2181,7 @@ sal_Bool TransferableDataHelper::GetSotStorageStream( const DataFlavor& rFlavor,
if( bRet )
{
- rxStream = new SotStorageStream( String() );
+ rxStream = new SotStorageStream( "" );
rxStream->Write( aSeq.getConstArray(), aSeq.getLength() );
rxStream->Seek( 0 );
}