From 7dc9761753a1f04f0791d43ceaff8a44d269cea7 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 18 Mar 2017 18:52:41 +0100 Subject: cppcheck: alloca (vcl/i18n_status) Change-Id: Ib36fc229ab4d4a349f11abe0fc7b6d02163d7f14 Reviewed-on: https://gerrit.libreoffice.org/35409 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/unx/generic/app/i18n_status.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx index 1b1ae8e61941..40c89dd83519 100644 --- a/vcl/unx/generic/app/i18n_status.cxx +++ b/vcl/unx/generic/app/i18n_status.cxx @@ -20,7 +20,6 @@ #if OSL_DEBUG_LEVEL > 1 #include #endif -#include #include #include @@ -561,7 +560,8 @@ void I18NStatus::setStatusText( const OUString& rText ) * #93614# convert fullwidth ASCII forms to ascii */ int nChars = rText.getLength(); - sal_Unicode* pBuffer = static_cast(alloca( nChars*sizeof( sal_Unicode ) )); + rtl_uString *pStr = rtl_uString_alloc(nChars); + sal_Unicode *pBuffer = pStr->buffer; for( int i = 0; i < nChars; i++ ) { if( rText[i] >=0xff00 && rText[i] <= 0xff5f ) @@ -569,7 +569,7 @@ void I18NStatus::setStatusText( const OUString& rText ) else pBuffer[i] = rText[i]; } - OUString aText( pBuffer, nChars ); + OUString aText(pStr, SAL_NO_ACQUIRE); m_pStatusWindow->setText( aText ); m_pStatusWindow->setPosition( m_pParent ); -- cgit