diff options
-rw-r--r-- | include/tools/string.hxx | 9 | ||||
-rw-r--r-- | tools/source/string/strimp.cxx | 29 | ||||
-rw-r--r-- | tools/source/string/tustring.cxx | 42 | ||||
-rw-r--r-- | unusedcode.easy | 2 |
4 files changed, 5 insertions, 77 deletions
diff --git a/include/tools/string.hxx b/include/tools/string.hxx index 74288fbfa271..796971ef2942 100644 --- a/include/tools/string.hxx +++ b/include/tools/string.hxx @@ -133,10 +133,15 @@ private: TOOLS_DLLPRIVATE UniString( const sal_Unicode* pCharStr, xub_StrLen nLen ); TOOLS_DLLPRIVATE UniString( sal_Unicode c ); TOOLS_DLLPRIVATE UniString& Assign( const sal_Unicode* pCharStr, xub_StrLen nLen ); + TOOLS_DLLPRIVATE UniString& Append( const sal_Unicode* pCharStr ); + TOOLS_DLLPRIVATE UniString& Append( const sal_Unicode* pCharStr, xub_StrLen nLen ); 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 xub_StrLen Search( const sal_Unicode* pCharStr, xub_StrLen nIndex = 0 ) const; + + TOOLS_DLLPRIVATE UniString& operator +=( const sal_Unicode* pCharStr ); + public: UniString(); UniString( const ResId& rResId ); @@ -191,8 +196,6 @@ public: { return operator =(static_cast< sal_Unicode >(c)); } UniString& Append( const UniString& rStr ); - UniString& Append( const sal_Unicode* pCharStr ); - UniString& Append( const sal_Unicode* pCharStr, xub_StrLen nLen ); UniString& Append( sal_Unicode c ); inline UniString & Append(char c) // ...but allow "Append('a')" { return Append(static_cast< sal_Unicode >(c)); } @@ -200,8 +203,6 @@ public: { return Append( rStr ); } UniString& operator +=( const OUString& rStr ) { return Append( UniString(rStr) ); } - UniString& operator +=( const sal_Unicode* pCharStr ) - { return Append( pCharStr ); } UniString& operator +=( sal_Unicode c ) { return Append( c ); } inline UniString & operator +=(char c) // ...but allow "+= 'a'" diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index b86564a88e5b..6b0c40129d4e 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -203,35 +203,6 @@ STRING& STRING::Append( const STRING& rStr ) return *this; } -STRING& STRING::Append( const STRCODE* pCharStr ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_ASSERT( pCharStr, "String::Append() - pCharStr is NULL" ); - - // determine string length - sal_Int32 nLen = mpData->mnLen; - sal_Int32 nCopyLen = ImplStringLen( pCharStr ); - - // detect overflow - nCopyLen = ImplGetCopyLen( nLen, nCopyLen ); - - if ( nCopyLen ) - { - // allocate string of new size - STRINGDATA* pNewData = ImplAllocData( nLen+nCopyLen ); - - // copy string - memcpy( pNewData->maStr, mpData->maStr, nLen*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nLen, pCharStr, nCopyLen*sizeof( STRCODE ) ); - - // free old string - STRING_RELEASE((STRING_TYPE *)mpData); - mpData = pNewData; - } - - return *this; -} - void STRING::SetChar( xub_StrLen nIndex, STRCODE c ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index c339941b2a3d..69af7a1f9e05 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -282,48 +282,6 @@ STRING STRING::GetToken( xub_StrLen nToken, STRCODE cTok, sal_Int32& rIndex ) co } } -STRING& STRING::Append( const STRCODE* pCharStr, xub_StrLen nCharLen ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_ASSERT( pCharStr, "String::Append() - pCharStr is NULL" ); - - if ( nCharLen == STRING_LEN ) - nCharLen = ImplStringLen( pCharStr ); - -#ifdef DBG_UTIL - if ( DbgIsAssert() ) - { - for ( xub_StrLen i = 0; i < nCharLen; i++ ) - { - if ( !pCharStr[i] ) - { - OSL_FAIL( "String::Append() : nLen is wrong" ); - } - } - } -#endif - - // Catch overflow - sal_Int32 nLen = mpData->mnLen; - sal_Int32 nCopyLen = ImplGetCopyLen( nLen, nCharLen ); - - if ( nCopyLen ) - { - // allocate string of new size - STRINGDATA* pNewData = ImplAllocData( nLen+nCopyLen ); - - // copy string - memcpy( pNewData->maStr, mpData->maStr, nLen*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nLen, pCharStr, nCopyLen*sizeof( STRCODE ) ); - - // free old string - STRING_RELEASE((STRING_TYPE *)mpData); - mpData = pNewData; - } - - return *this; -} - STRING& STRING::Append( STRCODE c ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); diff --git a/unusedcode.easy b/unusedcode.easy index 042fca5dacca..f96a77885f4a 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -63,8 +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::Append(unsigned short const*) -String::Append(unsigned short const*, unsigned short) String::Assign(unsigned short const*) String::Insert(String const&, unsigned short, unsigned short, unsigned short) String::String(char) |