diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-12-12 23:24:18 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-12-13 10:11:43 +0000 |
commit | 34cbfad1b27cf28c10974f8170abe00e824f4a9d (patch) | |
tree | 0f8d5356a28edb951e6acb58281c64aca402d27b /vcl/generic | |
parent | 41f59c6cf2e27a38e3cc4465582ba154be65086d (diff) |
replace ByteString(String ctor
Diffstat (limited to 'vcl/generic')
-rw-r--r-- | vcl/generic/fontmanager/fontmanager.cxx | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index c04874100e26..f8a082b75fce 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -1706,7 +1706,7 @@ OString PrintFontManager::getXLFD( PrintFont* pFont ) const OStringBuffer aXLFD( 128 ); aXLFD.append( "-misc-" ); - ByteString aFamily( String( m_pAtoms->getString( ATOM_FAMILYNAME, pFont->m_nFamilyName ) ), RTL_TEXTENCODING_UTF8 ); + ByteString aFamily(rtl::OUStringToOString(m_pAtoms->getString( ATOM_FAMILYNAME, pFont->m_nFamilyName ), RTL_TEXTENCODING_UTF8)); aFamily.SearchAndReplaceAll( '-',' ' ); aFamily.SearchAndReplaceAll( '?',' ' ); aFamily.SearchAndReplaceAll( '*',' ' ); @@ -3209,7 +3209,7 @@ int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bL if( pCallback && pCallback->isCanceled() ) break; - if( ! access( ByteString( String(aTo.PathToFileName()), aEncoding ).GetBuffer(), F_OK ) ) + if (!access( rtl::OUStringToOString(aTo.PathToFileName(), aEncoding).getStr(), F_OK)) { if( ! ( pCallback ? pCallback->queryOverwriteFile( aTo.PathToFileName() ) : false ) ) continue; @@ -3222,19 +3222,19 @@ int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bL { INetURLObject aFromAfm( aFrom ); aFromAfm.setExtension( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "afm" ) ) ); - if( access( ByteString( String(aFromAfm.PathToFileName()), aEncoding ).GetBuffer(), F_OK ) ) + if (access(rtl::OUStringToOString(aFromAfm.PathToFileName(), aEncoding).getStr(), F_OK)) { aFromAfm.setExtension( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AFM" ) ) ); - if( access( ByteString( String(aFromAfm.PathToFileName()), aEncoding ).GetBuffer(), F_OK ) ) + if (access(rtl::OUStringToOString(aFromAfm.PathToFileName(), aEncoding).getStr(), F_OK)) { aFromAfm.removeSegment(); aFromAfm.Append( String( RTL_CONSTASCII_USTRINGPARAM( "afm" ) ) ); aFromAfm.Append( aTo.GetName() ); aFromAfm.setExtension( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "afm" ) ) ); - if( access( ByteString( String(aFromAfm.PathToFileName()), aEncoding ).GetBuffer(), F_OK ) ) + if (access(rtl::OUStringToOString(aFromAfm.PathToFileName(), aEncoding).getStr(), F_OK)) { aFromAfm.setExtension( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AFM" ) ) ); - if( access( ByteString( String(aFromAfm.PathToFileName()), aEncoding ).GetBuffer(), F_OK ) ) + if (access(rtl::OUStringToOString(aFromAfm.PathToFileName(), aEncoding).getStr(), F_OK)) { // give up if( pCallback ) @@ -3249,11 +3249,11 @@ int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bL OUString aFromPath, aToPath; if( bLinkOnly ) { - ByteString aLinkFromPath( String(aFromAfm.PathToFileName()), - aEncoding ); - ByteString aLinkToPath( String(aToAfm.PathToFileName()), - aEncoding ); - nError = (FileBase::RC)symlink( aLinkFromPath.GetBuffer(), aLinkToPath.GetBuffer() ); + rtl::OString aLinkFromPath(rtl::OUStringToOString(aFromAfm.PathToFileName(), + aEncoding)); + rtl::OString aLinkToPath(rtl::OUStringToOString(aToAfm.PathToFileName(), + aEncoding)); + nError = (FileBase::RC)symlink(aLinkFromPath.getStr(), aLinkToPath.getStr()); } else nError = File::copy( aFromAfm.GetMainURL(INetURLObject::DECODE_TO_IURI), aToAfm.GetMainURL(INetURLObject::DECODE_TO_IURI) ); @@ -3267,11 +3267,9 @@ int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bL } if( bLinkOnly ) { - ByteString aFromPath( String(aFrom.PathToFileName()), - aEncoding ); - ByteString aToPath( String(aTo.PathToFileName()), aEncoding ); - nError = (FileBase::RC)symlink( aFromPath.GetBuffer(), - aToPath.GetBuffer() ); + rtl::OString aFromPath(rtl::OUStringToOString(aFrom.PathToFileName(), aEncoding)); + rtl::OString aToPath(rtl::OUStringToOString(aTo.PathToFileName(), aEncoding)); + nError = (FileBase::RC)symlink(aFromPath.getStr(), aToPath.getStr()); } else nError = File::copy( aFrom.GetMainURL(INetURLObject::DECODE_TO_IURI), aTo.GetMainURL(INetURLObject::DECODE_TO_IURI) ); |