summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_bookmark.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-26 15:14:35 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-27 19:53:13 +0000
commit6e72b2ecdb95f000dede3c80e0c32496c0b27a18 (patch)
tree36350bea8b8ee81449693f8667c62fff1cedbcea /core/fpdfdoc/cpdf_bookmark.cpp
parent827db14d7f3d0085253b686587717361ffbcad1b (diff)
downloadpdfium-6e72b2ecdb95f000dede3c80e0c32496c0b27a18.tar.xz
Remove more |new|s, part 2
Change-Id: I13b43ceafc6a35bcc1e366546a4a408ea01fe4ab Reviewed-on: https://pdfium-review.googlesource.com/4534 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_bookmark.cpp')
-rw-r--r--core/fpdfdoc/cpdf_bookmark.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fpdfdoc/cpdf_bookmark.cpp b/core/fpdfdoc/cpdf_bookmark.cpp
index ba1e18c46d..8ca5d128f5 100644
--- a/core/fpdfdoc/cpdf_bookmark.cpp
+++ b/core/fpdfdoc/cpdf_bookmark.cpp
@@ -7,6 +7,7 @@
#include "core/fpdfdoc/cpdf_bookmark.h"
#include <memory>
+#include <vector>
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_string.h"
@@ -44,12 +45,12 @@ CFX_WideString CPDF_Bookmark::GetTitle() const {
if (!len)
return CFX_WideString();
- std::unique_ptr<wchar_t[]> buf(new wchar_t[len]);
+ std::vector<wchar_t> buf(len);
for (int i = 0; i < len; i++) {
wchar_t w = title[i];
buf[i] = w > 0x20 ? w : 0x20;
}
- return CFX_WideString(buf.get(), len);
+ return CFX_WideString(buf.data(), len);
}
CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument) const {