diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-09-21 14:51:57 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-21 19:16:29 +0000 |
commit | b89669975f6156fce4ced5c8998125a845f8e7dc (patch) | |
tree | 185c2badc52530ec1baddb854824bc5891e476a1 | |
parent | db0312e6acd7cc15fef0f64e05bd463cb74c70e4 (diff) | |
download | pdfium-b89669975f6156fce4ced5c8998125a845f8e7dc.tar.xz |
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 <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r-- | BUILD.gn | 2 | ||||
-rw-r--r-- | core/fpdfapi/parser/cpdf_syntax_parser.cpp | 10 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_renderstatus.cpp | 4 | ||||
-rw-r--r-- | core/fxcrt/autorestorer.h (renamed from core/fxcrt/cfx_autorestorer.h) | 18 | ||||
-rw-r--r-- | fpdfsdk/cpdfsdk_pageview.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/formfiller/cffl_interactiveformfiller.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/javascript/cjs_event_context.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/pwl/cpwl_edit_impl.cpp | 14 | ||||
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmparser.cpp | 48 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_scriptcontext.cpp | 8 |
10 files changed, 61 insertions, 55 deletions
@@ -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<FX_FILESIZE> save_pos(&m_Pos); + AutoRestorer<FX_FILESIZE> 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<FX_FILESIZE> save_pos(&m_Pos); + AutoRestorer<FX_FILESIZE> save_pos(&m_Pos); return GetNextWord(bIsNumber); } @@ -379,7 +379,7 @@ std::unique_ptr<CPDF_Object> CPDF_SyntaxParser::GetObjectInternal( uint32_t gennum, bool bDecrypt, ParseType parse_type) { - CFX_AutoRestorer<int> restorer(&s_CurrentRecursionDepth); + AutoRestorer<int> restorer(&s_CurrentRecursionDepth); if (++s_CurrentRecursionDepth > kParserMaxRecursionDepth) return nullptr; @@ -485,7 +485,7 @@ std::unique_ptr<CPDF_Object> CPDF_SyntaxParser::GetObjectInternal( // contents to the un-decrypted form. if (m_pCryptoHandler && bDecrypt && pDict->IsSignatureDict() && dwSignValuePos) { - CFX_AutoRestorer<FX_FILESIZE> save_pos(&m_Pos); + AutoRestorer<FX_FILESIZE> 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<int> restorer(&s_CurrentRecursionDepth); + AutoRestorer<int> restorer(&s_CurrentRecursionDepth); if (++s_CurrentRecursionDepth > kRenderMaxRecursionDepth) { return; } diff --git a/core/fxcrt/cfx_autorestorer.h b/core/fxcrt/autorestorer.h index a8c5125c4e..745a56fff2 100644 --- a/core/fxcrt/cfx_autorestorer.h +++ b/core/fxcrt/autorestorer.h @@ -2,19 +2,25 @@ // 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_ +#ifndef CORE_FXCRT_AUTORESTORER_H_ +#define CORE_FXCRT_AUTORESTORER_H_ + +namespace fxcrt { template <typename T> -class CFX_AutoRestorer { +class AutoRestorer { public: - explicit CFX_AutoRestorer(T* location) + explicit AutoRestorer(T* location) : m_Location(location), m_OldValue(*location) {} - ~CFX_AutoRestorer() { *m_Location = m_OldValue; } + ~AutoRestorer() { *m_Location = m_OldValue; } private: T* const m_Location; const T m_OldValue; }; -#endif // CORE_FXCRT_CFX_AUTORESTORER_H_ +} // namespace fxcrt + +using fxcrt::AutoRestorer; + +#endif // CORE_FXCRT_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<bool> lock(&m_bLocked); + AutoRestorer<bool> 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<bool, bool> CFFL_InteractiveFormFiller::OnBeforeKeyStroke( return {true, false}; } - CFX_AutoRestorer<bool> restorer(&m_bNotifying); + AutoRestorer<bool> 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<bool> restorer(&m_bBusy); + AutoRestorer<bool> 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<bool> restorer(&m_bNotifyFlag); + AutoRestorer<bool> 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<bool> restorer(&m_bNotifyFlag); + AutoRestorer<bool> 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<bool> restorer(&m_bNotifyFlag); + AutoRestorer<bool> 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<bool> restorer(&m_bNotifyFlag); + AutoRestorer<bool> 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<bool> restorer(&m_bNotifyFlag); + AutoRestorer<bool> 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<bool> restorer(&m_bNotifyFlag); + AutoRestorer<bool> 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 <utility> #include <vector> -#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<std::unique_ptr<CXFA_FMExpression>> CXFA_FMParser::ParseTopExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return std::vector<std::unique_ptr<CXFA_FMExpression>>(); @@ -88,7 +88,7 @@ CXFA_FMParser::ParseTopExpression() { } std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseFunction() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -151,7 +151,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseFunction() { } std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -204,7 +204,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseExpression() { } std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseVarExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -261,7 +261,7 @@ CXFA_FMParser::ParseSimpleExpression() { } std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseExpExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -274,7 +274,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseExpExpression() { std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseLogicalOrExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -309,7 +309,7 @@ CXFA_FMParser::ParseLogicalOrExpression() { std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseLogicalAndExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -343,7 +343,7 @@ CXFA_FMParser::ParseLogicalAndExpression() { std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseEqualityExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -388,7 +388,7 @@ CXFA_FMParser::ParseEqualityExpression() { std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseRelationalExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -458,7 +458,7 @@ CXFA_FMParser::ParseRelationalExpression() { std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseAddtiveExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -502,7 +502,7 @@ CXFA_FMParser::ParseAddtiveExpression() { std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseMultiplicativeExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -545,7 +545,7 @@ CXFA_FMParser::ParseMultiplicativeExpression() { } std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseUnaryExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -593,7 +593,7 @@ std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseUnaryExpression() { std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParsePrimaryExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -661,7 +661,7 @@ CXFA_FMParser::ParsePrimaryExpression() { std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParsePostExpression( std::unique_ptr<CXFA_FMSimpleExpression> expr) { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -855,7 +855,7 @@ std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParsePostExpression( } std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseIndexExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -898,7 +898,7 @@ std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseIndexExpression() { } std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseParenExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -937,7 +937,7 @@ std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseParenExpression() { } std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseBlockExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -981,7 +981,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseBlockExpression() { } std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseIfExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -1052,7 +1052,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseIfExpression() { } std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseWhileExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -1073,7 +1073,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseWhileExpression() { std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseSubassignmentInForExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -1091,7 +1091,7 @@ CXFA_FMParser::ParseSubassignmentInForExpression() { } std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseForExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -1160,7 +1160,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseForExpression() { } std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseForeachExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> restorer(&m_parse_depth); if (HasError() || !IncrementParseDepthAndCheck()) return nullptr; @@ -1209,7 +1209,7 @@ std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseForeachExpression() { } std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseDoExpression() { - CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth); + AutoRestorer<unsigned long> 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 <utility> -#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<XFA_SCRIPTLANGTYPE> typeRestorer(&m_eScriptType); + AutoRestorer<XFA_SCRIPTLANGTYPE> 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<CXFA_Object*> nodeRestorer(&m_pThisObject); + AutoRestorer<CXFA_Object*> 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<CXFA_Object*> nodeRestorer(&m_pThisObject); + AutoRestorer<CXFA_Object*> nodeRestorer(&m_pThisObject); m_pThisObject = pThisObject; return pVariablesContext->ExecuteScript(btScript.c_str(), hRetValue.get()); } |