From 69ceb6a9761b3ccb228a2405e9a493a3666e0601 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 21 Oct 2015 15:55:42 -0700 Subject: More master side changes for convergence with XFA. - Add new CPDFSDK_Document::GetPDFDocument() - FPDFDocumentFromCPDFDocument() to match XFA - rename some JS variables to be consistent with XFA - remove unused param from CJS_GlobalData(). - kill dead code used XFA only. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1413883005 . --- fpdfsdk/src/javascript/Document.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'fpdfsdk/src/javascript/Document.cpp') diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 8908dfb664..4c7e1910cb 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -785,9 +785,7 @@ FX_BOOL Document::mailDoc(IJS_Context* cc, FX_BOOL Document::author(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - ASSERT(m_pDocument != NULL); - - CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -809,9 +807,7 @@ FX_BOOL Document::author(IJS_Context* cc, FX_BOOL Document::info(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - ASSERT(m_pDocument != NULL); - - CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -868,7 +864,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()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -889,7 +885,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()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -945,7 +941,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()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -966,7 +962,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()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -987,7 +983,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()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -1008,7 +1004,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()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -1029,10 +1025,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 == NULL || m_pDocument->GetPDFDocument() == NULL) return FALSE; - CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo(); + CPDF_Dictionary* pDictionary = m_pDocument->GetPDFDocument()->GetInfo(); if (!pDictionary) return FALSE; @@ -1522,7 +1518,7 @@ FX_BOOL Document::getPageNthWord(IJS_Context* cc, int nWordNo = params.GetSize() > 1 ? params[1].ToInt() : 0; bool bStrip = params.GetSize() > 2 ? params[2].ToBool() : true; - CPDF_Document* pDocument = m_pDocument->GetDocument(); + CPDF_Document* pDocument = m_pDocument->GetPDFDocument(); if (!pDocument) return FALSE; @@ -1594,7 +1590,7 @@ FX_BOOL Document::getPageNumWords(IJS_Context* cc, int nPageNo = params.GetSize() > 0 ? params[0].ToInt() : 0; - CPDF_Document* pDocument = m_pDocument->GetDocument(); + CPDF_Document* pDocument = m_pDocument->GetPDFDocument(); ASSERT(pDocument != NULL); CJS_Context* pContext = static_cast(cc); -- cgit v1.2.3