Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1375)

Unified Diff: core/fpdfdoc/cpdf_formcontrol.cpp

Issue 2510223002: Make CPDF_Dictionary use unique pointers. (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfdoc/cpdf_filespec_unittest.cpp ('k') | core/fpdfdoc/cpdf_formfield.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_formcontrol.cpp
diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp
index b01784b8dd376a231fe3c4dba7c4d55c221a27b4..54edb4910c0553d3b356b3238ba990e57b133df1 100644
--- a/core/fpdfdoc/cpdf_formcontrol.cpp
+++ b/core/fpdfdoc/cpdf_formcontrol.cpp
@@ -11,6 +11,7 @@
#include "core/fpdfapi/page/cpdf_form.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_document.h"
+#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "core/fpdfapi/render/cpdf_rendercontext.h"
@@ -61,14 +62,14 @@ void CPDF_FormControl::SetOnStateName(const CFX_ByteString& csOn) {
CFX_ByteString csAS = m_pWidgetDict->GetStringFor("AS", "Off");
if (csAS != "Off")
- m_pWidgetDict->SetNameFor("AS", csValue);
+ m_pWidgetDict->SetNewFor<CPDF_Name>("AS", csValue);
CPDF_Dictionary* pAP = m_pWidgetDict->GetDictFor("AP");
if (!pAP)
return;
for (const auto& it : *pAP) {
- CPDF_Object* pObj1 = it.second;
+ CPDF_Object* pObj1 = it.second.get();
if (!pObj1)
continue;
@@ -80,7 +81,7 @@ void CPDF_FormControl::SetOnStateName(const CFX_ByteString& csOn) {
auto subdict_it = pSubDict->begin();
while (subdict_it != pSubDict->end()) {
const CFX_ByteString& csKey2 = subdict_it->first;
- CPDF_Object* pObj2 = subdict_it->second;
+ CPDF_Object* pObj2 = subdict_it->second.get();
++subdict_it;
if (!pObj2)
continue;
@@ -155,7 +156,7 @@ void CPDF_FormControl::CheckControl(bool bChecked) {
csAS = csOn;
if (csOldAS == csAS)
return;
- m_pWidgetDict->SetNameFor("AS", csAS);
+ m_pWidgetDict->SetNewFor<CPDF_Name>("AS", csAS);
}
void CPDF_FormControl::DrawControl(CFX_RenderDevice* pDevice,
« no previous file with comments | « core/fpdfdoc/cpdf_filespec_unittest.cpp ('k') | core/fpdfdoc/cpdf_formfield.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698