diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-07-17 22:49:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-07-17 22:49:42 +0100 |
commit | 2d16373b60f5f18bf1e42f13eb47bb8de6f6312d (patch) | |
tree | 4b83e2207fad90606e2a80f09c7786b9293f3660 /sfx2 | |
parent | 2b75644c4bf583ec7051175ff60b135700391642 (diff) |
ByteString->rtl::OStringBuffer
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 66 | ||||
-rw-r--r-- | sfx2/source/control/objface.cxx | 51 |
2 files changed, 70 insertions, 47 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 5d480a6e8648..8236967eca41 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -218,9 +218,10 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if ( !pItem ) { #ifdef DBG_UTIL - ByteString aStr( "No creator method for item: "); - aStr += ByteString::CreateFromInt32( nSlotId ); - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "No creator method for item: ")); + aStr.append(static_cast<sal_Int32>(nSlotId)); + OSL_FAIL(aStr.getStr()); #endif return; } @@ -267,9 +268,10 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque // so this should be notified as a warning only if ( nCount != nSubCount ) { - ByteString aStr( "MacroPlayer: wrong number of parameters for slot: "); - aStr += ByteString::CreateFromInt32( nSlotId ); - DBG_WARNING( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "MacroPlayer: wrong number of parameters for slot: ")); + aStr.append(static_cast<sal_Int32>(nSlotId)); + DBG_WARNING(aStr.getStr()); } #endif // complex property; collect sub items from the parameter set and reconstruct complex item @@ -959,9 +961,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta else { // we will not rely on the "toggle" ability of some property slots - ByteString aStr( "Processing property slot without argument: "); - aStr += ByteString::CreateFromInt32( nSlotId ); - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Processing property slot without argument: ")); + aStr.append(static_cast<sal_Int32>(nSlotId)); + OSL_FAIL(aStr.getStr()); } #endif @@ -1249,9 +1252,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta continue; } - ByteString aDbg( "Unknown item detected: "); - aDbg += ByteString::CreateFromInt32( nId ); - DBG_ASSERT( nArg<nFormalArgs, aDbg.GetBuffer() ); + rtl::OStringBuffer aDbg(RTL_CONSTASCII_STRINGPARAM( + "Unknown item detected: ")); + aDbg.append(static_cast<sal_Int32>(nId)); + DBG_ASSERT(nArg<nFormalArgs, aDbg.getStr()); } } } @@ -1279,9 +1283,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = String( String::CreateFromAscii( pSlot->pUnoName ) ) ; if ( !pItem->QueryValue( pValue[nActProp].Value ) ) { - ByteString aStr( "Item not convertable: "); - aStr += ByteString::CreateFromInt32(nSlotId); - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Item not convertable: ")); + aStr.append(static_cast<sal_Int32>(nSlotId)); + OSL_FAIL(aStr.getStr()); } } else @@ -1300,10 +1305,13 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = aName; if ( !pItem->QueryValue( pValue[nActProp++].Value, nSubId ) ) { - ByteString aStr( "Sub item "); - aStr += ByteString::CreateFromInt32( pType->aAttrib[n-1].nAID ); - aStr += " not convertable in slot: "; - aStr += ByteString::CreateFromInt32(nSlotId); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Sub item ")); + aStr.append(static_cast<sal_Int32>( + pType->aAttrib[n-1].nAID)); + aStr.append(RTL_CONSTASCII_STRINGPARAM( + " not convertable in slot: ")); + aStr.append(static_cast<sal_Int32>(nSlotId)); OSL_FAIL( aStr.GetBuffer() ); } } @@ -1328,9 +1336,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = String( String::CreateFromAscii( rArg.pName ) ) ; if ( !pItem->QueryValue( pValue[nActProp++].Value ) ) { - ByteString aStr( "Item not convertable: "); - aStr += ByteString::CreateFromInt32(rArg.nSlotId); - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Item not convertable: ")); + aStr.append(static_cast<sal_Int32>(rArg.nSlotId)); + OSL_FAIL(aStr.getStr()); } } else @@ -1349,11 +1358,14 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = aName; if ( !pItem->QueryValue( pValue[nActProp++].Value, nSubId ) ) { - ByteString aStr( "Sub item "); - aStr += ByteString::CreateFromInt32( rArg.pType->aAttrib[n-1].nAID ); - aStr += " not convertable in slot: "; - aStr += ByteString::CreateFromInt32(rArg.nSlotId); - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Sub item ")); + aStr.append(static_cast<sal_Int32>( + rArg.pType->aAttrib[n-1].nAID)); + aStr.append(RTL_CONSTASCII_STRINGPARAM( + " not convertable in slot: ")); + aStr.append(static_cast<sal_Int32>(rArg.nSlotId)); + OSL_FAIL(aStr.getStr()); } } } diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index 6570a27b956e..245cc5848c03 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -41,6 +41,7 @@ #include "sfx2/sfxresid.hxx" #include <sfx2/minarray.hxx> #include <sfx2/objsh.hxx> +#include <rtl/strbuf.hxx> DBG_NAME(SfxInterface) @@ -237,20 +238,26 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) { if ( pSlave->pLinkedSlot != pMasterSlot ) { - ByteString aStr("Wrong Master/Slave- link: "); - aStr += ByteString::CreateFromInt32(pMasterSlot->GetSlotId()); - aStr += " , "; - aStr += ByteString::CreateFromInt32(pSlave->GetSlotId()); - OSL_FAIL(aStr.GetBuffer()); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Wrong Master/Slave- link: ")); + aStr.append(static_cast<sal_Int32>( + pMasterSlot->GetSlotId())); + aStr.append(RTL_CONSTASCII_STRINGPARAM(" , ")); + aStr.append(static_cast<sal_Int32>( + pSlave->GetSlotId())); + OSL_FAIL(aStr.getStr()); } if ( pSlave->nMasterSlotId != pMasterSlot->GetSlotId() ) { - ByteString aStr("Wrong Master/Slave-Ids: "); - aStr += ByteString::CreateFromInt32(pMasterSlot->GetSlotId()); - aStr += " , "; - aStr += ByteString::CreateFromInt32(pSlave->GetSlotId()); - OSL_FAIL(aStr.GetBuffer()); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Wrong Master/Slave-Ids: ")); + aStr.append(static_cast<sal_Int32>( + pMasterSlot->GetSlotId())); + aStr.append(RTL_CONSTASCII_STRINGPARAM(" , ")); + aStr.append(static_cast<sal_Int32>( + pSlave->GetSlotId())); + OSL_FAIL(aStr.getStr()); } pSlave = pSlave->pNextSlot; @@ -263,11 +270,13 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) { if ( pIter->pLinkedSlot->GetKind() != SFX_KIND_ENUM ) { - ByteString aStr("Slave is no enum: "); - aStr += ByteString::CreateFromInt32(pIter->GetSlotId()); - aStr += " , "; - aStr += ByteString::CreateFromInt32(pIter->pLinkedSlot->GetSlotId()); - OSL_FAIL(aStr.GetBuffer()); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Slave is no enum: ")); + aStr.append(static_cast<sal_Int32>(pIter->GetSlotId())); + aStr.append(RTL_CONSTASCII_STRINGPARAM(" , ")); + aStr.append(static_cast<sal_Int32>( + pIter->pLinkedSlot->GetSlotId())); + OSL_FAIL(aStr.getStr()); } } @@ -277,11 +286,13 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount ) pCurSlot = pCurSlot->pNextSlot; if ( pCurSlot->GetStateFnc() != pIter->GetStateFnc() ) { - ByteString aStr("Linked Slots with different State Methods : "); - aStr += ByteString::CreateFromInt32(pCurSlot->GetSlotId()); - aStr += " , "; - aStr += ByteString::CreateFromInt32(pIter->GetSlotId()); - OSL_FAIL(aStr.GetBuffer()); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Linked Slots with different State Methods : ")); + aStr.append(static_cast<sal_Int32>( + pCurSlot->GetSlotId())); + aStr.append(RTL_CONSTASCII_STRINGPARAM(" , ")); + aStr.append(static_cast<sal_Int32>(pIter->GetSlotId())); + OSL_FAIL(aStr.getStr()); } } while ( pCurSlot != pIter ); |