diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-03-18 18:52:41 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-21 11:46:28 +0000 |
commit | 7dc9761753a1f04f0791d43ceaff8a44d269cea7 (patch) | |
tree | 32bed2df1e43f9adcb3fddd67a61f2b981c76c87 /vcl/unx | |
parent | 3ff957b0a45a1c7a2666103a6a6783e69de3446c (diff) |
cppcheck: alloca (vcl/i18n_status)
Change-Id: Ib36fc229ab4d4a349f11abe0fc7b6d02163d7f14
Reviewed-on: https://gerrit.libreoffice.org/35409
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/app/i18n_status.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
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 <stdio.h> #endif -#include <sal/alloca.h> #include <X11/Xlib.h> #include <X11/Xutil.h> @@ -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<sal_Unicode*>(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 ); |