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 --- xfa/fxfa/fm2js/cxfa_fmparser.cpp | 48 +++++++++++++++++----------------- xfa/fxfa/parser/cxfa_scriptcontext.cpp | 8 +++--- 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'xfa') 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