diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-11-24 09:50:51 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-11-24 09:50:51 -0800 |
commit | 50d12ada784ad3ba3f9ed6935d59f1ce828695e5 (patch) | |
tree | 27caed4654213e5433256147a7c6b1b085692a32 /fpdfsdk/src/javascript/Document.cpp | |
parent | a2167107bbcef6a3e3687d49a5b1e62503391316 (diff) | |
download | pdfium-50d12ada784ad3ba3f9ed6935d59f1ce828695e5.tar.xz |
Introduce "underlying types" to abstract XFA differences.
See the comment in fsdk_define.h. Also tidy up a bit,
and remove dead DeletePages(). This should help us
match master more closely (given corresponding changes
on the master side).
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1473503002 .
Diffstat (limited to 'fpdfsdk/src/javascript/Document.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/Document.cpp | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 003820aec1..1fa88f9b12 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -536,7 +536,7 @@ FX_BOOL Document::removeField(IJS_Context* cc, CFX_RectArray aRefresh; aRefresh.Add(rcAnnot); - CPDFXFA_Page* pPage = pWidget->GetPDFXFAPage(); + UnderlyingPageType* pPage = pWidget->GetUnderlyingPage(); ASSERT(pPage); CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage); @@ -779,8 +779,7 @@ FX_BOOL Document::mailDoc(IJS_Context* cc, FX_BOOL Document::author(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - CPDF_Dictionary* pDictionary = - m_pDocument->GetDocument()->GetPDFDoc()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -802,8 +801,7 @@ FX_BOOL Document::author(IJS_Context* cc, FX_BOOL Document::info(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - CPDF_Dictionary* pDictionary = - m_pDocument->GetDocument()->GetPDFDoc()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -860,8 +858,7 @@ FX_BOOL Document::info(IJS_Context* cc, FX_BOOL Document::creationDate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - CPDF_Dictionary* pDictionary = - m_pDocument->GetDocument()->GetPDFDoc()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -882,8 +879,7 @@ FX_BOOL Document::creationDate(IJS_Context* cc, FX_BOOL Document::creator(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - CPDF_Dictionary* pDictionary = - m_pDocument->GetDocument()->GetPDFDoc()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -939,8 +935,7 @@ FX_BOOL Document::delay(IJS_Context* cc, FX_BOOL Document::keywords(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - CPDF_Dictionary* pDictionary = - m_pDocument->GetDocument()->GetPDFDoc()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -961,8 +956,7 @@ FX_BOOL Document::keywords(IJS_Context* cc, FX_BOOL Document::modDate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - CPDF_Dictionary* pDictionary = - m_pDocument->GetDocument()->GetPDFDoc()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -983,8 +977,7 @@ FX_BOOL Document::modDate(IJS_Context* cc, FX_BOOL Document::producer(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - CPDF_Dictionary* pDictionary = - m_pDocument->GetDocument()->GetPDFDoc()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -1005,8 +998,7 @@ FX_BOOL Document::producer(IJS_Context* cc, FX_BOOL Document::subject(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - CPDF_Dictionary* pDictionary = - m_pDocument->GetDocument()->GetPDFDoc()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -1027,11 +1019,10 @@ FX_BOOL Document::subject(IJS_Context* cc, FX_BOOL Document::title(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (m_pDocument == NULL || m_pDocument->GetDocument() == NULL) + if (!m_pDocument || !m_pDocument->GetUnderlyingDocument()) return FALSE; - CPDF_Dictionary* pDictionary = - m_pDocument->GetDocument()->GetPDFDoc()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -1521,7 +1512,7 @@ FX_BOOL Document::getPageNthWord(IJS_Context* cc, int nWordNo = params.size() > 1 ? params[1].ToInt() : 0; bool bStrip = params.size() > 2 ? params[2].ToBool() : true; - CPDF_Document* pDocument = m_pDocument->GetDocument()->GetPDFDoc(); + CPDF_Document* pDocument = m_pDocument->GetPDFDocument(); if (!pDocument) return FALSE; @@ -1593,7 +1584,7 @@ FX_BOOL Document::getPageNumWords(IJS_Context* cc, int nPageNo = params.size() > 0 ? params[0].ToInt() : 0; - CPDF_Document* pDocument = m_pDocument->GetDocument()->GetPDFDoc(); + CPDF_Document* pDocument = m_pDocument->GetPDFDocument(); ASSERT(pDocument != NULL); CJS_Context* pContext = static_cast<CJS_Context*>(cc); |