| OLD | NEW |
| 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/fpdf_doc.h" | 7 #include "../../public/fpdf_doc.h" |
| 8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 DLLEXPORT FPDF_BOOKMARK STDCALL | 53 DLLEXPORT FPDF_BOOKMARK STDCALL |
| 54 FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { | 54 FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { |
| 55 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 55 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 56 if (!pDoc) | 56 if (!pDoc) |
| 57 return nullptr; | 57 return nullptr; |
| 58 CPDF_BookmarkTree tree(pDoc); | 58 CPDF_BookmarkTree tree(pDoc); |
| 59 CPDF_Bookmark bookmark = CPDF_Bookmark((CPDF_Dictionary*)pDict); | 59 CPDF_Bookmark bookmark = |
| 60 CPDF_Bookmark(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 60 return tree.GetFirstChild(bookmark).GetDict(); | 61 return tree.GetFirstChild(bookmark).GetDict(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 DLLEXPORT FPDF_BOOKMARK STDCALL | 64 DLLEXPORT FPDF_BOOKMARK STDCALL |
| 64 FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { | 65 FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { |
| 65 if (!pDict) | 66 if (!pDict) |
| 66 return nullptr; | 67 return nullptr; |
| 67 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 68 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 68 if (!pDoc) | 69 if (!pDoc) |
| 69 return nullptr; | 70 return nullptr; |
| 70 CPDF_BookmarkTree tree(pDoc); | 71 CPDF_BookmarkTree tree(pDoc); |
| 71 CPDF_Bookmark bookmark = CPDF_Bookmark((CPDF_Dictionary*)pDict); | 72 CPDF_Bookmark bookmark = |
| 73 CPDF_Bookmark(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 72 return tree.GetNextSibling(bookmark).GetDict(); | 74 return tree.GetNextSibling(bookmark).GetDict(); |
| 73 } | 75 } |
| 74 | 76 |
| 75 DLLEXPORT unsigned long STDCALL FPDFBookmark_GetTitle(FPDF_BOOKMARK pDict, | 77 DLLEXPORT unsigned long STDCALL FPDFBookmark_GetTitle(FPDF_BOOKMARK pDict, |
| 76 void* buffer, | 78 void* buffer, |
| 77 unsigned long buflen) { | 79 unsigned long buflen) { |
| 78 if (!pDict) | 80 if (!pDict) |
| 79 return 0; | 81 return 0; |
| 80 CPDF_Bookmark bookmark((CPDF_Dictionary*)pDict); | 82 CPDF_Bookmark bookmark(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 81 CFX_WideString title = bookmark.GetTitle(); | 83 CFX_WideString title = bookmark.GetTitle(); |
| 82 CFX_ByteString encodedTitle = title.UTF16LE_Encode(); | 84 CFX_ByteString encodedTitle = title.UTF16LE_Encode(); |
| 83 unsigned long len = encodedTitle.GetLength(); | 85 unsigned long len = encodedTitle.GetLength(); |
| 84 if (buffer && buflen >= len) { | 86 if (buffer && buflen >= len) { |
| 85 FXSYS_memcpy(buffer, encodedTitle.c_str(), len); | 87 FXSYS_memcpy(buffer, encodedTitle.c_str(), len); |
| 86 } | 88 } |
| 87 return len; | 89 return len; |
| 88 } | 90 } |
| 89 | 91 |
| 90 DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, | 92 DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, |
| 91 FPDF_WIDESTRING title) { | 93 FPDF_WIDESTRING title) { |
| 92 if (!title || title[0] == 0) | 94 if (!title || title[0] == 0) |
| 93 return nullptr; | 95 return nullptr; |
| 94 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 96 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 95 if (!pDoc) | 97 if (!pDoc) |
| 96 return nullptr; | 98 return nullptr; |
| 97 CPDF_BookmarkTree tree(pDoc); | 99 CPDF_BookmarkTree tree(pDoc); |
| 98 FX_STRSIZE len = CFX_WideString::WStringLength(title); | 100 FX_STRSIZE len = CFX_WideString::WStringLength(title); |
| 99 CFX_WideString encodedTitle = CFX_WideString::FromUTF16LE(title, len); | 101 CFX_WideString encodedTitle = CFX_WideString::FromUTF16LE(title, len); |
| 100 return FindBookmark(tree, CPDF_Bookmark(), encodedTitle).GetDict(); | 102 return FindBookmark(tree, CPDF_Bookmark(), encodedTitle).GetDict(); |
| 101 } | 103 } |
| 102 | 104 |
| 103 DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, | 105 DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, |
| 104 FPDF_BOOKMARK pDict) { | 106 FPDF_BOOKMARK pDict) { |
| 105 if (!pDict) | 107 if (!pDict) |
| 106 return nullptr; | 108 return nullptr; |
| 107 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 109 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 108 if (!pDoc) | 110 if (!pDoc) |
| 109 return nullptr; | 111 return nullptr; |
| 110 CPDF_Bookmark bookmark((CPDF_Dictionary*)pDict); | 112 CPDF_Bookmark bookmark(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 111 CPDF_Dest dest = bookmark.GetDest(pDoc); | 113 CPDF_Dest dest = bookmark.GetDest(pDoc); |
| 112 if (dest) | 114 if (dest) |
| 113 return dest.GetObject(); | 115 return dest.GetObject(); |
| 114 // If this bookmark is not directly associated with a dest, we try to get | 116 // If this bookmark is not directly associated with a dest, we try to get |
| 115 // action | 117 // action |
| 116 CPDF_Action action = bookmark.GetAction(); | 118 CPDF_Action action = bookmark.GetAction(); |
| 117 if (!action) | 119 if (!action) |
| 118 return nullptr; | 120 return nullptr; |
| 119 return action.GetDest(pDoc).GetObject(); | 121 return action.GetDest(pDoc).GetObject(); |
| 120 } | 122 } |
| 121 | 123 |
| 122 DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK pDict) { | 124 DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK pDict) { |
| 123 if (!pDict) | 125 if (!pDict) |
| 124 return NULL; | 126 return NULL; |
| 125 CPDF_Bookmark bookmark((CPDF_Dictionary*)pDict); | 127 CPDF_Bookmark bookmark(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 126 return bookmark.GetAction().GetDict(); | 128 return bookmark.GetAction().GetDict(); |
| 127 } | 129 } |
| 128 | 130 |
| 129 DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION pDict) { | 131 DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION pDict) { |
| 130 if (!pDict) | 132 if (!pDict) |
| 131 return PDFACTION_UNSUPPORTED; | 133 return PDFACTION_UNSUPPORTED; |
| 132 | 134 |
| 133 CPDF_Action action((CPDF_Dictionary*)pDict); | 135 CPDF_Action action(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 134 CPDF_Action::ActionType type = action.GetType(); | 136 CPDF_Action::ActionType type = action.GetType(); |
| 135 switch (type) { | 137 switch (type) { |
| 136 case CPDF_Action::GoTo: | 138 case CPDF_Action::GoTo: |
| 137 return PDFACTION_GOTO; | 139 return PDFACTION_GOTO; |
| 138 case CPDF_Action::GoToR: | 140 case CPDF_Action::GoToR: |
| 139 return PDFACTION_REMOTEGOTO; | 141 return PDFACTION_REMOTEGOTO; |
| 140 case CPDF_Action::URI: | 142 case CPDF_Action::URI: |
| 141 return PDFACTION_URI; | 143 return PDFACTION_URI; |
| 142 case CPDF_Action::Launch: | 144 case CPDF_Action::Launch: |
| 143 return PDFACTION_LAUNCH; | 145 return PDFACTION_LAUNCH; |
| 144 default: | 146 default: |
| 145 return PDFACTION_UNSUPPORTED; | 147 return PDFACTION_UNSUPPORTED; |
| 146 } | 148 } |
| 147 } | 149 } |
| 148 | 150 |
| 149 DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, | 151 DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, |
| 150 FPDF_ACTION pDict) { | 152 FPDF_ACTION pDict) { |
| 151 if (!pDict) | 153 if (!pDict) |
| 152 return nullptr; | 154 return nullptr; |
| 153 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 155 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 154 if (!pDoc) | 156 if (!pDoc) |
| 155 return nullptr; | 157 return nullptr; |
| 156 CPDF_Action action((CPDF_Dictionary*)pDict); | 158 CPDF_Action action(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 157 return action.GetDest(pDoc).GetObject(); | 159 return action.GetDest(pDoc).GetObject(); |
| 158 } | 160 } |
| 159 | 161 |
| 160 DLLEXPORT unsigned long STDCALL | 162 DLLEXPORT unsigned long STDCALL |
| 161 FPDFAction_GetFilePath(FPDF_ACTION pDict, void* buffer, unsigned long buflen) { | 163 FPDFAction_GetFilePath(FPDF_ACTION pDict, void* buffer, unsigned long buflen) { |
| 162 unsigned long type = FPDFAction_GetType(pDict); | 164 unsigned long type = FPDFAction_GetType(pDict); |
| 163 if (type != PDFACTION_REMOTEGOTO && type != PDFACTION_LAUNCH) | 165 if (type != PDFACTION_REMOTEGOTO && type != PDFACTION_LAUNCH) |
| 164 return 0; | 166 return 0; |
| 165 | 167 |
| 166 CPDF_Action action((CPDF_Dictionary*)pDict); | 168 CPDF_Action action(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 167 CFX_ByteString path = action.GetFilePath().UTF8Encode(); | 169 CFX_ByteString path = action.GetFilePath().UTF8Encode(); |
| 168 unsigned long len = path.GetLength() + 1; | 170 unsigned long len = path.GetLength() + 1; |
| 169 if (buffer && buflen >= len) | 171 if (buffer && buflen >= len) |
| 170 FXSYS_memcpy(buffer, path.c_str(), len); | 172 FXSYS_memcpy(buffer, path.c_str(), len); |
| 171 return len; | 173 return len; |
| 172 } | 174 } |
| 173 | 175 |
| 174 DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, | 176 DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, |
| 175 FPDF_ACTION pDict, | 177 FPDF_ACTION pDict, |
| 176 void* buffer, | 178 void* buffer, |
| 177 unsigned long buflen) { | 179 unsigned long buflen) { |
| 178 if (!pDict) | 180 if (!pDict) |
| 179 return 0; | 181 return 0; |
| 180 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 182 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 181 if (!pDoc) | 183 if (!pDoc) |
| 182 return 0; | 184 return 0; |
| 183 CPDF_Action action((CPDF_Dictionary*)pDict); | 185 CPDF_Action action(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 184 CFX_ByteString path = action.GetURI(pDoc); | 186 CFX_ByteString path = action.GetURI(pDoc); |
| 185 unsigned long len = path.GetLength() + 1; | 187 unsigned long len = path.GetLength() + 1; |
| 186 if (buffer && buflen >= len) | 188 if (buffer && buflen >= len) |
| 187 FXSYS_memcpy(buffer, path.c_str(), len); | 189 FXSYS_memcpy(buffer, path.c_str(), len); |
| 188 return len; | 190 return len; |
| 189 } | 191 } |
| 190 | 192 |
| 191 DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, | 193 DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, |
| 192 FPDF_DEST pDict) { | 194 FPDF_DEST pDict) { |
| 193 if (!pDict) | 195 if (!pDict) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 return z_order; | 230 return z_order; |
| 229 } | 231 } |
| 230 | 232 |
| 231 DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, | 233 DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, |
| 232 FPDF_LINK pDict) { | 234 FPDF_LINK pDict) { |
| 233 if (!pDict) | 235 if (!pDict) |
| 234 return nullptr; | 236 return nullptr; |
| 235 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); | 237 CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); |
| 236 if (!pDoc) | 238 if (!pDoc) |
| 237 return nullptr; | 239 return nullptr; |
| 238 CPDF_Link link((CPDF_Dictionary*)pDict); | 240 CPDF_Link link(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 239 FPDF_DEST dest = link.GetDest(pDoc).GetObject(); | 241 FPDF_DEST dest = link.GetDest(pDoc).GetObject(); |
| 240 if (dest) | 242 if (dest) |
| 241 return dest; | 243 return dest; |
| 242 // If this link is not directly associated with a dest, we try to get action | 244 // If this link is not directly associated with a dest, we try to get action |
| 243 CPDF_Action action = link.GetAction(); | 245 CPDF_Action action = link.GetAction(); |
| 244 if (!action) | 246 if (!action) |
| 245 return nullptr; | 247 return nullptr; |
| 246 return action.GetDest(pDoc).GetObject(); | 248 return action.GetDest(pDoc).GetObject(); |
| 247 } | 249 } |
| 248 | 250 |
| 249 DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict) { | 251 DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict) { |
| 250 if (!pDict) | 252 if (!pDict) |
| 251 return nullptr; | 253 return nullptr; |
| 252 | 254 |
| 253 CPDF_Link link((CPDF_Dictionary*)pDict); | 255 CPDF_Link link(ToDictionary(static_cast<CPDF_Object*>(pDict))); |
| 254 return link.GetAction().GetDict(); | 256 return link.GetAction().GetDict(); |
| 255 } | 257 } |
| 256 | 258 |
| 257 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, | 259 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, |
| 258 int* startPos, | 260 int* startPos, |
| 259 FPDF_LINK* linkAnnot) { | 261 FPDF_LINK* linkAnnot) { |
| 260 if (!startPos || !linkAnnot) | 262 if (!startPos || !linkAnnot) |
| 261 return FALSE; | 263 return FALSE; |
| 262 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); | 264 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
| 263 if (!pPage || !pPage->m_pFormDict) | 265 if (!pPage || !pPage->m_pFormDict) |
| 264 return FALSE; | 266 return FALSE; |
| 265 CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots"); | 267 CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots"); |
| 266 if (!pAnnots) | 268 if (!pAnnots) |
| 267 return FALSE; | 269 return FALSE; |
| 268 for (int i = *startPos; i < (int)pAnnots->GetCount(); i++) { | 270 for (int i = *startPos; i < (int)pAnnots->GetCount(); i++) { |
| 269 CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i); | 271 CPDF_Dictionary* pDict = |
| 270 if (!pDict || pDict->GetType() != PDFOBJ_DICTIONARY) | 272 ToDictionary(static_cast<CPDF_Object*>(pAnnots->GetElementValue(i))); |
| 273 if (!pDict) |
| 271 continue; | 274 continue; |
| 272 if (pDict->GetString(FX_BSTRC("Subtype")).Equal(FX_BSTRC("Link"))) { | 275 if (pDict->GetString(FX_BSTRC("Subtype")).Equal(FX_BSTRC("Link"))) { |
| 273 *startPos = i + 1; | 276 *startPos = i + 1; |
| 274 *linkAnnot = (FPDF_LINK)pDict; | 277 *linkAnnot = (FPDF_LINK)pDict; |
| 275 return TRUE; | 278 return TRUE; |
| 276 } | 279 } |
| 277 } | 280 } |
| 278 return FALSE; | 281 return FALSE; |
| 279 } | 282 } |
| 280 | 283 |
| 281 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, | 284 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, |
| 282 FS_RECTF* rect) { | 285 FS_RECTF* rect) { |
| 283 if (!linkAnnot || !rect) | 286 if (!linkAnnot || !rect) |
| 284 return FALSE; | 287 return FALSE; |
| 285 CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot; | 288 CPDF_Dictionary* pAnnotDict = |
| 289 ToDictionary(static_cast<CPDF_Object*>(linkAnnot)); |
| 286 CPDF_Rect rt = pAnnotDict->GetRect(FX_BSTRC("Rect")); | 290 CPDF_Rect rt = pAnnotDict->GetRect(FX_BSTRC("Rect")); |
| 287 rect->left = rt.left; | 291 rect->left = rt.left; |
| 288 rect->bottom = rt.bottom; | 292 rect->bottom = rt.bottom; |
| 289 rect->right = rt.right; | 293 rect->right = rt.right; |
| 290 rect->top = rt.top; | 294 rect->top = rt.top; |
| 291 return TRUE; | 295 return TRUE; |
| 292 } | 296 } |
| 293 | 297 |
| 294 DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot) { | 298 DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot) { |
| 295 if (!linkAnnot) | 299 if (!linkAnnot) |
| 296 return 0; | 300 return 0; |
| 297 CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot; | 301 CPDF_Dictionary* pAnnotDict = |
| 302 ToDictionary(static_cast<CPDF_Object*>(linkAnnot)); |
| 298 CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints")); | 303 CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints")); |
| 299 if (!pArray) | 304 if (!pArray) |
| 300 return 0; | 305 return 0; |
| 301 return pArray->GetCount() / 8; | 306 return pArray->GetCount() / 8; |
| 302 } | 307 } |
| 303 | 308 |
| 304 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, | 309 DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, |
| 305 int quadIndex, | 310 int quadIndex, |
| 306 FS_QUADPOINTSF* quadPoints) { | 311 FS_QUADPOINTSF* quadPoints) { |
| 307 if (!linkAnnot || !quadPoints) | 312 if (!linkAnnot || !quadPoints) |
| 308 return FALSE; | 313 return FALSE; |
| 309 CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot; | 314 CPDF_Dictionary* pAnnotDict = |
| 315 ToDictionary(static_cast<CPDF_Object*>(linkAnnot)); |
| 310 CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints")); | 316 CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints")); |
| 311 if (pArray) { | 317 if (pArray) { |
| 312 if (quadIndex < 0 || quadIndex >= (int)pArray->GetCount() / 8 || | 318 if (quadIndex < 0 || quadIndex >= (int)pArray->GetCount() / 8 || |
| 313 ((quadIndex * 8 + 7) >= (int)pArray->GetCount())) | 319 ((quadIndex * 8 + 7) >= (int)pArray->GetCount())) |
| 314 return FALSE; | 320 return FALSE; |
| 315 quadPoints->x1 = pArray->GetNumber(quadIndex * 8); | 321 quadPoints->x1 = pArray->GetNumber(quadIndex * 8); |
| 316 quadPoints->y1 = pArray->GetNumber(quadIndex * 8 + 1); | 322 quadPoints->y1 = pArray->GetNumber(quadIndex * 8 + 1); |
| 317 quadPoints->x2 = pArray->GetNumber(quadIndex * 8 + 2); | 323 quadPoints->x2 = pArray->GetNumber(quadIndex * 8 + 2); |
| 318 quadPoints->y2 = pArray->GetNumber(quadIndex * 8 + 3); | 324 quadPoints->y2 = pArray->GetNumber(quadIndex * 8 + 3); |
| 319 quadPoints->x3 = pArray->GetNumber(quadIndex * 8 + 4); | 325 quadPoints->x3 = pArray->GetNumber(quadIndex * 8 + 4); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 339 return 0; | 345 return 0; |
| 340 CFX_WideString text = pInfo->GetUnicodeText(tag); | 346 CFX_WideString text = pInfo->GetUnicodeText(tag); |
| 341 // Use UTF-16LE encoding | 347 // Use UTF-16LE encoding |
| 342 CFX_ByteString encodedText = text.UTF16LE_Encode(); | 348 CFX_ByteString encodedText = text.UTF16LE_Encode(); |
| 343 unsigned long len = encodedText.GetLength(); | 349 unsigned long len = encodedText.GetLength(); |
| 344 if (buffer && buflen >= len) { | 350 if (buffer && buflen >= len) { |
| 345 FXSYS_memcpy(buffer, encodedText.c_str(), len); | 351 FXSYS_memcpy(buffer, encodedText.c_str(), len); |
| 346 } | 352 } |
| 347 return len; | 353 return len; |
| 348 } | 354 } |
| OLD | NEW |