summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_bookmark.cpp
diff options
context:
space:
mode:
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 {