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

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

Issue 1194933003: Make CPDF_Object::GetString() a virtual method. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 5 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
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 "../../third_party/base/nonstd_unique_ptr.h" 7 #include "../../third_party/base/nonstd_unique_ptr.h"
8 #include "../include/fsdk_define.h" 8 #include "../include/fsdk_define.h"
9 #include "../include/fsdk_mgr.h" 9 #include "../include/fsdk_mgr.h"
10 #include "../include/fsdk_baseannot.h" 10 #include "../include/fsdk_baseannot.h"
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 } 589 }
590 if (pControl->HasMKEntry("IX")) 590 if (pControl->HasMKEntry("IX"))
591 { 591 {
592 pDownIcon = pControl->GetDownIcon(); 592 pDownIcon = pControl->GetDownIcon();
593 } 593 }
594 594
595 if (pNormalIcon) 595 if (pNormalIcon)
596 { 596 {
597 if (CPDF_Dictionary* pImageDict = pNormalIcon->GetDict()) 597 if (CPDF_Dictionary* pImageDict = pNormalIcon->GetDict())
598 { 598 {
599 » » » if (pImageDict->GetString("Name").IsEmpty()) 599 » » » if (pImageDict->GetStringAt("Name").IsEmpty())
600 pImageDict->SetAtString("Name", "ImgA"); 600 pImageDict->SetAtString("Name", "ImgA");
601 } 601 }
602 } 602 }
603 603
604 if (pRolloverIcon) 604 if (pRolloverIcon)
605 { 605 {
606 if (CPDF_Dictionary* pImageDict = pRolloverIcon->GetDict()) 606 if (CPDF_Dictionary* pImageDict = pRolloverIcon->GetDict())
607 { 607 {
608 » » » if (pImageDict->GetString("Name").IsEmpty()) 608 » » » if (pImageDict->GetStringAt("Name").IsEmpty())
609 pImageDict->SetAtString("Name", "ImgB"); 609 pImageDict->SetAtString("Name", "ImgB");
610 } 610 }
611 } 611 }
612 612
613 if (pDownIcon) 613 if (pDownIcon)
614 { 614 {
615 if (CPDF_Dictionary* pImageDict = pDownIcon->GetDict()) 615 if (CPDF_Dictionary* pImageDict = pDownIcon->GetDict())
616 { 616 {
617 » » » if (pImageDict->GetString("Name").IsEmpty()) 617 » » » if (pImageDict->GetStringAt("Name").IsEmpty())
618 pImageDict->SetAtString("Name", "ImgC"); 618 pImageDict->SetAtString("Name", "ImgC");
619 } 619 }
620 } 620 }
621 621
622 CPDF_IconFit iconFit = pControl->GetIconFit(); 622 CPDF_IconFit iconFit = pControl->GetIconFit();
623 623
624 CPDFSDK_Document* pDoc = m_pInterForm->GetDocument(); 624 CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
625 ASSERT(pDoc != NULL); 625 ASSERT(pDoc != NULL);
626 CPDFDoc_Environment* pEnv = pDoc->GetEnv(); 626 CPDFDoc_Environment* pEnv = pDoc->GetEnv();
627 627
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 CPDF_Stream* pStream = pAPDict->GetStream(sAPType); 1520 CPDF_Stream* pStream = pAPDict->GetStream(sAPType);
1521 ASSERT(pStream != NULL); 1521 ASSERT(pStream != NULL);
1522 1522
1523 CPDF_Dictionary* pStreamDict = pStream->GetDict(); 1523 CPDF_Dictionary* pStreamDict = pStream->GetDict();
1524 ASSERT(pStreamDict != NULL); 1524 ASSERT(pStreamDict != NULL);
1525 1525
1526 CFX_ByteString sImageAlias = "IMG"; 1526 CFX_ByteString sImageAlias = "IMG";
1527 1527
1528 if (CPDF_Dictionary* pImageDict = pImage->GetDict()) 1528 if (CPDF_Dictionary* pImageDict = pImage->GetDict())
1529 { 1529 {
1530 » » sImageAlias = pImageDict->GetString("Name"); 1530 » » sImageAlias = pImageDict->GetStringAt("Name");
1531 if (sImageAlias.IsEmpty()) 1531 if (sImageAlias.IsEmpty())
1532 sImageAlias = "IMG"; 1532 sImageAlias = "IMG";
1533 } 1533 }
1534 1534
1535 CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources"); 1535 CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
1536 if (!pStreamResList) 1536 if (!pStreamResList)
1537 { 1537 {
1538 pStreamResList = new CPDF_Dictionary(); 1538 pStreamResList = new CPDF_Dictionary();
1539 pStreamDict->SetAt("Resources", pStreamResList); 1539 pStreamDict->SetAt("Resources", pStreamResList);
1540 } 1540 }
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 2278
2279 CFX_ByteTextBuf fdfEncodedData; 2279 CFX_ByteTextBuf fdfEncodedData;
2280 2280
2281 for (FX_DWORD i = 0; i < pFields->GetCount(); i ++) 2281 for (FX_DWORD i = 0; i < pFields->GetCount(); i ++)
2282 { 2282 {
2283 CPDF_Dictionary* pField = pFields->GetDict(i); 2283 CPDF_Dictionary* pField = pFields->GetDict(i);
2284 if (pField == NULL) continue; 2284 if (pField == NULL) continue;
2285 CFX_WideString name; 2285 CFX_WideString name;
2286 name = pField->GetUnicodeText("T"); 2286 name = pField->GetUnicodeText("T");
2287 CFX_ByteString name_b = CFX_ByteString::FromUnicode(name ); 2287 CFX_ByteString name_b = CFX_ByteString::FromUnicode(name );
2288 » » » CFX_ByteString csBValue = pField->GetString("V"); 2288 » » » CFX_ByteString csBValue = pField->GetStringAt("V");
2289 CFX_WideString csWValue = PDF_DecodeText(csBValue); 2289 CFX_WideString csWValue = PDF_DecodeText(csBValue);
2290 CFX_ByteString csValue_b = CFX_ByteString::FromUnicode(c sWValue); 2290 CFX_ByteString csValue_b = CFX_ByteString::FromUnicode(c sWValue);
2291 2291
2292 fdfEncodedData = fdfEncodedData<<name_b.GetBuffer(name_b .GetLength()); 2292 fdfEncodedData = fdfEncodedData<<name_b.GetBuffer(name_b .GetLength());
2293 name_b.ReleaseBuffer(); 2293 name_b.ReleaseBuffer();
2294 fdfEncodedData = fdfEncodedData<<"="; 2294 fdfEncodedData = fdfEncodedData<<"=";
2295 fdfEncodedData = fdfEncodedData<<csValue_b.GetBuffer(csV alue_b.GetLength()); 2295 fdfEncodedData = fdfEncodedData<<csValue_b.GetBuffer(csV alue_b.GetLength());
2296 csValue_b.ReleaseBuffer(); 2296 csValue_b.ReleaseBuffer();
2297 if(i != pFields->GetCount()-1) 2297 if(i != pFields->GetCount()-1)
2298 fdfEncodedData = fdfEncodedData<<"&"; 2298 fdfEncodedData = fdfEncodedData<<"&";
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2612 m_sType(sType), 2612 m_sType(sType),
2613 m_sSubType(sSubType), 2613 m_sSubType(sSubType),
2614 m_nTabs(BAI_STRUCTURE) 2614 m_nTabs(BAI_STRUCTURE)
2615 { 2615 {
2616 ASSERT(m_pPageView != NULL); 2616 ASSERT(m_pPageView != NULL);
2617 2617
2618 CPDF_Page* pPDFPage = m_pPageView->GetPDFPage(); 2618 CPDF_Page* pPDFPage = m_pPageView->GetPDFPage();
2619 ASSERT(pPDFPage != NULL); 2619 ASSERT(pPDFPage != NULL);
2620 ASSERT(pPDFPage->m_pFormDict != NULL); 2620 ASSERT(pPDFPage->m_pFormDict != NULL);
2621 2621
2622 » CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetString("Tabs"); 2622 » CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetStringAt("Tabs");
2623 2623
2624 if (sTabs == "R") 2624 if (sTabs == "R")
2625 { 2625 {
2626 m_nTabs = BAI_ROW; 2626 m_nTabs = BAI_ROW;
2627 } 2627 }
2628 else if (sTabs == "C") 2628 else if (sTabs == "C")
2629 { 2629 {
2630 m_nTabs = BAI_COLUMN; 2630 m_nTabs = BAI_COLUMN;
2631 } 2631 }
2632 else 2632 else
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
2935 2935
2936 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); 2936 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
2937 ASSERT(pPDFAnnot != NULL); 2937 ASSERT(pPDFAnnot != NULL);
2938 2938
2939 CPDF_Rect rcAnnot; 2939 CPDF_Rect rcAnnot;
2940 pPDFAnnot->GetRect(rcAnnot); 2940 pPDFAnnot->GetRect(rcAnnot);
2941 2941
2942 return rcAnnot; 2942 return rcAnnot;
2943 } 2943 }
2944 2944
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698