From d05a9ae25e4a397834330d868b68d92ca919e33b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 1 Oct 2013 13:39:46 +0100 Subject: Related: fdo#38838 remove UniString::AssignAscii Change-Id: I263ef2594080ff7d47d5499c2b62e60e1689d2d6 --- tools/source/string/strascii.cxx | 75 ---------------------------------------- 1 file changed, 75 deletions(-) (limited to 'tools') diff --git a/tools/source/string/strascii.cxx b/tools/source/string/strascii.cxx index bf0d5a288f14..53a2babc634f 100644 --- a/tools/source/string/strascii.cxx +++ b/tools/source/string/strascii.cxx @@ -91,81 +91,6 @@ static sal_Int32 ImplStringCompareWithoutZeroAscii( const sal_Unicode* pStr1, co return nRet; } -UniString& UniString::AssignAscii( const sal_Char* pAsciiStr ) -{ - DBG_CHKTHIS( UniString, DbgCheckUniString ); - DBG_ASSERT( pAsciiStr, "UniString::AssignAscii() - pAsciiStr is NULL" ); - - // Determine string length - xub_StrLen nLen = ImplStringLen( pAsciiStr ); - - if ( !nLen ) - { - STRING_NEW((STRING_TYPE **)&mpData); - } - else - { - // Replace string in-place if new size is equal - if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) ) - ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen ); - else - { - // release old string - STRING_RELEASE((STRING_TYPE *)mpData); - - // copy new string - mpData = ImplAllocData( nLen ); - ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen ); - } - } - - return *this; -} - -UniString& UniString::AssignAscii( const sal_Char* pAsciiStr, xub_StrLen nLen ) -{ - DBG_CHKTHIS( UniString, DbgCheckUniString ); - DBG_ASSERT( pAsciiStr, "UniString::AssignAscii() - pAsciiStr is NULL" ); - - if ( nLen == STRING_LEN ) - nLen = ImplStringLen( pAsciiStr ); - -#ifdef DBG_UTIL - if ( DbgIsAssert() ) - { - for ( xub_StrLen i = 0; i < nLen; ++i ) - { - if ( !pAsciiStr[i] ) - { - OSL_FAIL( "UniString::AssignAscii() : nLen is wrong" ); - } - } - } -#endif - - if ( !nLen ) - { - STRING_NEW((STRING_TYPE **)&mpData); - } - else - { - // Replace string in-place if new size is equal - if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) ) - ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen ); - else - { - // release old string - STRING_RELEASE((STRING_TYPE *)mpData); - - // copy new string - mpData = ImplAllocData( nLen ); - ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen ); - } - } - - return *this; -} - UniString& UniString::AppendAscii( const sal_Char* pAsciiStr ) { DBG_CHKTHIS( UniString, DbgCheckUniString ); -- cgit