Chromium Code Reviews| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "fpdfsdk/include/fsdk_mgr.h" | 10 #include "fpdfsdk/include/fsdk_mgr.h" |
| 11 | 11 |
| 12 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" | 12 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" |
| 13 #include "fpdfsdk/include/fsdk_define.h" | 13 #include "fpdfsdk/include/fsdk_define.h" |
| 14 #include "fpdfsdk/include/javascript/IJavaScript.h" | 14 #include "fpdfsdk/include/javascript/IJavaScript.h" |
| 15 #include "public/fpdf_ext.h" | 15 #include "public/fpdf_ext.h" |
| 16 #include "third_party/base/stl_util.h" | 16 #include "third_party/base/stl_util.h" |
| 17 | 17 |
| 18 #if _FX_OS_ == _FX_ANDROID_ | 18 #if _FX_OS_ == _FX_ANDROID_ |
| 19 #include "time.h" | 19 #include "time.h" |
| 20 #else | 20 #else |
| 21 #include <ctime> | 21 #include <ctime> |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 namespace { | |
| 25 | |
| 26 int CharSet2CP(int charset) { | |
| 27 if (charset == 128) | |
| 28 return 932; | |
| 29 if (charset == 134) | |
| 30 return 936; | |
| 31 if (charset == 129) | |
| 32 return 949; | |
| 33 if (charset == 136) | |
| 34 return 950; | |
| 35 return 0; | |
| 36 } | |
| 37 | |
| 38 } // namespace | |
| 39 | |
| 40 FPDF_WIDESTRING AsFPDFWideString(CFX_ByteString* bsUTF16LE) { | |
| 41 return reinterpret_cast<FPDF_WIDESTRING>( | |
| 42 bsUTF16LE->GetBuffer(bsUTF16LE->GetLength())); | |
| 43 } | |
| 44 | |
| 24 class CFX_SystemHandler : public IFX_SystemHandler { | 45 class CFX_SystemHandler : public IFX_SystemHandler { |
| 25 public: | 46 public: |
| 26 explicit CFX_SystemHandler(CPDFDoc_Environment* pEnv) | 47 explicit CFX_SystemHandler(CPDFDoc_Environment* pEnv) |
| 27 : m_pEnv(pEnv), m_nCharSet(-1) {} | 48 : m_pEnv(pEnv), m_nCharSet(-1) {} |
| 28 ~CFX_SystemHandler() override {} | 49 ~CFX_SystemHandler() override {} |
| 29 | 50 |
| 30 public: | 51 public: |
| 31 // IFX_SystemHandler | 52 // IFX_SystemHandler |
| 32 void InvalidateRect(FX_HWND hWnd, FX_RECT rect) override; | 53 void InvalidateRect(FX_HWND hWnd, FX_RECT rect) override; |
| 33 void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect) override; | 54 void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect) override; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 } | 176 } |
| 156 | 177 |
| 157 for (int i = 0; i < nSize; ++i) { | 178 for (int i = 0; i < nSize; ++i) { |
| 158 if (pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName)) | 179 if (pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName)) |
| 159 return TRUE; | 180 return TRUE; |
| 160 } | 181 } |
| 161 | 182 |
| 162 return FALSE; | 183 return FALSE; |
| 163 } | 184 } |
| 164 | 185 |
| 165 static int CharSet2CP(int charset) { | |
| 166 if (charset == 128) | |
| 167 return 932; | |
| 168 if (charset == 134) | |
| 169 return 936; | |
| 170 if (charset == 129) | |
| 171 return 949; | |
| 172 if (charset == 136) | |
| 173 return 950; | |
| 174 return 0; | |
| 175 } | |
| 176 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( | 186 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( |
| 177 CPDF_Document* pDoc, | 187 CPDF_Document* pDoc, |
| 178 CFX_ByteString sFontFaceName, | 188 CFX_ByteString sFontFaceName, |
| 179 uint8_t nCharset) { | 189 uint8_t nCharset) { |
| 180 if (pDoc) { | 190 if (pDoc) { |
| 181 CFX_Font* pFXFont = new CFX_Font(); | 191 CFX_Font* pFXFont = new CFX_Font(); |
| 182 pFXFont->LoadSubst(sFontFaceName, TRUE, 0, 0, 0, CharSet2CP(nCharset), | 192 pFXFont->LoadSubst(sFontFaceName, TRUE, 0, 0, 0, CharSet2CP(nCharset), |
| 183 FALSE); | 193 FALSE); |
| 184 CPDF_Font* pFont = pDoc->AddFont(pFXFont, nCharset, FALSE); | 194 CPDF_Font* pFont = pDoc->AddFont(pFXFont, nCharset, FALSE); |
| 185 delete pFXFont; | 195 delete pFXFont; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 207 m_pSysHandler.reset(new CFX_SystemHandler(this)); | 217 m_pSysHandler.reset(new CFX_SystemHandler(this)); |
| 208 } | 218 } |
| 209 | 219 |
| 210 CPDFDoc_Environment::~CPDFDoc_Environment() { | 220 CPDFDoc_Environment::~CPDFDoc_Environment() { |
| 211 } | 221 } |
| 212 | 222 |
| 213 int CPDFDoc_Environment::JS_appAlert(const FX_WCHAR* Msg, | 223 int CPDFDoc_Environment::JS_appAlert(const FX_WCHAR* Msg, |
| 214 const FX_WCHAR* Title, | 224 const FX_WCHAR* Title, |
| 215 FX_UINT Type, | 225 FX_UINT Type, |
| 216 FX_UINT Icon) { | 226 FX_UINT Icon) { |
| 217 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_alert) { | 227 if (!m_pInfo || !m_pInfo->m_pJsPlatform || |
| 218 CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode(); | 228 !m_pInfo->m_pJsPlatform->app_alert) { |
| 219 CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_Encode(); | 229 return -1; |
| 220 FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength()); | |
| 221 FPDF_WIDESTRING pTitle = | |
| 222 (FPDF_WIDESTRING)bsTitle.GetBuffer(bsTitle.GetLength()); | |
| 223 int ret = m_pInfo->m_pJsPlatform->app_alert(m_pInfo->m_pJsPlatform, pMsg, | |
| 224 pTitle, Type, Icon); | |
| 225 bsMsg.ReleaseBuffer(); | |
| 226 bsTitle.ReleaseBuffer(); | |
| 227 return ret; | |
| 228 } | 230 } |
| 229 return -1; | 231 CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode(); |
| 232 CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_Encode(); | |
| 233 return m_pInfo->m_pJsPlatform->app_alert( | |
| 234 m_pInfo->m_pJsPlatform, AsFPDFWideString(&bsMsg), | |
| 235 AsFPDFWideString(&bsTitle), Type, Icon); | |
| 230 } | 236 } |
| 231 | 237 |
| 232 int CPDFDoc_Environment::JS_appResponse(const FX_WCHAR* Question, | 238 int CPDFDoc_Environment::JS_appResponse(const FX_WCHAR* Question, |
| 233 const FX_WCHAR* Title, | 239 const FX_WCHAR* Title, |
| 234 const FX_WCHAR* Default, | 240 const FX_WCHAR* Default, |
| 235 const FX_WCHAR* cLabel, | 241 const FX_WCHAR* cLabel, |
| 236 FPDF_BOOL bPassword, | 242 FPDF_BOOL bPassword, |
| 237 void* response, | 243 void* response, |
| 238 int length) { | 244 int length) { |
| 239 if (m_pInfo && m_pInfo->m_pJsPlatform && | 245 if (!m_pInfo || !m_pInfo->m_pJsPlatform || |
| 240 m_pInfo->m_pJsPlatform->app_response) { | 246 m_pInfo->m_pJsPlatform->app_response) { |
|
Lei Zhang
2016/02/01 23:22:09
Missing '!'
Tom Sepez
2016/02/01 23:38:13
yikes.
| |
| 241 CFX_ByteString bsQuestion = CFX_WideString(Question).UTF16LE_Encode(); | 247 return -1; |
| 242 CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_Encode(); | |
| 243 CFX_ByteString bsDefault = CFX_WideString(Default).UTF16LE_Encode(); | |
| 244 CFX_ByteString bsLabel = CFX_WideString(cLabel).UTF16LE_Encode(); | |
| 245 FPDF_WIDESTRING pQuestion = | |
| 246 (FPDF_WIDESTRING)bsQuestion.GetBuffer(bsQuestion.GetLength()); | |
| 247 FPDF_WIDESTRING pTitle = | |
| 248 (FPDF_WIDESTRING)bsTitle.GetBuffer(bsTitle.GetLength()); | |
| 249 FPDF_WIDESTRING pDefault = | |
| 250 (FPDF_WIDESTRING)bsDefault.GetBuffer(bsDefault.GetLength()); | |
| 251 FPDF_WIDESTRING pLabel = | |
| 252 (FPDF_WIDESTRING)bsLabel.GetBuffer(bsLabel.GetLength()); | |
| 253 int ret = m_pInfo->m_pJsPlatform->app_response( | |
| 254 m_pInfo->m_pJsPlatform, pQuestion, pTitle, pDefault, pLabel, bPassword, | |
| 255 response, length); | |
| 256 bsQuestion.ReleaseBuffer(); | |
| 257 bsTitle.ReleaseBuffer(); | |
| 258 bsDefault.ReleaseBuffer(); | |
| 259 bsLabel.ReleaseBuffer(); | |
| 260 return ret; | |
| 261 } | 248 } |
| 262 return -1; | 249 CFX_ByteString bsQuestion = CFX_WideString(Question).UTF16LE_Encode(); |
| 250 CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_Encode(); | |
| 251 CFX_ByteString bsDefault = CFX_WideString(Default).UTF16LE_Encode(); | |
| 252 CFX_ByteString bsLabel = CFX_WideString(cLabel).UTF16LE_Encode(); | |
| 253 return m_pInfo->m_pJsPlatform->app_response( | |
| 254 m_pInfo->m_pJsPlatform, AsFPDFWideString(&bsQuestion), | |
| 255 AsFPDFWideString(&bsTitle), AsFPDFWideString(&bsDefault), | |
| 256 AsFPDFWideString(&bsLabel), bPassword, response, length); | |
| 257 } | |
| 258 | |
| 259 void CPDFDoc_Environment::JS_appBeep(int nType) { | |
| 260 if (!m_pInfo || !m_pInfo->m_pJsPlatform || m_pInfo->m_pJsPlatform->app_beep) { | |
|
Lei Zhang
2016/02/01 23:22:09
Missing '!'
Tom Sepez
2016/02/01 23:38:13
Done.
| |
| 261 return; | |
| 262 } | |
| 263 m_pInfo->m_pJsPlatform->app_beep(m_pInfo->m_pJsPlatform, nType); | |
| 263 } | 264 } |
| 264 | 265 |
| 265 CFX_WideString CPDFDoc_Environment::JS_fieldBrowse() { | 266 CFX_WideString CPDFDoc_Environment::JS_fieldBrowse() { |
| 266 if (!m_pInfo || !m_pInfo->m_pJsPlatform || | 267 if (!m_pInfo || !m_pInfo->m_pJsPlatform || |
| 267 !m_pInfo->m_pJsPlatform->Field_browse) { | 268 !m_pInfo->m_pJsPlatform->Field_browse) { |
| 268 return L""; | 269 return CFX_WideString(); |
| 269 } | 270 } |
| 270 | |
| 271 const int nRequiredLen = | 271 const int nRequiredLen = |
| 272 m_pInfo->m_pJsPlatform->Field_browse(m_pInfo->m_pJsPlatform, nullptr, 0); | 272 m_pInfo->m_pJsPlatform->Field_browse(m_pInfo->m_pJsPlatform, nullptr, 0); |
| 273 if (nRequiredLen <= 0) | 273 if (nRequiredLen <= 0) |
| 274 return L""; | 274 return CFX_WideString(); |
| 275 | 275 |
| 276 std::unique_ptr<char[]> pBuff(new char[nRequiredLen]); | 276 std::unique_ptr<char[]> pBuff(new char[nRequiredLen]); |
| 277 memset(pBuff.get(), 0, nRequiredLen); | 277 memset(pBuff.get(), 0, nRequiredLen); |
| 278 const int nActualLen = m_pInfo->m_pJsPlatform->Field_browse( | 278 const int nActualLen = m_pInfo->m_pJsPlatform->Field_browse( |
| 279 m_pInfo->m_pJsPlatform, pBuff.get(), nRequiredLen); | 279 m_pInfo->m_pJsPlatform, pBuff.get(), nRequiredLen); |
| 280 if (nActualLen <= 0 || nActualLen > nRequiredLen) | 280 if (nActualLen <= 0 || nActualLen > nRequiredLen) |
| 281 return L""; | 281 return CFX_WideString(); |
| 282 | 282 |
| 283 CFX_ByteString bsRet = CFX_ByteString(pBuff.get(), nActualLen); | 283 return CFX_WideString::FromLocal(CFX_ByteString(pBuff.get(), nActualLen)); |
| 284 CFX_WideString wsRet = CFX_WideString::FromLocal(bsRet); | |
| 285 return wsRet; | |
| 286 } | 284 } |
| 287 | 285 |
| 288 CFX_WideString CPDFDoc_Environment::JS_docGetFilePath() { | 286 CFX_WideString CPDFDoc_Environment::JS_docGetFilePath() { |
| 289 if (!m_pInfo || !m_pInfo->m_pJsPlatform || | 287 if (!m_pInfo || !m_pInfo->m_pJsPlatform || |
| 290 !m_pInfo->m_pJsPlatform->Doc_getFilePath) { | 288 !m_pInfo->m_pJsPlatform->Doc_getFilePath) { |
| 291 return L""; | 289 return CFX_WideString(); |
| 292 } | 290 } |
| 293 | |
| 294 const int nRequiredLen = m_pInfo->m_pJsPlatform->Doc_getFilePath( | 291 const int nRequiredLen = m_pInfo->m_pJsPlatform->Doc_getFilePath( |
| 295 m_pInfo->m_pJsPlatform, nullptr, 0); | 292 m_pInfo->m_pJsPlatform, nullptr, 0); |
| 296 if (nRequiredLen <= 0) | 293 if (nRequiredLen <= 0) |
| 297 return L""; | 294 return CFX_WideString(); |
| 298 | 295 |
| 299 std::unique_ptr<char[]> pBuff(new char[nRequiredLen]); | 296 std::unique_ptr<char[]> pBuff(new char[nRequiredLen]); |
| 300 memset(pBuff.get(), 0, nRequiredLen); | 297 memset(pBuff.get(), 0, nRequiredLen); |
| 301 const int nActualLen = m_pInfo->m_pJsPlatform->Doc_getFilePath( | 298 const int nActualLen = m_pInfo->m_pJsPlatform->Doc_getFilePath( |
| 302 m_pInfo->m_pJsPlatform, pBuff.get(), nRequiredLen); | 299 m_pInfo->m_pJsPlatform, pBuff.get(), nRequiredLen); |
| 303 if (nActualLen <= 0 || nActualLen > nRequiredLen) | 300 if (nActualLen <= 0 || nActualLen > nRequiredLen) |
| 304 return L""; | 301 return CFX_WideString(); |
| 305 | 302 |
| 306 CFX_ByteString bsRet = CFX_ByteString(pBuff.get(), nActualLen); | 303 return CFX_WideString::FromLocal(CFX_ByteString(pBuff.get(), nActualLen)); |
| 307 CFX_WideString wsRet = CFX_WideString::FromLocal(bsRet); | |
| 308 return wsRet; | |
| 309 } | 304 } |
| 310 | 305 |
| 311 void CPDFDoc_Environment::JS_docSubmitForm(void* formData, | 306 void CPDFDoc_Environment::JS_docSubmitForm(void* formData, |
| 312 int length, | 307 int length, |
| 313 const FX_WCHAR* URL) { | 308 const FX_WCHAR* URL) { |
| 314 if (m_pInfo && m_pInfo->m_pJsPlatform && | 309 if (!m_pInfo || m_pInfo->m_pJsPlatform || |
|
Lei Zhang
2016/02/01 23:22:09
missing '!'
Tom Sepez
2016/02/01 23:38:13
Done.
| |
| 315 m_pInfo->m_pJsPlatform->Doc_submitForm) { | 310 !m_pInfo->m_pJsPlatform->Doc_submitForm) { |
| 316 CFX_ByteString bsDestination = CFX_WideString(URL).UTF16LE_Encode(); | 311 return; |
| 317 FPDF_WIDESTRING pDestination = | |
| 318 (FPDF_WIDESTRING)bsDestination.GetBuffer(bsDestination.GetLength()); | |
| 319 m_pInfo->m_pJsPlatform->Doc_submitForm(m_pInfo->m_pJsPlatform, formData, | |
| 320 length, pDestination); | |
| 321 bsDestination.ReleaseBuffer(); | |
| 322 } | 312 } |
| 313 CFX_ByteString bsDestination = CFX_WideString(URL).UTF16LE_Encode(); | |
| 314 m_pInfo->m_pJsPlatform->Doc_submitForm(m_pInfo->m_pJsPlatform, formData, | |
| 315 length, | |
| 316 AsFPDFWideString(&bsDestination)); | |
| 323 } | 317 } |
| 324 | 318 |
| 325 void CPDFDoc_Environment::JS_docmailForm(void* mailData, | 319 void CPDFDoc_Environment::JS_docmailForm(void* mailData, |
| 326 int length, | 320 int length, |
| 327 FPDF_BOOL bUI, | 321 FPDF_BOOL bUI, |
| 328 const FX_WCHAR* To, | 322 const FX_WCHAR* To, |
| 329 const FX_WCHAR* Subject, | 323 const FX_WCHAR* Subject, |
| 330 const FX_WCHAR* CC, | 324 const FX_WCHAR* CC, |
| 331 const FX_WCHAR* BCC, | 325 const FX_WCHAR* BCC, |
| 332 const FX_WCHAR* Msg) { | 326 const FX_WCHAR* Msg) { |
| 333 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_mail) { | 327 if (!m_pInfo || !m_pInfo->m_pJsPlatform || |
| 334 CFX_ByteString bsTo = CFX_WideString(To).UTF16LE_Encode(); | 328 !m_pInfo->m_pJsPlatform->Doc_mail) { |
| 335 CFX_ByteString bsSubject = CFX_WideString(Subject).UTF16LE_Encode(); | 329 return; |
| 336 CFX_ByteString bsCC = CFX_WideString(CC).UTF16LE_Encode(); | |
| 337 CFX_ByteString bsBcc = CFX_WideString(BCC).UTF16LE_Encode(); | |
| 338 CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode(); | |
| 339 FPDF_WIDESTRING pTo = (FPDF_WIDESTRING)bsTo.GetBuffer(bsTo.GetLength()); | |
| 340 FPDF_WIDESTRING pCC = (FPDF_WIDESTRING)bsCC.GetBuffer(bsCC.GetLength()); | |
| 341 FPDF_WIDESTRING pBcc = (FPDF_WIDESTRING)bsBcc.GetBuffer(bsBcc.GetLength()); | |
| 342 FPDF_WIDESTRING pSubject = | |
| 343 (FPDF_WIDESTRING)bsSubject.GetBuffer(bsSubject.GetLength()); | |
| 344 FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength()); | |
| 345 m_pInfo->m_pJsPlatform->Doc_mail(m_pInfo->m_pJsPlatform, mailData, length, | |
| 346 bUI, pTo, pSubject, pCC, pBcc, pMsg); | |
| 347 bsTo.ReleaseBuffer(); | |
| 348 bsCC.ReleaseBuffer(); | |
| 349 bsBcc.ReleaseBuffer(); | |
| 350 bsSubject.ReleaseBuffer(); | |
| 351 bsMsg.ReleaseBuffer(); | |
| 352 } | 330 } |
| 331 CFX_ByteString bsTo = CFX_WideString(To).UTF16LE_Encode(); | |
| 332 CFX_ByteString bsSubject = CFX_WideString(Subject).UTF16LE_Encode(); | |
| 333 CFX_ByteString bsCC = CFX_WideString(CC).UTF16LE_Encode(); | |
| 334 CFX_ByteString bsBcc = CFX_WideString(BCC).UTF16LE_Encode(); | |
| 335 CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode(); | |
| 336 m_pInfo->m_pJsPlatform->Doc_mail( | |
| 337 m_pInfo->m_pJsPlatform, mailData, length, bUI, AsFPDFWideString(&bsTo), | |
| 338 AsFPDFWideString(&bsSubject), AsFPDFWideString(&bsCC), | |
| 339 AsFPDFWideString(&bsBcc), AsFPDFWideString(&bsMsg)); | |
| 340 } | |
| 341 | |
| 342 void CPDFDoc_Environment::JS_docprint(FPDF_BOOL bUI, | |
| 343 int nStart, | |
| 344 int nEnd, | |
| 345 FPDF_BOOL bSilent, | |
| 346 FPDF_BOOL bShrinkToFit, | |
| 347 FPDF_BOOL bPrintAsImage, | |
| 348 FPDF_BOOL bReverse, | |
| 349 FPDF_BOOL bAnnotations) { | |
| 350 if (!m_pInfo || !m_pInfo->m_pJsPlatform || | |
| 351 !m_pInfo->m_pJsPlatform->Doc_print) { | |
| 352 return; | |
| 353 } | |
| 354 m_pInfo->m_pJsPlatform->Doc_print(m_pInfo->m_pJsPlatform, bUI, nStart, nEnd, | |
| 355 bSilent, bShrinkToFit, bPrintAsImage, | |
| 356 bReverse, bAnnotations); | |
| 357 } | |
| 358 | |
| 359 void CPDFDoc_Environment::JS_docgotoPage(int nPageNum) { | |
| 360 if (!m_pInfo || !m_pInfo->m_pJsPlatform || | |
| 361 !m_pInfo->m_pJsPlatform->Doc_gotoPage) { | |
| 362 return; | |
| 363 } | |
| 364 m_pInfo->m_pJsPlatform->Doc_gotoPage(m_pInfo->m_pJsPlatform, nPageNum); | |
| 353 } | 365 } |
| 354 | 366 |
| 355 IJS_Runtime* CPDFDoc_Environment::GetJSRuntime() { | 367 IJS_Runtime* CPDFDoc_Environment::GetJSRuntime() { |
| 356 if (!IsJSInitiated()) | 368 if (!IsJSInitiated()) |
| 357 return NULL; | 369 return NULL; |
| 358 if (!m_pJSRuntime) | 370 if (!m_pJSRuntime) |
| 359 m_pJSRuntime.reset(IJS_Runtime::Create(this)); | 371 m_pJSRuntime.reset(IJS_Runtime::Create(this)); |
| 360 return m_pJSRuntime.get(); | 372 return m_pJSRuntime.get(); |
| 361 } | 373 } |
| 362 | 374 |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 924 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 936 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
| 925 if (!pFocusAnnot) | 937 if (!pFocusAnnot) |
| 926 return nullptr; | 938 return nullptr; |
| 927 | 939 |
| 928 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 940 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
| 929 if (pAnnot == pFocusAnnot) | 941 if (pAnnot == pFocusAnnot) |
| 930 return pAnnot; | 942 return pAnnot; |
| 931 } | 943 } |
| 932 return nullptr; | 944 return nullptr; |
| 933 } | 945 } |
| OLD | NEW |