diff options
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r-- | core/fpdfdoc/cpdf_interform.cpp | 7 | ||||
-rw-r--r-- | core/fpdfdoc/cpvt_fontmap.cpp | 4 | ||||
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 18 |
3 files changed, 12 insertions, 17 deletions
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp index 2e5c17508a..de3770901b 100644 --- a/core/fpdfdoc/cpdf_interform.cpp +++ b/core/fpdfdoc/cpdf_interform.cpp @@ -43,8 +43,8 @@ void InitDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument) { if (!pFormDict) { pFormDict = pDocument->NewIndirect<CPDF_Dictionary>(); - pDocument->GetRoot()->SetNewFor<CPDF_Reference>("AcroForm", pDocument, - pFormDict->GetObjNum()); + pDocument->GetRoot()->SetFor("AcroForm", + pFormDict->MakeReference(pDocument)); } ByteString csDA; @@ -248,8 +248,7 @@ void AddFont(CPDF_Dictionary*& pFormDict, csNameTag->Remove(' '); *csNameTag = CPDF_InterForm::GenerateNewResourceName(pDR, "Font", 4, csNameTag->c_str()); - pFonts->SetNewFor<CPDF_Reference>(*csNameTag, pDocument, - pFont->GetFontDict()->GetObjNum()); + pFonts->SetFor(*csNameTag, pFont->GetFontDict()->MakeReference(pDocument)); } CPDF_Font* AddNativeFont(CPDF_Dictionary*& pFormDict, diff --git a/core/fpdfdoc/cpvt_fontmap.cpp b/core/fpdfdoc/cpvt_fontmap.cpp index 6164062164..16ce4403c6 100644 --- a/core/fpdfdoc/cpvt_fontmap.cpp +++ b/core/fpdfdoc/cpvt_fontmap.cpp @@ -39,8 +39,8 @@ CPDF_Font* CPVT_FontMap::GetAnnotSysPDFFont(CPDF_Document* pDoc, CPDF_Dictionary* pFontList = pResDict->GetDictFor("Font"); if (pFontList && !pFontList->KeyExist(*sSysFontAlias)) { - pFontList->SetNewFor<CPDF_Reference>(*sSysFontAlias, pDoc, - pPDFFont->GetFontDict()->GetObjNum()); + pFontList->SetFor(*sSysFontAlias, + pPDFFont->GetFontDict()->MakeReference(pDoc)); } return pPDFFont; } diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index cf55e956ea..a582feb2cb 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -404,8 +404,7 @@ std::unique_ptr<CPDF_Dictionary> GenerateResourceFontDict( auto pResourceFontDict = pdfium::MakeUnique<CPDF_Dictionary>(pDoc->GetByteStringPool()); - pResourceFontDict->SetNewFor<CPDF_Reference>(sFontDictName, pDoc, - pFontDict->GetObjNum()); + pResourceFontDict->SetFor(sFontDictName, pFontDict->MakeReference(pDoc)); return pResourceFontDict; } @@ -511,7 +510,7 @@ void GenerateAndSetAPDict(CPDF_Document* pDoc, if (!pAPDict) pAPDict = pAnnotDict->SetNewFor<CPDF_Dictionary>("AP"); - pAPDict->SetNewFor<CPDF_Reference>("N", pDoc, pNormalStream->GetObjNum()); + pAPDict->SetFor("N", pNormalStream->MakeReference(pDoc)); CPDF_Dictionary* pStreamDict = pNormalStream->GetDict(); pStreamDict->SetNewFor<CPDF_Number>("FormType", 1); @@ -951,9 +950,8 @@ void CPVT_GenerateAP::GenerateFormAP(Type type, pFontDict->SetNewFor<CPDF_Name>("Subtype", "Type1"); pFontDict->SetNewFor<CPDF_Name>("BaseFont", CFX_Font::kDefaultAnsiFontName); pFontDict->SetNewFor<CPDF_Name>("Encoding", "WinAnsiEncoding"); - pDRFontDict->SetNewFor<CPDF_Reference>( - sFontName.Right(sFontName.GetLength() - 1), pDoc, - pFontDict->GetObjNum()); + pDRFontDict->SetFor(sFontName.Right(sFontName.GetLength() - 1), + pFontDict->MakeReference(pDoc)); } CPDF_Font* pDefFont = pDoc->LoadFont(pFontDict); if (!pDefFont) @@ -1062,7 +1060,7 @@ void CPVT_GenerateAP::GenerateFormAP(Type type, CPDF_Stream* pNormalStream = pAPDict->GetStreamFor("N"); if (!pNormalStream) { pNormalStream = pDoc->NewIndirect<CPDF_Stream>(); - pAPDict->SetNewFor<CPDF_Reference>("N", pDoc, pNormalStream->GetObjNum()); + pAPDict->SetFor("N", pNormalStream->MakeReference(pDoc)); } CPDF_Dictionary* pStreamDict = pNormalStream->GetDict(); if (pStreamDict) { @@ -1074,8 +1072,7 @@ void CPVT_GenerateAP::GenerateFormAP(Type type, if (!pStreamResFontList) pStreamResFontList = pStreamResList->SetNewFor<CPDF_Dictionary>("Font"); if (!pStreamResFontList->KeyExist(sFontName)) { - pStreamResFontList->SetNewFor<CPDF_Reference>(sFontName, pDoc, - pFontDict->GetObjNum()); + pStreamResFontList->SetFor(sFontName, pFontDict->MakeReference(pDoc)); } } else { pStreamDict->SetFor("Resources", pFormDict->GetDictFor("DR")->Clone()); @@ -1322,8 +1319,7 @@ void CPVT_GenerateAP::GenerateFormAP(Type type, pStreamResList->SetNewFor<CPDF_Dictionary>("Font"); } if (!pStreamResFontList->KeyExist(sFontName)) { - pStreamResFontList->SetNewFor<CPDF_Reference>(sFontName, pDoc, - pFontDict->GetObjNum()); + pStreamResFontList->SetFor(sFontName, pFontDict->MakeReference(pDoc)); } } else { pStreamDict->SetFor("Resources", pFormDict->GetDictFor("DR")->Clone()); |