summaryrefslogtreecommitdiff
path: root/idl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-04-10 22:43:04 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-04-10 23:13:32 +0200
commit5fe96b6dcec8f0ccb7c606fa8e981112e6160e7e (patch)
tree7c19b02613c6c573c5bf577fb3cae94df6df5078 /idl
parent5dba03b200564e2f891fc7e75e948f93ea769c10 (diff)
Drop SvStream::WriteCharPtr
WriteOString is a better replacement Change-Id: Ic431b9aeb98d19fe61cff71360eee555105cc2bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150192 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'idl')
-rw-r--r--idl/source/objects/basobj.cxx4
-rw-r--r--idl/source/objects/object.cxx32
-rw-r--r--idl/source/objects/slot.cxx56
-rw-r--r--idl/source/objects/types.cxx28
-rw-r--r--idl/source/prj/database.cxx8
5 files changed, 64 insertions, 64 deletions
diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx
index 872b42b391ed..6d9ed8d2fe03 100644
--- a/idl/source/objects/basobj.cxx
+++ b/idl/source/objects/basobj.cxx
@@ -27,14 +27,14 @@
void SvMetaObject::WriteTab( SvStream & rOutStm, sal_uInt16 nTab )
{
while( nTab-- )
- rOutStm.WriteCharPtr( " " );
+ rOutStm.WriteOString( " " );
}
void SvMetaObject::WriteStars( SvStream & rOutStm )
{
rOutStm.WriteChar( '/' );
for( int i = 6; i > 0; i-- )
- rOutStm.WriteCharPtr( "**********" );
+ rOutStm.WriteOString( "**********" );
rOutStm.WriteChar( '/' ) << endl;
}
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index ccee5c08f16c..8f207ca5ac04 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -266,19 +266,19 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
{
WriteStars( rOutStm );
// define class
- rOutStm.WriteCharPtr( "#ifdef ShellClass_" ).WriteOString( GetName() ) << endl;
- rOutStm.WriteCharPtr( "#undef ShellClass" ) << endl;
- rOutStm.WriteCharPtr( "#undef ShellClass_" ).WriteOString( GetName() ) << endl;
- rOutStm.WriteCharPtr( "#define ShellClass " ).WriteOString( GetName() ) << endl;
+ rOutStm.WriteOString( "#ifdef ShellClass_" ).WriteOString( GetName() ) << endl;
+ rOutStm.WriteOString( "#undef ShellClass" ) << endl;
+ rOutStm.WriteOString( "#undef ShellClass_" ).WriteOString( GetName() ) << endl;
+ rOutStm.WriteOString( "#define ShellClass " ).WriteOString( GetName() ) << endl;
// no slotmaps get written for interfaces
if( GetMetaTypeType() != MetaTypeType::Shell )
{
- rOutStm.WriteCharPtr( "#endif" ) << endl << endl;
+ rOutStm.WriteOString( "#endif" ) << endl << endl;
return;
}
// write parameter array
- rOutStm.WriteCharPtr("static SfxFormalArgument a").WriteOString(GetName()).WriteCharPtr("Args_Impl[] =") << endl;
+ rOutStm.WriteOString("static SfxFormalArgument a").WriteOString(GetName()).WriteOString("Args_Impl[] =") << endl;
rOutStm.WriteChar('{') << endl;
std::vector<sal_uInt32> aSuperList;
@@ -301,10 +301,10 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
{
// at least one dummy
WriteTab( rOutStm, 1 );
- rOutStm.WriteCharPtr("{ (const SfxType*) &aSfxVoidItem_Impl, 0, 0 }" ) << endl;
+ rOutStm.WriteOString("{ (const SfxType*) &aSfxVoidItem_Impl, 0, 0 }" ) << endl;
}
rOutStm << endl;
- rOutStm.WriteCharPtr( "};" ) << endl << endl;
+ rOutStm.WriteOString( "};" ) << endl << endl;
std::vector<OString> aStringList;
WriteSlotStubs( GetName(), aSlotList, aStringList, rOutStm );
@@ -313,7 +313,7 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
rOutStm << endl;
// write slotmap
- rOutStm.WriteCharPtr("static SfxSlot a").WriteOString(GetName()).WriteCharPtr("Slots_Impl[] =") << endl;
+ rOutStm.WriteOString("static SfxSlot a").WriteOString(GetName()).WriteOString("Slots_Impl[] =") << endl;
rOutStm.WriteChar( '{' ) << endl;
// write all attributes
@@ -324,15 +324,15 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
{
// at least one dummy
WriteTab( rOutStm, 1 );
- rOutStm.WriteCharPtr( "SFX_SLOT_ARG(" ).WriteOString( GetName() )
- .WriteCharPtr( ", 0, SfxGroupId::NONE, " )
- .WriteCharPtr( "SFX_STUB_PTR_EXEC_NONE," )
- .WriteCharPtr( "SFX_STUB_PTR_STATE_NONE," )
- .WriteCharPtr( "SfxSlotMode::NONE, SfxVoidItem, 0, 0, \"\", SfxSlotMode::NONE )" ) << endl;
+ rOutStm.WriteOString( "SFX_SLOT_ARG(" ).WriteOString( GetName() )
+ .WriteOString( ", 0, SfxGroupId::NONE, " )
+ .WriteOString( "SFX_STUB_PTR_EXEC_NONE," )
+ .WriteOString( "SFX_STUB_PTR_STATE_NONE," )
+ .WriteOString( "SfxSlotMode::NONE, SfxVoidItem, 0, 0, \"\", SfxSlotMode::NONE )" ) << endl;
}
rOutStm << endl;
- rOutStm.WriteCharPtr( "};" ) << endl;
- rOutStm.WriteCharPtr( "#endif" ) << endl << endl;
+ rOutStm.WriteOString( "};" ) << endl;
+ rOutStm.WriteOString( "#endif" ) << endl << endl;
for( size_t i = 0, n = aSlotList.size(); i < n; ++i )
{
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index 7ff190141d6d..6b2d7640c077 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -353,7 +353,7 @@ void SvMetaSlot::WriteSlotStubs( std::string_view rShellName,
if ( !bIn )
{
rList.push_back( aMethodName );
- rOutStm.WriteCharPtr( "SFX_EXEC_STUB(" )
+ rOutStm.WriteOString( "SFX_EXEC_STUB(" )
.WriteOString( rShellName )
.WriteChar( ',' )
.WriteOString( aMethodName )
@@ -378,7 +378,7 @@ void SvMetaSlot::WriteSlotStubs( std::string_view rShellName,
if ( !bIn )
{
rList.push_back( aMethodName );
- rOutStm.WriteCharPtr( "SFX_STATE_STUB(" )
+ rOutStm.WriteOString( "SFX_STATE_STUB(" )
.WriteOString( rShellName )
.WriteChar( ',' )
.WriteOString( aMethodName )
@@ -392,13 +392,13 @@ void SvMetaSlot::WriteSlot( std::string_view rShellName, sal_uInt16 nCount,
size_t nStart,
SvIdlDataBase & rBase, SvStream & rOutStm )
{
- rOutStm.WriteCharPtr( "// Slot Nr. " )
+ rOutStm.WriteOString( "// Slot Nr. " )
.WriteOString( OString::number(nListPos) )
- .WriteCharPtr( " : " );
+ .WriteOString( " : " );
OString aSlotIdValue(OString::number(GetSlotId().GetValue()));
rOutStm.WriteOString( aSlotIdValue ) << endl;
WriteTab( rOutStm, 1 );
- rOutStm.WriteCharPtr( "SFX_NEW_SLOT_ARG( " ).WriteOString( rShellName ).WriteChar( ',' ) ;
+ rOutStm.WriteOString( "SFX_NEW_SLOT_ARG( " ).WriteOString( rShellName ).WriteChar( ',' ) ;
rOutStm.WriteOString( rSlotId ).WriteChar( ',' );
@@ -406,7 +406,7 @@ void SvMetaSlot::WriteSlot( std::string_view rShellName, sal_uInt16 nCount,
if( !GetGroupId().isEmpty() )
rOutStm.WriteOString( GetGroupId() );
else
- rOutStm.WriteCharPtr( "SfxGroupId::NONE" );
+ rOutStm.WriteOString( "SfxGroupId::NONE" );
rOutStm.WriteChar( ',' ) << endl;
WriteTab( rOutStm, 4 );
@@ -444,9 +444,9 @@ void SvMetaSlot::WriteSlot( std::string_view rShellName, sal_uInt16 nCount,
assert(pNextSlot);
- rOutStm.WriteCharPtr( "&a" ).WriteOString( rShellName ).WriteCharPtr( "Slots_Impl[" )
+ rOutStm.WriteOString( "&a" ).WriteOString( rShellName ).WriteOString( "Slots_Impl[" )
.WriteOString( OString::number(pNextSlot->GetListPos()) )
- .WriteCharPtr( "] /*Offset Next*/, " ) << endl;
+ .WriteOString( "] /*Offset Next*/, " ) << endl;
WriteTab( rOutStm, 4 );
@@ -454,22 +454,22 @@ void SvMetaSlot::WriteSlot( std::string_view rShellName, sal_uInt16 nCount,
if( !GetExecMethod().isEmpty() &&
GetExecMethod() != "NoExec")
{
- rOutStm.WriteCharPtr( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' )
+ rOutStm.WriteOString( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' )
.WriteOString( GetExecMethod() ).WriteChar( ')' );
}
else
- rOutStm.WriteCharPtr( "SFX_STUB_PTR_EXEC_NONE" );
+ rOutStm.WriteOString( "SFX_STUB_PTR_EXEC_NONE" );
rOutStm.WriteChar( ',' );
// write StateMethod, with standard name if not specified
if( !GetStateMethod().isEmpty() &&
GetStateMethod() != "NoState")
{
- rOutStm.WriteCharPtr( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' )
+ rOutStm.WriteOString( "SFX_STUB_PTR(" ).WriteOString( rShellName ).WriteChar( ',' )
.WriteOString( GetStateMethod() ).WriteChar( ')' );
}
else
- rOutStm.WriteCharPtr( "SFX_STUB_PTR_STATE_NONE" );
+ rOutStm.WriteOString( "SFX_STUB_PTR_STATE_NONE" );
rOutStm.WriteChar( ',' ) << endl;
WriteTab( rOutStm, 4 );
@@ -501,12 +501,12 @@ void SvMetaSlot::WriteSlot( std::string_view rShellName, sal_uInt16 nCount,
rOutStm.WriteOString( MakeSlotName( SvHash_Container() ) ).WriteChar( '|' );
if ( GetReadOnlyDoc() )
rOutStm.WriteOString( MakeSlotName( SvHash_ReadOnlyDoc() ) ).WriteChar( '|' );
- rOutStm.WriteCharPtr( "SfxSlotMode::NONE" );
+ rOutStm.WriteOString( "SfxSlotMode::NONE" );
rOutStm.WriteChar( ',' ) << endl;
WriteTab( rOutStm, 4 );
if ( GetDisableFlags().isEmpty() )
- rOutStm.WriteCharPtr( "SfxDisableFlags::NONE" );
+ rOutStm.WriteOString( "SfxDisableFlags::NONE" );
else
rOutStm.WriteOString( GetDisableFlags() );
@@ -529,14 +529,14 @@ void SvMetaSlot::WriteSlot( std::string_view rShellName, sal_uInt16 nCount,
rBase.aUsedTypes.push_back( pT );
}
else
- rOutStm.WriteCharPtr( "SfxVoidItem not defined" );
+ rOutStm.WriteOString( "SfxVoidItem not defined" );
{
rOutStm.WriteChar( ',' ) << endl;
WriteTab( rOutStm, 4 );
rOutStm
.WriteOString( OString::number(nCount) )
- .WriteCharPtr( "/*Offset*/, " );
+ .WriteOString( "/*Offset*/, " );
if( IsMethod() )
{
@@ -544,27 +544,27 @@ void SvMetaSlot::WriteSlot( std::string_view rShellName, sal_uInt16 nCount,
size_t nSCount = pType->GetAttrCount();
rOutStm
.WriteOString( OString::number(nSCount) )
- .WriteCharPtr( "/*Count*/," );
+ .WriteOString( "/*Count*/," );
}
else
- rOutStm.WriteCharPtr( "0," );
+ rOutStm.WriteOString( "0," );
- rOutStm.WriteCharPtr( " " );
+ rOutStm.WriteOString( " " );
// Method/Property flags
if( IsMethod() )
- rOutStm.WriteCharPtr( "SfxSlotMode::METHOD|" );
+ rOutStm.WriteOString( "SfxSlotMode::METHOD|" );
- rOutStm.WriteCharPtr( "SfxSlotMode::NONE" );
+ rOutStm.WriteOString( "SfxSlotMode::NONE" );
}
{
- rOutStm.WriteCharPtr( ",\"" );
+ rOutStm.WriteOString( ",\"" );
rOutStm.WriteOString( GetName() );
- rOutStm.WriteCharPtr( "\"" );
+ rOutStm.WriteOString( "\"" );
}
- rOutStm.WriteCharPtr( " )," ) << endl;
+ rOutStm.WriteOString( " )," ) << endl;
}
sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rOutStm ) const
@@ -584,13 +584,13 @@ sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rO
SvMetaAttribute * pPar = rList[n];
SvMetaType * pPType = pPar->GetType();
WriteTab( rOutStm, 1 );
- rOutStm.WriteCharPtr("{ (const SfxType*) &a")
+ rOutStm.WriteOString("{ (const SfxType*) &a")
// item type
- .WriteOString(pPType->GetName()).WriteCharPtr("_Impl, ")
+ .WriteOString(pPType->GetName()).WriteOString("_Impl, ")
// parameter name
- .WriteCharPtr("\"").WriteOString(pPar->GetName()).WriteCharPtr("\", ")
+ .WriteOString("\"").WriteOString(pPar->GetName()).WriteOString("\", ")
// slot id
- .WriteOString(pPar->GetSlotId().getString()).WriteCharPtr(" },") << endl;
+ .WriteOString(pPar->GetSlotId().getString()).WriteOString(" },") << endl;
if( !SvIdlDataBase::FindType( pPType, rBase.aUsedTypes ) )
rBase.aUsedTypes.push_back( pPType );
}
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index 08492b4b6ddb..3af00c22cd0e 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -239,36 +239,36 @@ void SvMetaType::WriteSfxItem(
bReturn = true;
}
- rOutStm.WriteCharPtr( "extern " );
+ rOutStm.WriteOString( "extern " );
if (bExport)
- rOutStm.WriteCharPtr( "SFX2_DLLPUBLIC " );
+ rOutStm.WriteOString( "SFX2_DLLPUBLIC " );
rOutStm.WriteOString( aTypeName )
.WriteOString( aVarName ).WriteChar( ';' ) << endl;
if (bReturn)
return;
// write the implementation part
- rOutStm.WriteCharPtr( "#ifdef SFX_TYPEMAP" ) << endl;
- rOutStm.WriteCharPtr( "#if !defined(_WIN32) && (defined(DISABLE_DYNLOADING) && (defined(ANDROID) || defined(IOS) || defined(EMSCRIPTEN) || defined(LINUX)))" ) << endl;
- rOutStm.WriteCharPtr( "__attribute__((__weak__))" ) << endl;
- rOutStm.WriteCharPtr( "#endif" ) << endl;
+ rOutStm.WriteOString( "#ifdef SFX_TYPEMAP" ) << endl;
+ rOutStm.WriteOString( "#if !defined(_WIN32) && (defined(DISABLE_DYNLOADING) && (defined(ANDROID) || defined(IOS) || defined(EMSCRIPTEN) || defined(LINUX)))" ) << endl;
+ rOutStm.WriteOString( "__attribute__((__weak__))" ) << endl;
+ rOutStm.WriteOString( "#endif" ) << endl;
rOutStm.WriteOString( aTypeName ).WriteOString( aVarName )
- .WriteCharPtr( " = " ) << endl;
+ .WriteOString( " = " ) << endl;
rOutStm.WriteChar( '{' ) << endl;
- rOutStm.WriteCharPtr( "\tcreateSfxPoolItem<" ).WriteOString( rItemName )
- .WriteCharPtr(">, &typeid(").WriteOString( rItemName ).WriteCharPtr( "), " );
+ rOutStm.WriteOString( "\tcreateSfxPoolItem<" ).WriteOString( rItemName )
+ .WriteOString(">, &typeid(").WriteOString( rItemName ).WriteOString( "), " );
rOutStm.WriteOString( aAttrCount );
if( nAttrCount )
{
- rOutStm.WriteCharPtr( ", { " );
+ rOutStm.WriteOString( ", { " );
// write the single attributes
- rOutStm.WriteCharPtr( aAttrArray.getStr() );
- rOutStm.WriteCharPtr( " }" );
+ rOutStm.WriteOString( aAttrArray );
+ rOutStm.WriteOString( " }" );
}
rOutStm << endl;
- rOutStm.WriteCharPtr( "};" ) << endl;
- rOutStm.WriteCharPtr( "#endif" ) << endl << endl;
+ rOutStm.WriteOString( "};" ) << endl;
+ rOutStm.WriteOString( "#endif" ) << endl << endl;
}
void SvMetaType::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 229696b021ec..699d90e0f913 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -519,7 +519,7 @@ struct WriteDep
explicit WriteDep(SvFileStream & rStream) : m_rStream(rStream) { }
void operator() (std::u16string_view rItem)
{
- m_rStream.WriteCharPtr( " \\\n " );
+ m_rStream.WriteOString( " \\\n " );
m_rStream.WriteOString( OUStringToOString(rItem, RTL_TEXTENCODING_UTF8) );
}
};
@@ -533,7 +533,7 @@ struct WriteDummy
void operator() (std::u16string_view rItem)
{
m_rStream.WriteOString( OUStringToOString(rItem, RTL_TEXTENCODING_UTF8) );
- m_rStream.WriteCharPtr( " :\n\n" );
+ m_rStream.WriteOString( " :\n\n" );
}
};
@@ -543,9 +543,9 @@ void SvIdlDataBase::WriteDepFile(
SvFileStream & rStream, std::u16string_view rTarget)
{
rStream.WriteOString( OUStringToOString(rTarget, RTL_TEXTENCODING_UTF8) );
- rStream.WriteCharPtr( " :" );
+ rStream.WriteOString( " :" );
::std::for_each(m_DepFiles.begin(), m_DepFiles.end(), WriteDep(rStream));
- rStream.WriteCharPtr( "\n\n" );
+ rStream.WriteOString( "\n\n" );
::std::for_each(m_DepFiles.begin(), m_DepFiles.end(), WriteDummy(rStream));
}