diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-12-13 23:13:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-12-14 09:52:49 +0000 |
commit | 8cbfe4e211e1aafe6cab64682b3e326153bdfb1e (patch) | |
tree | 43e56395a2ca343807abbe5a0a9d60e3a6539ac2 /vcl/unx | |
parent | 2b4aa9198148c1af610df024e3a7cb09752e1819 (diff) |
ByteString->rtl::OString[Buffer]
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/app/i18n_cb.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/printer/ppdparser.cxx | 24 | ||||
-rw-r--r-- | vcl/unx/generic/printer/printerinfomanager.cxx | 18 |
3 files changed, 22 insertions, 22 deletions
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx index a891ddf3c7d6..b37d0ab16e91 100644 --- a/vcl/unx/generic/app/i18n_cb.cxx +++ b/vcl/unx/generic/app/i18n_cb.cxx @@ -603,7 +603,7 @@ void SwitchIMCallback (XIC, XPointer, XPointer call_data) { XIMSwitchIMNotifyCallbackStruct* pCallData = (XIMSwitchIMNotifyCallbackStruct*)call_data; - ::vcl::I18NStatus::get().changeIM( String( ByteString( pCallData->to->name ), RTL_TEXTENCODING_UTF8 ) ); + ::vcl::I18NStatus::get().changeIM( rtl::OStringToOUString(pCallData->to->name, RTL_TEXTENCODING_UTF8) ); } // ---------------------------------------------------------------------------------- diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 3aec40640d2b..738df2dbdd2d 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -274,7 +274,7 @@ using ::rtl::OUString; using ::rtl::OStringBuffer; using ::rtl::OUStringHash; -#define BSTRING(x) ByteString( x, osl_getThreadTextEncoding() ) +#define BSTRING(x) rtl::OUStringToOString( x, osl_getThreadTextEncoding() ) namespace { @@ -328,15 +328,15 @@ void PPDDecompressStream::Open( const rtl::OUString& i_rFile ) return; } - ByteString aLine; + rtl::OString aLine; mpFileStream->ReadLine( aLine ); mpFileStream->Seek( 0 ); // check for compress'ed or gzip'ed file sal_uLong nCompressMethod = 0; - if( aLine.Len() > 1 && static_cast<unsigned char>(aLine.GetChar( 0 )) == 0x1f ) + if( aLine.getLength() > 1 && static_cast<unsigned char>(aLine[0]) == 0x1f ) { - if( static_cast<unsigned char>(aLine.GetChar( 1 )) == 0x8b ) // check for gzip + if( static_cast<unsigned char>(aLine[1]) == 0x8b ) // check for gzip nCompressMethod = ZCODEC_DEFAULT | ZCODEC_GZ_LIB; } @@ -743,7 +743,7 @@ PPDParser::PPDParser( const String& rFile ) : // now get the Values parse( aLines ); #if OSL_DEBUG_LEVEL > 2 - fprintf( stderr, "acquired %d Keys from PPD %s:\n", m_aKeys.size(), BSTRING( m_aFile ).GetBuffer() ); + fprintf( stderr, "acquired %d Keys from PPD %s:\n", m_aKeys.size(), BSTRING( m_aFile ).getStr() ); for( PPDParser::hash_type::const_iterator it = m_aKeys.begin(); it != m_aKeys.end(); ++it ) { const PPDKey* pKey = it->second; @@ -759,7 +759,7 @@ PPDParser::PPDParser( const String& rFile ) : default: break; }; fprintf( stderr, "\t\"%s\" (%d values) OrderDependency: %d %s\n", - BSTRING( pKey->getKey() ).GetBuffer(), + BSTRING( pKey->getKey() ).getStr(), pKey->countValues(), pKey->m_nOrderDependency, pSetupType ); @@ -780,19 +780,19 @@ PPDParser::PPDParser( const String& rFile ) : default: break; }; fprintf( stderr, "option: \"%s\", value: type %s \"%s\"\n", - BSTRING( pValue->m_aOption ).GetBuffer(), + BSTRING( pValue->m_aOption ).getStr(), pVType, - BSTRING( pValue->m_aValue ).GetBuffer() ); + BSTRING( pValue->m_aValue ).getStr() ); } } fprintf( stderr, "constraints: (%d found)\n", m_aConstraints.size() ); for( std::list< PPDConstraint >::const_iterator cit = m_aConstraints.begin(); cit != m_aConstraints.end(); ++cit ) { fprintf( stderr, "*\"%s\" \"%s\" *\"%s\" \"%s\"\n", - BSTRING( cit->m_pKey1->getKey() ).GetBuffer(), - cit->m_pOption1 ? BSTRING( cit->m_pOption1->m_aOption ).GetBuffer() : "<nil>", - BSTRING( cit->m_pKey2->getKey() ).GetBuffer(), - cit->m_pOption2 ? BSTRING( cit->m_pOption2->m_aOption ).GetBuffer() : "<nil>" + BSTRING( cit->m_pKey1->getKey() ).getStr(), + cit->m_pOption1 ? BSTRING( cit->m_pOption1->m_aOption ).getStr() : "<nil>", + BSTRING( cit->m_pKey2->getKey() ).getStr(), + cit->m_pOption2 ? BSTRING( cit->m_pOption2->m_aOption ).getStr() : "<nil>" ); } #endif diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index d8a7f7993adc..be113e1f5a2a 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -823,9 +823,9 @@ bool PrinterInfoManager::writePrinterConfig() for( ::boost::unordered_map< OUString, OUString, OUStringHash >::const_iterator subst = it->second.m_aInfo.m_aFontSubstitutes.begin(); subst != it->second.m_aInfo.m_aFontSubstitutes.end(); ++subst ) { - ByteString aKey( "SubstFont_" ); - aKey.Append( rtl::OUStringToOString( subst->first, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); - pConfig->WriteKey( aKey, rtl::OUStringToOString( subst->second, RTL_TEXTENCODING_ISO_8859_1 ) ); + rtl::OStringBuffer aKey(RTL_CONSTASCII_STRINGPARAM("SubstFont_")); + aKey.append(rtl::OUStringToOString(subst->first, RTL_TEXTENCODING_ISO_8859_1)); + pConfig->WriteKey( aKey.makeStringAndClear(), rtl::OUStringToOString( subst->second, RTL_TEXTENCODING_ISO_8859_1 ) ); } } } @@ -1324,18 +1324,18 @@ static void lpgetSysQueueTokenHandler( nPos = it->indexOf( aDescrStr, 0 ); if( nPos != -1 ) { - ByteString aComment( WhitespaceToSpace( it->copy(nPos+12) ) ); - if( aComment.Len() > 0 ) - o_rQueues.back().m_aComment = String( aComment, aEncoding ); + rtl::OString aComment( WhitespaceToSpace( it->copy(nPos+12) ) ); + if( aComment.getLength() > 0 ) + o_rQueues.back().m_aComment = rtl::OStringToOUString(aComment, aEncoding); continue; } // look for "location" attribute, inser as location nPos = it->indexOf( aLocStr, 0 ); if( nPos != -1 ) { - ByteString aLoc( WhitespaceToSpace( it->copy(nPos+9) ) ); - if( aLoc.Len() > 0 ) - o_rQueues.back().m_aLocation = String( aLoc, aEncoding ); + rtl::OString aLoc( WhitespaceToSpace( it->copy(nPos+9) ) ); + if( aLoc.getLength() > 0 ) + o_rQueues.back().m_aLocation = rtl::OStringToOUString(aLoc, aEncoding); continue; } } |