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

Side by Side Diff: fpdfsdk/src/fpdfview.cpp

Issue 849693007: Merge to XFA: Add embeddertests. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 11 months 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/src/fpdfdoc_embeddertest.cpp ('k') | fpdfsdk/src/fpdfview_embeddertest.cpp » ('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 "../include/fsdk_define.h" 7 #include "../include/fsdk_define.h"
8 #include "../include/fsdk_mgr.h" 8 #include "../include/fsdk_mgr.h"
9 #include "../include/fpdfview.h" 9 #include "../include/fpdfview.h"
10 #include "../include/fsdk_rendercontext.h" 10 #include "../include/fsdk_rendercontext.h"
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 while (pos) { 1041 while (pos) {
1042 pDestObj = pDest->GetNextElement(pos, bsName); 1042 pDestObj = pDest->GetNextElement(pos, bsName);
1043 if (!pDestObj) continue; 1043 if (!pDestObj) continue;
1044 if (i == index) break; 1044 if (i == index) break;
1045 i++; 1045 i++;
1046 } 1046 }
1047 } else { 1047 } else {
1048 pDestObj = nameTree.LookupValue(index, bsName); 1048 pDestObj = nameTree.LookupValue(index, bsName);
1049 } 1049 }
1050 if (!pDestObj) return NULL; 1050 if (!pDestObj) return NULL;
1051 if (pDestObj->GetType() == PDFOBJ_DICTIONARY) 1051 if (pDestObj->GetType() == PDFOBJ_DICTIONARY) {
1052 pDestObj = ((CPDF_Dictionary*)pDestObj)->GetArray(FX_BSTRC("D")); 1052 pDestObj = ((CPDF_Dictionary*)pDestObj)->GetArray(FX_BSTRC("D"));
1053 if (!pDestObj) return NULL;
1054 }
1053 if (pDestObj->GetType() != PDFOBJ_ARRAY) return NULL; 1055 if (pDestObj->GetType() != PDFOBJ_ARRAY) return NULL;
1054 CFX_WideString wsName = PDF_DecodeText(bsName); 1056 CFX_WideString wsName = PDF_DecodeText(bsName);
1055 CFX_ByteString utf16Name = wsName.UTF16LE_Encode(); 1057 CFX_ByteString utf16Name = wsName.UTF16LE_Encode();
1056 unsigned int len = utf16Name.GetLength(); 1058 unsigned int len = utf16Name.GetLength();
1057 if (!buffer) { 1059 if (!buffer) {
1058 buflen = len; 1060 buflen = len;
1059 } else if (buflen >= len) { 1061 } else if (buflen >= len) {
1060 memcpy(buffer, utf16Name.c_str(), len); 1062 memcpy(buffer, utf16Name.c_str(), len);
1063 buflen = len;
1061 } else { 1064 } else {
1062 buflen = -1; 1065 buflen = -1;
1063 } 1066 }
1064 return (FPDF_DEST)pDestObj; 1067 return (FPDF_DEST)pDestObj;
1065 } 1068 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfdoc_embeddertest.cpp ('k') | fpdfsdk/src/fpdfview_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698