diff options
author | dsinclair <dsinclair@chromium.org> | 2016-09-14 06:11:08 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-14 06:11:08 -0700 |
commit | 89f8fa8694bbf209412845c250af48bbc539962b (patch) | |
tree | fa365a5f1a9c43e4d9d8851c36f04f14554ca07f /xfa/fxfa | |
parent | 2ca2da505ba75cd830539ffc98dfc482fd4daa41 (diff) | |
download | pdfium-89f8fa8694bbf209412845c250af48bbc539962b.tar.xz |
Remove unused code in CPDFXFA_Document
Remove methods that always just return without doing any work. Clean up the
IXFA_DocProvider interface calls for those methods and cleanup the callers
that were calling the methods.
Review-Url: https://codereview.chromium.org/2323523002
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/app/xfa_ffdoc.cpp | 54 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_ffsignature.cpp | 5 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_fftextedit.cpp | 16 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_fftextedit.h | 2 | ||||
-rw-r--r-- | xfa/fxfa/include/fxfa.h | 30 | ||||
-rw-r--r-- | xfa/fxfa/parser/cscript_hostpseudomodel.cpp | 14 | ||||
-rw-r--r-- | xfa/fxfa/parser/cscript_layoutpseudomodel.cpp | 95 | ||||
-rw-r--r-- | xfa/fxfa/parser/cscript_signaturepseudomodel.cpp | 68 |
8 files changed, 50 insertions, 234 deletions
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp index 4e69db4eea..1aed9c640e 100644 --- a/xfa/fxfa/app/xfa_ffdoc.cpp +++ b/xfa/fxfa/app/xfa_ffdoc.cpp @@ -235,60 +235,14 @@ void XFA_XPDPacket_MergeRootNode(CXFA_Node* pOriginRoot, CXFA_Node* pNewRoot) { } } } + int32_t CXFA_FFDoc::DoLoad(IFX_Pause* pPause) { int32_t iStatus = m_pDocumentParser->DoParse(pPause); - if (iStatus == XFA_PARSESTATUS_Done && !m_pPDFDoc) { - CXFA_Node* pPDFNode = ToNode( - m_pDocumentParser->GetDocument()->GetXFAObject(XFA_HASHCODE_Pdf)); - if (!pPDFNode) { - return XFA_PARSESTATUS_SyntaxErr; - } - CFDE_XMLNode* pPDFXML = pPDFNode->GetXMLMappingNode(); - if (pPDFXML->GetType() != FDE_XMLNODE_Element) { - return XFA_PARSESTATUS_SyntaxErr; - } - int32_t iBufferSize = 0; - uint8_t* pByteBuffer = nullptr; - IFX_FileRead* pXFAReader = nullptr; - if (XFA_GetPDFContentsFromPDFXML(pPDFXML, pByteBuffer, iBufferSize)) { - pXFAReader = FX_CreateMemoryStream(pByteBuffer, iBufferSize, TRUE); - } else { - CFX_WideString wsHref; - static_cast<CFDE_XMLElement*>(pPDFXML)->GetString(L"href", wsHref); - if (!wsHref.IsEmpty()) { - pXFAReader = GetDocProvider()->OpenLinkedFile(this, wsHref); - } - } - if (!pXFAReader) - return XFA_PARSESTATUS_SyntaxErr; - - CPDF_Document* pPDFDocument = - GetDocProvider()->OpenPDF(this, pXFAReader, TRUE); - ASSERT(!m_pPDFDoc); - if (!OpenDoc(pPDFDocument)) - return XFA_PARSESTATUS_SyntaxErr; - - CXFA_Document* doc = m_pDocumentParser->GetDocument(); - std::unique_ptr<CXFA_SimpleParser> pParser( - new CXFA_SimpleParser(doc, true)); - if (!pParser) - return XFA_PARSESTATUS_SyntaxErr; - - CXFA_Node* pRootNode = nullptr; - if (pParser->StartParse(m_pStream, XFA_XDPPACKET_XDP) == - XFA_PARSESTATUS_Ready && - pParser->DoParse(nullptr) == XFA_PARSESTATUS_Done) { - pRootNode = pParser->GetRootNode(); - } - if (pRootNode && doc->GetRoot()) { - XFA_XPDPacket_MergeRootNode(doc->GetRoot(), pRootNode); - iStatus = XFA_PARSESTATUS_Done; - } else { - iStatus = XFA_PARSESTATUS_StatusErr; - } - } + if (iStatus == XFA_PARSESTATUS_Done && !m_pPDFDoc) + return XFA_PARSESTATUS_SyntaxErr; return iStatus; } + void CXFA_FFDoc::StopLoad() { m_pApp->GetXFAFontMgr()->LoadDocFonts(this); m_dwDocType = XFA_DOCTYPE_Static; diff --git a/xfa/fxfa/app/xfa_ffsignature.cpp b/xfa/fxfa/app/xfa_ffsignature.cpp index 695969274c..3d92f286b9 100644 --- a/xfa/fxfa/app/xfa_ffsignature.cpp +++ b/xfa/fxfa/app/xfa_ffsignature.cpp @@ -34,11 +34,8 @@ void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); RenderCaption(pGS, &mtRotate); DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); - CFX_RectF rtWidget = m_rtUI; - IXFA_DocProvider* pDocProvider = m_pDataAcc->GetDoc()->GetDocProvider(); - ASSERT(pDocProvider); - pDocProvider->RenderCustomWidget(this, pGS, &mtRotate, rtWidget); } + FX_BOOL CXFA_FFSignature::OnMouseEnter() { return FALSE; } diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp index 6df4507e22..bd92a45e4c 100644 --- a/xfa/fxfa/app/xfa_fftextedit.cpp +++ b/xfa/fxfa/app/xfa_fftextedit.cpp @@ -387,18 +387,9 @@ void CXFA_FFTextEdit::OnTextFull(IFWL_Widget* pWidget) { } FX_BOOL CXFA_FFTextEdit::CheckWord(const CFX_ByteStringC& sWord) { - if (sWord.IsEmpty() || m_pDataAcc->GetUIType() != XFA_Element::TextEdit) { + if (sWord.IsEmpty() || m_pDataAcc->GetUIType() != XFA_Element::TextEdit) return TRUE; - } - return GetDoc()->GetDocProvider()->CheckWord(GetDoc(), sWord); -} -FX_BOOL CXFA_FFTextEdit::GetSuggestWords( - const CFX_ByteStringC& sWord, - std::vector<CFX_ByteString>& sSuggest) { - if (m_pDataAcc->GetUIType() != XFA_Element::TextEdit) { - return FALSE; - } - return GetDoc()->GetDocProvider()->GetSuggestWords(GetDoc(), sWord, sSuggest); + return FALSE; } void CXFA_FFTextEdit::OnProcessMessage(CFWL_Message* pMessage) { @@ -426,8 +417,7 @@ void CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) { } case CFWL_EventType::GetSuggestedWords: { CFWL_EvtEdtGetSuggestWords* event = (CFWL_EvtEdtGetSuggestWords*)pEvent; - event->bSuggestWords = GetSuggestWords(event->bsWord.AsStringC(), - event->bsArraySuggestWords); + event->bSuggestWords = FALSE; break; } default: diff --git a/xfa/fxfa/app/xfa_fftextedit.h b/xfa/fxfa/app/xfa_fftextedit.h index c6d9c9c862..048008d700 100644 --- a/xfa/fxfa/app/xfa_fftextedit.h +++ b/xfa/fxfa/app/xfa_fftextedit.h @@ -52,8 +52,6 @@ class CXFA_FFTextEdit : public CXFA_FFField { const CFX_WideString& wsPrevText); void OnTextFull(IFWL_Widget* pWidget); FX_BOOL CheckWord(const CFX_ByteStringC& sWord); - FX_BOOL GetSuggestWords(const CFX_ByteStringC& sWord, - std::vector<CFX_ByteString>& sSuggest); protected: FX_BOOL CommitData() override; diff --git a/xfa/fxfa/include/fxfa.h b/xfa/fxfa/include/fxfa.h index f0c140452e..2ee19eee8a 100644 --- a/xfa/fxfa/include/fxfa.h +++ b/xfa/fxfa/include/fxfa.h @@ -315,10 +315,6 @@ class IXFA_DocProvider { CXFA_WidgetAcc* pWidgetData) = 0; virtual void WidgetPreRemove(CXFA_FFWidget* hWidget, CXFA_WidgetAcc* pWidgetData) = 0; - virtual FX_BOOL RenderCustomWidget(CXFA_FFWidget* hWidget, - CFX_Graphics* pGS, - CFX_Matrix* pMatrix, - const CFX_RectF& rtUI) = 0; virtual int32_t CountPages(CXFA_FFDoc* hDoc) = 0; virtual int32_t GetCurrentPage(CXFA_FFDoc* hDoc) = 0; @@ -330,8 +326,6 @@ class IXFA_DocProvider { virtual void ExportData(CXFA_FFDoc* hDoc, const CFX_WideString& wsFilePath, FX_BOOL bXDP = TRUE) = 0; - virtual void ImportData(CXFA_FFDoc* hDoc, - const CFX_WideString& wsFilePath) = 0; virtual void GotoURL(CXFA_FFDoc* hDoc, const CFX_WideString& bsURL, FX_BOOL bAppend = TRUE) = 0; @@ -342,31 +336,10 @@ class IXFA_DocProvider { int32_t nStartPage, int32_t nEndPage, uint32_t dwOptions) = 0; - virtual int32_t AbsPageCountInBatch(CXFA_FFDoc* hDoc) = 0; - virtual int32_t AbsPageInBatch(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) = 0; - virtual int32_t SheetCountInBatch(CXFA_FFDoc* hDoc) = 0; - virtual int32_t SheetInBatch(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) = 0; - virtual int32_t Verify(CXFA_FFDoc* hDoc, - CXFA_Node* pSigNode, - FX_BOOL bUsed = TRUE) = 0; - virtual FX_BOOL Sign(CXFA_FFDoc* hDoc, - CXFA_NodeList* pNodeList, - const CFX_WideStringC& wsExpression, - const CFX_WideStringC& wsXMLIdent, - const CFX_WideStringC& wsValue = FX_WSTRC(L"open"), - FX_BOOL bUsed = TRUE) = 0; - virtual CXFA_NodeList* Enumerate(CXFA_FFDoc* hDoc) = 0; - virtual FX_BOOL Clear(CXFA_FFDoc* hDoc, - CXFA_Node* pSigNode, - FX_BOOL bCleared = TRUE) = 0; virtual void GetURL(CXFA_FFDoc* hDoc, CFX_WideString& wsDocURL) = 0; virtual FX_ARGB GetHighlightColor(CXFA_FFDoc* hDoc) = 0; virtual FX_BOOL SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) = 0; - virtual FX_BOOL CheckWord(CXFA_FFDoc* hDoc, const CFX_ByteStringC& sWord) = 0; - virtual FX_BOOL GetSuggestWords(CXFA_FFDoc* hDoc, - const CFX_ByteStringC& sWord, - std::vector<CFX_ByteString>& sSuggest) = 0; virtual FX_BOOL GetPDFScriptObject(CXFA_FFDoc* hDoc, const CFX_ByteStringC& utf8Name, CFXJSE_Value* pValue) = 0; @@ -376,9 +349,6 @@ class IXFA_DocProvider { virtual FX_BOOL SetGlobalProperty(CXFA_FFDoc* hDoc, const CFX_ByteStringC& szPropName, CFXJSE_Value* pValue) = 0; - virtual CPDF_Document* OpenPDF(CXFA_FFDoc* hDoc, - IFX_FileRead* pFile, - FX_BOOL bTakeOverFile) = 0; virtual IFX_FileRead* OpenLinkedFile(CXFA_FFDoc* hDoc, const CFX_WideString& wsLink) = 0; }; diff --git a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp index 4448180436..cee99e8a3b 100644 --- a/xfa/fxfa/parser/cscript_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_hostpseudomodel.cpp @@ -628,24 +628,16 @@ void CScript_HostPseudoModel::Print(CFXJSE_Arguments* pArguments) { } pNotify->GetDocProvider()->Print(hDoc, nStartPage, nEndPage, dwOptions); } + void CScript_HostPseudoModel::ImportData(CFXJSE_Arguments* pArguments) { int32_t iLength = pArguments->GetLength(); if (iLength < 0 || iLength > 1) { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"importData"); return; } - CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); - if (!pNotify) { - return; - } - CFX_WideString wsFilePath; - if (iLength > 0) { - CFX_ByteString bsFilePath = pArguments->GetUTF8String(0); - wsFilePath = CFX_WideString::FromUTF8(bsFilePath.AsStringC()); - } - CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - pNotify->GetDocProvider()->ImportData(hDoc, wsFilePath); + // Not implemented. } + void CScript_HostPseudoModel::ExportData(CFXJSE_Arguments* pArguments) { int32_t iLength = pArguments->GetLength(); if (iLength < 0 || iLength > 2) { diff --git a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp index b8330ed909..7c451a96c0 100644 --- a/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_layoutpseudomodel.cpp @@ -45,6 +45,7 @@ void CScript_LayoutPseudoModel::Ready(CFXJSE_Value* pValue, int32_t iStatus = pNotify->GetLayoutStatus(); pValue->SetBoolean(iStatus >= 2); } + void CScript_LayoutPseudoModel::HWXY(CFXJSE_Arguments* pArguments, XFA_LAYOUTMODEL_HWXY layoutModel) { int32_t iLength = pArguments->GetLength(); @@ -125,18 +126,23 @@ void CScript_LayoutPseudoModel::HWXY(CFXJSE_Arguments* pArguments, if (pValue) pValue->SetFloat(fValue); } + void CScript_LayoutPseudoModel::H(CFXJSE_Arguments* pArguments) { HWXY(pArguments, XFA_LAYOUTMODEL_H); } + void CScript_LayoutPseudoModel::W(CFXJSE_Arguments* pArguments) { HWXY(pArguments, XFA_LAYOUTMODEL_W); } + void CScript_LayoutPseudoModel::X(CFXJSE_Arguments* pArguments) { HWXY(pArguments, XFA_LAYOUTMODEL_X); } + void CScript_LayoutPseudoModel::Y(CFXJSE_Arguments* pArguments) { HWXY(pArguments, XFA_LAYOUTMODEL_Y); } + void CScript_LayoutPseudoModel::NumberedPageCount(CFXJSE_Arguments* pArguments, FX_BOOL bNumbered) { CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); @@ -163,9 +169,11 @@ void CScript_LayoutPseudoModel::NumberedPageCount(CFXJSE_Arguments* pArguments, if (pValue) pValue->SetInteger(iPageCount); } + void CScript_LayoutPseudoModel::PageCount(CFXJSE_Arguments* pArguments) { NumberedPageCount(pArguments, TRUE); } + void CScript_LayoutPseudoModel::PageSpan(CFXJSE_Arguments* pArguments) { int32_t iLength = pArguments->GetLength(); if (iLength != 1) { @@ -195,9 +203,11 @@ void CScript_LayoutPseudoModel::PageSpan(CFXJSE_Arguments* pArguments) { if (pValue) pValue->SetInteger(iPageSpan); } + void CScript_LayoutPseudoModel::Page(CFXJSE_Arguments* pArguments) { PageImp(pArguments, FALSE); } + void CScript_LayoutPseudoModel::GetObjArray(CXFA_LayoutProcessor* pDocLayout, int32_t iPageNo, const CFX_WideString& wsType, @@ -329,6 +339,7 @@ void CScript_LayoutPseudoModel::GetObjArray(CXFA_LayoutProcessor* pDocLayout, return; } } + void CScript_LayoutPseudoModel::PageContent(CFXJSE_Arguments* pArguments) { int32_t iLength = pArguments->GetLength(); if (iLength < 1 || iLength > 3) { @@ -363,33 +374,25 @@ void CScript_LayoutPseudoModel::PageContent(CFXJSE_Arguments* pArguments) { pArguments->GetReturnValue()->SetObject( pArrayNodeList, m_pDocument->GetScriptContext()->GetJseNormalClass()); } + void CScript_LayoutPseudoModel::AbsPageCount(CFXJSE_Arguments* pArguments) { NumberedPageCount(pArguments, FALSE); } + void CScript_LayoutPseudoModel::AbsPageCountInBatch( CFXJSE_Arguments* pArguments) { - CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); - if (!pNotify) { - return; - } - CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - int32_t iPageCount = pNotify->GetDocProvider()->AbsPageCountInBatch(hDoc); CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetInteger(iPageCount); + pValue->SetInteger(0); } + void CScript_LayoutPseudoModel::SheetCountInBatch( CFXJSE_Arguments* pArguments) { - CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); - if (!pNotify) { - return; - } - CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - int32_t iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc); CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetInteger(iPageCount); + pValue->SetInteger(0); } + void CScript_LayoutPseudoModel::Relayout(CFXJSE_Arguments* pArguments) { CXFA_Node* pRootNode = m_pDocument->GetRoot(); CXFA_Node* pFormRoot = pRootNode->GetFirstChildByClass(XFA_Element::Form); @@ -401,84 +404,48 @@ void CScript_LayoutPseudoModel::Relayout(CFXJSE_Arguments* pArguments) { } pLayoutProcessor->SetForceReLayout(TRUE); } + void CScript_LayoutPseudoModel::AbsPageSpan(CFXJSE_Arguments* pArguments) { PageSpan(pArguments); } + void CScript_LayoutPseudoModel::AbsPageInBatch(CFXJSE_Arguments* pArguments) { - int32_t iLength = pArguments->GetLength(); - if (iLength != 1) { + if (pArguments->GetLength() != 1) { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"absPageInBatch"); return; } - CXFA_Node* pNode = nullptr; - if (iLength >= 1) { - pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); - } - if (!pNode) { - return; - } - CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); - if (!pNotify) { - return; - } - CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); - if (!pDocLayout) { - return; - } - CXFA_FFWidget* hWidget = - pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); - if (!hWidget) { - return; - } - CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - int32_t iPageCount = pNotify->GetDocProvider()->AbsPageInBatch(hDoc, hWidget); + CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetInteger(iPageCount); + pValue->SetInteger(0); } + void CScript_LayoutPseudoModel::SheetInBatch(CFXJSE_Arguments* pArguments) { - int32_t iLength = pArguments->GetLength(); - if (iLength != 1) { + if (pArguments->GetLength() != 1) { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"sheetInBatch"); return; } - CXFA_Node* pNode = nullptr; - if (iLength >= 1) { - pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); - } - if (!pNode) { - return; - } - CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); - if (!pNotify) { - return; - } - CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); - if (!pDocLayout) { - return; - } - CXFA_FFWidget* hWidget = - pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); - if (!hWidget) { - return; - } - CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - int32_t iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget); + CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetInteger(iPageCount); + pValue->SetInteger(0); } + void CScript_LayoutPseudoModel::Sheet(CFXJSE_Arguments* pArguments) { PageImp(pArguments, TRUE); } + void CScript_LayoutPseudoModel::RelayoutPageArea(CFXJSE_Arguments* pArguments) { } + void CScript_LayoutPseudoModel::SheetCount(CFXJSE_Arguments* pArguments) { NumberedPageCount(pArguments, FALSE); } + void CScript_LayoutPseudoModel::AbsPage(CFXJSE_Arguments* pArguments) { PageImp(pArguments, TRUE); } + void CScript_LayoutPseudoModel::PageImp(CFXJSE_Arguments* pArguments, FX_BOOL bAbsPage) { int32_t iLength = pArguments->GetLength(); diff --git a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp index 071ae39900..83e84b6d79 100644 --- a/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp +++ b/xfa/fxfa/parser/cscript_signaturepseudomodel.cpp @@ -29,19 +29,10 @@ void CScript_SignaturePseudoModel::Verify(CFXJSE_Arguments* pArguments) { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"verify"); return; } - CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); - if (!pNotify) { - return; - } - CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - CXFA_Node* pNode = nullptr; - if (iLength >= 1) { - pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); - } - int32_t bVerify = pNotify->GetDocProvider()->Verify(hDoc, pNode); + CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetInteger(bVerify); + pValue->SetInteger(0); } void CScript_SignaturePseudoModel::Sign(CFXJSE_Arguments* pArguments) { @@ -50,48 +41,18 @@ void CScript_SignaturePseudoModel::Sign(CFXJSE_Arguments* pArguments) { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"sign"); return; } - CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); - if (!pNotify) { - return; - } - CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - CXFA_NodeList* pNodeList = nullptr; - CFX_WideString wsExpression; - CFX_WideString wsXMLIdent; - if (iLength >= 1) { - pNodeList = (CXFA_NodeList*)pArguments->GetObject(0); - } - if (iLength >= 2) { - CFX_ByteString bsExpression = pArguments->GetUTF8String(1); - wsExpression = CFX_WideString::FromUTF8(bsExpression.AsStringC()); - } - if (iLength >= 3) { - CFX_ByteString bsXMLIdent = pArguments->GetUTF8String(2); - wsXMLIdent = CFX_WideString::FromUTF8(bsXMLIdent.AsStringC()); - } - FX_BOOL bSign = pNotify->GetDocProvider()->Sign( - hDoc, pNodeList, wsExpression.AsStringC(), wsXMLIdent.AsStringC()); + CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetBoolean(bSign); + pValue->SetBoolean(FALSE); } void CScript_SignaturePseudoModel::Enumerate(CFXJSE_Arguments* pArguments) { - int32_t iLength = pArguments->GetLength(); - if (iLength != 0) { + if (pArguments->GetLength() != 0) { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"enumerate"); return; } - CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); - if (!pNotify) { - return; - } - CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - CXFA_NodeList* pList = pNotify->GetDocProvider()->Enumerate(hDoc); - if (!pList) - return; - pArguments->GetReturnValue()->Assign( - m_pDocument->GetScriptContext()->GetJSValueFromMap(pList)); + return; } void CScript_SignaturePseudoModel::Clear(CFXJSE_Arguments* pArguments) { @@ -100,21 +61,8 @@ void CScript_SignaturePseudoModel::Clear(CFXJSE_Arguments* pArguments) { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"clear"); return; } - CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); - if (!pNotify) { - return; - } - CXFA_FFDoc* hDoc = pNotify->GetHDOC(); - CXFA_Node* pNode = nullptr; - FX_BOOL bClear = TRUE; - if (iLength >= 1) { - pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); - } - if (iLength >= 2) { - bClear = pArguments->GetInt32(1) == 0 ? FALSE : TRUE; - } - FX_BOOL bFlag = pNotify->GetDocProvider()->Clear(hDoc, pNode, bClear); + CFXJSE_Value* pValue = pArguments->GetReturnValue(); if (pValue) - pValue->SetBoolean(bFlag); + pValue->SetBoolean(FALSE); } |