Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(557)

Side by Side Diff: fpdfsdk/fpdfview.cpp

Issue 2519343002: Add APIs for limited use of document tagged code. (Closed)
Patch Set: More nits Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/fpdfdoc.cpp ('k') | fpdfsdk/fpdfview_c_api_test.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "public/fpdfview.h" 7 #include "public/fpdfview.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 return nullptr; 1103 return nullptr;
1104 } 1104 }
1105 if (!pDestObj->IsArray()) 1105 if (!pDestObj->IsArray())
1106 return nullptr; 1106 return nullptr;
1107 1107
1108 CFX_WideString wsName = PDF_DecodeText(bsName); 1108 CFX_WideString wsName = PDF_DecodeText(bsName);
1109 CFX_ByteString utf16Name = wsName.UTF16LE_Encode(); 1109 CFX_ByteString utf16Name = wsName.UTF16LE_Encode();
1110 int len = utf16Name.GetLength(); 1110 int len = utf16Name.GetLength();
1111 if (!buffer) { 1111 if (!buffer) {
1112 *buflen = len; 1112 *buflen = len;
1113 } else if (*buflen >= len) { 1113 } else if (len <= *buflen) {
1114 memcpy(buffer, utf16Name.c_str(), len); 1114 memcpy(buffer, utf16Name.c_str(), len);
1115 *buflen = len; 1115 *buflen = len;
1116 } else { 1116 } else {
1117 *buflen = -1; 1117 *buflen = -1;
1118 } 1118 }
1119 return (FPDF_DEST)pDestObj; 1119 return (FPDF_DEST)pDestObj;
1120 } 1120 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfdoc.cpp ('k') | fpdfsdk/fpdfview_c_api_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698