summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-04 12:16:37 +0200
committerNoel Grandin <noel@peralex.com>2013-09-05 08:55:02 +0200
commitb46236f54e94a7f3f9e2a553b130d4bb06486f28 (patch)
tree5777faaeeb45c0bae691acebbca80a730b731b45 /svx
parent78c96d8337e0b8c3726ab675c1f70b75fcd0d046 (diff)
convert svx/source/xml/*.cxx from String to OUString
Change-Id: Id300414c0b34af4cc8c8a5cd49d1a17ba56f9b57
Diffstat (limited to 'svx')
-rw-r--r--svx/source/xml/xmleohlp.cxx2
-rw-r--r--svx/source/xml/xmlgrhlp.cxx72
-rw-r--r--svx/source/xml/xmlxtimp.cxx3
3 files changed, 38 insertions, 39 deletions
diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx
index 71447f942c61..7b47ddb74e89 100644
--- a/svx/source/xml/xmleohlp.cxx
+++ b/svx/source/xml/xmleohlp.cxx
@@ -381,7 +381,7 @@ sal_Bool SvXMLEmbeddedObjectHelper::ImplReadObject(
if( !xCntnrStor.is() && !pTemp )
return sal_False;
- String aSrcObjName( rObjName );
+ OUString aSrcObjName( rObjName );
comphelper::EmbeddedObjectContainer& rContainer = mpDocPersist->getEmbeddedObjectContainer();
// Is the object name unique?
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 312091614d81..c3d4034cabc7 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -120,14 +120,14 @@ SvXMLGraphicInputStream::SvXMLGraphicInputStream( const OUString& rGraphicId )
if( aGraphic.GetType() == GRAPHIC_BITMAP )
{
GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter();
- String aFormat;
+ OUString aFormat;
if( aGraphic.IsAnimated() )
- aFormat = String( "gif" );
+ aFormat = "gif";
else
- aFormat = String( "png" );
+ aFormat = "png";
- bRet = ( rFilter.ExportGraphic( aGraphic, String(), *pStm, rFilter.GetExportFormatNumberForShortName( aFormat ) ) == 0 );
+ bRet = ( rFilter.ExportGraphic( aGraphic, "", *pStm, rFilter.GetExportFormatNumberForShortName( aFormat ) ) == 0 );
}
else if( aGraphic.GetType() == GRAPHIC_GDIMETAFILE )
{
@@ -283,7 +283,7 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject()
mpOStm->Seek( 0 );
sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW;
sal_uInt16 pDeterminedFormat = GRFILTER_FORMAT_DONTKNOW;
- GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, String(), *mpOStm ,nFormat,&pDeterminedFormat );
+ GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, "", *mpOStm ,nFormat,&pDeterminedFormat );
if (pDeterminedFormat == GRFILTER_FORMAT_DONTKNOW)
{
@@ -326,7 +326,7 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject()
if (nStreamLen_)
{
pDest->Seek(0L);
- GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, String(), *pDest ,nFormat,&pDeterminedFormat );
+ GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, "", *pDest ,nFormat,&pDeterminedFormat );
}
}
delete pDest;
@@ -370,18 +370,18 @@ sal_Bool SvXMLGraphicHelper::ImplGetStreamNames( const OUString& rURLStr,
OUString& rPictureStorageName,
OUString& rPictureStreamName )
{
- String aURLStr( rURLStr );
+ OUString aURLStr( rURLStr );
sal_Bool bRet = sal_False;
- if( aURLStr.Len() )
+ if( !aURLStr.isEmpty() )
{
- aURLStr = aURLStr.GetToken( comphelper::string::getTokenCount(aURLStr, ':') - 1, ':' );
+ aURLStr = aURLStr.getToken( comphelper::string::getTokenCount(aURLStr, ':') - 1, ':' );
const sal_uInt32 nTokenCount = comphelper::string::getTokenCount(aURLStr, '/');
if( 1 == nTokenCount )
{
- rPictureStorageName = String( XML_GRAPHICSTORAGE_NAME );
+ rPictureStorageName = XML_GRAPHICSTORAGE_NAME;
rPictureStreamName = aURLStr;
}
else
@@ -495,7 +495,7 @@ Graphic SvXMLGraphicHelper::ImplReadGraphic( const OUString& rPictureStorageName
if( aStream.xStream.is() )
{
SvStream* pStream = utl::UcbStreamHelper::CreateStream( aStream.xStream );
- GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, String(), *pStream );
+ GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, "", *pStream );
delete pStream;
}
@@ -540,14 +540,14 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageNa
if( aGraphic.GetType() == GRAPHIC_BITMAP )
{
GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter();
- String aFormat;
+ OUString aFormat;
if( aGraphic.IsAnimated() )
- aFormat = String( "gif" );
+ aFormat = "gif";
else
- aFormat = String( "png" );
+ aFormat = "png";
- bRet = ( rFilter.ExportGraphic( aGraphic, String(), *pStream,
+ bRet = ( rFilter.ExportGraphic( aGraphic, "", *pStream,
rFilter.GetExportFormatNumberForShortName( aFormat ) ) == 0 );
}
else if( aGraphic.GetType() == GRAPHIC_GDIMETAFILE )
@@ -621,33 +621,33 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt
RTL_TEXTENCODING_ASCII_US);
}
else
- rURLPair.second = String();
+ rURLPair.second = "";
}
else
{
- const String aGraphicObjectId( aPictureStreamName );
+ const OUString aGraphicObjectId( aPictureStreamName );
const OString aAsciiObjectID(OUStringToOString(aGraphicObjectId, RTL_TEXTENCODING_ASCII_US));
const GraphicObject aGrfObject( aAsciiObjectID );
if( aGrfObject.GetType() != GRAPHIC_NONE )
{
- String aStreamName( aGraphicObjectId );
+ OUString aStreamName( aGraphicObjectId );
Graphic aGraphic( (Graphic&) aGrfObject.GetGraphic() );
const GfxLink aGfxLink( aGraphic.GetLink() );
- String aExtension;
+ OUString aExtension;
bool bUseGfxLink( true );
if( aGfxLink.GetDataSize() )
{
switch( aGfxLink.GetType() )
{
- case( GFX_LINK_TYPE_EPS_BUFFER ): aExtension = String( ".eps" ); break;
- case( GFX_LINK_TYPE_NATIVE_GIF ): aExtension = String( ".gif" ); break;
- case( GFX_LINK_TYPE_NATIVE_JPG ): aExtension = String( ".jpg" ); break;
- case( GFX_LINK_TYPE_NATIVE_PNG ): aExtension = String( ".png" ); break;
- case( GFX_LINK_TYPE_NATIVE_TIF ): aExtension = String( ".tif" ); break;
- case( GFX_LINK_TYPE_NATIVE_WMF ): aExtension = String( ".wmf" ); break;
- case( GFX_LINK_TYPE_NATIVE_MET ): aExtension = String( ".met" ); break;
- case( GFX_LINK_TYPE_NATIVE_PCT ): aExtension = String( ".pct" ); break;
+ case( GFX_LINK_TYPE_EPS_BUFFER ): aExtension = ".eps"; break;
+ case( GFX_LINK_TYPE_NATIVE_GIF ): aExtension = ".gif"; break;
+ case( GFX_LINK_TYPE_NATIVE_JPG ): aExtension = ".jpg"; break;
+ case( GFX_LINK_TYPE_NATIVE_PNG ): aExtension = ".png"; break;
+ case( GFX_LINK_TYPE_NATIVE_TIF ): aExtension = ".tif"; break;
+ case( GFX_LINK_TYPE_NATIVE_WMF ): aExtension = ".wmf"; break;
+ case( GFX_LINK_TYPE_NATIVE_MET ): aExtension = ".met"; break;
+ case( GFX_LINK_TYPE_NATIVE_PCT ): aExtension = ".pct"; break;
case( GFX_LINK_TYPE_NATIVE_SVG ):
// backward-compat kludge: since no released OOo
// version to date can handle svg properly, wrap it up
@@ -657,14 +657,14 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt
if( SvtSaveOptions().GetODFDefaultVersion() <= SvtSaveOptions::ODFVER_012 )
{
bUseGfxLink = false;
- aExtension = String( ".svm" );
+ aExtension = ".svm";
}
else
- aExtension = String( ".svg" );
+ aExtension = ".svg";
break;
default:
- aExtension = String( ".grf" );
+ aExtension = ".grf";
break;
}
}
@@ -673,23 +673,23 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt
if( aGrfObject.GetType() == GRAPHIC_BITMAP )
{
if( aGrfObject.IsAnimated() )
- aExtension = String( ".gif" );
+ aExtension = ".gif";
else
- aExtension = String( ".png" );
+ aExtension = ".png";
}
else if( aGrfObject.GetType() == GRAPHIC_GDIMETAFILE )
{
// SJ: first check if this metafile is just a eps file, then we will store the eps instead of svm
GDIMetaFile& rMtf( (GDIMetaFile&)aGraphic.GetGDIMetaFile() );
if ( ImplCheckForEPS( rMtf ) )
- aExtension = String( ".eps" );
+ aExtension = ".eps";
else
- aExtension = String( ".svm" );
+ aExtension = ".svm";
}
}
OUString aURLEntry;
- const String sPictures( "Pictures/" );
+ const OUString sPictures( "Pictures/" );
if ( !rRequestedFileName.isEmpty() )
{
@@ -709,7 +709,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt
aStreamName += aExtension;
- if( mbDirect && aStreamName.Len() )
+ if( mbDirect && !aStreamName.isEmpty() )
ImplWriteGraphic( aPictureStorageName, aStreamName, aGraphicObjectId, bUseGfxLink );
rURLPair.second = sPictures;
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx
index c5746f32a418..ca821cf6c768 100644
--- a/svx/source/xml/xmlxtimp.cxx
+++ b/svx/source/xml/xmlxtimp.cxx
@@ -359,8 +359,7 @@ static void openStorageStream( xml::sax::InputSource *pParserInput,
uno::Reference < embed::XStorage > xStorage )
{
uno::Reference < io::XStream > xIStm;
- const String aContentStmName( RTL_CONSTASCII_USTRINGPARAM( "Content.xml" ) );
- xIStm.set( xStorage->openStreamElement( aContentStmName, embed::ElementModes::READ ), uno::UNO_QUERY_THROW );
+ xIStm.set( xStorage->openStreamElement( "Content.xml", embed::ElementModes::READ ), uno::UNO_QUERY_THROW );
if( !xIStm.is() )
{
OSL_FAIL( "could not open Content stream" );