From b89669975f6156fce4ced5c8998125a845f8e7dc Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 21 Sep 2017 14:51:57 -0400 Subject: Move CFX_AutoRestorer to fxcrt::AutoRestorer This CL renames CFX_AutoRestorer to just AutoRestorer and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: Id9f36df94e95f3b2a55054bc198ca1bfd249ee3d Reviewed-on: https://pdfium-review.googlesource.com/14450 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- BUILD.gn | 2 +- core/fpdfapi/parser/cpdf_syntax_parser.cpp | 10 ++--- core/fpdfapi/render/cpdf_renderstatus.cpp | 4 +- core/fxcrt/autorestorer.h | 26 ++++++++++++ core/fxcrt/cfx_autorestorer.h | 20 ---------- fpdfsdk/cpdfsdk_pageview.cpp | 4 +- fpdfsdk/formfiller/cffl_interactiveformfiller.cpp | 4 +- fpdfsdk/javascript/cjs_event_context.cpp | 4 +- fpdfsdk/pwl/cpwl_edit_impl.cpp | 14 +++---- xfa/fxfa/fm2js/cxfa_fmparser.cpp | 48 +++++++++++------------ xfa/fxfa/parser/cxfa_scriptcontext.cpp | 8 ++-- 11 files changed, 75 insertions(+), 69 deletions(-) create mode 100644 core/fxcrt/autorestorer.h delete mode 100644 core/fxcrt/cfx_autorestorer.h diff --git a/BUILD.gn b/BUILD.gn index aad97e97e5..f95da713b1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -805,9 +805,9 @@ config("fxge_warnings") { static_library("fxcrt") { sources = [ + "core/fxcrt/autorestorer.h", "core/fxcrt/bytestring.cpp", "core/fxcrt/bytestring.h", - "core/fxcrt/cfx_autorestorer.h", "core/fxcrt/cfx_binarybuf.cpp", "core/fxcrt/cfx_binarybuf.h", "core/fxcrt/cfx_bitstream.cpp", diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp index 4412105c7b..4556dc9627 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp @@ -25,7 +25,7 @@ #include "core/fpdfapi/parser/cpdf_string.h" #include "core/fpdfapi/parser/fpdf_parser_decode.h" #include "core/fpdfapi/parser/fpdf_parser_utility.h" -#include "core/fxcrt/cfx_autorestorer.h" +#include "core/fxcrt/autorestorer.h" #include "core/fxcrt/cfx_binarybuf.h" #include "core/fxcrt/fx_extension.h" #include "third_party/base/numerics/safe_math.h" @@ -55,7 +55,7 @@ CPDF_SyntaxParser::~CPDF_SyntaxParser() { } bool CPDF_SyntaxParser::GetCharAt(FX_FILESIZE pos, uint8_t& ch) { - CFX_AutoRestorer save_pos(&m_Pos); + AutoRestorer save_pos(&m_Pos); m_Pos = pos; return GetNextChar(ch); } @@ -352,7 +352,7 @@ ByteString CPDF_SyntaxParser::GetNextWord(bool* bIsNumber) { } ByteString CPDF_SyntaxParser::PeekNextWord(bool* bIsNumber) { - const CFX_AutoRestorer save_pos(&m_Pos); + AutoRestorer save_pos(&m_Pos); return GetNextWord(bIsNumber); } @@ -379,7 +379,7 @@ std::unique_ptr CPDF_SyntaxParser::GetObjectInternal( uint32_t gennum, bool bDecrypt, ParseType parse_type) { - CFX_AutoRestorer restorer(&s_CurrentRecursionDepth); + AutoRestorer restorer(&s_CurrentRecursionDepth); if (++s_CurrentRecursionDepth > kParserMaxRecursionDepth) return nullptr; @@ -485,7 +485,7 @@ std::unique_ptr CPDF_SyntaxParser::GetObjectInternal( // contents to the un-decrypted form. if (m_pCryptoHandler && bDecrypt && pDict->IsSignatureDict() && dwSignValuePos) { - CFX_AutoRestorer save_pos(&m_Pos); + AutoRestorer save_pos(&m_Pos); m_Pos = dwSignValuePos; pDict->SetFor("Contents", GetObject(pObjList, objnum, gennum, false)); } diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index 6d7e7f1372..26eed112c5 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -45,7 +45,7 @@ #include "core/fpdfapi/render/cpdf_transferfunc.h" #include "core/fpdfapi/render/cpdf_type3cache.h" #include "core/fpdfdoc/cpdf_occontext.h" -#include "core/fxcrt/cfx_autorestorer.h" +#include "core/fxcrt/autorestorer.h" #include "core/fxcrt/cfx_fixedbufgrow.h" #include "core/fxcrt/cfx_maybe_owned.h" #include "core/fxcrt/fx_safe_types.h" @@ -1079,7 +1079,7 @@ void CPDF_RenderStatus::RenderSingleObject(CPDF_PageObject* pObj, #if defined _SKIA_SUPPORT_ DebugVerifyDeviceIsPreMultiplied(); #endif - CFX_AutoRestorer restorer(&s_CurrentRecursionDepth); + AutoRestorer restorer(&s_CurrentRecursionDepth); if (++s_CurrentRecursionDepth > kRenderMaxRecursionDepth) { return; } diff --git a/core/fxcrt/autorestorer.h b/core/fxcrt/autorestorer.h new file mode 100644 index 0000000000..745a56fff2 --- /dev/null +++ b/core/fxcrt/autorestorer.h @@ -0,0 +1,26 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CORE_FXCRT_AUTORESTORER_H_ +#define CORE_FXCRT_AUTORESTORER_H_ + +namespace fxcrt { + +template +class AutoRestorer { + public: + explicit AutoRestorer(T* location) + : m_Location(location), m_OldValue(*location) {} + ~AutoRestorer() { *m_Location = m_OldValue; } + + private: + T* const m_Location; + const T m_OldValue; +}; + +} // namespace fxcrt + +using fxcrt::AutoRestorer; + +#endif // CORE_FXCRT_AUTORESTORER_H_ diff --git a/core/fxcrt/cfx_autorestorer.h b/core/fxcrt/cfx_autorestorer.h deleted file mode 100644 index a8c5125c4e..0000000000 --- a/core/fxcrt/cfx_autorestorer.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CORE_FXCRT_CFX_AUTORESTORER_H_ -#define CORE_FXCRT_CFX_AUTORESTORER_H_ - -template -class CFX_AutoRestorer { - public: - explicit CFX_AutoRestorer(T* location) - : m_Location(location), m_OldValue(*location) {} - ~CFX_AutoRestorer() { *m_Location = m_OldValue; } - - private: - T* const m_Location; - const T m_OldValue; -}; - -#endif // CORE_FXCRT_CFX_AUTORESTORER_H_ diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp index f22d575150..a8dc88c7d6 100644 --- a/fpdfsdk/cpdfsdk_pageview.cpp +++ b/fpdfsdk/cpdfsdk_pageview.cpp @@ -13,7 +13,7 @@ #include "core/fpdfapi/render/cpdf_renderoptions.h" #include "core/fpdfdoc/cpdf_annotlist.h" #include "core/fpdfdoc/cpdf_interform.h" -#include "core/fxcrt/cfx_autorestorer.h" +#include "core/fxcrt/autorestorer.h" #include "fpdfsdk/cpdfsdk_annot.h" #include "fpdfsdk/cpdfsdk_annotiteration.h" #include "fpdfsdk/cpdfsdk_formfillenvironment.h" @@ -422,7 +422,7 @@ void CPDFSDK_PageView::LoadFXAnnots() { CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = m_pFormFillEnv->GetAnnotHandlerMgr(); - CFX_AutoRestorer lock(&m_bLocked); + AutoRestorer lock(&m_bLocked); m_bLocked = true; #ifdef PDF_ENABLE_XFA diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index 3625e9db38..70d3990ea3 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp @@ -8,7 +8,7 @@ #include "core/fpdfapi/page/cpdf_page.h" #include "core/fpdfapi/parser/cpdf_document.h" -#include "core/fxcrt/cfx_autorestorer.h" +#include "core/fxcrt/autorestorer.h" #include "core/fxge/cfx_graphstatedata.h" #include "core/fxge/cfx_pathdata.h" #include "core/fxge/cfx_renderdevice.h" @@ -880,7 +880,7 @@ std::pair CFFL_InteractiveFormFiller::OnBeforeKeyStroke( return {true, false}; } - CFX_AutoRestorer restorer(&m_bNotifying); + AutoRestorer restorer(&m_bNotifying); m_bNotifying = true; uint32_t nAge = privateData.pWidget->GetAppearanceAge(); diff --git a/fpdfsdk/javascript/cjs_event_context.cpp b/fpdfsdk/javascript/cjs_event_context.cpp index b820bc309b..bf6b337a70 100644 --- a/fpdfsdk/javascript/cjs_event_context.cpp +++ b/fpdfsdk/javascript/cjs_event_context.cpp @@ -6,7 +6,7 @@ #include "fpdfsdk/javascript/cjs_event_context.h" -#include "core/fxcrt/cfx_autorestorer.h" +#include "core/fxcrt/autorestorer.h" #include "fpdfsdk/javascript/JS_EventHandler.h" #include "fpdfsdk/javascript/cjs_runtime.h" #include "fpdfsdk/javascript/resource.h" @@ -35,7 +35,7 @@ bool CJS_EventContext::RunScript(const WideString& script, WideString* info) { return false; } - CFX_AutoRestorer restorer(&m_bBusy); + AutoRestorer restorer(&m_bBusy); m_bBusy = true; ASSERT(m_pEventHandler->IsValid()); diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp index c65199955b..89b19de63d 100644 --- a/fpdfsdk/pwl/cpwl_edit_impl.cpp +++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp @@ -22,7 +22,7 @@ #include "core/fpdfdoc/cpvt_section.h" #include "core/fpdfdoc/cpvt_word.h" #include "core/fpdfdoc/ipvt_fontmap.h" -#include "core/fxcrt/cfx_autorestorer.h" +#include "core/fxcrt/autorestorer.h" #include "core/fxcrt/fx_codepage.h" #include "core/fxge/cfx_graphstatedata.h" #include "core/fxge/cfx_pathdata.h" @@ -1012,7 +1012,7 @@ void CPWL_EditImpl::SetScrollInfo() { if (m_bNotifyFlag) return; - CFX_AutoRestorer restorer(&m_bNotifyFlag); + AutoRestorer restorer(&m_bNotifyFlag); m_bNotifyFlag = true; PWL_SCROLL_INFO Info; @@ -1047,7 +1047,7 @@ void CPWL_EditImpl::SetScrollPosY(float fy) { if (m_pNotify) { if (!m_bNotifyFlag) { - CFX_AutoRestorer restorer(&m_bNotifyFlag); + AutoRestorer restorer(&m_bNotifyFlag); m_bNotifyFlag = true; m_pNotify->SetScrollPosition(fy); } @@ -1157,7 +1157,7 @@ void CPWL_EditImpl::Refresh() { if (m_pNotify) { if (!m_bNotifyFlag) { - CFX_AutoRestorer restorer(&m_bNotifyFlag); + AutoRestorer restorer(&m_bNotifyFlag); m_bNotifyFlag = true; if (const CPWL_EditImpl_RectArray* pRects = m_Refresh.GetRefreshRects()) { @@ -1227,7 +1227,7 @@ void CPWL_EditImpl::RefreshWordRange(const CPVT_WordRange& wr) { if (m_pNotify) { if (!m_bNotifyFlag) { - CFX_AutoRestorer restorer(&m_bNotifyFlag); + AutoRestorer restorer(&m_bNotifyFlag); m_bNotifyFlag = true; CFX_FloatRect rcRefresh = VTToEdit(rcWord); m_pNotify->InvalidateRect(&rcRefresh); @@ -1241,7 +1241,7 @@ void CPWL_EditImpl::RefreshWordRange(const CPVT_WordRange& wr) { if (m_pNotify) { if (!m_bNotifyFlag) { - CFX_AutoRestorer restorer(&m_bNotifyFlag); + AutoRestorer restorer(&m_bNotifyFlag); m_bNotifyFlag = true; CFX_FloatRect rcRefresh = VTToEdit(rcLine); m_pNotify->InvalidateRect(&rcRefresh); @@ -1280,7 +1280,7 @@ void CPWL_EditImpl::SetCaretInfo() { ptFoot.y = line.ptLine.y + line.fLineDescent; } - CFX_AutoRestorer restorer(&m_bNotifyFlag); + AutoRestorer restorer(&m_bNotifyFlag); m_bNotifyFlag = true; m_pNotify->SetCaret(m_SelState.IsEmpty(), VTToEdit(ptHead), VTToEdit(ptFoot)); diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.cpp b/xfa/fxfa/fm2js/cxfa_fmparser.cpp index dde994318c..644fdf2a82 100644 --- a/xfa/fxfa/fm2js/cxfa_fmparser.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmparser.cpp @@ -10,7 +10,7 @@ #include #include -#include "core/fxcrt/cfx_autorestorer.h" +#include "core/fxcrt/autorestorer.h" #include "third_party/base/ptr_util.h" namespace { @@ -64,7 +64,7 @@ bool CXFA_FMParser::IncrementParseDepthAndCheck() { std::vector> CXFA_FMParser::ParseTopExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return std::vector>(); @@ -88,7 +88,7 @@ CXFA_FMParser::ParseTopExpression() { } std::unique_ptr CXFA_FMParser::ParseFunction() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -151,7 +151,7 @@ std::unique_ptr CXFA_FMParser::ParseFunction() { } std::unique_ptr CXFA_FMParser::ParseExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -204,7 +204,7 @@ std::unique_ptr CXFA_FMParser::ParseExpression() { } std::unique_ptr CXFA_FMParser::ParseVarExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -261,7 +261,7 @@ CXFA_FMParser::ParseSimpleExpression() { } std::unique_ptr CXFA_FMParser::ParseExpExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -274,7 +274,7 @@ std::unique_ptr CXFA_FMParser::ParseExpExpression() { std::unique_ptr CXFA_FMParser::ParseLogicalOrExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -309,7 +309,7 @@ CXFA_FMParser::ParseLogicalOrExpression() { std::unique_ptr CXFA_FMParser::ParseLogicalAndExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -343,7 +343,7 @@ CXFA_FMParser::ParseLogicalAndExpression() { std::unique_ptr CXFA_FMParser::ParseEqualityExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -388,7 +388,7 @@ CXFA_FMParser::ParseEqualityExpression() { std::unique_ptr CXFA_FMParser::ParseRelationalExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -458,7 +458,7 @@ CXFA_FMParser::ParseRelationalExpression() { std::unique_ptr CXFA_FMParser::ParseAddtiveExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -502,7 +502,7 @@ CXFA_FMParser::ParseAddtiveExpression() { std::unique_ptr CXFA_FMParser::ParseMultiplicativeExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -545,7 +545,7 @@ CXFA_FMParser::ParseMultiplicativeExpression() { } std::unique_ptr CXFA_FMParser::ParseUnaryExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -593,7 +593,7 @@ std::unique_ptr CXFA_FMParser::ParseUnaryExpression() { std::unique_ptr CXFA_FMParser::ParsePrimaryExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -661,7 +661,7 @@ CXFA_FMParser::ParsePrimaryExpression() { std::unique_ptr CXFA_FMParser::ParsePostExpression( std::unique_ptr expr) { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -855,7 +855,7 @@ std::unique_ptr CXFA_FMParser::ParsePostExpression( } std::unique_ptr CXFA_FMParser::ParseIndexExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -898,7 +898,7 @@ std::unique_ptr CXFA_FMParser::ParseIndexExpression() { } std::unique_ptr CXFA_FMParser::ParseParenExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -937,7 +937,7 @@ std::unique_ptr CXFA_FMParser::ParseParenExpression() { } std::unique_ptr CXFA_FMParser::ParseBlockExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -981,7 +981,7 @@ std::unique_ptr CXFA_FMParser::ParseBlockExpression() { } std::unique_ptr CXFA_FMParser::ParseIfExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -1052,7 +1052,7 @@ std::unique_ptr CXFA_FMParser::ParseIfExpression() { } std::unique_ptr CXFA_FMParser::ParseWhileExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -1073,7 +1073,7 @@ std::unique_ptr CXFA_FMParser::ParseWhileExpression() { std::unique_ptr CXFA_FMParser::ParseSubassignmentInForExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -1091,7 +1091,7 @@ CXFA_FMParser::ParseSubassignmentInForExpression() { } std::unique_ptr CXFA_FMParser::ParseForExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -1160,7 +1160,7 @@ std::unique_ptr CXFA_FMParser::ParseForExpression() { } std::unique_ptr CXFA_FMParser::ParseForeachExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -1209,7 +1209,7 @@ std::unique_ptr CXFA_FMParser::ParseForeachExpression() { } std::unique_ptr CXFA_FMParser::ParseDoExpression() { - CFX_AutoRestorer restorer(&m_parse_depth); + AutoRestorer restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; diff --git a/xfa/fxfa/parser/cxfa_scriptcontext.cpp b/xfa/fxfa/parser/cxfa_scriptcontext.cpp index 38d503962d..4e78f46f17 100644 --- a/xfa/fxfa/parser/cxfa_scriptcontext.cpp +++ b/xfa/fxfa/parser/cxfa_scriptcontext.cpp @@ -8,7 +8,7 @@ #include -#include "core/fxcrt/cfx_autorestorer.h" +#include "core/fxcrt/autorestorer.h" #include "core/fxcrt/cfx_widetextbuf.h" #include "core/fxcrt/fx_extension.h" #include "fxjs/cfxjse_arguments.h" @@ -150,7 +150,7 @@ bool CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, CFXJSE_Value* hRetValue, CXFA_Object* pThisObject) { ByteString btScript; - CFX_AutoRestorer typeRestorer(&m_eScriptType); + AutoRestorer typeRestorer(&m_eScriptType); m_eScriptType = eScriptType; if (eScriptType == XFA_SCRIPTLANGTYPE_Formcalc) { if (!m_FM2JSContext) { @@ -166,7 +166,7 @@ bool CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, } else { btScript = FX_UTF8Encode(wsScript); } - CFX_AutoRestorer nodeRestorer(&m_pThisObject); + AutoRestorer nodeRestorer(&m_pThisObject); m_pThisObject = pThisObject; CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : nullptr; return m_JsContext->ExecuteScript(btScript.c_str(), hRetValue, pValue); @@ -498,7 +498,7 @@ bool CXFA_ScriptContext::RunVariablesScript(CXFA_Node* pScriptNode) { CXFA_Node* pThisObject = pParent->GetNodeItem(XFA_NODEITEM_Parent); CFXJSE_Context* pVariablesContext = CreateVariablesContext(pScriptNode, pThisObject); - CFX_AutoRestorer nodeRestorer(&m_pThisObject); + AutoRestorer nodeRestorer(&m_pThisObject); m_pThisObject = pThisObject; return pVariablesContext->ExecuteScript(btScript.c_str(), hRetValue.get()); } -- cgit v1.2.3