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 | |
parent | 2b4aa9198148c1af610df024e3a7cb09752e1819 (diff) |
ByteString->rtl::OString[Buffer]
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/dbase/dindexnode.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/hsqldb/HDriver.cxx | 12 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppControllerDnD.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbfindex.cxx | 18 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 4 | ||||
-rw-r--r-- | idl/source/objects/module.cxx | 6 | ||||
-rw-r--r-- | idl/source/objects/object.cxx | 20 | ||||
-rw-r--r-- | idl/source/prj/command.cxx | 6 | ||||
-rw-r--r-- | idl/source/prj/database.cxx | 13 | ||||
-rw-r--r-- | idl/source/prj/globals.cxx | 2 | ||||
-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 |
14 files changed, 70 insertions, 69 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 8d6c4670a6a6..7200ac2da2eb 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1661,7 +1661,7 @@ Reference<XPropertySet> ODbaseTable::isUniqueByColumnName(sal_Int32 _nColumnPos) return Reference<XPropertySet>(); } //------------------------------------------------------------------ -double toDouble(const ByteString& rString) +static double toDouble(const rtl::OString& rString) { return ::rtl::math::stringToDouble( rString, '.', ',', NULL, NULL ); } @@ -1908,12 +1908,12 @@ sal_Bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,c // one, because const_cast GetFormatPrecision on SvNumberFormat is not constant, // even though it really could and should be - const ByteString aDefaultValue( ::rtl::math::doubleToString( n, rtl_math_StringFormat_F, nScale, '.', NULL, 0)); - const sal_Int32 nValueLen = aDefaultValue.Len(); + const rtl::OString aDefaultValue( ::rtl::math::doubleToString( n, rtl_math_StringFormat_F, nScale, '.', NULL, 0)); + const sal_Int32 nValueLen = aDefaultValue.getLength(); if ( nValueLen <= nLen ) { // Write value right-justified, padded with blanks to the left. - memcpy(pData+nLen-nValueLen,aDefaultValue.GetBuffer(),nValueLen); + memcpy(pData+nLen-nValueLen,aDefaultValue.getStr(),nValueLen); // write the resulting double back *rRow.get()[nPos] = toDouble(aDefaultValue); } diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index 0b67e1d5c66f..c1befc432e45 100644 --- a/connectivity/source/drivers/dbase/dindexnode.cxx +++ b/connectivity/source/drivers/dbase/dindexnode.cxx @@ -911,7 +911,7 @@ void ONDXPage::PrintPage() } else { - OSL_TRACE("SDB: [%d,%s,%d]",rKey.GetRecord(), (const char* )ByteString(rKey.getValue().getString().getStr(), rIndex.m_pTable->getConnection()->getTextEncoding()).GetBuffer(),rNode.GetChild().GetPagePos()); + OSL_TRACE("SDB: [%d,%s,%d]",rKey.GetRecord(), rtl::OUStringToOString(rKey.getValue().getString(), rIndex.m_pTable->getConnection()->getTextEncoding()).getStr(),rNode.GetChild().GetPagePos()); } } OSL_TRACE("SDB: -----------------------------------------------"); diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index bcaa77e3cede..215c0e257b83 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -278,21 +278,21 @@ namespace connectivity ::std::auto_ptr<SvStream> pStream( ::utl::UcbStreamHelper::CreateStream(xStream) ); if ( pStream.get() ) { - ByteString sLine; + rtl::OString sLine; rtl::OString sVersionString; while ( pStream->ReadLine(sLine) ) { - if ( sLine.Len() == 0 ) + if ( sLine.getLength() == 0 ) continue; - const ByteString sIniKey = comphelper::string::getToken(sLine, 0, '='); - const ByteString sValue = comphelper::string::getToken(sLine, 1, '='); - if ( sIniKey.Equals( "hsqldb.compatible_version" ) ) + const rtl::OString sIniKey = comphelper::string::getToken(sLine, 0, '='); + const rtl::OString sValue = comphelper::string::getToken(sLine, 1, '='); + if (sIniKey.equalsL(RTL_CONSTASCII_STRINGPARAM("hsqldb.compatible_version"))) { sVersionString = sValue; } else { - if ( sIniKey.Equals( "version" ) + if (sIniKey.equalsL(RTL_CONSTASCII_STRINGPARAM("version")) && ( sVersionString.isEmpty() ) ) { diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 2d9135d3c8f9..07884331e29b 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -202,7 +202,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec Reference< XHierarchicalNameContainer > xHierarchyName( xNames, UNO_QUERY ); if ( xNames.is() ) { - ByteString sDialogPosition; + rtl::OString sDialogPosition; svtools::QueryDeleteResult_Impl eResult = _bConfirm ? svtools::QUERYDELETE_YES : svtools::QUERYDELETE_ALL; // The list of elements to delete is allowed to contain related elements: A given element may @@ -227,7 +227,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec { svtools::QueryDeleteDlg_Impl aDlg( getView(), *aThisRound ); - if ( sDialogPosition.Len() ) + if ( sDialogPosition.getLength() ) aDlg.SetWindowState( sDialogPosition ); if ( nObjectsLeft > 1 ) diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 3fb9ff5361fd..ffba407621dd 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -52,7 +52,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ucb; using namespace ::svt; -const ByteString aGroupIdent("dBase III"); +const rtl::OString aGroupIdent(RTL_CONSTASCII_STRINGPARAM("dBase III")); ////////////////////////////////////////////////////////////////////////// // Klasse ODbaseIndexDialog @@ -377,19 +377,19 @@ void ODbaseIndexDialog::Init() /////////////////////////////////////////////////////////////////////////// // fill the indexes list - ByteString aNDX; + rtl::OString aNDX; sal_uInt16 nKeyCnt = aInfFile.GetKeyCount(); - ByteString aKeyName; + rtl::OString aKeyName; String aEntry; for( sal_uInt16 nKey = 0; nKey < nKeyCnt; nKey++ ) { // does the key point to an index file ? aKeyName = aInfFile.GetKeyName( nKey ); - aNDX = aKeyName.Copy(0,3); + aNDX = aKeyName.copy(0,3); // yes -> add to the tables index list - if (aNDX == "NDX" ) + if (aNDX.equalsL(RTL_CONSTASCII_STRINGPARAM("NDX"))) { aEntry = rtl::OStringToOUString(aInfFile.ReadKey(aKeyName), osl_getThreadTextEncoding()); rTabInfo.aIndexList.push_back( OTableIndex( aEntry ) ); @@ -488,18 +488,18 @@ void OTableInfo::WriteInfFile( const String& rDSN ) const aInfFile.SetGroup( aGroupIdent ); // Erst einmal alle Tabellenindizes loeschen - ByteString aNDX; + rtl::OString aNDX; sal_uInt16 nKeyCnt = aInfFile.GetKeyCount(); sal_uInt16 nKey = 0; while( nKey < nKeyCnt ) { // Verweist der Key auf ein Indexfile?... - ByteString aKeyName = aInfFile.GetKeyName( nKey ); - aNDX = aKeyName.Copy(0,3); + rtl::OString aKeyName = aInfFile.GetKeyName( nKey ); + aNDX = aKeyName.copy(0,3); //...wenn ja, Indexfile loeschen, nKey steht dann auf nachfolgendem Key - if( aNDX == "NDX" ) + if (aNDX.equalsL(RTL_CONSTASCII_STRINGPARAM("NDX"))) { aInfFile.DeleteKey(aKeyName); nKeyCnt--; diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index d13d5f98a7df..ff46e8159228 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -204,8 +204,8 @@ void OSelectionBrowseBox::initialize() for (size_t i = 0; i < SAL_N_ELEMENTS(eFunctions); ++i) { m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";")); - m_aFunctionStrings += String(ByteString(rContext.getIntlKeywordAscii(eFunctions[i])),RTL_TEXTENCODING_UTF8); - + m_aFunctionStrings += rtl::OStringToOUString(rContext.getIntlKeywordAscii(eFunctions[i]), + RTL_TEXTENCODING_UTF8); } m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";")); m_aFunctionStrings += sGroup; diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx index 75af0cfc25a1..ef141a2135b7 100644 --- a/idl/source/objects/module.cxx +++ b/idl/source/objects/module.cxx @@ -154,9 +154,9 @@ void SvMetaModule::ReadAttributesSvIdl( SvIdlDataBase & rBase, sal_uInt32 nTokPos = rInStm.Tell(); if( !rBase.ReadIdFile( String::CreateFromAscii( aSlotIdFile.GetBuffer() ) ) ) { - ByteString aStr = "cannot read file: "; - aStr += aSlotIdFile; - rBase.SetError( aStr, rInStm.GetToken() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("cannot read file: ")); + aStr.append(aSlotIdFile); + rBase.SetError( aStr.makeStringAndClear(), rInStm.GetToken() ); rBase.WriteError( rInStm ); rInStm.Seek( nTokPos ); diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx index 01dd2d5071c4..30cd08c758f5 100644 --- a/idl/source/objects/object.cxx +++ b/idl/source/objects/object.cxx @@ -341,10 +341,10 @@ sal_Bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInS OSL_FAIL( pS->GetSlotId().GetBuffer() ); OSL_FAIL( rAttr.GetSlotId().GetBuffer() ); - ByteString aStr( "Attribute's " ); - aStr += pS->GetName(); - aStr += " with different id's"; - rBase.SetError( aStr, rInStm.GetToken() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Attribute's ")); + aStr.append(pS->GetName()); + aStr.append(RTL_CONSTASCII_STRINGPARAM(" with different id's")); + rBase.SetError(aStr.makeStringAndClear(), rInStm.GetToken()); rBase.WriteError( rInStm ); return sal_False; } @@ -361,12 +361,12 @@ sal_Bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInS OSL_FAIL( pS->GetSlotId().GetBuffer() ); OSL_FAIL( rAttr.GetSlotId().GetBuffer() ); - ByteString aStr( "Attribute " ); - aStr += pS->GetName(); - aStr += " and Attribute "; - aStr += rAttr.GetName(); - aStr += " with equal id's"; - rBase.SetError( aStr, rInStm.GetToken() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Attribute ")); + aStr.append(pS->GetName()); + aStr.append(RTL_CONSTASCII_STRINGPARAM(" and Attribute ")); + aStr.append(rAttr.GetName()); + aStr.append(RTL_CONSTASCII_STRINGPARAM(" with equal id's")); + rBase.SetError(aStr.makeStringAndClear(), rInStm.GetToken()); rBase.WriteError( rInStm ); return sal_False; } diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx index 0eece073c550..b7943b66f67b 100644 --- a/idl/source/prj/command.cxx +++ b/idl/source/prj/command.cxx @@ -363,13 +363,13 @@ SvCommand::SvCommand( int argc, char ** argv ) delete aList[ i ]; aList.clear(); - ByteString aInc( getenv( "INCLUDE" ) ); + rtl::OString aInc(getenv("INCLUDE")); // append include environment variable - if( aInc.Len() ) + if( aInc.getLength() ) { if( aPath.Len() ) aPath += DirEntry::GetSearchDelimiter(); - aPath += String::CreateFromAscii( aInc.GetBuffer() ); + aPath += String::CreateFromAscii( aInc.getStr() ); } } diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx index e76434e7996c..06d0037511c7 100644 --- a/idl/source/prj/database.cxx +++ b/idl/source/prj/database.cxx @@ -239,12 +239,13 @@ sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName ) if( pTok->Is( SvHash_define() ) ) { pTok = aTokStm.GetToken_Next(); - ByteString aDefName; + rtl::OString aDefName; if( pTok->IsIdentifier() ) aDefName = pTok->GetString(); else { - ByteString aStr( "unexpected token after define" ); + rtl::OString aStr(RTL_CONSTASCII_STRINGPARAM( + "unexpected token after define")); // set error SetError( aStr, pTok ); WriteError( aTokStm ); @@ -300,7 +301,7 @@ sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName ) { if( !InsertId( aDefName, nVal ) ) { - ByteString aStr = "hash table overflow: "; + rtl::OString aStr(RTL_CONSTASCII_STRINGPARAM("hash table overflow: ")); SetError( aStr, pTok ); WriteError( aTokStm ); return sal_False; @@ -616,9 +617,9 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) } if( pTok && pTok->IsIdentifier() ) { - ByteString aN = IDLAPP->pHashTable->GetNearString( pTok->GetString() ); - if( aN.Len() ) - fprintf( stderr, "%s versus %s\n", pTok->GetString().GetBuffer(), aN.GetBuffer() ); + rtl::OString aN = IDLAPP->pHashTable->GetNearString( pTok->GetString() ); + if( aN.getLength() ) + fprintf( stderr, "%s versus %s\n", pTok->GetString().GetBuffer(), aN.getStr() ); } } diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx index 6def78c4ae64..6ed455d1b035 100644 --- a/idl/source/prj/globals.cxx +++ b/idl/source/prj/globals.cxx @@ -76,7 +76,7 @@ IdlDll::~IdlDll() delete pHashTable; } -inline SvStringHashEntry * INS( const ByteString & rName ) +inline SvStringHashEntry * INS( const rtl::OString& rName ) { sal_uInt32 nIdx; IDLAPP->pHashTable->Insert( rName, &nIdx ); 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; } } |