diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-05-06 17:48:47 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-05-06 17:48:47 -0700 |
commit | 9c55287c168eb6a469fd59ad77e8a58b93d67649 (patch) | |
tree | 50238c1472919b811626309928bcf5b9ff8ef2ad /core/src | |
parent | dd995a3d20de128ff1e3143a531beed0c90d65c1 (diff) | |
download | pdfium-9c55287c168eb6a469fd59ad77e8a58b93d67649.tar.xz |
Merge to XFA: Support arrays in nonstd::unique_ptr<>.
Original Review URL: https://codereview.chromium.org/1130053003
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1124353002
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/fpdfdoc/doc_bookmark.cpp | 6 |
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 { |