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

Unified Diff: fpdfsdk/formfiller/cba_fontmap.cpp

Issue 2424533003: Revert "Update CPDF_IndirectObjectHolder APIs for unique objects." (Closed)
Patch Set: Created 4 years, 2 months 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 | « fpdfsdk/cpdfsdk_widget.cpp ('k') | fpdfsdk/fpdf_flatten.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/formfiller/cba_fontmap.cpp
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index af518fe9566fe33d889f832d9e5a4c9869bf6f28..7178b902d022fbe3773464a0df97075f8b3d8305 100644
--- a/fpdfsdk/formfiller/cba_fontmap.cpp
+++ b/fpdfsdk/formfiller/cba_fontmap.cpp
@@ -166,8 +166,9 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
CPDF_Stream* pStream = pAPDict->GetStreamFor(m_sAPType);
if (!pStream) {
- pStream = m_pDocument->AddIndirectStream();
- pAPDict->SetReferenceFor(m_sAPType, m_pDocument, pStream);
+ pStream = new CPDF_Stream;
+ pAPDict->SetReferenceFor(m_sAPType, m_pDocument,
+ m_pDocument->AddIndirectObject(pStream));
}
CPDF_Dictionary* pStreamDict = pStream->GetDict();
@@ -185,12 +186,14 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDictFor("Font");
if (!pStreamResFontList) {
pStreamResFontList =
- m_pDocument->AddIndirectDictionary(m_pDocument->GetByteStringPool());
- pStreamResList->SetReferenceFor("Font", m_pDocument, pStreamResFontList);
+ new CPDF_Dictionary(m_pDocument->GetByteStringPool());
+ pStreamResList->SetReferenceFor(
+ "Font", m_pDocument,
+ m_pDocument->AddIndirectObject(pStreamResFontList));
}
if (!pStreamResFontList->KeyExist(sAlias)) {
pStreamResFontList->SetReferenceFor(sAlias, m_pDocument,
- pFont->GetFontDict());
+ pFont->GetFontDict()->GetObjNum());
}
}
}
« no previous file with comments | « fpdfsdk/cpdfsdk_widget.cpp ('k') | fpdfsdk/fpdf_flatten.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698