summaryrefslogtreecommitdiff
path: root/vcl/source/font
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-29 14:25:23 +0200
committerMichael Stahl <mstahl@redhat.com>2015-09-29 14:57:44 +0200
commit28f18b68db1af3668203730ba8cfbb66103fe669 (patch)
tree9d639a077257394d7f1cef39deae14e180004ed6 /vcl/source/font
parent9555d03c98346e7c1dc1443c8d8c3ac1b41bf678 (diff)
vcl: replace alloca() with std::unique_ptr
Change-Id: I82b982895ee422bcf5a23756df4d81c89bc47636
Diffstat (limited to 'vcl/source/font')
-rw-r--r--vcl/source/font/PhysicalFontCollection.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx
index 26b33ed02191..cd89bdf0e6a1 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ -18,7 +18,6 @@
*/
#include <sal/types.h>
-#include <sal/alloca.h>
#include <vector>
@@ -244,7 +243,7 @@ PhysicalFontFamily* PhysicalFontCollection::GetGlyphFallbackFont( FontSelectPatt
// there is a matching fallback in the cache
// so update rMissingCodes with codepoints not yet resolved by this fallback
int nRemainingLength = 0;
- sal_UCS4* pRemainingCodes = static_cast<sal_UCS4*>(alloca( rMissingCodes.getLength() * sizeof(sal_UCS4) ));
+ std::unique_ptr<sal_UCS4[]> const pRemainingCodes(new sal_UCS4[rMissingCodes.getLength()]);
OUString aFontName;
while( nStrIndex < rMissingCodes.getLength() )
@@ -254,7 +253,7 @@ PhysicalFontFamily* PhysicalFontCollection::GetGlyphFallbackFont( FontSelectPatt
if( !bCached || (rFontSelData.maSearchName != aFontName) )
pRemainingCodes[ nRemainingLength++ ] = cChar;
}
- rMissingCodes = OUString( pRemainingCodes, nRemainingLength );
+ rMissingCodes = OUString( pRemainingCodes.get(), nRemainingLength );
}
else
{