diff options
22 files changed, 120 insertions, 109 deletions
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx index 97d3156dadf2..f9062ba08f32 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx @@ -354,8 +354,10 @@ OUString WrappedSymbolBitmapURLProperty::getValueFromSeries( const Reference< be && aSymbol.Graphic.is()) { GraphicObject aGrObj( Graphic( aSymbol.Graphic )); - aRet = OUString( RTL_CONSTASCII_USTRINGPARAM( UNO_NAME_GRAPHOBJ_URLPREFIX )); - aRet += OUString::createFromAscii( aGrObj.GetUniqueID().GetBuffer()); + aRet = OUString(RTL_CONSTASCII_USTRINGPARAM( + UNO_NAME_GRAPHOBJ_URLPREFIX)); + aRet += OStringToOUString(aGrObj.GetUniqueID(), + RTL_TEXTENCODING_ASCII_US); } return aRet; } diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 0a94389f2c33..5eaac774713b 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3544,11 +3544,12 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const sLink = *pStrLink; else if( pImpl->pGraphicObject ) { - OUString sPrefix(RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX)); - String sId( pImpl->pGraphicObject->GetUniqueID(), - RTL_TEXTENCODING_ASCII_US ); - sLink = sPrefix; - sLink += OUString(sId); + OUString sPrefix(RTL_CONSTASCII_USTRINGPARAM( + UNO_NAME_GRAPHOBJ_URLPREFIX)); + OUString sId(rtl::OStringToOUString( + pImpl->pGraphicObject->GetUniqueID(), + RTL_TEXTENCODING_ASCII_US)); + sLink = sPrefix + sId; } rVal <<= sLink; } diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index d3915e770d21..a69aadaed881 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -244,7 +244,8 @@ Sequence<beans::PropertyValue> SvxUnoNumberingRules::getNumberingRuleByIndex( sa { const GraphicObject* pGrafObj = pBrush->GetGraphicObject(); OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX)); - aURL += OUString::createFromAscii( pGrafObj->GetUniqueID().GetBuffer() ); + aURL += OStringToOUString(pGrafObj->GetUniqueID(), + RTL_TEXTENCODING_ASCII_US); aVal <<= aURL; const beans::PropertyValue aGraphicProp( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL")), -1, aVal, beans::PropertyState_DIRECT_VALUE); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 7cbf1d07a9a4..70ee252a9323 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -7286,7 +7286,9 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell ) XFillBitmapItem aXFillBitmapItem((const XFillBitmapItem&)pObj->GetMergedItem( XATTR_FILLBITMAP )); XOBitmap aLocalXOBitmap( aXFillBitmapItem.GetBitmapValue() ); rtl::OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX)); - aURL += rtl::OUString::createFromAscii( aLocalXOBitmap.GetGraphicObject().GetUniqueID().GetBuffer() ); + aURL += rtl::OStringToOUString( + aLocalXOBitmap.GetGraphicObject().GetUniqueID(), + RTL_TEXTENCODING_ASCII_US); static const rtl::OUString sFillBitmapURL( String( RTL_CONSTASCII_USTRINGPARAM( "FillBitmapURL" ) ) ); xPropSet->setPropertyValue( sFillBitmapURL, Any( aURL ) ); diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx index 215329aa41ff..adc644845bbb 100644 --- a/svtools/bmpmaker/bmpsum.cxx +++ b/svtools/bmpmaker/bmpsum.cxx @@ -36,6 +36,7 @@ #include <map> #include <rtl/crc.h> +#include <rtl/strbuf.hxx> #include <tools/stream.hxx> #include <tools/fsys.hxx> #include <vcl/svapp.hxx> @@ -411,14 +412,13 @@ void BmpSum::ProcessFileList( const String& rInFileList, // write new entries for( sal_uInt32 i = 0; i < aFileNameVector.size(); ++i ) { - ByteString aStr(rtl::OString::valueOf(static_cast<sal_Int64>(aPair.first))); - ByteString aFileName( aFileNameVector[ i ] ); + ByteString aFileName( aFileNameVector[ i ] ); DirEntry aSrcFile( aFileName ); - aStr += '\t'; - aStr += aFileName; - - aOStm.WriteLine( aStr ); + rtl::OStringBuffer aStr; + aStr.append(static_cast<sal_Int64>(aPair.first)) + .append('\t').append(aFileName); + aOStm.WriteLine( aStr.makeStringAndClear() ); // copy bitmap if( rOutPath.Len() ) diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx index f43aec4cbae9..a7c58e17dd6e 100644 --- a/svtools/inc/svtools/grfmgr.hxx +++ b/svtools/inc/svtools/grfmgr.hxx @@ -229,7 +229,7 @@ private: void SVT_DLLPRIVATE ImplAssignGraphicData(); void SVT_DLLPRIVATE ImplSetGraphicManager( const GraphicManager* pMgr, - const ByteString* pID = NULL, + const rtl::OString* pID = NULL, const GraphicObject* pCopyObj = NULL ); void SVT_DLLPRIVATE ImplAutoSwapIn(); @@ -360,7 +360,7 @@ public: GraphicObject( const GraphicManager* pMgr = NULL ); GraphicObject( const Graphic& rGraphic, const GraphicManager* pMgr = NULL ); GraphicObject( const GraphicObject& rCacheObj, const GraphicManager* pMgr = NULL ); - GraphicObject( const ByteString& rUniqueID, const GraphicManager* pMgr = NULL ); + GraphicObject( const rtl::OString& rUniqueID, const GraphicManager* pMgr = NULL ); ~GraphicObject(); GraphicObject& operator=( const GraphicObject& rCacheObj ); @@ -435,7 +435,7 @@ public: void SetUserData( const String& rUserData ); String GetUserData() const; - ByteString GetUniqueID() const; + rtl::OString GetUniqueID() const; GraphicType GetType() const { return meType; } const Size& GetPrefSize() const { return maPrefSize; } @@ -649,7 +649,7 @@ private: void SVT_DLLPRIVATE ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubstitute, - const ByteString* pID = NULL, + const rtl::OString* pID = NULL, const GraphicObject* pCopyObj = NULL ); void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj ); @@ -663,7 +663,7 @@ private: ); void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj ); - ByteString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const; + rtl::OString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const; public: diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index 71b28846ac55..46101bc413a5 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -29,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" +#include <rtl/strbuf.hxx> #include <vcl/svapp.hxx> #include <tools/table.hxx> #include <vcl/help.hxx> @@ -234,13 +235,15 @@ void Calendar::ImplInit( WinBits nWinStyle ) if (maCalendarWrapper.getUniqueID() != aGregorian) { #ifdef DBG_UTIL - ByteString aMsg( "Calendar::ImplInit: No ``gregorian'' calendar available for locale ``"); + rtl::OStringBuffer aMsg( "Calendar::ImplInit: No ``gregorian'' calendar available for locale ``"); lang::Locale aLoc( Application::GetAppLocaleDataWrapper().getLocale()); - aMsg += ByteString( String( aLoc.Language), RTL_TEXTENCODING_UTF8); - aMsg += '-'; - aMsg += ByteString( String( aLoc.Country), RTL_TEXTENCODING_UTF8); - aMsg += "'' and other calendars aren't supported. Using en-US fallback."; - DBG_ERRORFILE( aMsg.GetBuffer()); + aMsg.append(rtl::OUStringToOString(aLoc.Language, + RTL_TEXTENCODING_UTF8)); + aMsg.append('-'); + aMsg.append(rtl::OUStringToOString(aLoc.Country, + RTL_TEXTENCODING_UTF8)); + aMsg.append("'' and other calendars aren't supported. Using en-US fallback."); + DBG_ERRORFILE(aMsg.getStr()); #endif /* If we ever wanted to support other calendars than Gregorian a lot of * rewrite would be necessary to internally replace use of class Date diff --git a/svtools/source/graphic/graphicunofactory.cxx b/svtools/source/graphic/graphicunofactory.cxx index c1e2f13068de..bfa77d15ae19 100644 --- a/svtools/source/graphic/graphicunofactory.cxx +++ b/svtools/source/graphic/graphicunofactory.cxx @@ -92,7 +92,7 @@ void SAL_CALL GObjectImpl::setGraphic( const uno::Reference< graphic::XGraphic > ::osl::MutexGuard aGuard( m_aMutex ); rtl::OUString sId; if ( mpGObject.get() ) - sId = String( mpGObject->GetUniqueID().GetBuffer(), RTL_TEXTENCODING_ASCII_US ); + sId = rtl::OStringToOUString(mpGObject->GetUniqueID(), RTL_TEXTENCODING_ASCII_US); return sId; } diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index 573866020b42..3299deb23695 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -78,7 +78,7 @@ public: rID.mnID3 == mnID3 && rID.mnID4 == mnID4 ); } - ByteString GetIDString() const; + rtl::OString GetIDString() const; sal_Bool IsEmpty() const { return( 0 == mnID4 ); } }; @@ -134,7 +134,7 @@ GraphicID::GraphicID( const GraphicObject& rObj ) // ----------------------------------------------------------------------------- -ByteString GraphicID::GetIDString() const +rtl::OString GraphicID::GetIDString() const { rtl::OStringBuffer aHexStr; sal_Int32 nShift, nIndex = 0; @@ -587,7 +587,7 @@ GraphicCache::~GraphicCache() void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute, - const ByteString* pID, + const rtl::OString* pID, const GraphicObject* pCopyObj ) { @@ -866,9 +866,9 @@ sal_Bool GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, c // ----------------------------------------------------------------------------- -ByteString GraphicCache::GetUniqueID( const GraphicObject& rObj ) const +rtl::OString GraphicCache::GetUniqueID( const GraphicObject& rObj ) const { - ByteString aRet; + rtl::OString aRet; GraphicCacheEntry* pEntry = ( (GraphicCache*) this )->ImplGetCacheEntry( rObj ); // ensure that the entry is correctly initialized (it has to be read at least once) diff --git a/svtools/source/graphic/grfcache.hxx b/svtools/source/graphic/grfcache.hxx index edc1aa67ceb5..efcfda8983a0 100644 --- a/svtools/source/graphic/grfcache.hxx +++ b/svtools/source/graphic/grfcache.hxx @@ -75,7 +75,7 @@ public: void AddGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute, - const ByteString* pID, + const rtl::OString* pID, const GraphicObject* pCopyObj ); @@ -85,7 +85,7 @@ public: sal_Bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); void GraphicObjectWasSwappedIn( const GraphicObject& rObj ); - ByteString GetUniqueID( const GraphicObject& rObj ) const; + rtl::OString GetUniqueID( const GraphicObject& rObj ) const; public: diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 4e3d99493a0f..52621ac5f43e 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -104,7 +104,7 @@ GraphicObject::GraphicObject( const GraphicObject& rGraphicObj, const GraphicMan ImplSetGraphicManager( pMgr, NULL, &rGraphicObj ); } -GraphicObject::GraphicObject( const ByteString& rUniqueID, const GraphicManager* pMgr ) : +GraphicObject::GraphicObject( const rtl::OString& rUniqueID, const GraphicManager* pMgr ) : mpLink ( NULL ), mpUserData ( NULL ) { @@ -163,7 +163,7 @@ void GraphicObject::ImplAssignGraphicData() mnAnimationLoopCount = ( mbAnimated ? maGraphic.GetAnimationLoopCount() : 0 ); } -void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const ByteString* pID, const GraphicObject* pCopyObj ) +void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const rtl::OString* pID, const GraphicObject* pCopyObj ) { if( !mpMgr || ( pMgr != mpMgr ) ) { @@ -378,12 +378,12 @@ void GraphicObject::Assign( const SvDataCopyStream& rCopyStream ) *this = (const GraphicObject& ) rCopyStream; } -ByteString GraphicObject::GetUniqueID() const +rtl::OString GraphicObject::GetUniqueID() const { if ( !IsInSwapIn() && ( IsEPS() || IsRenderGraphic() ) ) const_cast<GraphicObject*>(this)->FireSwapInRequest(); - ByteString aRet; + rtl::OString aRet; if( mpMgr ) aRet = mpMgr->ImplGetUniqueID( *this ); diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 60c778b62f0a..7534c47648af 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -227,7 +227,7 @@ sal_Bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Si // ----------------------------------------------------------------------------- void GraphicManager::ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubstitute, - const ByteString* pID, const GraphicObject* pCopyObj ) + const rtl::OString* pID, const GraphicObject* pCopyObj ) { maObjList.push_back( (GraphicObject*)&rObj ); mpCache->AddGraphicObject( rObj, rSubstitute, pID, pCopyObj ); @@ -256,7 +256,7 @@ void GraphicManager::ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj ) // ----------------------------------------------------------------------------- -ByteString GraphicManager::ImplGetUniqueID( const GraphicObject& rObj ) const +rtl::OString GraphicManager::ImplGetUniqueID( const GraphicObject& rObj ) const { return mpCache->GetUniqueID( rObj ); } diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index b28093172921..6ff6cad985e9 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -30,6 +30,7 @@ #include "precompiled_svtools.hxx" #include <string.h> +#include <rtl/strbuf.hxx> #include <vcl/svapp.hxx> #include <tools/urlobj.hxx> #include <vcl/wrkwin.hxx> @@ -263,7 +264,6 @@ sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL ) void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL ) { ByteString aStr( rLine ); - ByteString aToken; aStr.EraseLeadingChars( ' ' ); aStr.EraseLeadingChars( '\t' ); @@ -273,12 +273,14 @@ void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL const char* pStr = aStr.GetBuffer(); char cChar = *pStr++; - // Anweisung finden + // Anweisung finden + rtl::OStringBuffer aBuf; while( ( cChar >= 'a' ) && ( cChar <= 'z' ) && NOTEOL( cChar ) ) { - aToken += cChar; + aBuf.append(cChar); cChar = *pStr++; } + rtl::OString aToken = aBuf.makeStringAndClear(); if ( NOTEOL( cChar ) ) { @@ -406,7 +408,6 @@ sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL ) void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL ) { ByteString aStr( rLine ); - ByteString aToken; aStr.EraseLeadingChars( ' ' ); aStr.EraseLeadingChars( '\t' ); @@ -416,12 +417,14 @@ void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL const char* pStr = aStr.GetBuffer(); char cChar = *pStr++; - // Anweisung finden + // Anweisung finden + rtl::OStringBuffer aBuf; while( ( cChar >= 'a' ) && ( cChar <= 'z' ) && NOTEOL( cChar ) ) { - aToken += cChar; + aBuf.append(cChar); cChar = *pStr++; } + rtl::OString aToken = aBuf.makeStringAndClear(); if ( NOTEOL( cChar ) ) { diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 89bc665dcdc1..25fd6dfb165e 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -404,10 +404,11 @@ const sal_Char *lcl_svhtml_GetEntityForChar( sal_Unicode c, return pStr; } -void lcl_ConvertCharToHTML( sal_Unicode c, ByteString& rDest, +rtl::OString lcl_ConvertCharToHTML( sal_Unicode c, HTMLOutContext& rContext, String *pNonConvertableChars ) { + rtl::OStringBuffer aDest; DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW != rContext.m_eDestEnc, "wrong destination encoding" ); const sal_Char *pStr = 0; @@ -449,8 +450,8 @@ void lcl_ConvertCharToHTML( sal_Unicode c, ByteString& rDest, DBG_ASSERT( (nInfo & (RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0, "HTMLOut: error while flushing" ); sal_Char *pBuffer = cBuffer; while( nLen-- ) - rDest += *pBuffer++; - ((rDest += '&') += pStr) += ';'; + aDest.append(*pBuffer++); + aDest.append('&').append(pStr).append(';'); } else { @@ -463,7 +464,7 @@ void lcl_ConvertCharToHTML( sal_Unicode c, ByteString& rDest, { sal_Char *pBuffer = cBuffer; while( nLen-- ) - rDest += *pBuffer++; + aDest.append(*pBuffer++); } else { @@ -478,19 +479,22 @@ void lcl_ConvertCharToHTML( sal_Unicode c, ByteString& rDest, DBG_ASSERT( (nInfo & (RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0, "HTMLOut: error while flushing" ); sal_Char *pBuffer = cBuffer; while( nLen-- ) - rDest += *pBuffer++; + aDest.append(*pBuffer++); - (((rDest += '&') += '#') += - ByteString(rtl::OString::valueOf(static_cast<sal_Int64>(c)))) += ';'; + aDest.append('&').append('#').append(static_cast<sal_Int64>(c)) + .append(';'); if( pNonConvertableChars && STRING_NOTFOUND == pNonConvertableChars->Search( c ) ) pNonConvertableChars->Append( c ); } } + return aDest.makeStringAndClear(); } -sal_Bool lcl_FlushToAscii( ByteString& rDest, HTMLOutContext& rContext ) +rtl::OString lcl_FlushToAscii( HTMLOutContext& rContext ) { + rtl::OStringBuffer aDest; + sal_Unicode c = 0; sal_Char cBuffer[TXTCONV_BUFFER_SIZE]; sal_uInt32 nInfo = 0; @@ -505,11 +509,10 @@ sal_Bool lcl_FlushToAscii( ByteString& rDest, HTMLOutContext& rContext ) cBuffer, TXTCONV_BUFFER_SIZE, nFlags, &nInfo, &nSrcChars ); DBG_ASSERT( (nInfo & (RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0, "HTMLOut: error while flushing" ); - sal_Bool bRet = nLen > 0; sal_Char *pBuffer = cBuffer; while( nLen-- ) - rDest += *pBuffer++; - return bRet; + aDest.append(*pBuffer++); + return aDest.makeStringAndClear(); } void HTMLOutFuncs::ConvertStringToHTML( const String& rSrc, @@ -519,9 +522,9 @@ void HTMLOutFuncs::ConvertStringToHTML( const String& rSrc, { HTMLOutContext aContext( eDestEnc ); for( sal_uInt32 i=0UL, nLen = rSrc.Len(); i < nLen; i++ ) - lcl_ConvertCharToHTML( rSrc.GetChar( (xub_StrLen)i ), rDest, aContext, - pNonConvertableChars ); - lcl_FlushToAscii( rDest, aContext ); + rDest += ByteString(lcl_ConvertCharToHTML( + rSrc.GetChar( (xub_StrLen)i ), aContext, pNonConvertableChars)); + rDest += ByteString(lcl_FlushToAscii( aContext )); } SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const sal_Char *pStr, @@ -537,9 +540,8 @@ SvStream& HTMLOutFuncs::Out_Char( SvStream& rStream, sal_Unicode c, HTMLOutContext& rContext, String *pNonConvertableChars ) { - ByteString sOut; - lcl_ConvertCharToHTML( c, sOut, rContext, pNonConvertableChars ); - rStream << sOut.GetBuffer(); + rtl::OString sOut = lcl_ConvertCharToHTML( c, rContext, pNonConvertableChars ); + rStream << sOut.getStr(); return rStream; } @@ -559,9 +561,10 @@ SvStream& HTMLOutFuncs::Out_String( SvStream& rStream, const String& rStr, SvStream& HTMLOutFuncs::FlushToAscii( SvStream& rStream, HTMLOutContext& rContext ) { - ByteString sOut; - if( lcl_FlushToAscii( sOut, rContext ) ) - rStream << sOut.GetBuffer(); + rtl::OString sOut = lcl_FlushToAscii( rContext ); + + if (sOut.getLength()) + rStream << sOut.getStr(); return rStream; } diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx index 02b102e578a1..12555a4c8804 100644 --- a/svtools/source/svrtf/parrtf.cxx +++ b/svtools/source/svrtf/parrtf.cxx @@ -339,30 +339,16 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak ) case '\'': { - ByteString aByteString; + rtl::OStringBuffer aByteString; while (1) { char c = (char)GetHexValue(); - - if (c) - { - aByteString.Append(c); - } - else - { - /* \'00 is a valid internal character in a - * string in RTF, however ByteString::Append - * does nothing if '\0' is passed in. It is - * otherwise capable of handling strings with - * embedded NULs, so add a '\1' and then - * change it, as ByteString::SetChar does not - * care if the character is '\0'. - */ - int nLen = aByteString.Len(); - - aByteString.Append('\001'); - aByteString.SetChar(nLen, '\0'); - } + /* + * Note: \'00 is a valid internal character in a + * string in RTF. rtl::OStringBuffer supports + * appending nulls fine + */ + aByteString.append(c); bool bBreak = false; sal_Char nSlash = '\\'; @@ -371,11 +357,10 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak ) wchar_t __next=GetNextChar(); if (__next>0xFF) // fix for #i43933# and #i35653# { - if (aByteString.Len()) - aStrBuffer.Append(String(aByteString, GetSrcEncoding())); + if (aByteString.getLength()) + aStrBuffer.Append(String(rtl::OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()))); aStrBuffer.Append((sal_Unicode)__next); - aByteString.Erase(); continue; } nSlash = (sal_Char)__next; @@ -390,7 +375,7 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak ) bBreak = true; break; default: - aByteString.Append(nSlash); + aByteString.append(nSlash); break; } } @@ -407,8 +392,8 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak ) bNextCh = false; - if (aByteString.Len()) - aStrBuffer.Append(String(aByteString, GetSrcEncoding())); + if (aByteString.getLength()) + aStrBuffer.Append(String(rtl::OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()))); } break; case '\\': diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx index 5e5f9810ed8c..6d803b43c11e 100644 --- a/svx/source/unodraw/XPropertyTable.cxx +++ b/svx/source/unodraw/XPropertyTable.cxx @@ -688,7 +688,9 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoXBitmapTable_createInstance( XP uno::Any SvxUnoXBitmapTable::getAny( const XPropertyEntry* pEntry ) const throw() { OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX)); - aURL += OUString::createFromAscii( ((XBitmapEntry*)pEntry)->GetXBitmap().GetGraphicObject().GetUniqueID().GetBuffer() ); + aURL += OStringToOUString( + ((XBitmapEntry*)pEntry)->GetXBitmap().GetGraphicObject().GetUniqueID(), + RTL_TEXTENCODING_ASCII_US); uno::Any aAny; aAny <<= aURL; diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 93363cab2d9b..67a311002552 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1671,7 +1671,7 @@ bool SvxGraphicObject::getPropertyValueImpl( const ::rtl::OUString& rName, const sal_Bool bSwapped = static_cast< SdrGrafObj* >( mpObj.get() )->IsSwappedOut(); const GraphicObject& rGrafObj = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphicObject(true); OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX)); - aURL += OUString::createFromAscii( rGrafObj.GetUniqueID().GetBuffer() ); + aURL += OStringToOUString(rGrafObj.GetUniqueID(), RTL_TEXTENCODING_ASCII_US); rValue <<= aURL; if ( bSwapped ) static_cast< SdrGrafObj* >( mpObj.get() )->ForceSwapOut(); diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index a7c08e759a99..7b642e6e061b 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -407,8 +407,10 @@ bool SvxOle2Shape::getPropertyValueImpl( const ::rtl::OUString& rName, const Sfx if( pGraphic ) { GraphicObject aObj( *pGraphic ); - aURL = OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX)); - aURL += OUString::createFromAscii( aObj.GetUniqueID().GetBuffer() ); + aURL = OUString(RTL_CONSTASCII_USTRINGPARAM( + UNO_NAME_GRAPHOBJ_URLPREFIX)); + aURL += rtl::OStringToOUString(aObj.GetUniqueID(), + RTL_TEXTENCODING_ASCII_US); } } rValue <<= aURL; diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 23cb968233b9..78e458cf5306 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -695,11 +695,12 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s if( aObj.GetType() != GRAPHIC_NONE ) { - const static ::rtl::OUString aBaseURL( RTL_CONSTASCII_USTRINGPARAM( XML_GRAPHICOBJECT_URL_BASE ) ); - maGrfObjs.push_back( aObj ); + ::rtl::OUString aBaseURL( RTL_CONSTASCII_USTRINGPARAM( XML_GRAPHICOBJECT_URL_BASE ) ); + rURLPair.second = aBaseURL; - rURLPair.second += String( aObj.GetUniqueID().GetBuffer(), RTL_TEXTENCODING_ASCII_US ); + rURLPair.second += rtl::OStringToOUString(aObj.GetUniqueID(), + RTL_TEXTENCODING_ASCII_US); } else rURLPair.second = String(); @@ -951,8 +952,9 @@ Reference< XOutputStream > SAL_CALL SvXMLGraphicHelper::createOutputStream() if( pOStm ) { - const GraphicObject& rGrfObj = pOStm->GetGraphicObject(); - const ::rtl::OUString aId( ::rtl::OUString::createFromAscii( rGrfObj.GetUniqueID().GetBuffer() ) ); + const GraphicObject& rGrfObj = pOStm->GetGraphicObject(); + const ::rtl::OUString aId(::rtl::OStringToOUString( + rGrfObj.GetUniqueID(), RTL_TEXTENCODING_ASCII_US)); if( aId.getLength() ) { diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index 5f3237d1b7b1..1f421c4a5d7b 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -639,8 +639,11 @@ bool XFillBitmapItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nM nMemberId == 0 ) { XOBitmap aLocalXOBitmap( GetBitmapValue() ); - aURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX)); - aURL += ::rtl::OUString::createFromAscii( aLocalXOBitmap.GetGraphicObject().GetUniqueID().GetBuffer() ); + aURL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + UNO_NAME_GRAPHOBJ_URLPREFIX)); + aURL += ::rtl::OStringToOUString( + aLocalXOBitmap.GetGraphicObject().GetUniqueID(), + RTL_TEXTENCODING_ASCII_US); } if( nMemberId == MID_BITMAP || nMemberId == 0 ) diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index a8e6dc099a66..b407c9b5b385 100755 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -795,7 +795,8 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf( String aExtStr = _aStrmName.Copy( nExtPos ); if ( GetGrfObj().GetType() != GRAPHIC_NONE ) { - _aStrmName = String( GetGrfObj().GetUniqueID(), RTL_TEXTENCODING_ASCII_US ); + _aStrmName = rtl::OStringToOUString(GetGrfObj().GetUniqueID(), + RTL_TEXTENCODING_ASCII_US); _aStrmName += aExtStr; } } diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 1225af12d2e6..8a8ffca43e64 100755 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1488,10 +1488,11 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) } else { - String sPrefix( RTL_CONSTASCII_USTRINGPARAM(sGraphicObjectProtocol) ); - String sId( pGrfNode->GetGrfObj().GetUniqueID(), - RTL_TEXTENCODING_ASCII_US ); - (sGrfName = sPrefix) += sId; + rtl::OUString sPrefix( RTL_CONSTASCII_USTRINGPARAM(sGraphicObjectProtocol) ); + rtl::OUString sId(rtl::OStringToOUString( + pGrfNode->GetGrfObj().GetUniqueID(), + RTL_TEXTENCODING_ASCII_US)); + sGrfName = sPrefix + sId; } } aAny <<= OUString(sGrfName); |