Kaydet (Commit) be8d4365 authored tarafından Noel Grandin's avatar Noel Grandin

convert svtools/source/misc/* from String to OUString

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