summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_bookmark.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-05-06 17:29:29 -0700
committerTom Sepez <tsepez@chromium.org>2015-05-06 17:29:29 -0700
commit21031ad28a73f0633e720997d310440c5bc31ec5 (patch)
tree610fab06995fcc7577232d1a72fa519c1cfcd0ab /core/src/fpdfdoc/doc_bookmark.cpp
parent1fd0b107570f41cc6f378794a22d8450f5619665 (diff)
downloadpdfium-21031ad28a73f0633e720997d310440c5bc31ec5.tar.xz
Support arrays in nonstd::unique_ptr<>.
This mimics the std:: behaviour. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1130053003
Diffstat (limited to 'core/src/fpdfdoc/doc_bookmark.cpp')
-rw-r--r--core/src/fpdfdoc/doc_bookmark.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/src/fpdfdoc/doc_bookmark.cpp b/core/src/fpdfdoc/doc_bookmark.cpp
index 6ba98e655d..10ef07e93e 100644
--- a/core/src/fpdfdoc/doc_bookmark.cpp
+++ b/core/src/fpdfdoc/doc_bookmark.cpp
@@ -63,14 +63,12 @@ CFX_WideString CPDF_Bookmark::GetTitle() const
if (!len) {
return CFX_WideString();
}
- nonstd::unique_ptr<std::vector<FX_WCHAR> > vec;
- vec.reset(new std::vector<FX_WCHAR>(len));
- FX_WCHAR* buf = &vec->front();
+ nonstd::unique_ptr<FX_WCHAR[]> buf(new FX_WCHAR[len]);
for (int i = 0; i < len; i++) {
FX_WCHAR w = title[i];
buf[i] = w > 0x20 ? w : 0x20;
}
- return CFX_WideString(buf, len);
+ return CFX_WideString(buf.get(), len);
}
CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument) const
{