Kaydet (Commit) 1a302e71 authored tarafından Caolán McNamara's avatar Caolán McNamara

risk converting ByteString to rtl::OString for OSes I don't have

üst c251139c
...@@ -316,46 +316,46 @@ void InitSalMain() ...@@ -316,46 +316,46 @@ void InitSalMain()
oslFileError err2 = osl_getSystemPathFromFileURL(urlWorkDir.pData, &sysWorkDir); oslFileError err2 = osl_getSystemPathFromFileURL(urlWorkDir.pData, &sysWorkDir);
if (err2 == osl_File_E_None) if (err2 == osl_File_E_None)
{ {
ByteString aPath( getenv( "PATH" ) ); rtl::OString aPath( getenv( "PATH" ) );
ByteString aResPath( getenv( "STAR_RESOURCEPATH" ) ); rtl::OString aResPath( getenv( "STAR_RESOURCEPATH" ) );
ByteString aLibPath( getenv( "DYLD_LIBRARY_PATH" ) ); rtl::OString aLibPath( getenv( "DYLD_LIBRARY_PATH" ) );
ByteString aCmdPath( OUStringToOString(OUString(sysWorkDir), RTL_TEXTENCODING_UTF8).getStr() ); rtl::OString aCmdPath( OUStringToOString(OUString(sysWorkDir), RTL_TEXTENCODING_UTF8).getStr() );
ByteString aTmpPath; rtl::OString aTmpPath;
// Get absolute path of command's directory // Get absolute path of command's directory
if ( aCmdPath.Len() ) { if ( !aCmdPath.isEmpty() ) {
DirEntry aCmdDirEntry( aCmdPath ); DirEntry aCmdDirEntry( aCmdPath );
aCmdDirEntry.ToAbs(); aCmdDirEntry.ToAbs();
aCmdPath = rtl::OUStringToOString( aCmdDirEntry.GetPath().GetFull(), RTL_TEXTENCODING_ASCII_US ); aCmdPath = rtl::OUStringToOString( aCmdDirEntry.GetPath().GetFull(), RTL_TEXTENCODING_ASCII_US );
} }
// Assign to PATH environment variable // Assign to PATH environment variable
if ( aCmdPath.Len() ) if ( !aCmdPath.isEmpty() )
{ {
aTmpPath = ByteString( "PATH=" ); aTmpPath = rtl::OString( "PATH=" );
aTmpPath += aCmdPath; aTmpPath += aCmdPath;
if ( aPath.Len() ) if ( !aPath.isEmpty() )
aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
aTmpPath += aPath; aTmpPath += aPath;
putenv( (char*)aTmpPath.GetBuffer() ); putenv( (char*)aTmpPath.getStr() );
} }
// Assign to STAR_RESOURCEPATH environment variable // Assign to STAR_RESOURCEPATH environment variable
if ( aCmdPath.Len() ) if ( !aCmdPath.isEmpty() )
{ {
aTmpPath = ByteString( "STAR_RESOURCEPATH=" ); aTmpPath = rtl::OString( "STAR_RESOURCEPATH=" );
aTmpPath += aCmdPath; aTmpPath += aCmdPath;
if ( aResPath.Len() ) if ( !aResPath.isEmpty() )
aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
aTmpPath += aResPath; aTmpPath += aResPath;
putenv( (char*)aTmpPath.GetBuffer() ); putenv( (char*)aTmpPath.getStr() );
} }
// Assign to DYLD_LIBRARY_PATH environment variable // Assign to DYLD_LIBRARY_PATH environment variable
if ( aCmdPath.Len() ) if ( !aCmdPath.isEmpty() )
{ {
aTmpPath = ByteString( "DYLD_LIBRARY_PATH=" ); aTmpPath = rtl::OString( "DYLD_LIBRARY_PATH=" );
aTmpPath += aCmdPath; aTmpPath += aCmdPath;
if ( aLibPath.Len() ) if ( !aLibPath.isEmpty() )
aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
aTmpPath += aLibPath; aTmpPath += aLibPath;
putenv( (char*)aTmpPath.GetBuffer() ); putenv( (char*)aTmpPath.getStr() );
} }
} }
} }
......
...@@ -239,9 +239,9 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs ) ...@@ -239,9 +239,9 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs )
ByteCount nDummy; ByteCount nDummy;
ATSUGetAttribute( mrATSUStyle, kATSUSizeTag, sizeof(fFontSize), &fFontSize, &nDummy); ATSUGetAttribute( mrATSUStyle, kATSUSizeTag, sizeof(fFontSize), &fFontSize, &nDummy);
String aUniName( &rArgs.mpStr[rArgs.mnMinCharPos], mnCharCount ); String aUniName( &rArgs.mpStr[rArgs.mnMinCharPos], mnCharCount );
ByteString aCName( aUniName, RTL_TEXTENCODING_UTF8 ); rtl::OString aCName(rtl::OUStringToOString(aUniName, RTL_TEXTENCODING_UTF8));
fprintf( stderr, "ATSLayout( \"%s\" %d..%d of %d) with h=%4.1f\n", fprintf( stderr, "ATSLayout( \"%s\" %d..%d of %d) with h=%4.1f\n",
aCName.GetBuffer(),rArgs.mnMinCharPos,rArgs.mnEndCharPos,rArgs.mnLength,Fix2X(fFontSize) ); aCName.getStr(),rArgs.mnMinCharPos,rArgs.mnEndCharPos,rArgs.mnLength,Fix2X(fFontSize) );
#endif #endif
// create the ATSUI layout // create the ATSUI layout
......
...@@ -53,17 +53,16 @@ ...@@ -53,17 +53,16 @@
// and SFNT fonts on Mac usually do not contain an OS/2 table. // and SFNT fonts on Mac usually do not contain an OS/2 table.
static void UpdateAttributesFromPSName( const String& rPSName, ImplDevFontAttributes& rDFA ) static void UpdateAttributesFromPSName( const String& rPSName, ImplDevFontAttributes& rDFA )
{ {
ByteString aPSName( rtl::OUStringToOString( rPSName, RTL_TEXTENCODING_UTF8 ) ); rtl::OString aPSName( rtl::OUStringToOString( rPSName, RTL_TEXTENCODING_UTF8 ).toAsciiLowerCase() );
aPSName.ToLowerAscii();
// TODO: use a multi-string ignore-case matcher once it becomes available // TODO: use a multi-string ignore-case matcher once it becomes available
if( (aPSName.Search("regular") != STRING_NOTFOUND) if( (aPSName.indexOf("regular") != -1)
|| (aPSName.Search("normal") != STRING_NOTFOUND) || (aPSName.indexOf("normal") != -1)
|| (aPSName.Search("roman") != STRING_NOTFOUND) || (aPSName.indexOf("roman") != -1)
|| (aPSName.Search("medium") != STRING_NOTFOUND) || (aPSName.indexOf("medium") != -1)
|| (aPSName.Search("plain") != STRING_NOTFOUND) || (aPSName.indexOf("plain") != -1)
|| (aPSName.Search("standard") != STRING_NOTFOUND) || (aPSName.indexOf("standard") != -1)
|| (aPSName.Search("std") != STRING_NOTFOUND) ) || (aPSName.indexOf("std") != -1) )
{ {
rDFA.meWidthType = WIDTH_NORMAL; rDFA.meWidthType = WIDTH_NORMAL;
rDFA.meWeight = WEIGHT_NORMAL; rDFA.meWeight = WEIGHT_NORMAL;
...@@ -71,108 +70,108 @@ static void UpdateAttributesFromPSName( const String& rPSName, ImplDevFontAttrib ...@@ -71,108 +70,108 @@ static void UpdateAttributesFromPSName( const String& rPSName, ImplDevFontAttrib
} }
// heuristics for font weight // heuristics for font weight
if (aPSName.Search("extrablack") != STRING_NOTFOUND) if (aPSName.indexOf("extrablack") != -1)
rDFA.meWeight = WEIGHT_BLACK; rDFA.meWeight = WEIGHT_BLACK;
else if (aPSName.Search("black") != STRING_NOTFOUND) else if (aPSName.indexOf("black") != -1)
rDFA.meWeight = WEIGHT_BLACK; rDFA.meWeight = WEIGHT_BLACK;
//else if (aPSName.Search("book") != STRING_NOTFOUND) //else if (aPSName.indexOf("book") != -1)
// rDFA.meWeight = WEIGHT_SEMIBOLD; // rDFA.meWeight = WEIGHT_SEMIBOLD;
else if( (aPSName.Search("semibold") != STRING_NOTFOUND) else if( (aPSName.indexOf("semibold") != -1)
|| (aPSName.Search("smbd") != STRING_NOTFOUND)) || (aPSName.indexOf("smbd") != -1))
rDFA.meWeight = WEIGHT_SEMIBOLD; rDFA.meWeight = WEIGHT_SEMIBOLD;
else if (aPSName.Search("ultrabold") != STRING_NOTFOUND) else if (aPSName.indexOf("ultrabold") != -1)
rDFA.meWeight = WEIGHT_ULTRABOLD; rDFA.meWeight = WEIGHT_ULTRABOLD;
else if (aPSName.Search("extrabold") != STRING_NOTFOUND) else if (aPSName.indexOf("extrabold") != -1)
rDFA.meWeight = WEIGHT_BLACK; rDFA.meWeight = WEIGHT_BLACK;
else if( (aPSName.Search("bold") != STRING_NOTFOUND) else if( (aPSName.indexOf("bold") != -1)
|| (aPSName.Search("-bd") != STRING_NOTFOUND)) || (aPSName.indexOf("-bd") != -1))
rDFA.meWeight = WEIGHT_BOLD; rDFA.meWeight = WEIGHT_BOLD;
else if (aPSName.Search("extralight") != STRING_NOTFOUND) else if (aPSName.indexOf("extralight") != -1)
rDFA.meWeight = WEIGHT_ULTRALIGHT; rDFA.meWeight = WEIGHT_ULTRALIGHT;
else if (aPSName.Search("ultralight") != STRING_NOTFOUND) else if (aPSName.indexOf("ultralight") != -1)
rDFA.meWeight = WEIGHT_ULTRALIGHT; rDFA.meWeight = WEIGHT_ULTRALIGHT;
else if (aPSName.Search("light") != STRING_NOTFOUND) else if (aPSName.indexOf("light") != -1)
rDFA.meWeight = WEIGHT_LIGHT; rDFA.meWeight = WEIGHT_LIGHT;
else if (aPSName.Search("thin") != STRING_NOTFOUND) else if (aPSName.indexOf("thin") != -1)
rDFA.meWeight = WEIGHT_THIN; rDFA.meWeight = WEIGHT_THIN;
else if (aPSName.Search("-w3") != STRING_NOTFOUND) else if (aPSName.indexOf("-w3") != -1)
rDFA.meWeight = WEIGHT_LIGHT; rDFA.meWeight = WEIGHT_LIGHT;
else if (aPSName.Search("-w4") != STRING_NOTFOUND) else if (aPSName.indexOf("-w4") != -1)
rDFA.meWeight = WEIGHT_SEMILIGHT; rDFA.meWeight = WEIGHT_SEMILIGHT;
else if (aPSName.Search("-w5") != STRING_NOTFOUND) else if (aPSName.indexOf("-w5") != -1)
rDFA.meWeight = WEIGHT_NORMAL; rDFA.meWeight = WEIGHT_NORMAL;
else if (aPSName.Search("-w6") != STRING_NOTFOUND) else if (aPSName.indexOf("-w6") != -1)
rDFA.meWeight = WEIGHT_SEMIBOLD; rDFA.meWeight = WEIGHT_SEMIBOLD;
else if (aPSName.Search("-w7") != STRING_NOTFOUND) else if (aPSName.indexOf("-w7") != -1)
rDFA.meWeight = WEIGHT_BOLD; rDFA.meWeight = WEIGHT_BOLD;
else if (aPSName.Search("-w8") != STRING_NOTFOUND) else if (aPSName.indexOf("-w8") != -1)
rDFA.meWeight = WEIGHT_ULTRABOLD; rDFA.meWeight = WEIGHT_ULTRABOLD;
else if (aPSName.Search("-w9") != STRING_NOTFOUND) else if (aPSName.indexOf("-w9") != -1)
rDFA.meWeight = WEIGHT_BLACK; rDFA.meWeight = WEIGHT_BLACK;
// heuristics for font slant // heuristics for font slant
if( (aPSName.Search("italic") != STRING_NOTFOUND) if( (aPSName.indexOf("italic") != -1)
|| (aPSName.Search(" ital") != STRING_NOTFOUND) || (aPSName.indexOf(" ital") != -1)
|| (aPSName.Search("cursive") != STRING_NOTFOUND) || (aPSName.indexOf("cursive") != -1)
|| (aPSName.Search("-it") != STRING_NOTFOUND) || (aPSName.indexOf("-it") != -1)
|| (aPSName.Search("lightit") != STRING_NOTFOUND) || (aPSName.indexOf("lightit") != -1)
|| (aPSName.Search("mediumit") != STRING_NOTFOUND) || (aPSName.indexOf("mediumit") != -1)
|| (aPSName.Search("boldit") != STRING_NOTFOUND) || (aPSName.indexOf("boldit") != -1)
|| (aPSName.Search("cnit") != STRING_NOTFOUND) || (aPSName.indexOf("cnit") != -1)
|| (aPSName.Search("bdcn") != STRING_NOTFOUND) || (aPSName.indexOf("bdcn") != -1)
|| (aPSName.Search("bdit") != STRING_NOTFOUND) || (aPSName.indexOf("bdit") != -1)
|| (aPSName.Search("condit") != STRING_NOTFOUND) || (aPSName.indexOf("condit") != -1)
|| (aPSName.Search("bookit") != STRING_NOTFOUND) || (aPSName.indexOf("bookit") != -1)
|| (aPSName.Search("blackit") != STRING_NOTFOUND) ) || (aPSName.indexOf("blackit") != -1) )
rDFA.meItalic = ITALIC_NORMAL; rDFA.meItalic = ITALIC_NORMAL;
if( (aPSName.Search("oblique") != STRING_NOTFOUND) if( (aPSName.indexOf("oblique") != -1)
|| (aPSName.Search("inclined") != STRING_NOTFOUND) || (aPSName.indexOf("inclined") != -1)
|| (aPSName.Search("slanted") != STRING_NOTFOUND) ) || (aPSName.indexOf("slanted") != -1) )
rDFA.meItalic = ITALIC_OBLIQUE; rDFA.meItalic = ITALIC_OBLIQUE;
// heuristics for font width // heuristics for font width
if( (aPSName.Search("condensed") != STRING_NOTFOUND) if( (aPSName.indexOf("condensed") != -1)
|| (aPSName.Search("-cond") != STRING_NOTFOUND) || (aPSName.indexOf("-cond") != -1)
|| (aPSName.Search("boldcond") != STRING_NOTFOUND) || (aPSName.indexOf("boldcond") != -1)
|| (aPSName.Search("boldcn") != STRING_NOTFOUND) || (aPSName.indexOf("boldcn") != -1)
|| (aPSName.Search("cnit") != STRING_NOTFOUND) ) || (aPSName.indexOf("cnit") != -1) )
rDFA.meWidthType = WIDTH_CONDENSED; rDFA.meWidthType = WIDTH_CONDENSED;
else if (aPSName.Search("narrow") != STRING_NOTFOUND) else if (aPSName.indexOf("narrow") != -1)
rDFA.meWidthType = WIDTH_SEMI_CONDENSED; rDFA.meWidthType = WIDTH_SEMI_CONDENSED;
else if (aPSName.Search("expanded") != STRING_NOTFOUND) else if (aPSName.indexOf("expanded") != -1)
rDFA.meWidthType = WIDTH_EXPANDED; rDFA.meWidthType = WIDTH_EXPANDED;
else if (aPSName.Search("wide") != STRING_NOTFOUND) else if (aPSName.indexOf("wide") != -1)
rDFA.meWidthType = WIDTH_EXPANDED; rDFA.meWidthType = WIDTH_EXPANDED;
// heuristics for font pitch // heuristics for font pitch
if( (aPSName.Search("mono") != STRING_NOTFOUND) if( (aPSName.indexOf("mono") != -1)
|| (aPSName.Search("courier") != STRING_NOTFOUND) || (aPSName.indexOf("courier") != -1)
|| (aPSName.Search("monaco") != STRING_NOTFOUND) || (aPSName.indexOf("monaco") != -1)
|| (aPSName.Search("typewriter") != STRING_NOTFOUND) ) || (aPSName.indexOf("typewriter") != -1) )
rDFA.mePitch = PITCH_FIXED; rDFA.mePitch = PITCH_FIXED;
// heuristics for font family type // heuristics for font family type
if( (aPSName.Search("script") != STRING_NOTFOUND) if( (aPSName.indexOf("script") != -1)
|| (aPSName.Search("chancery") != STRING_NOTFOUND) || (aPSName.indexOf("chancery") != -1)
|| (aPSName.Search("zapfino") != STRING_NOTFOUND)) || (aPSName.indexOf("zapfino") != -1))
rDFA.meFamily = FAMILY_SCRIPT; rDFA.meFamily = FAMILY_SCRIPT;
else if( (aPSName.Search("comic") != STRING_NOTFOUND) else if( (aPSName.indexOf("comic") != -1)
|| (aPSName.Search("outline") != STRING_NOTFOUND) || (aPSName.indexOf("outline") != -1)
|| (aPSName.Search("pinpoint") != STRING_NOTFOUND) ) || (aPSName.indexOf("pinpoint") != -1) )
rDFA.meFamily = FAMILY_DECORATIVE; rDFA.meFamily = FAMILY_DECORATIVE;
else if( (aPSName.Search("sans") != STRING_NOTFOUND) else if( (aPSName.indexOf("sans") != -1)
|| (aPSName.Search("arial") != STRING_NOTFOUND) ) || (aPSName.indexOf("arial") != -1) )
rDFA.meFamily = FAMILY_SWISS; rDFA.meFamily = FAMILY_SWISS;
else if( (aPSName.Search("roman") != STRING_NOTFOUND) else if( (aPSName.indexOf("roman") != -1)
|| (aPSName.Search("times") != STRING_NOTFOUND) ) || (aPSName.indexOf("times") != -1) )
rDFA.meFamily = FAMILY_ROMAN; rDFA.meFamily = FAMILY_ROMAN;
// heuristics for codepoint semantic // heuristics for codepoint semantic
if( (aPSName.Search("symbol") != STRING_NOTFOUND) if( (aPSName.indexOf("symbol") != -1)
|| (aPSName.Search("dings") != STRING_NOTFOUND) || (aPSName.indexOf("dings") != -1)
|| (aPSName.Search("dingbats") != STRING_NOTFOUND) || (aPSName.indexOf("dingbats") != -1)
|| (aPSName.Search("ornaments") != STRING_NOTFOUND) || (aPSName.indexOf("ornaments") != -1)
|| (aPSName.Search("embellishments") != STRING_NOTFOUND) ) || (aPSName.indexOf("embellishments") != -1) )
rDFA.mbSymbolFlag = true; rDFA.mbSymbolFlag = true;
// #i100020# special heuristic for names with single-char styles // #i100020# special heuristic for names with single-char styles
......
...@@ -2222,7 +2222,7 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, ...@@ -2222,7 +2222,7 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
if( osl_File_E_None != osl_getSystemPathFromFileURL( rToFile.pData, &aSysPath.pData ) ) if( osl_File_E_None != osl_getSystemPathFromFileURL( rToFile.pData, &aSysPath.pData ) )
return sal_False; return sal_False;
const rtl_TextEncoding aThreadEncoding = osl_getThreadTextEncoding(); const rtl_TextEncoding aThreadEncoding = osl_getThreadTextEncoding();
const ByteString aToFile( rtl::OUStringToOString( aSysPath, aThreadEncoding ) ); const rtl::OString aToFile( rtl::OUStringToOString( aSysPath, aThreadEncoding ) );
// get the raw-bytes from the font to be subset // get the raw-bytes from the font to be subset
ByteVector aBuffer; ByteVector aBuffer;
...@@ -2240,7 +2240,7 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, ...@@ -2240,7 +2240,7 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// NOTE: assuming that all glyphids requested on Aqua are fully translated // NOTE: assuming that all glyphids requested on Aqua are fully translated
// make the subsetter provide the requested subset // make the subsetter provide the requested subset
FILE* pOutFile = fopen( aToFile.GetBuffer(), "wb" ); FILE* pOutFile = fopen( aToFile.getStr(), "wb" );
bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL, bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL,
pGlyphIDs, pEncoding, nGlyphCount, pGlyphWidths ); pGlyphIDs, pEncoding, nGlyphCount, pGlyphWidths );
fclose( pOutFile ); fclose( pOutFile );
...@@ -2338,7 +2338,7 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, ...@@ -2338,7 +2338,7 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
free( pGlyphMetrics ); free( pGlyphMetrics );
// write subset into destination file // write subset into destination file
nRC = ::CreateTTFromTTGlyphs( pSftFont, aToFile.GetBuffer(), aShortIDs, nRC = ::CreateTTFromTTGlyphs( pSftFont, aToFile.getStr(), aShortIDs,
aTempEncs, nGlyphCount, 0, NULL, 0 ); aTempEncs, nGlyphCount, 0, NULL, 0 );
::CloseTTFont(pSftFont); ::CloseTTFont(pSftFont);
return (nRC == SF_OK); return (nRC == SF_OK);
......
...@@ -189,35 +189,36 @@ void InitSalMain() ...@@ -189,35 +189,36 @@ void InitSalMain()
oslFileError err2 = osl_getSystemPathFromFileURL(urlWorkDir.pData, &sysWorkDir); oslFileError err2 = osl_getSystemPathFromFileURL(urlWorkDir.pData, &sysWorkDir);
if (err2 == osl_File_E_None) if (err2 == osl_File_E_None)
{ {
ByteString aPath( getenv( "PATH" ) ); rtl::OString aPath( getenv( "PATH" ) );
ByteString aResPath( getenv( "STAR_RESOURCEPATH" ) ); rtl::OString aResPath( getenv( "STAR_RESOURCEPATH" ) );
ByteString aCmdPath( OUStringToOString(OUString(sysWorkDir), RTL_TEXTENCODING_UTF8).getStr() ); rtl::OString aCmdPath( OUStringToOString(OUString(sysWorkDir), RTL_TEXTENCODING_UTF8).getStr() );
ByteString aTmpPath; rtl::OString aTmpPath;
// Get absolute path of command's directory // Get absolute path of command's directory
if ( aCmdPath.Len() ) { if ( !aCmdPath.isEmpty() )
{
DirEntry aCmdDirEntry( aCmdPath ); DirEntry aCmdDirEntry( aCmdPath );
aCmdDirEntry.ToAbs(); aCmdDirEntry.ToAbs();
aCmdPath = rtl::OUStringToOString( aCmdDirEntry.GetPath().GetFull(), RTL_TEXTENCODING_ASCII_US ); aCmdPath = rtl::OUStringToOString( aCmdDirEntry.GetPath().GetFull(), RTL_TEXTENCODING_ASCII_US );
} }
// Assign to PATH environment variable // Assign to PATH environment variable
if ( aCmdPath.Len() ) if ( !aCmdPath.isEmpty() )
{ {
aTmpPath = ByteString( "PATH=" ); aTmpPath = rtl::OString( "PATH=" );
aTmpPath += aCmdPath; aTmpPath += aCmdPath;
if ( aPath.Len() ) if ( !aPath.isEmpty() )
aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
aTmpPath += aPath; aTmpPath += aPath;
putenv( (char*)aTmpPath.GetBuffer() ); putenv( (char*)aTmpPath.getStr() );
} }
// Assign to STAR_RESOURCEPATH environment variable // Assign to STAR_RESOURCEPATH environment variable
if ( aCmdPath.Len() ) if ( !aCmdPath.isEmpty() )
{ {
aTmpPath = ByteString( "STAR_RESOURCEPATH=" ); aTmpPath = rtl::OString( "STAR_RESOURCEPATH=" );
aTmpPath += aCmdPath; aTmpPath += aCmdPath;
if ( aResPath.Len() ) if ( !aResPath.isEmpty() )
aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); aTmpPath += rtl::OUStringToOString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
aTmpPath += aResPath; aTmpPath += aResPath;
putenv( (char*)aTmpPath.GetBuffer() ); putenv( (char*)aTmpPath.getStr() );
} }
} }
} }
......
...@@ -1940,7 +1940,7 @@ sal_Bool IosSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, ...@@ -1940,7 +1940,7 @@ sal_Bool IosSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
if( osl_File_E_None != osl_getSystemPathFromFileURL( rToFile.pData, &aSysPath.pData ) ) if( osl_File_E_None != osl_getSystemPathFromFileURL( rToFile.pData, &aSysPath.pData ) )
return sal_False; return sal_False;
const rtl_TextEncoding aThreadEncoding = osl_getThreadTextEncoding(); const rtl_TextEncoding aThreadEncoding = osl_getThreadTextEncoding();
const ByteString aToFile( rtl::OUStringToOString( aSysPath, aThreadEncoding ) ); const rtl::OString aToFile( rtl::OUStringToOString( aSysPath, aThreadEncoding ) );
// get the raw-bytes from the font to be subset // get the raw-bytes from the font to be subset
ByteVector aBuffer; ByteVector aBuffer;
...@@ -1958,7 +1958,7 @@ sal_Bool IosSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, ...@@ -1958,7 +1958,7 @@ sal_Bool IosSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
// NOTE: assuming that all glyphids requested on Ios are fully translated // NOTE: assuming that all glyphids requested on Ios are fully translated
// make the subsetter provide the requested subset // make the subsetter provide the requested subset
FILE* pOutFile = fopen( aToFile.GetBuffer(), "wb" ); FILE* pOutFile = fopen( aToFile.getStr(), "wb" );
bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL, bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL,
pGlyphIDs, pEncoding, nGlyphCount, pGlyphWidths ); pGlyphIDs, pEncoding, nGlyphCount, pGlyphWidths );
fclose( pOutFile ); fclose( pOutFile );
...@@ -2056,7 +2056,7 @@ sal_Bool IosSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, ...@@ -2056,7 +2056,7 @@ sal_Bool IosSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
free( pGlyphMetrics ); free( pGlyphMetrics );
// write subset into destination file // write subset into destination file
nRC = ::CreateTTFromTTGlyphs( pSftFont, aToFile.GetBuffer(), aShortIDs, nRC = ::CreateTTFromTTGlyphs( pSftFont, aToFile.getStr(), aShortIDs,
aTempEncs, nGlyphCount, 0, NULL, 0 ); aTempEncs, nGlyphCount, 0, NULL, 0 );
::CloseTTFont(pSftFont); ::CloseTTFont(pSftFont);
return (nRC == SF_OK); return (nRC == SF_OK);
......
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