Kaydet (Commit) 3c91d336 authored tarafından Chr. Rossmanith's avatar Chr. Rossmanith

RTL_CONSTASCII_(U)STRINGPARAM removed in vcl/generic

Change-Id: I9d1ebdba22dc59f4761b3ff53d6d5df02a3496e0
üst 08def320
...@@ -86,12 +86,12 @@ SalGenericSystem::~SalGenericSystem() ...@@ -86,12 +86,12 @@ SalGenericSystem::~SalGenericSystem()
{ {
} }
int SalGenericSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int SalGenericSystem::ShowNativeMessageBox( const OUString& rTitle, const OUString& rMessage,
int nButtonCombination, int nDefaultButton, int nButtonCombination, int nDefaultButton,
bool bUseResources ) bool bUseResources )
{ {
int nDefButton = 0; int nDefButton = 0;
std::list< rtl::OUString > aButtons; std::list< OUString > aButtons;
int nButtonIds[5], nBut = 0; int nButtonIds[5], nBut = 0;
ImplHideSplash(); ImplHideSplash();
...@@ -157,18 +157,18 @@ const char* SalGenericSystem::getFrameResName() ...@@ -157,18 +157,18 @@ const char* SalGenericSystem::getFrameResName()
* then try RESOURCE_NAME environment variable * then try RESOURCE_NAME environment variable
* then use argv[0] stripped by directories * then use argv[0] stripped by directories
*/ */
static rtl::OStringBuffer aResName; static OStringBuffer aResName;
if( !aResName.getLength() ) if( !aResName.getLength() )
{ {
int nArgs = osl_getCommandArgCount(); int nArgs = osl_getCommandArgCount();
for( int n = 0; n < nArgs-1; n++ ) for( int n = 0; n < nArgs-1; n++ )
{ {
rtl::OUString aArg; OUString aArg;
if( ! osl_getCommandArg( n, &aArg.pData ) && if( ! osl_getCommandArg( n, &aArg.pData ) &&
aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("-name")) && aArg.equalsIgnoreAsciiCase("-name") &&
! osl_getCommandArg( n+1, &aArg.pData ) ) ! osl_getCommandArg( n+1, &aArg.pData ) )
{ {
aResName.append( rtl::OUStringToOString( aArg, osl_getThreadTextEncoding() ) ); aResName.append( OUStringToOString( aArg, osl_getThreadTextEncoding() ) );
break; break;
} }
} }
...@@ -186,26 +186,26 @@ const char* SalGenericSystem::getFrameResName() ...@@ -186,26 +186,26 @@ const char* SalGenericSystem::getFrameResName()
const char* SalGenericSystem::getFrameClassName() const char* SalGenericSystem::getFrameClassName()
{ {
static rtl::OStringBuffer aClassName; static OStringBuffer aClassName;
if( !aClassName.getLength() ) if( !aClassName.getLength() )
{ {
rtl::OUString aIni, aProduct; OUString aIni, aProduct;
rtl::Bootstrap::get( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BRAND_BASE_DIR" ) ), aIni ); rtl::Bootstrap::get( "BRAND_BASE_DIR", aIni );
aIni += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/program/" SAL_CONFIGFILE( "bootstrap" ) ) ); aIni += OUString("/program/") + SAL_CONFIGFILE( "bootstrap" );
rtl::Bootstrap aBootstrap( aIni ); rtl::Bootstrap aBootstrap( aIni );
aBootstrap.getFrom( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ProductKey" ) ), aProduct ); aBootstrap.getFrom( "ProductKey", aProduct );
if( !aProduct.isEmpty() ) if( !aProduct.isEmpty() )
aClassName.append( rtl::OUStringToOString( aProduct, osl_getThreadTextEncoding() ) ); aClassName.append( OUStringToOString( aProduct, osl_getThreadTextEncoding() ) );
else else
aClassName.append( "VCLSalFrame" ); aClassName.append( "VCLSalFrame" );
} }
return aClassName.getStr(); return aClassName.getStr();
} }
rtl::OString SalGenericSystem::getFrameResName( SalExtStyle nStyle ) OString SalGenericSystem::getFrameResName( SalExtStyle nStyle )
{ {
rtl::OStringBuffer aBuf( 64 ); OStringBuffer aBuf( 64 );
aBuf.append( getFrameResName() ); aBuf.append( getFrameResName() );
if( (nStyle & SAL_FRAME_EXT_STYLE_DOCUMENT) ) if( (nStyle & SAL_FRAME_EXT_STYLE_DOCUMENT) )
aBuf.append( ".DocumentWindow" ); aBuf.append( ".DocumentWindow" );
......
...@@ -109,7 +109,7 @@ void FontCache::flush() ...@@ -109,7 +109,7 @@ void FontCache::flush()
} }
aStream.SetLineDelimiter( LINEEND_LF ); aStream.SetLineDelimiter( LINEEND_LF );
aStream.WriteLine(rtl::OString(RTL_CONSTASCII_STRINGPARAM(CACHE_MAGIC))); aStream.WriteLine( CACHE_MAGIC );
PrintFontManager& rManager( PrintFontManager::get() ); PrintFontManager& rManager( PrintFontManager::get() );
MultiAtomProvider* pAtoms = rManager.m_pAtoms; MultiAtomProvider* pAtoms = rManager.m_pAtoms;
...@@ -119,13 +119,12 @@ void FontCache::flush() ...@@ -119,13 +119,12 @@ void FontCache::flush()
const FontDirMap& rDir( dir_it->second.m_aEntries ); const FontDirMap& rDir( dir_it->second.m_aEntries );
rtl::OString aDirectory(rManager.getDirectory(dir_it->first)); rtl::OString aDirectory(rManager.getDirectory(dir_it->first));
rtl::OStringBuffer aLine( rtl::OStringBuffer aLine("FontCacheDirectory:");
RTL_CONSTASCII_STRINGPARAM("FontCacheDirectory:"));
aLine.append(dir_it->second.m_nTimestamp); aLine.append(dir_it->second.m_nTimestamp);
aLine.append(':'); aLine.append(':');
aLine.append(aDirectory); aLine.append(aDirectory);
if( rDir.empty() && dir_it->second.m_bNoFiles ) if( rDir.empty() && dir_it->second.m_bNoFiles )
aLine.insert(0, RTL_CONSTASCII_STRINGPARAM("Empty")); aLine.insert(0, "Empty");
aStream.WriteLine(aLine.makeStringAndClear()); aStream.WriteLine(aLine.makeStringAndClear());
for( FontDirMap::const_iterator entry_it = rDir.begin(); entry_it != rDir.end(); ++entry_it ) for( FontDirMap::const_iterator entry_it = rDir.begin(); entry_it != rDir.end(); ++entry_it )
...@@ -135,7 +134,7 @@ void FontCache::flush() ...@@ -135,7 +134,7 @@ void FontCache::flush()
if( rEntry.begin() == rEntry.end() ) if( rEntry.begin() == rEntry.end() )
continue; continue;
aLine.append(RTL_CONSTASCII_STRINGPARAM("File:")); aLine.append("File:");
aLine.append(entry_it->first); aLine.append(entry_it->first);
aStream.WriteLine(aLine.makeStringAndClear()); aStream.WriteLine(aLine.makeStringAndClear());
...@@ -254,7 +253,7 @@ void FontCache::read() ...@@ -254,7 +253,7 @@ void FontCache::read()
OString aLine; OString aLine;
aStream.ReadLine( aLine ); aStream.ReadLine( aLine );
if (!aLine.equalsL(RTL_CONSTASCII_STRINGPARAM(CACHE_MAGIC))) if ( !(aLine == CACHE_MAGIC) )
{ {
#if OSL_DEBUG_LEVEL >1 #if OSL_DEBUG_LEVEL >1
fprintf( stderr, "FontCache::read: cache file %s fails magic test\n", rtl::OUStringToOString(m_aCacheFile, osl_getThreadTextEncoding()).getStr() ); fprintf( stderr, "FontCache::read: cache file %s fails magic test\n", rtl::OUStringToOString(m_aCacheFile, osl_getThreadTextEncoding()).getStr() );
...@@ -268,10 +267,10 @@ void FontCache::read() ...@@ -268,10 +267,10 @@ void FontCache::read()
do do
{ {
aStream.ReadLine( aLine ); aStream.ReadLine( aLine );
if( aLine.compareTo( RTL_CONSTASCII_STRINGPARAM( "FontCacheDirectory:" ) ) == 0 || if( aLine.compareTo( "FontCacheDirectory:" ) == 0 ||
aLine.compareTo( RTL_CONSTASCII_STRINGPARAM( "EmptyFontCacheDirectory:" ) ) == 0 ) aLine.compareTo( "EmptyFontCacheDirectory:" ) == 0 )
{ {
bool bEmpty = (aLine.compareTo( RTL_CONSTASCII_STRINGPARAM ("Empty" ) ) == 0); bool bEmpty = (aLine.compareTo( "Empty" ) == 0);
sal_Int32 nSearchIndex = bEmpty ? 24 : 19; sal_Int32 nSearchIndex = bEmpty ? 24 : 19;
OString aDir; OString aDir;
...@@ -313,7 +312,7 @@ void FontCache::read() ...@@ -313,7 +312,7 @@ void FontCache::read()
m_aCache[ nDir ].m_bUserOverrideOnly = bKeepOnlyUserOverridden; m_aCache[ nDir ].m_bUserOverrideOnly = bKeepOnlyUserOverridden;
} }
} }
else if( pDir && aLine.compareTo( RTL_CONSTASCII_STRINGPARAM( "File:" ) ) == 0 ) else if( pDir && aLine.compareTo( "File:" ) == 0 )
{ {
OString aFile( aLine.copy( 5 ) ); OString aFile( aLine.copy( 5 ) );
aStream.ReadLine( aLine ); aStream.ReadLine( aLine );
......
...@@ -124,34 +124,34 @@ inline sal_uInt32 getUInt32BE( const sal_uInt8*& pBuffer ) ...@@ -124,34 +124,34 @@ inline sal_uInt32 getUInt32BE( const sal_uInt8*& pBuffer )
static FontWeight parseWeight( const rtl::OString& rWeight ) static FontWeight parseWeight( const rtl::OString& rWeight )
{ {
FontWeight eWeight = WEIGHT_DONTKNOW; FontWeight eWeight = WEIGHT_DONTKNOW;
if (rWeight.indexOfL(RTL_CONSTASCII_STRINGPARAM("bold") ) != -1) if (rWeight.indexOf("bold") != -1)
{ {
if (rWeight.indexOfL(RTL_CONSTASCII_STRINGPARAM("emi")) != -1) // semi, demi if (rWeight.indexOf("emi") != -1) // semi, demi
eWeight = WEIGHT_SEMIBOLD; eWeight = WEIGHT_SEMIBOLD;
else if (rWeight.indexOfL(RTL_CONSTASCII_STRINGPARAM("ultra")) != -1) else if (rWeight.indexOf("ultra") != -1)
eWeight = WEIGHT_ULTRABOLD; eWeight = WEIGHT_ULTRABOLD;
else else
eWeight = WEIGHT_BOLD; eWeight = WEIGHT_BOLD;
} }
else if (rWeight.indexOfL(RTL_CONSTASCII_STRINGPARAM("heavy")) != -1) else if (rWeight.indexOf("heavy") != -1)
eWeight = WEIGHT_BOLD; eWeight = WEIGHT_BOLD;
else if (rWeight.indexOfL(RTL_CONSTASCII_STRINGPARAM("light")) != -1) else if (rWeight.indexOf("light") != -1)
{ {
if (rWeight.indexOfL(RTL_CONSTASCII_STRINGPARAM("emi")) != -1) // semi, demi if (rWeight.indexOf("emi") != -1) // semi, demi
eWeight = WEIGHT_SEMILIGHT; eWeight = WEIGHT_SEMILIGHT;
else if (rWeight.indexOfL(RTL_CONSTASCII_STRINGPARAM("ultra")) != -1) else if (rWeight.indexOf("ultra") != -1)
eWeight = WEIGHT_ULTRALIGHT; eWeight = WEIGHT_ULTRALIGHT;
else else
eWeight = WEIGHT_LIGHT; eWeight = WEIGHT_LIGHT;
} }
else if (rWeight.indexOfL(RTL_CONSTASCII_STRINGPARAM("black")) != -1) else if (rWeight.indexOf("black") != -1)
eWeight = WEIGHT_BLACK; eWeight = WEIGHT_BLACK;
else if (rWeight.equalsL(RTL_CONSTASCII_STRINGPARAM("demi"))) else if (rWeight == "demi")
eWeight = WEIGHT_SEMIBOLD; eWeight = WEIGHT_SEMIBOLD;
else if (rWeight.equalsL(RTL_CONSTASCII_STRINGPARAM("book")) || else if ((rWeight == "book") ||
rWeight.equalsL(RTL_CONSTASCII_STRINGPARAM("semicondensed"))) (rWeight == "semicondensed"))
eWeight = WEIGHT_LIGHT; eWeight = WEIGHT_LIGHT;
else if (rWeight.equalsL(RTL_CONSTASCII_STRINGPARAM("medium")) || rWeight.equalsL(RTL_CONSTASCII_STRINGPARAM("roman"))) else if ((rWeight == "medium") || (rWeight == "roman"))
eWeight = WEIGHT_MEDIUM; eWeight = WEIGHT_MEDIUM;
else else
eWeight = WEIGHT_NORMAL; eWeight = WEIGHT_NORMAL;
...@@ -544,14 +544,10 @@ static bool familyNameOverride( const OUString& i_rPSname, OUString& o_rFamilyNa ...@@ -544,14 +544,10 @@ static bool familyNameOverride( const OUString& i_rPSname, OUString& o_rFamilyNa
static boost::unordered_map< OUString, OUString, OUStringHash > aPSNameToFamily( 16 ); static boost::unordered_map< OUString, OUString, OUStringHash > aPSNameToFamily( 16 );
if( aPSNameToFamily.empty() ) // initialization if( aPSNameToFamily.empty() ) // initialization
{ {
aPSNameToFamily[ OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica-Narrow" ) ) ] = aPSNameToFamily[ "Helvetica-Narrow" ] = "Helvetica Narrow";
OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica Narrow" ) ); aPSNameToFamily[ "Helvetica-Narrow-Bold" ] = "Helvetica Narrow";
aPSNameToFamily[ OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica-Narrow-Bold" ) ) ] = aPSNameToFamily[ "Helvetica-Narrow-BoldOblique" ] = "Helvetica Narrow";
OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica Narrow" ) ); aPSNameToFamily[ "Helvetica-Narrow-Oblique" ] = "Helvetica Narrow";
aPSNameToFamily[ OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica-Narrow-BoldOblique" ) ) ] =
OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica Narrow" ) );
aPSNameToFamily[ OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica-Narrow-Oblique" ) ) ] =
OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica Narrow" ) );
} }
boost::unordered_map<OUString,OUString,OUStringHash>::const_iterator it = boost::unordered_map<OUString,OUString,OUStringHash>::const_iterator it =
aPSNameToFamily.find( i_rPSname ); aPSNameToFamily.find( i_rPSname );
...@@ -1110,15 +1106,15 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, :: ...@@ -1110,15 +1106,15 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, ::
if (eFormat == UNKNOWN) if (eFormat == UNKNOWN)
{ {
rtl::OString aExt( rFontFile.copy( rFontFile.lastIndexOf( '.' )+1 ) ); rtl::OString aExt( rFontFile.copy( rFontFile.lastIndexOf( '.' )+1 ) );
if( aExt.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("pfb")) || aExt.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("pfa")) ) if( aExt.equalsIgnoreAsciiCase("pfb") || aExt.equalsIgnoreAsciiCase("pfa") )
eFormat = TYPE1; eFormat = TYPE1;
else if( aExt.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("afm"))) else if( aExt.equalsIgnoreAsciiCase("afm"))
eFormat = AFM; eFormat = AFM;
else if( aExt.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("ttf")) else if( aExt.equalsIgnoreAsciiCase("ttf")
|| aExt.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("ttc")) || aExt.equalsIgnoreAsciiCase("ttc")
|| aExt.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("tte")) ) // #i33947# for Gaiji support || aExt.equalsIgnoreAsciiCase("tte") ) // #i33947# for Gaiji support
eFormat = TRUETYPE; eFormat = TRUETYPE;
else if( aExt.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("otf")) ) // check for TTF- and PS-OpenType too else if( aExt.equalsIgnoreAsciiCase("otf") ) // check for TTF- and PS-OpenType too
eFormat = CFF; eFormat = CFF;
} }
...@@ -1134,17 +1130,17 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, :: ...@@ -1134,17 +1130,17 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, ::
rFontFile.copy(0, rFontFile.getLength() - 4)). rFontFile.copy(0, rFontFile.getLength() - 4)).
append(pSuffix[i]).makeStringAndClear(); append(pSuffix[i]).makeStringAndClear();
rtl::OStringBuffer aFilePath(aDir); OStringBuffer aFilePath(aDir);
aFilePath.append('/').append(aName); aFilePath.append('/').append(aName);
rtl::OString aAfmFile; OString aAfmFile;
if( access( aFilePath.makeStringAndClear().getStr(), R_OK ) ) if( access( aFilePath.makeStringAndClear().getStr(), R_OK ) )
{ {
// try in subdirectory afm instead // try in subdirectory afm instead
aFilePath.append(aDir).append(RTL_CONSTASCII_STRINGPARAM("/afm/")).append(aName); aFilePath.append(aDir).append("/afm/").append(aName);
if (!access(aFilePath.getStr(), R_OK)) if (!access(aFilePath.getStr(), R_OK))
aAfmFile = rtl::OString(RTL_CONSTASCII_STRINGPARAM("afm/")) + aName; aAfmFile = OString("afm/") + aName;
} }
else else
aAfmFile = aName; aAfmFile = aName;
...@@ -1407,7 +1403,7 @@ namespace ...@@ -1407,7 +1403,7 @@ namespace
if ( rName == "Berling Antiqua" ) if ( rName == "Berling Antiqua" )
{ {
::std::set< OUString >::iterator aEnd = rSet.end(); ::std::set< OUString >::iterator aEnd = rSet.end();
::std::set< OUString >::iterator aI = rSet.find(OUString(RTL_CONSTASCII_USTRINGPARAM("Times New Roman"))); ::std::set< OUString >::iterator aI = rSet.find("Times New Roman");
if (aI != aEnd) if (aI != aEnd)
{ {
bRet = true; bRet = true;
...@@ -2891,7 +2887,7 @@ bool PrintFontManager::readOverrideMetrics() ...@@ -2891,7 +2887,7 @@ bool PrintFontManager::readOverrideMetrics()
if( !xFact.is() ) if( !xFact.is() )
return false; return false;
css::uno::Reference< XMaterialHolder > xMat( css::uno::Reference< XMaterialHolder > xMat(
xFact->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.psprint.CompatMetricOverride" ) ) ), xFact->createInstance( "com.sun.star.psprint.CompatMetricOverride" ),
UNO_QUERY ); UNO_QUERY );
if( !xMat.is() ) if( !xMat.is() )
return false; return false;
......
...@@ -52,11 +52,11 @@ OUString getOfficePath( enum whichOfficePath ePath ) ...@@ -52,11 +52,11 @@ OUString getOfficePath( enum whichOfficePath ePath )
{ {
bOnce = true; bOnce = true;
OUString aIni; OUString aIni;
Bootstrap::get( OUString( RTL_CONSTASCII_USTRINGPARAM( "BRAND_BASE_DIR" ) ), aInstallationRootPath ); Bootstrap::get( "BRAND_BASE_DIR", aInstallationRootPath );
aIni = aInstallationRootPath + OUString( RTL_CONSTASCII_USTRINGPARAM( "/program/" SAL_CONFIGFILE( "bootstrap" ) ) ); aIni = aInstallationRootPath + "/program/" + SAL_CONFIGFILE( "bootstrap" );
Bootstrap aBootstrap( aIni ); Bootstrap aBootstrap( aIni );
aBootstrap.getFrom( OUString( RTL_CONSTASCII_USTRINGPARAM( "CustomDataUrl" ) ), aConfigPath ); aBootstrap.getFrom( "CustomDataUrl", aConfigPath );
aBootstrap.getFrom( OUString( RTL_CONSTASCII_USTRINGPARAM( "UserInstallation" ) ), aUserPath ); aBootstrap.getFrom( "UserInstallation", aUserPath );
OUString aUPath = aUserPath; OUString aUPath = aUserPath;
if( ! aConfigPath.compareToAscii( "file://", 7 ) ) if( ! aConfigPath.compareToAscii( "file://", 7 ) )
...@@ -78,7 +78,7 @@ OUString getOfficePath( enum whichOfficePath ePath ) ...@@ -78,7 +78,7 @@ OUString getOfficePath( enum whichOfficePath ePath )
aUserPath = aSysPath; aUserPath = aSysPath;
} }
// ensure user path exists // ensure user path exists
aUPath += OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/psprint" ) ); aUPath += "/user/psprint";
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
oslFileError eErr = oslFileError eErr =
#endif #endif
...@@ -363,7 +363,7 @@ void psp::normPath( OString& rPath ) ...@@ -363,7 +363,7 @@ void psp::normPath( OString& rPath )
if( !aPath.isEmpty() && aPath[aPath.getLength()-1] == '/' ) if( !aPath.isEmpty() && aPath[aPath.getLength()-1] == '/' )
aPath = aPath.copy(0, aPath.getLength()-1); aPath = aPath.copy(0, aPath.getLength()-1);
if( ( aPath.indexOfL(RTL_CONSTASCII_STRINGPARAM("./")) != -1 || if( ( aPath.indexOf("./") != -1 ||
aPath.indexOf( '~' ) != -1 ) aPath.indexOf( '~' ) != -1 )
&& realpath( aPath.getStr(), buf ) ) && realpath( aPath.getStr(), buf ) )
{ {
......
...@@ -1179,7 +1179,7 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize ...@@ -1179,7 +1179,7 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize
char cChar = aLine[1]; char cChar = aLine[1];
if( cChar == '%' ) if( cChar == '%' )
{ {
if( aLine.matchIgnoreAsciiCase( rtl::OString( RTL_CONSTASCII_STRINGPARAM("%%BoundingBox:") ) ) ) if( aLine.matchIgnoreAsciiCase( rtl::OString( "%%BoundingBox:") ) )
{ {
aLine = WhitespaceToSpace( aLine.getToken(1, ':') ); aLine = WhitespaceToSpace( aLine.getToken(1, ':') );
if( !aLine.isEmpty() && aLine.indexOf( "atend" ) == -1 ) if( !aLine.isEmpty() && aLine.indexOf( "atend" ) == -1 )
...@@ -1190,9 +1190,9 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize ...@@ -1190,9 +1190,9 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize
fTop = StringToDouble( GetCommandLineToken( 3, aLine ) ); fTop = StringToDouble( GetCommandLineToken( 3, aLine ) );
} }
} }
else if( aLine.matchIgnoreAsciiCase( rtl::OString( RTL_CONSTASCII_STRINGPARAM("%%Title:") ) ) ) else if( aLine.matchIgnoreAsciiCase( "%%Title:" ) )
aDocTitle = WhitespaceToSpace( aLine.copy( 8 ) ); aDocTitle = WhitespaceToSpace( aLine.copy( 8 ) );
else if( aLine.matchIgnoreAsciiCase( rtl::OString( RTL_CONSTASCII_STRINGPARAM("%%EndComments") ) ) ) else if( aLine.matchIgnoreAsciiCase( "%%EndComments" ) )
bEndComments = true; bEndComments = true;
} }
else if( cChar == ' ' || cChar == '\t' || cChar == '\r' || cChar == '\n' ) else if( cChar == ' ' || cChar == '\t' || cChar == '\r' || cChar == '\n' )
......
...@@ -103,7 +103,7 @@ static void getPaLib() ...@@ -103,7 +103,7 @@ static void getPaLib()
#if defined( UNX ) && !( defined( MACOSX ) || defined( IOS ) || defined( ANDROID ) ) #if defined( UNX ) && !( defined( MACOSX ) || defined( IOS ) || defined( ANDROID ) )
if( ! driverLib ) if( ! driverLib )
{ {
OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( _XSALSET_LIBNAME ) ); OUString aLibName( _XSALSET_LIBNAME );
driverLib = osl_loadModuleRelative( (oslGenericFunction)getPaLib, aLibName.pData, SAL_LOADMODULE_DEFAULT ); driverLib = osl_loadModuleRelative( (oslGenericFunction)getPaLib, aLibName.pData, SAL_LOADMODULE_DEFAULT );
if ( !driverLib ) if ( !driverLib )
{ {
...@@ -162,7 +162,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) ...@@ -162,7 +162,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
pJobSetup->mnPaperBin = 0; pJobSetup->mnPaperBin = 0;
if( rData.m_pParser ) if( rData.m_pParser )
pKey = rData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ); pKey = rData.m_pParser->getKey( OUString("InputSlot") );
if( pKey ) if( pKey )
pValue = rData.m_aContext.getValue( pKey ); pValue = rData.m_aContext.getValue( pKey );
if( pKey && pValue ) if( pKey && pValue )
...@@ -182,7 +182,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) ...@@ -182,7 +182,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
pJobSetup->meDuplexMode = DUPLEX_UNKNOWN; pJobSetup->meDuplexMode = DUPLEX_UNKNOWN;
if( rData.m_pParser ) if( rData.m_pParser )
pKey = rData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "Duplex" ) ) ); pKey = rData.m_pParser->getKey( OUString("Duplex") );
if( pKey ) if( pKey )
pValue = rData.m_aContext.getValue( pKey ); pValue = rData.m_aContext.getValue( pKey );
if( pKey && pValue ) if( pKey && pValue )
...@@ -326,8 +326,8 @@ static bool sendAFax( const OUString& rFaxNumber, const OUString& rFileName, con ...@@ -326,8 +326,8 @@ static bool sendAFax( const OUString& rFaxNumber, const OUString& rFileName, con
{ {
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
OUString aFaxes( rFaxNumber ); OUString aFaxes( rFaxNumber );
OUString aBeginToken( RTL_CONSTASCII_USTRINGPARAM("<Fax#>") ); OUString aBeginToken( "<Fax#>" );
OUString aEndToken( RTL_CONSTASCII_USTRINGPARAM("</Fax#>") ); OUString aEndToken( "</Fax#>" );
while( nIndex != -1 ) while( nIndex != -1 )
{ {
nIndex = aFaxes.indexOf( aBeginToken, nIndex ); nIndex = aFaxes.indexOf( aBeginToken, nIndex );
...@@ -467,7 +467,7 @@ void SalGenericInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) ...@@ -467,7 +467,7 @@ void SalGenericInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
while( nIndex != -1 ) while( nIndex != -1 )
{ {
rtl::OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) ); rtl::OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
if( aToken.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("pdf=") ) ) if( aToken.match( "pdf=" ) )
{ {
pInfo->maLocation = getPdfDir( rInfo ); pInfo->maLocation = getPdfDir( rInfo );
break; break;
...@@ -516,7 +516,7 @@ void PspSalInfoPrinter::InitPaperFormats( const ImplJobSetup* ) ...@@ -516,7 +516,7 @@ void PspSalInfoPrinter::InitPaperFormats( const ImplJobSetup* )
if( m_aJobData.m_pParser ) if( m_aJobData.m_pParser )
{ {
const PPDKey* pKey = m_aJobData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); const PPDKey* pKey = m_aJobData.m_pParser->getKey( OUString("PageSize") );
if( pKey ) if( pKey )
{ {
int nValues = pKey->countValues(); int nValues = pKey->countValues();
...@@ -645,7 +645,7 @@ sal_Bool PspSalInfoPrinter::SetData( ...@@ -645,7 +645,7 @@ sal_Bool PspSalInfoPrinter::SetData(
else else
aPaper = rtl::OStringToOUString(PaperInfo::toPSName(pJobSetup->mePaperFormat), RTL_TEXTENCODING_ISO_8859_1); aPaper = rtl::OStringToOUString(PaperInfo::toPSName(pJobSetup->mePaperFormat), RTL_TEXTENCODING_ISO_8859_1);
pKey = aData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) ); pKey = aData.m_pParser->getKey( OUString("PageSize") );
pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL; pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL;
// some PPD files do not specify the standard paper names (e.g. C5 instead of EnvC5) // some PPD files do not specify the standard paper names (e.g. C5 instead of EnvC5)
...@@ -666,7 +666,7 @@ sal_Bool PspSalInfoPrinter::SetData( ...@@ -666,7 +666,7 @@ sal_Bool PspSalInfoPrinter::SetData(
// merge paperbin if necessary // merge paperbin if necessary
if( nSetDataFlags & SAL_JOBSET_PAPERBIN ) if( nSetDataFlags & SAL_JOBSET_PAPERBIN )
{ {
pKey = aData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ); pKey = aData.m_pParser->getKey( OUString("InputSlot") );
if( pKey ) if( pKey )
{ {
int nPaperBin = pJobSetup->mnPaperBin; int nPaperBin = pJobSetup->mnPaperBin;
...@@ -690,22 +690,22 @@ sal_Bool PspSalInfoPrinter::SetData( ...@@ -690,22 +690,22 @@ sal_Bool PspSalInfoPrinter::SetData(
// merge duplex if necessary // merge duplex if necessary
if( nSetDataFlags & SAL_JOBSET_DUPLEXMODE ) if( nSetDataFlags & SAL_JOBSET_DUPLEXMODE )
{ {
pKey = aData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "Duplex" ) ) ); pKey = aData.m_pParser->getKey( OUString("Duplex") );
if( pKey ) if( pKey )
{ {
pValue = NULL; pValue = NULL;
switch( pJobSetup->meDuplexMode ) switch( pJobSetup->meDuplexMode )
{ {
case DUPLEX_OFF: case DUPLEX_OFF:
pValue = pKey->getValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "None" ) ) ); pValue = pKey->getValue( OUString("None") );
if( pValue == NULL ) if( pValue == NULL )
pValue = pKey->getValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "SimplexNoTumble" ) ) ); pValue = pKey->getValue( OUString("SimplexNoTumble") );
break; break;
case DUPLEX_SHORTEDGE: case DUPLEX_SHORTEDGE:
pValue = pKey->getValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DuplexTumble" ) ) ); pValue = pKey->getValue( OUString("DuplexTumble") );
break; break;
case DUPLEX_LONGEDGE: case DUPLEX_LONGEDGE:
pValue = pKey->getValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DuplexNoTumble" ) ) ); pValue = pKey->getValue( OUString("DuplexNoTumble") );
break; break;
case DUPLEX_UNKNOWN: case DUPLEX_UNKNOWN:
default: default:
...@@ -776,7 +776,7 @@ sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) ...@@ -776,7 +776,7 @@ sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
JobData aData; JobData aData;
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData ); JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL; const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( OUString("InputSlot") ): NULL;
return pKey ? pKey->countValues() : 0; return pKey ? pKey->countValues() : 0;
} }
...@@ -788,7 +788,7 @@ rtl::OUString PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ...@@ -788,7 +788,7 @@ rtl::OUString PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup,
OUString aRet; OUString aRet;
if( aData.m_pParser ) if( aData.m_pParser )
{ {
const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL; const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( OUString("InputSlot") ): NULL;
if( ! pKey || nPaperBin >= (sal_uLong)pKey->countValues() ) if( ! pKey || nPaperBin >= (sal_uLong)pKey->countValues() )
aRet = aData.m_pParser->getDefaultInputSlot(); aRet = aData.m_pParser->getDefaultInputSlot();
else else
...@@ -816,8 +816,8 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal ...@@ -816,8 +816,8 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal
JobData aData; JobData aData;
JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData ); JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ) ) : NULL; const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( OUString("Collate") ) : NULL;
const PPDValue* pVal = pKey ? pKey->getValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "True" ) ) ) : NULL; const PPDValue* pVal = pKey ? pKey->getValue(OUString("True")) : NULL;
// PPDs don't mention the number of possible collated copies. // PPDs don't mention the number of possible collated copies.
// so let's guess as many as we want ? // so let's guess as many as we want ?
...@@ -931,8 +931,8 @@ sal_Bool PspSalPrinter::StartJob( ...@@ -931,8 +931,8 @@ sal_Bool PspSalPrinter::StartJob(
m_aTmpFile = getTmpName(); m_aTmpFile = getTmpName();
nMode = S_IRUSR | S_IWUSR; nMode = S_IRUSR | S_IWUSR;
::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it; ::boost::unordered_map< OUString, OUString, ::rtl::OUStringHash >::const_iterator it;
it = pJobSetup->maValueMap.find( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAX#")) ); it = pJobSetup->maValueMap.find( OUString("FAX#") );
if( it != pJobSetup->maValueMap.end() ) if( it != pJobSetup->maValueMap.end() )
m_aFaxNr = it->second; m_aFaxNr = it->second;
...@@ -952,7 +952,7 @@ sal_Bool PspSalPrinter::StartJob( ...@@ -952,7 +952,7 @@ sal_Bool PspSalPrinter::StartJob(
rtl::OUStringBuffer aFileName( getPdfDir( rInfo ) ); rtl::OUStringBuffer aFileName( getPdfDir( rInfo ) );
aFileName.append( '/' ); aFileName.append( '/' );
aFileName.append( rJobName ); aFileName.append( rJobName );
aFileName.appendAscii( RTL_CONSTASCII_STRINGPARAM( ".pdf" ) ); aFileName.appendAscii( ".pdf" );
m_aFileName = aFileName.makeStringAndClear(); m_aFileName = aFileName.makeStringAndClear();
} }
break; break;
...@@ -1088,7 +1088,7 @@ sal_Bool PspSalPrinter::StartJob( const rtl::OUString* i_pFileName, const rtl::O ...@@ -1088,7 +1088,7 @@ sal_Bool PspSalPrinter::StartJob( const rtl::OUString* i_pFileName, const rtl::O
// possibly create one job for collated output // possibly create one job for collated output
sal_Bool bSinglePrintJobs = sal_False; sal_Bool bSinglePrintJobs = sal_False;
beans::PropertyValue* pSingleValue = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs" ) ) ); beans::PropertyValue* pSingleValue = i_rController.getValue( OUString( "PrintCollateAsSingleJobs" ) );
if( pSingleValue ) if( pSingleValue )
{ {
pSingleValue->Value >>= bSinglePrintJobs; pSingleValue->Value >>= bSinglePrintJobs;
......
...@@ -1283,9 +1283,9 @@ bool GenPspGraphics::filterText( const rtl::OUString& rOrig, rtl::OUString& rNew ...@@ -1283,9 +1283,9 @@ bool GenPspGraphics::filterText( const rtl::OUString& rOrig, rtl::OUString& rNew
if( ! m_bPhoneCollectionActive ) if( ! m_bPhoneCollectionActive )
{ {
rtl::OUStringBuffer aPhoneNr; rtl::OUStringBuffer aPhoneNr;
aPhoneNr.appendAscii( RTL_CONSTASCII_STRINGPARAM( "<Fax#>" ) ); aPhoneNr.append( "<Fax#>" );
aPhoneNr.append( m_aPhoneCollection ); aPhoneNr.append( m_aPhoneCollection );
aPhoneNr.appendAscii( RTL_CONSTASCII_STRINGPARAM( "</Fax#>" ) ); aPhoneNr.append( "</Fax#>" );
*m_pPhoneNr = aPhoneNr.makeStringAndClear(); *m_pPhoneNr = aPhoneNr.makeStringAndClear();
m_aPhoneCollection = rtl::OUString(); m_aPhoneCollection = rtl::OUString();
} }
......
...@@ -1009,9 +1009,9 @@ bool PrinterJob::writeSetup( osl::File* pFile, const JobData& rJob ) ...@@ -1009,9 +1009,9 @@ bool PrinterJob::writeSetup( osl::File* pFile, const JobData& rJob )
if( ! bExternalDialog && rJob.m_nCopies > 1 ) if( ! bExternalDialog && rJob.m_nCopies > 1 )
{ {
// setup code // setup code
rtl::OStringBuffer aLine(RTL_CONSTASCII_STRINGPARAM("/#copies ")); rtl::OStringBuffer aLine("/#copies ");
aLine.append(static_cast<sal_Int32>(rJob.m_nCopies)); aLine.append(static_cast<sal_Int32>(rJob.m_nCopies));
aLine.append(RTL_CONSTASCII_STRINGPARAM(" def\n")); aLine.append(" def\n");
sal_uInt64 nWritten = 0; sal_uInt64 nWritten = 0;
bSuccess = pFile->write(aLine.getStr(), aLine.getLength(), nWritten) bSuccess = pFile->write(aLine.getStr(), aLine.getLength(), nWritten)
|| nWritten != static_cast<sal_uInt64>(aLine.getLength()) ? || nWritten != static_cast<sal_uInt64>(aLine.getLength()) ?
......
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