replace ByteString(String ctor
This commit is contained in:
@@ -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) );
|
||||
|
@@ -1871,12 +1871,12 @@ char* PPDContext::getStreamableBuffer( sal_uLong& rBytes ) const
|
||||
hash_type::const_iterator it;
|
||||
for( it = m_aCurrentValues.begin(); it != m_aCurrentValues.end(); ++it )
|
||||
{
|
||||
ByteString aCopy( it->first->getKey(), RTL_TEXTENCODING_MS_1252 );
|
||||
ByteString aCopy(rtl::OUStringToOString(it->first->getKey(), RTL_TEXTENCODING_MS_1252));
|
||||
rBytes += aCopy.Len();
|
||||
rBytes += 1; // for ':'
|
||||
if( it->second )
|
||||
{
|
||||
aCopy = ByteString( it->second->m_aOption, RTL_TEXTENCODING_MS_1252 );
|
||||
aCopy = rtl::OUStringToOString(it->second->m_aOption, RTL_TEXTENCODING_MS_1252);
|
||||
rBytes += aCopy.Len();
|
||||
}
|
||||
else
|
||||
@@ -1889,13 +1889,13 @@ char* PPDContext::getStreamableBuffer( sal_uLong& rBytes ) const
|
||||
char* pRun = pBuffer;
|
||||
for( it = m_aCurrentValues.begin(); it != m_aCurrentValues.end(); ++it )
|
||||
{
|
||||
ByteString aCopy( it->first->getKey(), RTL_TEXTENCODING_MS_1252 );
|
||||
ByteString aCopy(rtl::OUStringToOString(it->first->getKey(), RTL_TEXTENCODING_MS_1252));
|
||||
int nBytes = aCopy.Len();
|
||||
memcpy( pRun, aCopy.GetBuffer(), nBytes );
|
||||
pRun += nBytes;
|
||||
*pRun++ = ':';
|
||||
if( it->second )
|
||||
aCopy = ByteString( it->second->m_aOption, RTL_TEXTENCODING_MS_1252 );
|
||||
aCopy = rtl::OUStringToOString(it->second->m_aOption, RTL_TEXTENCODING_MS_1252);
|
||||
else
|
||||
aCopy = "*nil";
|
||||
nBytes = aCopy.Len();
|
||||
|
@@ -631,7 +631,7 @@ void PrinterInfoManager::initialize()
|
||||
aPrinter.m_aInfo.m_aComment = it->m_aComment;
|
||||
aPrinter.m_aInfo.m_aLocation = it->m_aLocation;
|
||||
aPrinter.m_bModified = false;
|
||||
aPrinter.m_aGroup = ByteString( aPrinterName, aEncoding ); //provide group name in case user makes this one permanent in padmin
|
||||
aPrinter.m_aGroup = rtl::OUStringToOString(aPrinterName, aEncoding); //provide group name in case user makes this one permanent in padmin
|
||||
|
||||
m_aPrinters[ aPrinterName ] = aPrinter;
|
||||
}
|
||||
@@ -780,11 +780,11 @@ bool PrinterInfoManager::writePrinterConfig()
|
||||
aValue.append(rtl::OUStringToOString(it->first, RTL_TEXTENCODING_UTF8));
|
||||
pConfig->WriteKey("Printer", aValue.makeStringAndClear());
|
||||
pConfig->WriteKey( "DefaultPrinter", it->first == m_aDefaultPrinter ? "1" : "0" );
|
||||
pConfig->WriteKey( "Location", ByteString( String( it->second.m_aInfo.m_aLocation ), RTL_TEXTENCODING_UTF8 ) );
|
||||
pConfig->WriteKey( "Comment", ByteString( String( it->second.m_aInfo.m_aComment ), RTL_TEXTENCODING_UTF8 ) );
|
||||
pConfig->WriteKey( "Command", ByteString( String( it->second.m_aInfo.m_aCommand ), RTL_TEXTENCODING_UTF8 ) );
|
||||
pConfig->WriteKey( "QuickCommand", ByteString( String( it->second.m_aInfo.m_aQuickCommand ), RTL_TEXTENCODING_UTF8 ) );
|
||||
pConfig->WriteKey( "Features", ByteString( String( it->second.m_aInfo.m_aFeatures ), RTL_TEXTENCODING_UTF8 ) );
|
||||
pConfig->WriteKey( "Location", rtl::OUStringToOString(it->second.m_aInfo.m_aLocation, RTL_TEXTENCODING_UTF8) );
|
||||
pConfig->WriteKey( "Comment", rtl::OUStringToOString(it->second.m_aInfo.m_aComment, RTL_TEXTENCODING_UTF8) );
|
||||
pConfig->WriteKey( "Command", rtl::OUStringToOString(it->second.m_aInfo.m_aCommand, RTL_TEXTENCODING_UTF8) );
|
||||
pConfig->WriteKey( "QuickCommand", rtl::OUStringToOString(it->second.m_aInfo.m_aQuickCommand, RTL_TEXTENCODING_UTF8) );
|
||||
pConfig->WriteKey( "Features", rtl::OUStringToOString(it->second.m_aInfo.m_aFeatures, RTL_TEXTENCODING_UTF8) );
|
||||
pConfig->WriteKey("Copies", rtl::OString::valueOf(static_cast<sal_Int32>(it->second.m_aInfo.m_nCopies)));
|
||||
pConfig->WriteKey( "Orientation", it->second.m_aInfo.m_eOrientation == orientation::Landscape ? "Landscape" : "Portrait" );
|
||||
pConfig->WriteKey("PSLevel", rtl::OString::valueOf(static_cast<sal_Int32>(it->second.m_aInfo.m_nPSLevel)));
|
||||
@@ -806,15 +806,15 @@ bool PrinterInfoManager::writePrinterConfig()
|
||||
for( int i = 0; i < it->second.m_aInfo.m_aContext.countValuesModified(); i++ )
|
||||
{
|
||||
const PPDKey* pKey = it->second.m_aInfo.m_aContext.getModifiedKey( i );
|
||||
ByteString aKey( "PPD_" );
|
||||
aKey += ByteString( pKey->getKey(), RTL_TEXTENCODING_ISO_8859_1 );
|
||||
rtl::OStringBuffer aKey(RTL_CONSTASCII_STRINGPARAM("PPD_"));
|
||||
aKey.append(rtl::OUStringToOString(pKey->getKey(), RTL_TEXTENCODING_ISO_8859_1));
|
||||
|
||||
const PPDValue* pValue = it->second.m_aInfo.m_aContext.getValue( pKey );
|
||||
if (pValue)
|
||||
aValue.append(rtl::OUStringToOString(pValue->m_aOption, RTL_TEXTENCODING_ISO_8859_1));
|
||||
else
|
||||
aValue.append(RTL_CONSTASCII_STRINGPARAM("*nil"));
|
||||
pConfig->WriteKey(aKey, aValue.makeStringAndClear());
|
||||
pConfig->WriteKey(aKey.makeStringAndClear(), aValue.makeStringAndClear());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user