diff options
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/aqua/NSString_OOoAdditions.mm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fpicker/source/aqua/NSString_OOoAdditions.mm b/fpicker/source/aqua/NSString_OOoAdditions.mm index 23ae6bc5c853..5721674f8121 100644 --- a/fpicker/source/aqua/NSString_OOoAdditions.mm +++ b/fpicker/source/aqua/NSString_OOoAdditions.mm @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <memory> + #include "NSString_OOoAdditions.hxx" @implementation NSString (OOoAdditions) @@ -32,14 +36,14 @@ { unsigned int nFileNameLength = [self length]; - UniChar unichars[nFileNameLength+1]; + auto const unichars = std::make_unique<UniChar[]>(nFileNameLength+1); //'close' the string buffer correctly unichars[nFileNameLength] = '\0'; - [self getCharacters:unichars]; + [self getCharacters:unichars.get()]; - return OUString(reinterpret_cast<sal_Unicode *>(unichars)); + return OUString(reinterpret_cast<sal_Unicode *>(unichars.get())); } @end |