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

ByteString -> rtl::OStringBuffer

üst 12870341
...@@ -61,6 +61,8 @@ ...@@ -61,6 +61,8 @@
#include <osl/security.hxx> #include <osl/security.hxx>
#include "doc.hrc" #include "doc.hrc"
#include <rtl/strbuf.hxx>
#include <assert.h> #include <assert.h>
namespace css = ::com::sun::star; namespace css = ::com::sun::star;
...@@ -166,10 +168,11 @@ void SfxObjectFactory::RegisterViewFactory ...@@ -166,10 +168,11 @@ void SfxObjectFactory::RegisterViewFactory
{ {
if ( !pImpl->aViewFactoryArr[i]->GetAPIViewName().Equals( sViewName ) ) if ( !pImpl->aViewFactoryArr[i]->GetAPIViewName().Equals( sViewName ) )
continue; continue;
ByteString sMessage( "SfxObjectFactory::RegisterViewFactory: duplicate view name '" ); rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
sMessage += ByteString( sViewName, RTL_TEXTENCODING_ASCII_US ); "SfxObjectFactory::RegisterViewFactory: duplicate view name '"));
sMessage += "'!"; sMessage.append(rtl::OUStringToOString(sViewName, RTL_TEXTENCODING_ASCII_US));
OSL_FAIL( sMessage.GetBuffer() ); sMessage.append(RTL_CONSTASCII_STRINGPARAM("'!"));
OSL_FAIL(sMessage.getStr());
break; break;
} }
} }
......
...@@ -1082,8 +1082,9 @@ sal_Bool SfxObjectShell::SaveTo_Impl ...@@ -1082,8 +1082,9 @@ sal_Bool SfxObjectShell::SaveTo_Impl
RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "PERFORMANCE SfxObjectShell::SaveTo_Impl" ); RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "PERFORMANCE SfxObjectShell::SaveTo_Impl" );
if( RTL_LOGFILE_HASLOGFILE() ) if( RTL_LOGFILE_HASLOGFILE() )
{ {
ByteString aString( rMedium.GetName(), RTL_TEXTENCODING_ASCII_US ); rtl::OString aString(
RTL_LOGFILE_PRODUCT_CONTEXT_TRACE1( aLog, "saving \"%s\"", aString.GetBuffer() ); rtl::OUStringToOString(rMedium.GetName(), RTL_TEXTENCODING_ASCII_US));
RTL_LOGFILE_PRODUCT_CONTEXT_TRACE1(aLog, "saving \"%s\"", aString.getStr());
} }
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Begin" ) ) ); AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Begin" ) ) );
...@@ -2964,8 +2965,9 @@ sal_Bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium ) ...@@ -2964,8 +2965,9 @@ sal_Bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "PERFORMANCE SfxObjectShell::LoadOwnFormat" ); RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "PERFORMANCE SfxObjectShell::LoadOwnFormat" );
if( RTL_LOGFILE_HASLOGFILE() ) if( RTL_LOGFILE_HASLOGFILE() )
{ {
ByteString aString( rMedium.GetName(), RTL_TEXTENCODING_ASCII_US ); rtl::OString aString(
RTL_LOGFILE_PRODUCT_CONTEXT_TRACE1( aLog, "loading \"%s\"", aString.GetBuffer() ); rtl::OUStringToOString(rMedium.GetName(), RTL_TEXTENCODING_ASCII_US));
RTL_LOGFILE_PRODUCT_CONTEXT_TRACE1(aLog, "loading \"%s\"", aString.getStr());
} }
uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage(); uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
......
...@@ -344,12 +344,12 @@ String SfxOleStringHelper::ImplLoadString16( SvStream& rStrm ) const ...@@ -344,12 +344,12 @@ String SfxOleStringHelper::ImplLoadString16( SvStream& rStrm ) const
void SfxOleStringHelper::ImplSaveString8( SvStream& rStrm, const String& rValue ) const void SfxOleStringHelper::ImplSaveString8( SvStream& rStrm, const String& rValue ) const
{ {
// encode to byte string // encode to byte string
ByteString aEncoded( rValue, GetTextEncoding() ); rtl::OString aEncoded(rtl::OUStringToOString(rValue, GetTextEncoding()));
// write size field (including trailing NUL character) // write size field (including trailing NUL character)
sal_Int32 nSize = static_cast< sal_Int32 >( aEncoded.Len() + 1 ); sal_Int32 nSize = aEncoded.getLength() + 1;
rStrm << nSize; rStrm << nSize;
// write character array with trailing NUL character // write character array with trailing NUL character
rStrm.Write( aEncoded.GetBuffer(), aEncoded.Len() ); rStrm.Write(aEncoded.getStr(), aEncoded.getLength());
rStrm << sal_uInt8( 0 ); rStrm << sal_uInt8( 0 );
} }
......
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
#include <svtools/ehdl.hxx> #include <svtools/ehdl.hxx>
#include <svtools/sfxecode.hxx> #include <svtools/sfxecode.hxx>
#include <rtl/logfile.hxx> #include <rtl/logfile.hxx>
#include <rtl/strbuf.hxx>
#include <framework/configimporter.hxx> #include <framework/configimporter.hxx>
#include <framework/interaction.hxx> #include <framework/interaction.hxx>
#include <framework/titlehelper.hxx> #include <framework/titlehelper.hxx>
...@@ -2999,9 +3000,10 @@ void SfxBaseModel::postEvent_Impl( const ::rtl::OUString& aName, const uno::Refe ...@@ -2999,9 +3000,10 @@ void SfxBaseModel::postEvent_Impl( const ::rtl::OUString& aName, const uno::Refe
if ( pIC ) if ( pIC )
{ {
#ifdef DBG_UTIL #ifdef DBG_UTIL
ByteString aTmp( "SfxDocumentEvent: " ); rtl::OStringBuffer aTmp(RTL_CONSTASCII_STRINGPARAM(
aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 ); "SfxDocumentEvent: "));
OSL_TRACE( aTmp.GetBuffer() ); aTmp.append(rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8));
OSL_TRACE(aTmp.getStr());
#endif #endif
document::DocumentEvent aDocumentEvent( (frame::XModel*)this, aName, xController, uno::Any() ); document::DocumentEvent aDocumentEvent( (frame::XModel*)this, aName, xController, uno::Any() );
...@@ -3016,9 +3018,10 @@ void SfxBaseModel::postEvent_Impl( const ::rtl::OUString& aName, const uno::Refe ...@@ -3016,9 +3018,10 @@ void SfxBaseModel::postEvent_Impl( const ::rtl::OUString& aName, const uno::Refe
if ( pIC ) if ( pIC )
{ {
#ifdef DBG_UTIL #ifdef DBG_UTIL
ByteString aTmp( "SfxEvent: " ); rtl::OStringBuffer aTmp(RTL_CONSTASCII_STRINGPARAM(
aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 ); "SfxEvent: "));
OSL_TRACE( "%s", aTmp.GetBuffer() ); aTmp.append(rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8));
OSL_TRACE(aTmp.getStr());
#endif #endif
document::EventObject aEvent( (frame::XModel*)this, aName ); document::EventObject aEvent( (frame::XModel*)this, aName );
......
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