Related: fdo#38838 remove the unused String::Insert

Change-Id: I39f4c68b76d8816fc91e4dc39bf2305142d1fb93
This commit is contained in:
Caolán McNamara 2013-10-20 12:06:08 +01:00
parent 2d41f3acc3
commit b0fd64b2fa
3 changed files with 2 additions and 46 deletions

View file

@ -142,6 +142,8 @@ private:
TOOLS_DLLPRIVATE UniString& Expand( xub_StrLen nCount, sal_Unicode cExpandChar );
TOOLS_DLLPRIVATE sal_Bool Equals( const sal_Unicode* pCharStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
TOOLS_DLLPRIVATE UniString& Insert( const UniString& rStr, xub_StrLen nPos, xub_StrLen nLen,
xub_StrLen nIndex = STRING_LEN );
TOOLS_DLLPRIVATE UniString& operator +=( const sal_Unicode* pCharStr );
@ -215,8 +217,6 @@ public:
xub_StrLen Len() const { return (xub_StrLen)mpData->mnLen; }
UniString& Insert( const UniString& rStr, xub_StrLen nIndex = STRING_LEN );
UniString& Insert( const UniString& rStr, xub_StrLen nPos, xub_StrLen nLen,
xub_StrLen nIndex = STRING_LEN );
UniString& Insert( sal_Unicode c, xub_StrLen nIndex = STRING_LEN );
UniString Copy( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ) const;

View file

@ -58,49 +58,6 @@ sal_Int32 UniString::ToInt32() const
return rtl_ustr_toInt32( mpData->maStr, 10 );
}
STRING& STRING::Insert( const STRING& rStr, xub_StrLen nPos, xub_StrLen nLen,
xub_StrLen nIndex )
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
// Determine string length
if ( nPos > rStr.mpData->mnLen )
nLen = 0;
else
{
// Correct length if necessary
sal_Int32 nMaxLen = rStr.mpData->mnLen-nPos;
if ( nLen > nMaxLen )
nLen = static_cast< xub_StrLen >(nMaxLen);
}
// Detect overflow
sal_Int32 nCopyLen = ImplGetCopyLen( mpData->mnLen, nLen );
if ( !nCopyLen )
return *this;
// Correct index if necessary
if ( nIndex > mpData->mnLen )
nIndex = static_cast< xub_StrLen >(mpData->mnLen);
// Determine new length and allocate string
STRINGDATA* pNewData = ImplAllocData( mpData->mnLen+nCopyLen );
// copy string to newdata
memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) );
memcpy( pNewData->maStr+nIndex, rStr.mpData->maStr+nPos, nCopyLen*sizeof( STRCODE ) );
memcpy( pNewData->maStr+nIndex+nCopyLen, mpData->maStr+nIndex,
(mpData->mnLen-nIndex)*sizeof( STRCODE ) );
// release old data
STRING_RELEASE((STRING_TYPE *)mpData);
mpData = pNewData;
return *this;
}
STRING& STRING::Insert( STRCODE c, xub_StrLen nIndex )
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );

View file

@ -63,7 +63,6 @@ SfxGrabBagItem::SetGrabBag(std::__debug::map<rtl::OUString, com::sun::star::uno:
SfxTemplatePanelControl::SetParagraphFamily()
SmFontPickList::Contains(Font const&) const
SmParser::Insert(rtl::OUString const&, int)
String::Insert(String const&, unsigned short, unsigned short, unsigned short)
String::String(char)
SvdProgressInfo::ReportError()
SvpSalInstance::PostEvent(SalFrame const*, void*, unsigned short)