Rename "pDoc" instances to "doc" in //core
Mass rename a common variable name to follow Google C++ style. Gemini
did some of the work, with lots of manual interventions.
Bug: 42271580
Change-Id: Id9a0c00c5f6c54d822d369bd3661d39f2a664050
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/134410
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp
index 4b0bd77..deb2181 100644
--- a/core/fpdfapi/edit/cpdf_creator.cpp
+++ b/core/fpdfapi/edit/cpdf_creator.cpp
@@ -120,10 +120,10 @@
} // namespace
-CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc,
+CPDF_Creator::CPDF_Creator(CPDF_Document* doc,
RetainPtr<IFX_RetainableWriteStream> archive)
- : document_(pDoc),
- parser_(pDoc->GetParser()),
+ : document_(doc),
+ parser_(doc->GetParser()),
encrypt_dict_(parser_ ? parser_->GetEncryptDict() : nullptr),
security_handler_(parser_ ? parser_->GetSecurityHandler() : nullptr),
last_obj_num_(document_->GetLastObjNum()),
diff --git a/core/fpdfapi/edit/cpdf_creator.h b/core/fpdfapi/edit/cpdf_creator.h
index 5419d0a..5e8ca42 100644
--- a/core/fpdfapi/edit/cpdf_creator.h
+++ b/core/fpdfapi/edit/cpdf_creator.h
@@ -28,7 +28,7 @@
class CPDF_Creator {
public:
- CPDF_Creator(CPDF_Document* pDoc,
+ CPDF_Creator(CPDF_Document* doc,
RetainPtr<IFX_RetainableWriteStream> archive);
~CPDF_Creator();
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
index 6609b6e..75fede5 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
@@ -204,11 +204,11 @@
pPathObj->mutable_general_state().SetFillAlpha(0.5f);
pPathObj->mutable_general_state().SetStrokeAlpha(0.8f);
- auto pDoc = std::make_unique<CPDF_TestDocument>();
- pDoc->CreateNewDoc();
+ auto doc = std::make_unique<CPDF_TestDocument>();
+ doc->CreateNewDoc();
- RetainPtr<CPDF_Dictionary> pPageDict(pDoc->CreateNewPage(0));
- auto pTestPage = pdfium::MakeRetain<CPDF_Page>(pDoc.get(), pPageDict);
+ RetainPtr<CPDF_Dictionary> pPageDict(doc->CreateNewPage(0));
+ auto pTestPage = pdfium::MakeRetain<CPDF_Page>(doc.get(), pPageDict);
CPDF_PageContentGenerator generator(pTestPage.Get());
fxcrt::ostringstream buf;
TestProcessPath(&generator, &buf, pPathObj.get());
@@ -261,15 +261,15 @@
TEST_F(CPDFPageContentGeneratorTest, ProcessStandardText) {
// Checking font whose font dictionary is not yet indirect object.
- auto pDoc = std::make_unique<CPDF_TestDocument>();
- pDoc->CreateNewDoc();
+ auto doc = std::make_unique<CPDF_TestDocument>();
+ doc->CreateNewDoc();
- RetainPtr<CPDF_Dictionary> pPageDict(pDoc->CreateNewPage(0));
- auto pTestPage = pdfium::MakeRetain<CPDF_Page>(pDoc.get(), pPageDict);
+ RetainPtr<CPDF_Dictionary> pPageDict(doc->CreateNewPage(0));
+ auto pTestPage = pdfium::MakeRetain<CPDF_Page>(doc.get(), pPageDict);
CPDF_PageContentGenerator generator(pTestPage.Get());
auto pTextObj = std::make_unique<CPDF_TextObject>();
pTextObj->mutable_text_state().SetFont(
- CPDF_Font::GetStockFont(pDoc.get(), "Times-Roman"));
+ CPDF_Font::GetStockFont(doc.get(), "Times-Roman"));
pTextObj->mutable_text_state().SetFontSize(10.0f);
static const std::vector<float> rgb = {0.5f, 0.7f, 0.35f};
@@ -330,32 +330,32 @@
TEST_F(CPDFPageContentGeneratorTest, ProcessText) {
// Checking font whose font dictionary is already an indirect object.
- auto pDoc = std::make_unique<CPDF_TestDocument>();
- pDoc->CreateNewDoc();
+ auto doc = std::make_unique<CPDF_TestDocument>();
+ doc->CreateNewDoc();
- RetainPtr<CPDF_Dictionary> pPageDict(pDoc->CreateNewPage(0));
- auto pTestPage = pdfium::MakeRetain<CPDF_Page>(pDoc.get(), pPageDict);
+ RetainPtr<CPDF_Dictionary> pPageDict(doc->CreateNewPage(0));
+ auto pTestPage = pdfium::MakeRetain<CPDF_Page>(doc.get(), pPageDict);
CPDF_PageContentGenerator generator(pTestPage.Get());
fxcrt::ostringstream buf;
{
// Set the text object font and text
auto pTextObj = std::make_unique<CPDF_TextObject>();
- auto dict = pDoc->NewIndirect<CPDF_Dictionary>();
+ auto dict = doc->NewIndirect<CPDF_Dictionary>();
dict->SetNewFor<CPDF_Name>("Type", "Font");
dict->SetNewFor<CPDF_Name>("Subtype", "TrueType");
- RetainPtr<CPDF_Font> font = CPDF_Font::GetStockFont(pDoc.get(), "Arial");
+ RetainPtr<CPDF_Font> font = CPDF_Font::GetStockFont(doc.get(), "Arial");
dict->SetNewFor<CPDF_Name>("BaseFont", font->GetBaseFontName());
- auto pDesc = pDoc->NewIndirect<CPDF_Dictionary>();
+ auto pDesc = doc->NewIndirect<CPDF_Dictionary>();
pDesc->SetNewFor<CPDF_Name>("Type", "FontDescriptor");
pDesc->SetNewFor<CPDF_Name>("FontName", font->GetBaseFontName());
- dict->SetNewFor<CPDF_Reference>("FontDescriptor", pDoc.get(),
+ dict->SetNewFor<CPDF_Reference>("FontDescriptor", doc.get(),
pDesc->GetObjNum());
pTextObj->mutable_text_state().SetFont(
- CPDF_DocPageData::FromDocument(pDoc.get())->GetFont(dict));
+ CPDF_DocPageData::FromDocument(doc.get())->GetFont(dict));
pTextObj->mutable_text_state().SetFontSize(15.5f);
pTextObj->SetText("I am indirect");
pTextObj->SetTextRenderMode(TextRenderingMode::MODE_FILL_CLIP);
@@ -408,13 +408,13 @@
}
TEST_F(CPDFPageContentGeneratorTest, ProcessEmptyForm) {
- auto pDoc = std::make_unique<CPDF_TestDocument>();
- pDoc->CreateNewDoc();
+ auto doc = std::make_unique<CPDF_TestDocument>();
+ doc->CreateNewDoc();
auto pStream =
pdfium::MakeRetain<CPDF_Stream>(pdfium::MakeRetain<CPDF_Dictionary>());
// Create an empty form.
- auto pTestForm = std::make_unique<CPDF_Form>(pDoc.get(), nullptr, pStream);
+ auto pTestForm = std::make_unique<CPDF_Form>(doc.get(), nullptr, pStream);
pTestForm->ParseContent();
ASSERT_EQ(CPDF_PageObjectHolder::ParseState::kParsed,
pTestForm->GetParseState());
@@ -427,8 +427,8 @@
}
TEST_F(CPDFPageContentGeneratorTest, ProcessFormWithPath) {
- auto pDoc = std::make_unique<CPDF_TestDocument>();
- pDoc->CreateNewDoc();
+ auto doc = std::make_unique<CPDF_TestDocument>();
+ doc->CreateNewDoc();
static constexpr uint8_t kContents[] =
"q 3.102 4.6700001 m 5.4500012 .28999999 "
"l 4.2399998 3.1499999 4.65 2.98 3.456 0.24 c 3.102 4.6700001 l h f Q\n";
@@ -437,7 +437,7 @@
pdfium::MakeRetain<CPDF_Dictionary>());
// Create a form with a non-empty stream.
- auto pTestForm = std::make_unique<CPDF_Form>(pDoc.get(), nullptr, pStream);
+ auto pTestForm = std::make_unique<CPDF_Form>(doc.get(), nullptr, pStream);
pTestForm->ParseContent();
ASSERT_EQ(CPDF_PageObjectHolder::ParseState::kParsed,
pTestForm->GetParseState());
diff --git a/core/fpdfapi/font/cpdf_font.cpp b/core/fpdfapi/font/cpdf_font.cpp
index d8baa11..9a98f3b 100644
--- a/core/fpdfapi/font/cpdf_font.cpp
+++ b/core/fpdfapi/font/cpdf_font.cpp
@@ -279,7 +279,7 @@
}
// static
-RetainPtr<CPDF_Font> CPDF_Font::GetStockFont(CPDF_Document* pDoc,
+RetainPtr<CPDF_Font> CPDF_Font::GetStockFont(CPDF_Document* doc,
ByteStringView name) {
ByteString fontname(name);
std::optional<CFX_FontMapper::StandardFont> font_id =
@@ -289,24 +289,24 @@
}
auto* font_globals = CPDF_FontGlobals::GetInstance();
- RetainPtr<CPDF_Font> font = font_globals->Find(pDoc, font_id.value());
+ RetainPtr<CPDF_Font> font = font_globals->Find(doc, font_id.value());
if (font) {
return font;
}
- auto dict = pDoc->New<CPDF_Dictionary>();
+ auto dict = doc->New<CPDF_Dictionary>();
dict->SetNewFor<CPDF_Name>("Type", "Font");
dict->SetNewFor<CPDF_Name>("Subtype", "Type1");
dict->SetNewFor<CPDF_Name>("BaseFont", fontname);
dict->SetNewFor<CPDF_Name>("Encoding",
pdfium::font_encodings::kWinAnsiEncoding);
font = CPDF_Font::Create(nullptr, std::move(dict), nullptr);
- font_globals->Set(pDoc, font_id.value(), font);
+ font_globals->Set(doc, font_id.value(), font);
return font;
}
// static
-RetainPtr<CPDF_Font> CPDF_Font::Create(CPDF_Document* pDoc,
+RetainPtr<CPDF_Font> CPDF_Font::Create(CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> font_dict,
FormFactoryIface* pFactory) {
ByteString type = font_dict->GetByteStringFor("Subtype");
@@ -318,21 +318,21 @@
RetainPtr<const CPDF_Dictionary> font_desc =
font_dict->GetDictFor("FontDescriptor");
if (!font_desc || !font_desc->KeyExist("FontFile2")) {
- font = pdfium::MakeRetain<CPDF_CIDFont>(pDoc, std::move(font_dict));
+ font = pdfium::MakeRetain<CPDF_CIDFont>(doc, std::move(font_dict));
}
break;
}
}
if (!font) {
- font = pdfium::MakeRetain<CPDF_TrueTypeFont>(pDoc, std::move(font_dict));
+ font = pdfium::MakeRetain<CPDF_TrueTypeFont>(doc, std::move(font_dict));
}
} else if (type == "Type3") {
- font = pdfium::MakeRetain<CPDF_Type3Font>(pDoc, std::move(font_dict),
- pFactory);
+ font =
+ pdfium::MakeRetain<CPDF_Type3Font>(doc, std::move(font_dict), pFactory);
} else if (type == "Type0") {
- font = pdfium::MakeRetain<CPDF_CIDFont>(pDoc, std::move(font_dict));
+ font = pdfium::MakeRetain<CPDF_CIDFont>(doc, std::move(font_dict));
} else {
- font = pdfium::MakeRetain<CPDF_Type1Font>(pDoc, std::move(font_dict));
+ font = pdfium::MakeRetain<CPDF_Type1Font>(doc, std::move(font_dict));
}
if (!font->Load()) {
return nullptr;
diff --git a/core/fpdfapi/font/cpdf_font.h b/core/fpdfapi/font/cpdf_font.h
index 3507817..13fbc1e 100644
--- a/core/fpdfapi/font/cpdf_font.h
+++ b/core/fpdfapi/font/cpdf_font.h
@@ -62,10 +62,10 @@
static constexpr uint32_t kInvalidCharCode = static_cast<uint32_t>(-1);
// |pFactory| only required for Type3 fonts.
- static RetainPtr<CPDF_Font> Create(CPDF_Document* pDoc,
+ static RetainPtr<CPDF_Font> Create(CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> font_dict,
FormFactoryIface* pFactory);
- static RetainPtr<CPDF_Font> GetStockFont(CPDF_Document* pDoc,
+ static RetainPtr<CPDF_Font> GetStockFont(CPDF_Document* doc,
ByteStringView fontname);
virtual bool IsType1Font() const;
diff --git a/core/fpdfapi/font/cpdf_fontglobals.cpp b/core/fpdfapi/font/cpdf_fontglobals.cpp
index c4edcd6..bd57de4 100644
--- a/core/fpdfapi/font/cpdf_fontglobals.cpp
+++ b/core/fpdfapi/font/cpdf_fontglobals.cpp
@@ -63,9 +63,9 @@
}
RetainPtr<CPDF_Font> CPDF_FontGlobals::Find(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
CFX_FontMapper::StandardFont index) {
- auto it = stock_map_.find(pDoc);
+ auto it = stock_map_.find(doc);
if (it == stock_map_.end() || !it->second) {
return nullptr;
}
@@ -73,20 +73,20 @@
return it->second->GetFont(index);
}
-void CPDF_FontGlobals::Set(CPDF_Document* pDoc,
+void CPDF_FontGlobals::Set(CPDF_Document* doc,
CFX_FontMapper::StandardFont index,
RetainPtr<CPDF_Font> font) {
- UnownedPtr<CPDF_Document> pKey(pDoc);
+ UnownedPtr<CPDF_Document> pKey(doc);
if (!pdfium::Contains(stock_map_, pKey)) {
stock_map_[pKey] = std::make_unique<CFX_StockFontArray>();
}
stock_map_[pKey]->SetFont(index, std::move(font));
}
-void CPDF_FontGlobals::Clear(CPDF_Document* pDoc) {
+void CPDF_FontGlobals::Clear(CPDF_Document* doc) {
// Avoid constructing smart-pointer key as erase() doesn't invoke
// transparent lookup in the same way find() does.
- auto it = stock_map_.find(pDoc);
+ auto it = stock_map_.find(doc);
if (it != stock_map_.end()) {
stock_map_.erase(it);
}
diff --git a/core/fpdfapi/font/cpdf_fontglobals.h b/core/fpdfapi/font/cpdf_fontglobals.h
index 92553cb..669e8a2 100644
--- a/core/fpdfapi/font/cpdf_fontglobals.h
+++ b/core/fpdfapi/font/cpdf_fontglobals.h
@@ -32,10 +32,10 @@
// Caller must load the maps before using font globals.
void LoadEmbeddedMaps();
- void Clear(CPDF_Document* pDoc);
- RetainPtr<CPDF_Font> Find(CPDF_Document* pDoc,
+ void Clear(CPDF_Document* doc);
+ RetainPtr<CPDF_Font> Find(CPDF_Document* doc,
CFX_FontMapper::StandardFont index);
- void Set(CPDF_Document* pDoc,
+ void Set(CPDF_Document* doc,
CFX_FontMapper::StandardFont index,
RetainPtr<CPDF_Font> font);
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index 3fd364a..f777155 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -130,7 +130,7 @@
// CPDF_ColorSpace:
std::optional<FX_RGB_STRUCT<float>> GetRGB(
pdfium::span<const float> pBuf) const override;
- uint32_t v_Load(CPDF_Document* pDoc,
+ uint32_t v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) override;
void TranslateImageLine(pdfium::span<uint8_t> dest_span,
@@ -164,7 +164,7 @@
int image_width,
int image_height,
bool bTransMask) const override;
- uint32_t v_Load(CPDF_Document* pDoc,
+ uint32_t v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) override;
@@ -198,7 +198,7 @@
int image_width,
int image_height,
bool bTransMask) const override;
- uint32_t v_Load(CPDF_Document* pDoc,
+ uint32_t v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) override;
@@ -228,7 +228,7 @@
int image_height,
bool bTransMask) const override;
bool IsNormal() const override;
- uint32_t v_Load(CPDF_Document* pDoc,
+ uint32_t v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) override;
@@ -236,7 +236,7 @@
CPDF_ICCBasedCS();
// If no valid ICC profile or using sRGB, try looking for an alternate.
- bool FindAlternateProfile(CPDF_Document* pDoc,
+ bool FindAlternateProfile(CPDF_Document* doc,
const CPDF_Dictionary* dict,
std::set<const CPDF_Object*>* pVisited,
uint32_t nExpectedComponents);
@@ -262,7 +262,7 @@
float* value,
float* min,
float* max) const override;
- uint32_t v_Load(CPDF_Document* pDoc,
+ uint32_t v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) override;
@@ -285,7 +285,7 @@
float* value,
float* min,
float* max) const override;
- uint32_t v_Load(CPDF_Document* pDoc,
+ uint32_t v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) override;
@@ -501,7 +501,7 @@
// static
RetainPtr<CPDF_ColorSpace> CPDF_ColorSpace::Load(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
const CPDF_Object* pObj,
std::set<const CPDF_Object*>* pVisited) {
if (!pObj) {
@@ -556,7 +556,7 @@
}
pCS->array_.Reset(pArray);
- pCS->components_ = pCS->v_Load(pDoc, pArray, pVisited);
+ pCS->components_ = pCS->v_Load(doc, pArray, pVisited);
if (pCS->components_ == 0) {
return nullptr;
}
@@ -699,7 +699,7 @@
CPDF_CalGray::~CPDF_CalGray() = default;
-uint32_t CPDF_CalGray::v_Load(CPDF_Document* pDoc,
+uint32_t CPDF_CalGray::v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) {
RetainPtr<const CPDF_Dictionary> dict = pArray->GetDictAt(1);
@@ -749,7 +749,7 @@
CPDF_CalRGB::~CPDF_CalRGB() = default;
-uint32_t CPDF_CalRGB::v_Load(CPDF_Document* pDoc,
+uint32_t CPDF_CalRGB::v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) {
RetainPtr<const CPDF_Dictionary> dict = pArray->GetDictAt(1);
@@ -845,7 +845,7 @@
*value = 0.0f;
}
-uint32_t CPDF_LabCS::v_Load(CPDF_Document* pDoc,
+uint32_t CPDF_LabCS::v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) {
RetainPtr<const CPDF_Dictionary> dict = pArray->GetDictAt(1);
@@ -932,7 +932,7 @@
CPDF_ICCBasedCS::~CPDF_ICCBasedCS() = default;
-uint32_t CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc,
+uint32_t CPDF_ICCBasedCS::v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) {
RetainPtr<const CPDF_Stream> pStream = pArray->GetStreamAt(1);
@@ -951,7 +951,7 @@
// Safe to cast, as the value just got validated.
const uint32_t nComponents = static_cast<uint32_t>(nDictComponents);
- profile_ = CPDF_DocPageData::FromDocument(pDoc)->GetIccProfile(pStream);
+ profile_ = CPDF_DocPageData::FromDocument(doc)->GetIccProfile(pStream);
if (!profile_) {
return 0;
}
@@ -960,7 +960,7 @@
// SRGB, a profile PDFium recognizes but does not support well, then try the
// alternate profile.
if (!profile_->IsSupported() &&
- !FindAlternateProfile(pDoc, dict.Get(), pVisited, nComponents)) {
+ !FindAlternateProfile(doc, dict.Get(), pVisited, nComponents)) {
// If there is no alternate profile, use a stock profile as mentioned in
// the PDF 1.7 spec in table 4.16 in the "Alternate" key description.
DCHECK(!base_cs_);
@@ -1080,7 +1080,7 @@
}
bool CPDF_ICCBasedCS::FindAlternateProfile(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
const CPDF_Dictionary* dict,
std::set<const CPDF_Object*>* pVisited,
uint32_t nExpectedComponents) {
@@ -1090,7 +1090,7 @@
return false;
}
- auto pAlterCS = CPDF_ColorSpace::Load(pDoc, pAlterCSObj.Get(), pVisited);
+ auto pAlterCS = CPDF_ColorSpace::Load(doc, pAlterCSObj.Get(), pVisited);
if (!pAlterCS) {
return false;
}
@@ -1153,7 +1153,7 @@
*max = 1.0f;
}
-uint32_t CPDF_SeparationCS::v_Load(CPDF_Document* pDoc,
+uint32_t CPDF_SeparationCS::v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) {
is_none_type_ = pArray->GetByteStringAt(1) == "None";
@@ -1166,7 +1166,7 @@
return 0;
}
- base_cs_ = Load(pDoc, pAltArray.Get(), pVisited);
+ base_cs_ = Load(doc, pAltArray.Get(), pVisited);
if (!base_cs_) {
return 0;
}
@@ -1223,7 +1223,7 @@
*max = 1.0f;
}
-uint32_t CPDF_DeviceNCS::v_Load(CPDF_Document* pDoc,
+uint32_t CPDF_DeviceNCS::v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) {
RetainPtr<const CPDF_Array> pObj = ToArray(pArray->GetDirectObjectAt(1));
@@ -1236,7 +1236,7 @@
return 0;
}
- base_cs_ = Load(pDoc, pAltCS.Get(), pVisited);
+ base_cs_ = Load(doc, pAltCS.Get(), pVisited);
func_ = CPDF_Function::Load(pArray->GetDirectObjectAt(3));
if (!base_cs_ || !func_) {
return 0;
diff --git a/core/fpdfapi/page/cpdf_colorspace.h b/core/fpdfapi/page/cpdf_colorspace.h
index 76bd36c..5821412 100644
--- a/core/fpdfapi/page/cpdf_colorspace.h
+++ b/core/fpdfapi/page/cpdf_colorspace.h
@@ -79,7 +79,7 @@
static RetainPtr<CPDF_ColorSpace> GetStockCS(Family family);
static RetainPtr<CPDF_ColorSpace> GetStockCSForName(const ByteString& name);
static RetainPtr<CPDF_ColorSpace> Load(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
const CPDF_Object* pObj,
std::set<const CPDF_Object*>* pVisited);
@@ -138,7 +138,7 @@
~CPDF_ColorSpace() override;
// Returns the number of components, or 0 on failure.
- virtual uint32_t v_Load(CPDF_Document* pDoc,
+ virtual uint32_t v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) = 0;
diff --git a/core/fpdfapi/page/cpdf_devicecs.cpp b/core/fpdfapi/page/cpdf_devicecs.cpp
index a834c19..1f90ed1 100644
--- a/core/fpdfapi/page/cpdf_devicecs.cpp
+++ b/core/fpdfapi/page/cpdf_devicecs.cpp
@@ -35,7 +35,7 @@
CPDF_DeviceCS::~CPDF_DeviceCS() = default;
-uint32_t CPDF_DeviceCS::v_Load(CPDF_Document* pDoc,
+uint32_t CPDF_DeviceCS::v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) {
// Unlike other classes that inherit from CPDF_ColorSpace, CPDF_DeviceCS is
diff --git a/core/fpdfapi/page/cpdf_devicecs.h b/core/fpdfapi/page/cpdf_devicecs.h
index 788c36e..5fff876 100644
--- a/core/fpdfapi/page/cpdf_devicecs.h
+++ b/core/fpdfapi/page/cpdf_devicecs.h
@@ -26,7 +26,7 @@
int image_width,
int image_height,
bool bTransMask) const override;
- uint32_t v_Load(CPDF_Document* pDoc,
+ uint32_t v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) override;
diff --git a/core/fpdfapi/page/cpdf_dib.cpp b/core/fpdfapi/page/cpdf_dib.cpp
index be46268..cf117c8 100644
--- a/core/fpdfapi/page/cpdf_dib.cpp
+++ b/core/fpdfapi/page/cpdf_dib.cpp
@@ -310,8 +310,8 @@
} // namespace
-CPDF_DIB::CPDF_DIB(CPDF_Document* pDoc, RetainPtr<const CPDF_Stream> pStream)
- : document_(pDoc), stream_(std::move(pStream)) {}
+CPDF_DIB::CPDF_DIB(CPDF_Document* doc, RetainPtr<const CPDF_Stream> pStream)
+ : document_(doc), stream_(std::move(pStream)) {}
CPDF_DIB::~CPDF_DIB() = default;
diff --git a/core/fpdfapi/page/cpdf_dib.h b/core/fpdfapi/page/cpdf_dib.h
index 7f4e197..4c237aa 100644
--- a/core/fpdfapi/page/cpdf_dib.h
+++ b/core/fpdfapi/page/cpdf_dib.h
@@ -65,7 +65,7 @@
RetainPtr<CPDF_DIB> DetachMask();
private:
- CPDF_DIB(CPDF_Document* pDoc, RetainPtr<const CPDF_Stream> pStream);
+ CPDF_DIB(CPDF_Document* doc, RetainPtr<const CPDF_Stream> pStream);
~CPDF_DIB() override;
struct JpxSMaskInlineData {
diff --git a/core/fpdfapi/page/cpdf_docpagedata.cpp b/core/fpdfapi/page/cpdf_docpagedata.cpp
index ec59369..b48f66b 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.cpp
+++ b/core/fpdfapi/page/cpdf_docpagedata.cpp
@@ -149,7 +149,7 @@
pBaseDict->SetFor("Widths", pWidths);
}
-RetainPtr<CPDF_Dictionary> CalculateFontDesc(CPDF_Document* pDoc,
+RetainPtr<CPDF_Dictionary> CalculateFontDesc(CPDF_Document* doc,
ByteString basefont,
int flags,
int italicangle,
@@ -157,7 +157,7 @@
int descend,
RetainPtr<CPDF_Array> bbox,
int32_t stemV) {
- auto font_desc = pDoc->New<CPDF_Dictionary>();
+ auto font_desc = doc->New<CPDF_Dictionary>();
font_desc->SetNewFor<CPDF_Name>("Type", "FontDescriptor");
font_desc->SetNewFor<CPDF_Name>("FontName", basefont);
font_desc->SetNewFor<CPDF_Number>("Flags", flags);
@@ -172,8 +172,8 @@
} // namespace
// static
-CPDF_DocPageData* CPDF_DocPageData::FromDocument(const CPDF_Document* pDoc) {
- return static_cast<CPDF_DocPageData*>(pDoc->GetPageData());
+CPDF_DocPageData* CPDF_DocPageData::FromDocument(const CPDF_Document* doc) {
+ return static_cast<CPDF_DocPageData*>(doc->GetPageData());
}
CPDF_DocPageData::CPDF_DocPageData() = default;
diff --git a/core/fpdfapi/page/cpdf_docpagedata.h b/core/fpdfapi/page/cpdf_docpagedata.h
index ed90d27..e733a87 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.h
+++ b/core/fpdfapi/page/cpdf_docpagedata.h
@@ -33,7 +33,7 @@
class CPDF_DocPageData final : public CPDF_Document::PageDataIface,
public CPDF_Font::FormFactoryIface {
public:
- static CPDF_DocPageData* FromDocument(const CPDF_Document* pDoc);
+ static CPDF_DocPageData* FromDocument(const CPDF_Document* doc);
CPDF_DocPageData();
~CPDF_DocPageData() override;
diff --git a/core/fpdfapi/page/cpdf_form.cpp b/core/fpdfapi/page/cpdf_form.cpp
index 8fdd5ad..a363f9d 100644
--- a/core/fpdfapi/page/cpdf_form.cpp
+++ b/core/fpdfapi/page/cpdf_form.cpp
@@ -33,19 +33,19 @@
return pParentResources ? pParentResources : pPageResources;
}
-CPDF_Form::CPDF_Form(CPDF_Document* pDoc,
+CPDF_Form::CPDF_Form(CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> pPageResources,
RetainPtr<CPDF_Stream> pFormStream)
- : CPDF_Form(pDoc,
+ : CPDF_Form(doc,
std::move(pPageResources),
std::move(pFormStream),
nullptr) {}
-CPDF_Form::CPDF_Form(CPDF_Document* pDoc,
+CPDF_Form::CPDF_Form(CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> pPageResources,
RetainPtr<CPDF_Stream> pFormStream,
CPDF_Dictionary* pParentResources)
- : CPDF_PageObjectHolder(pDoc,
+ : CPDF_PageObjectHolder(doc,
pFormStream->GetMutableDict(),
pPageResources,
pdfium::WrapRetain(ChooseResourcesDict(
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index 7aacac1..5067b09 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -48,19 +48,19 @@
return bpc == 1 || bpc == 2 || bpc == 4 || bpc == 8 || bpc == 16;
}
-CPDF_Image::CPDF_Image(CPDF_Document* pDoc) : document_(pDoc) {
+CPDF_Image::CPDF_Image(CPDF_Document* doc) : document_(doc) {
DCHECK(document_);
}
-CPDF_Image::CPDF_Image(CPDF_Document* pDoc, RetainPtr<CPDF_Stream> pStream)
- : is_inline_(true), document_(pDoc), stream_(std::move(pStream)) {
+CPDF_Image::CPDF_Image(CPDF_Document* doc, RetainPtr<CPDF_Stream> pStream)
+ : is_inline_(true), document_(doc), stream_(std::move(pStream)) {
DCHECK(document_);
FinishInitialization();
}
-CPDF_Image::CPDF_Image(CPDF_Document* pDoc, uint32_t dwStreamObjNum)
- : document_(pDoc),
- stream_(ToStream(pDoc->GetMutableIndirectObject(dwStreamObjNum))) {
+CPDF_Image::CPDF_Image(CPDF_Document* doc, uint32_t dwStreamObjNum)
+ : document_(doc),
+ stream_(ToStream(doc->GetMutableIndirectObject(dwStreamObjNum))) {
DCHECK(document_);
FinishInitialization();
}
diff --git a/core/fpdfapi/page/cpdf_image.h b/core/fpdfapi/page/cpdf_image.h
index 4327b86..175cfc1 100644
--- a/core/fpdfapi/page/cpdf_image.h
+++ b/core/fpdfapi/page/cpdf_image.h
@@ -75,9 +75,9 @@
RetainPtr<CFX_DIBBase> DetachMask();
private:
- explicit CPDF_Image(CPDF_Document* pDoc);
- CPDF_Image(CPDF_Document* pDoc, RetainPtr<CPDF_Stream> pStream);
- CPDF_Image(CPDF_Document* pDoc, uint32_t dwStreamObjNum);
+ explicit CPDF_Image(CPDF_Document* doc);
+ CPDF_Image(CPDF_Document* doc, RetainPtr<CPDF_Stream> pStream);
+ CPDF_Image(CPDF_Document* doc, uint32_t dwStreamObjNum);
~CPDF_Image() override;
void FinishInitialization();
diff --git a/core/fpdfapi/page/cpdf_imageobject.cpp b/core/fpdfapi/page/cpdf_imageobject.cpp
index 8376883..b8846d5 100644
--- a/core/fpdfapi/page/cpdf_imageobject.cpp
+++ b/core/fpdfapi/page/cpdf_imageobject.cpp
@@ -98,9 +98,9 @@
return;
}
- auto* pDoc = image_->GetDocument();
- CHECK(pDoc);
+ auto* doc = image_->GetDocument();
+ CHECK(doc);
image_.Reset(); // Clear my reference before asking the cache.
- pDoc->MaybePurgeImage(objnum);
+ doc->MaybePurgeImage(objnum);
}
diff --git a/core/fpdfapi/page/cpdf_indexedcs.cpp b/core/fpdfapi/page/cpdf_indexedcs.cpp
index ee3deaa..54426e7 100644
--- a/core/fpdfapi/page/cpdf_indexedcs.cpp
+++ b/core/fpdfapi/page/cpdf_indexedcs.cpp
@@ -28,7 +28,7 @@
return this;
}
-uint32_t CPDF_IndexedCS::v_Load(CPDF_Document* pDoc,
+uint32_t CPDF_IndexedCS::v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) {
if (pArray->size() < 4) {
@@ -40,7 +40,7 @@
return 0;
}
- auto* pDocPageData = CPDF_DocPageData::FromDocument(pDoc);
+ auto* pDocPageData = CPDF_DocPageData::FromDocument(doc);
base_cs_ =
pDocPageData->GetColorSpaceGuarded(pBaseObj.Get(), nullptr, pVisited);
if (!base_cs_) {
diff --git a/core/fpdfapi/page/cpdf_indexedcs.h b/core/fpdfapi/page/cpdf_indexedcs.h
index 99a80e8..917bd99 100644
--- a/core/fpdfapi/page/cpdf_indexedcs.h
+++ b/core/fpdfapi/page/cpdf_indexedcs.h
@@ -31,7 +31,7 @@
std::optional<FX_RGB_STRUCT<float>> GetRGB(
pdfium::span<const float> pBuf) const override;
const CPDF_IndexedCS* AsIndexedCS() const override;
- uint32_t v_Load(CPDF_Document* pDoc,
+ uint32_t v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) override;
diff --git a/core/fpdfapi/page/cpdf_occontext.cpp b/core/fpdfapi/page/cpdf_occontext.cpp
index cc4f498..9830c66 100644
--- a/core/fpdfapi/page/cpdf_occontext.cpp
+++ b/core/fpdfapi/page/cpdf_occontext.cpp
@@ -36,11 +36,11 @@
return bsIntent == "All" || bsIntent == csElement;
}
-RetainPtr<const CPDF_Dictionary> GetConfig(CPDF_Document* pDoc,
+RetainPtr<const CPDF_Dictionary> GetConfig(CPDF_Document* doc,
const CPDF_Dictionary* pOCGDict) {
DCHECK(pOCGDict);
RetainPtr<const CPDF_Dictionary> pOCProperties =
- pDoc->GetRoot()->GetDictFor("OCProperties");
+ doc->GetRoot()->GetDictFor("OCProperties");
if (!pOCProperties) {
return nullptr;
}
@@ -85,9 +85,9 @@
} // namespace
-CPDF_OCContext::CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType)
- : document_(pDoc), usage_type_(eUsageType) {
- DCHECK(pDoc);
+CPDF_OCContext::CPDF_OCContext(CPDF_Document* doc, UsageType eUsageType)
+ : document_(doc), usage_type_(eUsageType) {
+ DCHECK(doc);
}
CPDF_OCContext::~CPDF_OCContext() = default;
diff --git a/core/fpdfapi/page/cpdf_occontext.h b/core/fpdfapi/page/cpdf_occontext.h
index 7985d54..61533e8 100644
--- a/core/fpdfapi/page/cpdf_occontext.h
+++ b/core/fpdfapi/page/cpdf_occontext.h
@@ -29,7 +29,7 @@
bool CheckPageObjectVisible(const CPDF_PageObject* pObj) const;
private:
- CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType);
+ CPDF_OCContext(CPDF_Document* doc, UsageType eUsageType);
~CPDF_OCContext() override;
bool LoadOCGStateFromConfig(ByteStringView config,
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.cpp b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
index f80e1bf..362b988 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.cpp
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
@@ -39,14 +39,14 @@
}
CPDF_PageObjectHolder::CPDF_PageObjectHolder(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> dict,
RetainPtr<CPDF_Dictionary> pPageResources,
RetainPtr<CPDF_Dictionary> pResources)
: page_resources_(std::move(pPageResources)),
resources_(std::move(pResources)),
dict_(std::move(dict)),
- document_(pDoc) {
+ document_(doc) {
DCHECK(dict_);
}
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.h b/core/fpdfapi/page/cpdf_pageobjectholder.h
index 9bbd2b4..7ca2bbf 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.h
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.h
@@ -70,7 +70,7 @@
using const_iterator =
std::deque<std::unique_ptr<CPDF_PageObject>>::const_iterator;
- CPDF_PageObjectHolder(CPDF_Document* pDoc,
+ CPDF_PageObjectHolder(CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> dict,
RetainPtr<CPDF_Dictionary> pPageResources,
RetainPtr<CPDF_Dictionary> pResources);
diff --git a/core/fpdfapi/page/cpdf_pattern.cpp b/core/fpdfapi/page/cpdf_pattern.cpp
index 28ee312..d0daf62 100644
--- a/core/fpdfapi/page/cpdf_pattern.cpp
+++ b/core/fpdfapi/page/cpdf_pattern.cpp
@@ -11,10 +11,10 @@
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fxcrt/check.h"
-CPDF_Pattern::CPDF_Pattern(CPDF_Document* pDoc,
+CPDF_Pattern::CPDF_Pattern(CPDF_Document* doc,
RetainPtr<CPDF_Object> pObj,
const CFX_Matrix& parentMatrix)
- : document_(pDoc),
+ : document_(doc),
pattern_obj_(std::move(pObj)),
parent_matrix_(parentMatrix) {
DCHECK(document_);
diff --git a/core/fpdfapi/page/cpdf_pattern.h b/core/fpdfapi/page/cpdf_pattern.h
index 68be477..5aaf703 100644
--- a/core/fpdfapi/page/cpdf_pattern.h
+++ b/core/fpdfapi/page/cpdf_pattern.h
@@ -28,7 +28,7 @@
const CFX_Matrix& pattern_to_form() const { return pattern_to_form_; }
protected:
- CPDF_Pattern(CPDF_Document* pDoc,
+ CPDF_Pattern(CPDF_Document* doc,
RetainPtr<CPDF_Object> pObj,
const CFX_Matrix& parentMatrix);
~CPDF_Pattern() override;
diff --git a/core/fpdfapi/page/cpdf_patterncs.cpp b/core/fpdfapi/page/cpdf_patterncs.cpp
index 81b663c..a811ba9 100644
--- a/core/fpdfapi/page/cpdf_patterncs.cpp
+++ b/core/fpdfapi/page/cpdf_patterncs.cpp
@@ -21,7 +21,7 @@
SetComponentsForStockCS(1);
}
-uint32_t CPDF_PatternCS::v_Load(CPDF_Document* pDoc,
+uint32_t CPDF_PatternCS::v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) {
RetainPtr<const CPDF_Object> pBaseCS = pArray->GetDirectObjectAt(1);
@@ -29,7 +29,7 @@
return 0;
}
- auto* pDocPageData = CPDF_DocPageData::FromDocument(pDoc);
+ auto* pDocPageData = CPDF_DocPageData::FromDocument(doc);
base_cs_ =
pDocPageData->GetColorSpaceGuarded(pBaseCS.Get(), nullptr, pVisited);
if (!base_cs_) {
diff --git a/core/fpdfapi/page/cpdf_patterncs.h b/core/fpdfapi/page/cpdf_patterncs.h
index 69b7688..5c4bb58 100644
--- a/core/fpdfapi/page/cpdf_patterncs.h
+++ b/core/fpdfapi/page/cpdf_patterncs.h
@@ -29,7 +29,7 @@
std::optional<FX_RGB_STRUCT<float>> GetRGB(
pdfium::span<const float> pBuf) const override;
const CPDF_PatternCS* AsPatternCS() const override;
- uint32_t v_Load(CPDF_Document* pDoc,
+ uint32_t v_Load(CPDF_Document* doc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) override;
diff --git a/core/fpdfapi/page/cpdf_shadingpattern.cpp b/core/fpdfapi/page/cpdf_shadingpattern.cpp
index 3529cf4..e94f344 100644
--- a/core/fpdfapi/page/cpdf_shadingpattern.cpp
+++ b/core/fpdfapi/page/cpdf_shadingpattern.cpp
@@ -30,11 +30,11 @@
} // namespace
-CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc,
+CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* doc,
RetainPtr<CPDF_Object> pPatternObj,
bool bShading,
const CFX_Matrix& parentMatrix)
- : CPDF_Pattern(pDoc, std::move(pPatternObj), parentMatrix),
+ : CPDF_Pattern(doc, std::move(pPatternObj), parentMatrix),
shading_(bShading) {
DCHECK(document());
if (!bShading) {
diff --git a/core/fpdfapi/page/cpdf_shadingpattern.h b/core/fpdfapi/page/cpdf_shadingpattern.h
index 49434ed..9a36d77 100644
--- a/core/fpdfapi/page/cpdf_shadingpattern.h
+++ b/core/fpdfapi/page/cpdf_shadingpattern.h
@@ -61,7 +61,7 @@
}
private:
- CPDF_ShadingPattern(CPDF_Document* pDoc,
+ CPDF_ShadingPattern(CPDF_Document* doc,
RetainPtr<CPDF_Object> pPatternObj,
bool bShading,
const CFX_Matrix& parentMatrix);
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h
index 1e7df63..38e9977 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.h
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.h
@@ -45,7 +45,7 @@
static void InitializeGlobals();
static void DestroyGlobals();
- CPDF_StreamContentParser(CPDF_Document* pDoc,
+ CPDF_StreamContentParser(CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> pPageResources,
RetainPtr<CPDF_Dictionary> pParentResources,
const CFX_Matrix* pmtContentToUser,
diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp
index 9572b72..1441831 100644
--- a/core/fpdfapi/page/cpdf_streamparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamparser.cpp
@@ -138,7 +138,7 @@
CPDF_StreamParser::~CPDF_StreamParser() = default;
RetainPtr<CPDF_Stream> CPDF_StreamParser::ReadInlineStream(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> dict,
const CPDF_Object* pCSObj) {
auto stream_span = buf_.subspan(pos_);
@@ -177,7 +177,7 @@
uint32_t nComponents = 1;
if (pCSObj) {
RetainPtr<CPDF_ColorSpace> pCS =
- CPDF_DocPageData::FromDocument(pDoc)->GetColorSpace(pCSObj, nullptr);
+ CPDF_DocPageData::FromDocument(doc)->GetColorSpace(pCSObj, nullptr);
nComponents = pCS ? pCS->ComponentCount() : 3;
bpc = dict->GetIntegerFor("BitsPerComponent");
}
diff --git a/core/fpdfapi/page/cpdf_streamparser.h b/core/fpdfapi/page/cpdf_streamparser.h
index e520464..b50d2d0 100644
--- a/core/fpdfapi/page/cpdf_streamparser.h
+++ b/core/fpdfapi/page/cpdf_streamparser.h
@@ -42,7 +42,7 @@
RetainPtr<CPDF_Object> ReadNextObject(bool bAllowNestedArray,
bool bInArray,
uint32_t dwRecursionLevel);
- RetainPtr<CPDF_Stream> ReadInlineStream(CPDF_Document* pDoc,
+ RetainPtr<CPDF_Stream> ReadInlineStream(CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> dict,
const CPDF_Object* pCSObj);
diff --git a/core/fpdfapi/page/cpdf_tilingpattern.cpp b/core/fpdfapi/page/cpdf_tilingpattern.cpp
index a88aa5e..7bf8a2b 100644
--- a/core/fpdfapi/page/cpdf_tilingpattern.cpp
+++ b/core/fpdfapi/page/cpdf_tilingpattern.cpp
@@ -18,10 +18,10 @@
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fxcrt/check.h"
-CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc,
+CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* doc,
RetainPtr<CPDF_Object> pPatternObj,
const CFX_Matrix& parentMatrix)
- : CPDF_Pattern(pDoc, std::move(pPatternObj), parentMatrix) {
+ : CPDF_Pattern(doc, std::move(pPatternObj), parentMatrix) {
DCHECK(document());
colored_ = pattern_obj()->GetDict()->GetIntegerFor("PaintType") == 1;
SetPatternToFormMatrix();
diff --git a/core/fpdfapi/page/cpdf_tilingpattern.h b/core/fpdfapi/page/cpdf_tilingpattern.h
index e62fcd1..997c602 100644
--- a/core/fpdfapi/page/cpdf_tilingpattern.h
+++ b/core/fpdfapi/page/cpdf_tilingpattern.h
@@ -34,7 +34,7 @@
float y_step() const { return ystep_; }
private:
- CPDF_TilingPattern(CPDF_Document* pDoc,
+ CPDF_TilingPattern(CPDF_Document* doc,
RetainPtr<CPDF_Object> pPatternObj,
const CFX_Matrix& parentMatrix);
CPDF_TilingPattern(const CPDF_TilingPattern&) = delete;
diff --git a/core/fpdfapi/parser/cfdf_document.cpp b/core/fpdfapi/parser/cfdf_document.cpp
index dbb5ee3..60dbf8b 100644
--- a/core/fpdfapi/parser/cfdf_document.cpp
+++ b/core/fpdfapi/parser/cfdf_document.cpp
@@ -22,20 +22,20 @@
CFDF_Document::~CFDF_Document() = default;
std::unique_ptr<CFDF_Document> CFDF_Document::CreateNewDoc() {
- auto pDoc = std::make_unique<CFDF_Document>();
- pDoc->root_dict_ = pDoc->NewIndirect<CPDF_Dictionary>();
- pDoc->root_dict_->SetNewFor<CPDF_Dictionary>("FDF");
- return pDoc;
+ auto doc = std::make_unique<CFDF_Document>();
+ doc->root_dict_ = doc->NewIndirect<CPDF_Dictionary>();
+ doc->root_dict_->SetNewFor<CPDF_Dictionary>("FDF");
+ return doc;
}
std::unique_ptr<CFDF_Document> CFDF_Document::ParseMemory(
pdfium::span<const uint8_t> span) {
- auto pDoc = std::make_unique<CFDF_Document>();
- pDoc->ParseStream(pdfium::MakeRetain<CFX_ReadOnlySpanStream>(span));
- if (!pDoc->root_dict_) {
+ auto doc = std::make_unique<CFDF_Document>();
+ doc->ParseStream(pdfium::MakeRetain<CFX_ReadOnlySpanStream>(span));
+ if (!doc->root_dict_) {
return nullptr;
}
- return pDoc;
+ return doc;
}
void CFDF_Document::ParseStream(RetainPtr<IFX_SeekableReadStream> pFile) {
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index 0aeea56..e22f546 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -57,7 +57,7 @@
RetainPtr<CPDF_StreamAcc>&& pStreamAcc) = 0;
virtual void MaybePurgeImage(uint32_t objnum) = 0;
- void SetDocument(CPDF_Document* pDoc) { doc_ = pDoc; }
+ void SetDocument(CPDF_Document* doc) { doc_ = doc; }
protected:
CPDF_Document* GetDocument() const { return doc_; }
@@ -71,7 +71,7 @@
RenderDataIface();
virtual ~RenderDataIface();
- void SetDocument(CPDF_Document* pDoc) { doc_ = pDoc; }
+ void SetDocument(CPDF_Document* doc) { doc_ = doc; }
protected:
CPDF_Document* GetDocument() const { return doc_; }
diff --git a/core/fpdfapi/parser/cpdf_document_unittest.cpp b/core/fpdfapi/parser/cpdf_document_unittest.cpp
index 1b63258..27a5a16 100644
--- a/core/fpdfapi/parser/cpdf_document_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_document_unittest.cpp
@@ -26,15 +26,15 @@
const int kNumTestPages = 7;
RetainPtr<CPDF_Dictionary> CreatePageTreeNode(RetainPtr<CPDF_Array> kids,
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
int count) {
- uint32_t new_objnum = pDoc->AddIndirectObject(kids);
- auto pageNode = pDoc->NewIndirect<CPDF_Dictionary>();
+ uint32_t new_objnum = doc->AddIndirectObject(kids);
+ auto pageNode = doc->NewIndirect<CPDF_Dictionary>();
pageNode->SetNewFor<CPDF_Name>("Type", "Pages");
- pageNode->SetNewFor<CPDF_Reference>("Kids", pDoc, new_objnum);
+ pageNode->SetNewFor<CPDF_Reference>("Kids", doc, new_objnum);
pageNode->SetNewFor<CPDF_Number>("Count", count);
for (size_t i = 0; i < kids->size(); i++) {
- kids->GetMutableDictAt(i)->SetNewFor<CPDF_Reference>("Parent", pDoc,
+ kids->GetMutableDictAt(i)->SetNewFor<CPDF_Reference>("Parent", doc,
pageNode->GetObjNum());
}
return pageNode;
@@ -298,12 +298,12 @@
TEST_F(DocumentTest, PagesWithoutKids) {
// Set up a document with Pages dict without kids, and Count = 3
- auto pDoc = std::make_unique<CPDF_TestDocPagesWithoutKids>();
- EXPECT_TRUE(pDoc->GetPageDictionary(0));
+ auto doc = std::make_unique<CPDF_TestDocPagesWithoutKids>();
+ EXPECT_TRUE(doc->GetPageDictionary(0));
// Test GetPage does not fetch pages out of range
for (int i = 1; i < 5; i++) {
- EXPECT_FALSE(pDoc->GetPageDictionary(i));
+ EXPECT_FALSE(doc->GetPageDictionary(i));
}
- EXPECT_TRUE(pDoc->GetPageDictionary(0));
+ EXPECT_TRUE(doc->GetPageDictionary(0));
}
diff --git a/core/fpdfapi/parser/cpdf_reference.cpp b/core/fpdfapi/parser/cpdf_reference.cpp
index d176f91..8dc56d5 100644
--- a/core/fpdfapi/parser/cpdf_reference.cpp
+++ b/core/fpdfapi/parser/cpdf_reference.cpp
@@ -12,8 +12,8 @@
#include "core/fxcrt/containers/contains.h"
#include "core/fxcrt/fx_stream.h"
-CPDF_Reference::CPDF_Reference(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum)
- : obj_list_(pDoc), ref_obj_num_(objnum) {}
+CPDF_Reference::CPDF_Reference(CPDF_IndirectObjectHolder* doc, uint32_t objnum)
+ : obj_list_(doc), ref_obj_num_(objnum) {}
CPDF_Reference::~CPDF_Reference() = default;
@@ -71,8 +71,8 @@
return (obj && !obj->IsReference()) ? obj : nullptr;
}
-void CPDF_Reference::SetRef(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum) {
- obj_list_ = pDoc;
+void CPDF_Reference::SetRef(CPDF_IndirectObjectHolder* doc, uint32_t objnum) {
+ obj_list_ = doc;
ref_obj_num_ = objnum;
}
diff --git a/core/fpdfapi/parser/cpdf_reference.h b/core/fpdfapi/parser/cpdf_reference.h
index 547d547..63baff1 100644
--- a/core/fpdfapi/parser/cpdf_reference.h
+++ b/core/fpdfapi/parser/cpdf_reference.h
@@ -33,12 +33,12 @@
uint32_t GetRefObjNum() const { return ref_obj_num_; }
bool HasIndirectObjectHolder() const { return !!obj_list_; }
- void SetRef(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum);
+ void SetRef(CPDF_IndirectObjectHolder* doc, uint32_t objnum);
private:
friend class CPDF_Dictionary;
- CPDF_Reference(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum);
+ CPDF_Reference(CPDF_IndirectObjectHolder* doc, uint32_t objnum);
~CPDF_Reference() override;
const CPDF_Object* GetDirectInternal() const override;
diff --git a/core/fpdfapi/render/cpdf_docrenderdata.cpp b/core/fpdfapi/render/cpdf_docrenderdata.cpp
index 30a7f73..753f962 100644
--- a/core/fpdfapi/render/cpdf_docrenderdata.cpp
+++ b/core/fpdfapi/render/cpdf_docrenderdata.cpp
@@ -34,9 +34,8 @@
} // namespace
// static
-CPDF_DocRenderData* CPDF_DocRenderData::FromDocument(
- const CPDF_Document* pDoc) {
- return static_cast<CPDF_DocRenderData*>(pDoc->GetRenderData());
+CPDF_DocRenderData* CPDF_DocRenderData::FromDocument(const CPDF_Document* doc) {
+ return static_cast<CPDF_DocRenderData*>(doc->GetRenderData());
}
CPDF_DocRenderData::CPDF_DocRenderData() = default;
diff --git a/core/fpdfapi/render/cpdf_docrenderdata.h b/core/fpdfapi/render/cpdf_docrenderdata.h
index 035a7d7..f11be0c 100644
--- a/core/fpdfapi/render/cpdf_docrenderdata.h
+++ b/core/fpdfapi/render/cpdf_docrenderdata.h
@@ -31,7 +31,7 @@
class CPDF_DocRenderData : public CPDF_Document::RenderDataIface {
public:
- static CPDF_DocRenderData* FromDocument(const CPDF_Document* pDoc);
+ static CPDF_DocRenderData* FromDocument(const CPDF_Document* doc);
CPDF_DocRenderData();
~CPDF_DocRenderData() override;
diff --git a/core/fpdfapi/render/cpdf_rendercontext.cpp b/core/fpdfapi/render/cpdf_rendercontext.cpp
index f78de19..c699c11 100644
--- a/core/fpdfapi/render/cpdf_rendercontext.cpp
+++ b/core/fpdfapi/render/cpdf_rendercontext.cpp
@@ -25,10 +25,10 @@
#include "core/fxge/dib/fx_dib.h"
CPDF_RenderContext::CPDF_RenderContext(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> pPageResources,
CPDF_PageImageCache* pPageCache)
- : document_(pDoc),
+ : document_(doc),
page_resources_(std::move(pPageResources)),
page_cache_(pPageCache) {}
diff --git a/core/fpdfapi/render/cpdf_rendercontext.h b/core/fpdfapi/render/cpdf_rendercontext.h
index 63de34b..9cc3e98 100644
--- a/core/fpdfapi/render/cpdf_rendercontext.h
+++ b/core/fpdfapi/render/cpdf_rendercontext.h
@@ -40,7 +40,7 @@
const CFX_Matrix matrix_;
};
- CPDF_RenderContext(CPDF_Document* pDoc,
+ CPDF_RenderContext(CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> pPageResources,
CPDF_PageImageCache* pPageCache);
~CPDF_RenderContext();
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 1a31f44..c5a6f35 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1051,9 +1051,9 @@
}
#endif
- CPDF_Document* pDoc = pType3Font->GetDocument();
+ CPDF_Document* doc = pType3Font->GetDocument();
RetainPtr<CPDF_Type3Cache> pCache =
- CPDF_DocRenderData::FromDocument(pDoc)->GetCachedType3(pType3Font);
+ CPDF_DocRenderData::FromDocument(doc)->GetCachedType3(pType3Font);
const CFX_GlyphBitmap* pBitmap = pCache->LoadGlyph(charcode, matrix);
if (!pBitmap) {
diff --git a/core/fpdfapi/render/cpdf_rendertiling.cpp b/core/fpdfapi/render/cpdf_rendertiling.cpp
index de6c3cd..23db451 100644
--- a/core/fpdfapi/render/cpdf_rendertiling.cpp
+++ b/core/fpdfapi/render/cpdf_rendertiling.cpp
@@ -25,7 +25,7 @@
namespace {
RetainPtr<CFX_DIBitmap> DrawPatternBitmap(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
CPDF_PageImageCache* pCache,
CPDF_TilingPattern* pPattern,
CPDF_Form* pPatternForm,
@@ -60,7 +60,7 @@
options.GetOptions() = draw_options;
options.GetOptions().bForceHalftone = true;
- CPDF_RenderContext context(pDoc, nullptr, pCache);
+ CPDF_RenderContext context(doc, nullptr, pCache);
context.AppendLayer(pPatternForm, mtPattern2Bitmap);
context.Render(&bitmap_device, nullptr, &options, nullptr);
diff --git a/core/fpdfdoc/cpdf_action.cpp b/core/fpdfdoc/cpdf_action.cpp
index 4e8dde9..83a0383 100644
--- a/core/fpdfdoc/cpdf_action.cpp
+++ b/core/fpdfdoc/cpdf_action.cpp
@@ -72,12 +72,12 @@
return Type::kUnknown;
}
-CPDF_Dest CPDF_Action::GetDest(CPDF_Document* pDoc) const {
+CPDF_Dest CPDF_Action::GetDest(CPDF_Document* doc) const {
Type type = GetType();
if (type != Type::kGoTo && type != Type::kGoToR && type != Type::kGoToE) {
return CPDF_Dest(nullptr);
}
- return CPDF_Dest::Create(pDoc, dict_->GetDirectObjectFor("D"));
+ return CPDF_Dest::Create(doc, dict_->GetDirectObjectFor("D"));
}
WideString CPDF_Action::GetFilePath() const {
@@ -106,13 +106,13 @@
pWinDict->GetByteStringFor(pdfium::stream::kF).AsStringView());
}
-ByteString CPDF_Action::GetURI(const CPDF_Document* pDoc) const {
+ByteString CPDF_Action::GetURI(const CPDF_Document* doc) const {
if (GetType() != Type::kURI) {
return ByteString();
}
ByteString csURI = dict_->GetByteStringFor("URI");
- RetainPtr<const CPDF_Dictionary> pURI = pDoc->GetRoot()->GetDictFor("URI");
+ RetainPtr<const CPDF_Dictionary> pURI = doc->GetRoot()->GetDictFor("URI");
if (pURI) {
auto result = csURI.Find(":");
if (!result.has_value() || result.value() == 0) {
diff --git a/core/fpdfdoc/cpdf_action.h b/core/fpdfdoc/cpdf_action.h
index 2b582d1..93fc16b 100644
--- a/core/fpdfdoc/cpdf_action.h
+++ b/core/fpdfdoc/cpdf_action.h
@@ -51,9 +51,9 @@
const CPDF_Dictionary* GetDict() const { return dict_.Get(); }
Type GetType() const;
- CPDF_Dest GetDest(CPDF_Document* pDoc) const;
+ CPDF_Dest GetDest(CPDF_Document* doc) const;
WideString GetFilePath() const;
- ByteString GetURI(const CPDF_Document* pDoc) const;
+ ByteString GetURI(const CPDF_Document* doc) const;
bool GetHideStatus() const;
ByteString GetNamedAction() const;
uint32_t GetFlags() const;
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp
index 6c40319..45d8b16 100644
--- a/core/fpdfdoc/cpdf_annotlist.cpp
+++ b/core/fpdfdoc/cpdf_annotlist.cpp
@@ -125,7 +125,7 @@
return pPopupAnnot;
}
-void GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) {
+void GenerateAP(CPDF_Document* doc, CPDF_Dictionary* pAnnotDict) {
if (!pAnnotDict ||
pAnnotDict->GetByteStringFor(pdfium::annotation::kSubtype) != "Widget") {
return;
@@ -139,7 +139,7 @@
ByteString field_type = pFieldTypeObj->GetString();
if (field_type == pdfium::form_fields::kTx) {
- CPDF_GenerateAP::GenerateFormAP(pDoc, pAnnotDict,
+ CPDF_GenerateAP::GenerateFormAP(doc, pAnnotDict,
CPDF_GenerateAP::kTextField);
return;
}
@@ -151,7 +151,7 @@
auto type = (flags & pdfium::form_flags::kChoiceCombo)
? CPDF_GenerateAP::kComboBox
: CPDF_GenerateAP::kListBox;
- CPDF_GenerateAP::GenerateFormAP(pDoc, pAnnotDict, type);
+ CPDF_GenerateAP::GenerateFormAP(doc, pAnnotDict, type);
return;
}
diff --git a/core/fpdfdoc/cpdf_bafontmap.cpp b/core/fpdfdoc/cpdf_bafontmap.cpp
index 9bca83c..324f13d 100644
--- a/core/fpdfdoc/cpdf_bafontmap.cpp
+++ b/core/fpdfdoc/cpdf_bafontmap.cpp
@@ -39,10 +39,10 @@
font_mapper->HasLocalizedFont(sFontFaceName);
}
-RetainPtr<CPDF_Font> AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc,
+RetainPtr<CPDF_Font> AddNativeTrueTypeFontToPDF(CPDF_Document* doc,
ByteString sFontFaceName,
FX_Charset nCharset) {
- if (!pDoc) {
+ if (!doc) {
return nullptr;
}
@@ -50,7 +50,7 @@
pFXFont->LoadSubst(sFontFaceName, true, 0, 0, 0,
FX_GetCodePageFromCharset(nCharset), false);
- auto* pDocPageData = CPDF_DocPageData::FromDocument(pDoc);
+ auto* pDocPageData = CPDF_DocPageData::FromDocument(doc);
return pDocPageData->AddFont(std::move(pFXFont), nCharset);
}
diff --git a/core/fpdfdoc/cpdf_dest.cpp b/core/fpdfdoc/cpdf_dest.cpp
index 483e177..ac99bbc 100644
--- a/core/fpdfdoc/cpdf_dest.cpp
+++ b/core/fpdfdoc/cpdf_dest.cpp
@@ -38,20 +38,20 @@
CPDF_Dest::~CPDF_Dest() = default;
// static
-CPDF_Dest CPDF_Dest::Create(CPDF_Document* pDoc,
+CPDF_Dest CPDF_Dest::Create(CPDF_Document* doc,
RetainPtr<const CPDF_Object> pDest) {
if (!pDest) {
return CPDF_Dest(nullptr);
}
if (pDest->IsString() || pDest->IsName()) {
- return CPDF_Dest(CPDF_NameTree::LookupNamedDest(pDoc, pDest->GetString()));
+ return CPDF_Dest(CPDF_NameTree::LookupNamedDest(doc, pDest->GetString()));
}
return CPDF_Dest(ToArray(pDest));
}
-int CPDF_Dest::GetDestPageIndex(CPDF_Document* pDoc) const {
+int CPDF_Dest::GetDestPageIndex(CPDF_Document* doc) const {
if (!array_) {
return -1;
}
@@ -69,7 +69,7 @@
return -1;
}
- return pDoc->GetPageIndex(pPage->GetObjNum());
+ return doc->GetPageIndex(pPage->GetObjNum());
}
std::vector<float> CPDF_Dest::GetScrollPositionArray() const {
diff --git a/core/fpdfdoc/cpdf_dest.h b/core/fpdfdoc/cpdf_dest.h
index 6cd1c1d..c79010d 100644
--- a/core/fpdfdoc/cpdf_dest.h
+++ b/core/fpdfdoc/cpdf_dest.h
@@ -22,12 +22,12 @@
~CPDF_Dest();
// Use when |pDest| is an object of an unknown type. Can pass in nullptr.
- static CPDF_Dest Create(CPDF_Document* pDoc,
+ static CPDF_Dest Create(CPDF_Document* doc,
RetainPtr<const CPDF_Object> pDest);
const CPDF_Array* GetArray() const { return array_.Get(); }
- int GetDestPageIndex(CPDF_Document* pDoc) const;
+ int GetDestPageIndex(CPDF_Document* doc) const;
std::vector<float> GetScrollPositionArray() const;
// Returns the zoom mode, as one of the PDFDEST_VIEW_* values in fpdf_doc.h.
diff --git a/core/fpdfdoc/cpdf_generateap.h b/core/fpdfdoc/cpdf_generateap.h
index 60b158b..51ff1a1 100644
--- a/core/fpdfdoc/cpdf_generateap.h
+++ b/core/fpdfdoc/cpdf_generateap.h
@@ -17,13 +17,13 @@
public:
enum FormType { kTextField, kComboBox, kListBox };
- static void GenerateFormAP(CPDF_Document* pDoc,
+ static void GenerateFormAP(CPDF_Document* doc,
CPDF_Dictionary* pAnnotDict,
FormType type);
- static void GenerateEmptyAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
+ static void GenerateEmptyAP(CPDF_Document* doc, CPDF_Dictionary* pAnnotDict);
- static bool GenerateAnnotAP(CPDF_Document* pDoc,
+ static bool GenerateAnnotAP(CPDF_Document* doc,
CPDF_Dictionary* pAnnotDict,
CPDF_Annot::Subtype subtype);
diff --git a/core/fpdfdoc/cpdf_interactiveform.cpp b/core/fpdfdoc/cpdf_interactiveform.cpp
index 2dcb49b..24bf93a 100644
--- a/core/fpdfdoc/cpdf_interactiveform.cpp
+++ b/core/fpdfdoc/cpdf_interactiveform.cpp
@@ -1048,15 +1048,15 @@
const WideString& pdf_path,
const std::vector<CPDF_FormField*>& fields,
bool bIncludeOrExclude) const {
- std::unique_ptr<CFDF_Document> pDoc = CFDF_Document::CreateNewDoc();
- if (!pDoc) {
+ std::unique_ptr<CFDF_Document> doc = CFDF_Document::CreateNewDoc();
+ if (!doc) {
return nullptr;
}
RetainPtr<CPDF_Dictionary> pMainDict =
- pDoc->GetMutableRoot()->GetMutableDictFor("FDF");
+ doc->GetMutableRoot()->GetMutableDictFor("FDF");
if (!pdf_path.IsEmpty()) {
- auto new_dict = pDoc->New<CPDF_Dictionary>();
+ auto new_dict = doc->New<CPDF_Dictionary>();
new_dict->SetNewFor<CPDF_Name>("Type", "Filespec");
WideString wsStr = CPDF_FileSpec::EncodeFileName(pdf_path);
new_dict->SetNewFor<CPDF_String>(pdfium::stream::kF, wsStr.ToDefANSI());
@@ -1091,7 +1091,7 @@
WideString fullname =
CPDF_FormField::GetFullNameForDict(field->GetFieldDict());
- auto field_dict = pDoc->New<CPDF_Dictionary>();
+ auto field_dict = doc->New<CPDF_Dictionary>();
field_dict->SetNewFor<CPDF_String>(pdfium::form_fields::kT,
fullname.AsStringView());
if (field->GetType() == CPDF_FormField::kCheckBox ||
@@ -1114,7 +1114,7 @@
}
fields_array->Append(field_dict);
}
- return pDoc;
+ return doc;
}
void CPDF_InteractiveForm::SetNotifierIface(NotifierIface* notify) {
diff --git a/core/fpdfdoc/cpdf_link.cpp b/core/fpdfdoc/cpdf_link.cpp
index b7a3cf5..2b7f8e2 100644
--- a/core/fpdfdoc/cpdf_link.cpp
+++ b/core/fpdfdoc/cpdf_link.cpp
@@ -23,8 +23,8 @@
return dict_->GetRectFor("Rect");
}
-CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc) {
- return CPDF_Dest::Create(pDoc, dict_->GetDirectObjectFor("Dest"));
+CPDF_Dest CPDF_Link::GetDest(CPDF_Document* doc) {
+ return CPDF_Dest::Create(doc, dict_->GetDirectObjectFor("Dest"));
}
CPDF_Action CPDF_Link::GetAction() {
diff --git a/core/fpdfdoc/cpdf_link.h b/core/fpdfdoc/cpdf_link.h
index eb2d30d..d228fc4 100644
--- a/core/fpdfdoc/cpdf_link.h
+++ b/core/fpdfdoc/cpdf_link.h
@@ -22,7 +22,7 @@
RetainPtr<CPDF_Dictionary> GetMutableDict() const { return dict_; }
CFX_FloatRect GetRect();
- CPDF_Dest GetDest(CPDF_Document* pDoc);
+ CPDF_Dest GetDest(CPDF_Document* doc);
CPDF_Action GetAction();
private:
diff --git a/core/fpdfdoc/cpdf_nametree.cpp b/core/fpdfdoc/cpdf_nametree.cpp
index 10147eb..b4f65c7 100644
--- a/core/fpdfdoc/cpdf_nametree.cpp
+++ b/core/fpdfdoc/cpdf_nametree.cpp
@@ -443,10 +443,9 @@
return nullptr;
}
-RetainPtr<const CPDF_Array> LookupOldStyleNamedDest(CPDF_Document* pDoc,
+RetainPtr<const CPDF_Array> LookupOldStyleNamedDest(CPDF_Document* doc,
const ByteString& name) {
- RetainPtr<const CPDF_Dictionary> pDests =
- pDoc->GetRoot()->GetDictFor("Dests");
+ RetainPtr<const CPDF_Dictionary> pDests = doc->GetRoot()->GetDictFor("Dests");
if (!pDests) {
return nullptr;
}
@@ -464,9 +463,9 @@
CPDF_NameTree::~CPDF_NameTree() = default;
// static
-std::unique_ptr<CPDF_NameTree> CPDF_NameTree::Create(CPDF_Document* pDoc,
+std::unique_ptr<CPDF_NameTree> CPDF_NameTree::Create(CPDF_Document* doc,
ByteStringView category) {
- RetainPtr<CPDF_Dictionary> pRoot = pDoc->GetMutableRoot();
+ RetainPtr<CPDF_Dictionary> pRoot = doc->GetMutableRoot();
if (!pRoot) {
return nullptr;
}
@@ -487,9 +486,9 @@
// static
std::unique_ptr<CPDF_NameTree> CPDF_NameTree::CreateWithRootNameArray(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
ByteStringView category) {
- RetainPtr<CPDF_Dictionary> pRoot = pDoc->GetMutableRoot();
+ RetainPtr<CPDF_Dictionary> pRoot = doc->GetMutableRoot();
if (!pRoot) {
return nullptr;
}
@@ -497,16 +496,16 @@
// Retrieve the document's Names dictionary; create it if missing.
RetainPtr<CPDF_Dictionary> pNames = pRoot->GetMutableDictFor("Names");
if (!pNames) {
- pNames = pDoc->NewIndirect<CPDF_Dictionary>();
- pRoot->SetNewFor<CPDF_Reference>("Names", pDoc, pNames->GetObjNum());
+ pNames = doc->NewIndirect<CPDF_Dictionary>();
+ pRoot->SetNewFor<CPDF_Reference>("Names", doc, pNames->GetObjNum());
}
// Create the |category| dictionary if missing.
RetainPtr<CPDF_Dictionary> pCategory = pNames->GetMutableDictFor(category);
if (!pCategory) {
- pCategory = pDoc->NewIndirect<CPDF_Dictionary>();
+ pCategory = doc->NewIndirect<CPDF_Dictionary>();
pCategory->SetNewFor<CPDF_Array>("Names");
- pNames->SetNewFor<CPDF_Reference>(ByteString(category), pDoc,
+ pNames->SetNewFor<CPDF_Reference>(ByteString(category), doc,
pCategory->GetObjNum());
}
@@ -522,15 +521,15 @@
// static
RetainPtr<const CPDF_Array> CPDF_NameTree::LookupNamedDest(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
const ByteString& name) {
RetainPtr<const CPDF_Array> dest_array;
- std::unique_ptr<CPDF_NameTree> name_tree = Create(pDoc, "Dests");
+ std::unique_ptr<CPDF_NameTree> name_tree = Create(doc, "Dests");
if (name_tree) {
dest_array = name_tree->LookupNewStyleNamedDest(name);
}
if (!dest_array) {
- dest_array = LookupOldStyleNamedDest(pDoc, name);
+ dest_array = LookupOldStyleNamedDest(doc, name);
}
return dest_array;
}
diff --git a/core/fpdfdoc/cpdf_nametree.h b/core/fpdfdoc/cpdf_nametree.h
index d64b546..a6505a6 100644
--- a/core/fpdfdoc/cpdf_nametree.h
+++ b/core/fpdfdoc/cpdf_nametree.h
@@ -25,14 +25,14 @@
CPDF_NameTree& operator=(const CPDF_NameTree&) = delete;
~CPDF_NameTree();
- static std::unique_ptr<CPDF_NameTree> Create(CPDF_Document* pDoc,
+ static std::unique_ptr<CPDF_NameTree> Create(CPDF_Document* doc,
ByteStringView category);
- // If necessary, create missing Names dictionary in |pDoc|, and/or missing
+ // If necessary, create missing Names dictionary in |doc|, and/or missing
// Names array in the dictionary that corresponds to |category|, if necessary.
// Returns nullptr on failure.
static std::unique_ptr<CPDF_NameTree> CreateWithRootNameArray(
- CPDF_Document* pDoc,
+ CPDF_Document* doc,
ByteStringView category);
static std::unique_ptr<CPDF_NameTree> CreateForTesting(
diff --git a/core/fpdfdoc/cpdf_structtree.cpp b/core/fpdfdoc/cpdf_structtree.cpp
index 56a738c..3ce713a 100644
--- a/core/fpdfdoc/cpdf_structtree.cpp
+++ b/core/fpdfdoc/cpdf_structtree.cpp
@@ -18,9 +18,9 @@
namespace {
-bool IsTagged(const CPDF_Document* pDoc) {
+bool IsTagged(const CPDF_Document* doc) {
RetainPtr<const CPDF_Dictionary> pMarkInfo =
- pDoc->GetRoot()->GetDictFor("MarkInfo");
+ doc->GetRoot()->GetDictFor("MarkInfo");
return pMarkInfo && pMarkInfo->GetIntegerFor("Marked");
}
@@ -28,19 +28,19 @@
// static
std::unique_ptr<CPDF_StructTree> CPDF_StructTree::LoadPage(
- const CPDF_Document* pDoc,
+ const CPDF_Document* doc,
RetainPtr<const CPDF_Dictionary> pPageDict) {
- if (!IsTagged(pDoc)) {
+ if (!IsTagged(doc)) {
return nullptr;
}
- auto pTree = std::make_unique<CPDF_StructTree>(pDoc);
+ auto pTree = std::make_unique<CPDF_StructTree>(doc);
pTree->LoadPageTree(std::move(pPageDict));
return pTree;
}
-CPDF_StructTree::CPDF_StructTree(const CPDF_Document* pDoc)
- : tree_root_(pDoc->GetRoot()->GetDictFor("StructTreeRoot")),
+CPDF_StructTree::CPDF_StructTree(const CPDF_Document* doc)
+ : tree_root_(doc->GetRoot()->GetDictFor("StructTreeRoot")),
role_map_(tree_root_ ? tree_root_->GetDictFor("RoleMap") : nullptr) {}
CPDF_StructTree::~CPDF_StructTree() = default;
diff --git a/core/fpdfdoc/cpdf_structtree.h b/core/fpdfdoc/cpdf_structtree.h
index a459774..0ec7f95 100644
--- a/core/fpdfdoc/cpdf_structtree.h
+++ b/core/fpdfdoc/cpdf_structtree.h
@@ -22,10 +22,10 @@
class CPDF_StructTree {
public:
static std::unique_ptr<CPDF_StructTree> LoadPage(
- const CPDF_Document* pDoc,
+ const CPDF_Document* doc,
RetainPtr<const CPDF_Dictionary> pPageDict);
- explicit CPDF_StructTree(const CPDF_Document* pDoc);
+ explicit CPDF_StructTree(const CPDF_Document* doc);
~CPDF_StructTree();
size_t CountTopElements() const { return kids_.size(); }
diff --git a/core/fpdfdoc/cpdf_viewerpreferences.cpp b/core/fpdfdoc/cpdf_viewerpreferences.cpp
index 51a354e..4915373 100644
--- a/core/fpdfdoc/cpdf_viewerpreferences.cpp
+++ b/core/fpdfdoc/cpdf_viewerpreferences.cpp
@@ -11,8 +11,8 @@
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_name.h"
-CPDF_ViewerPreferences::CPDF_ViewerPreferences(const CPDF_Document* pDoc)
- : doc_(pDoc) {}
+CPDF_ViewerPreferences::CPDF_ViewerPreferences(const CPDF_Document* doc)
+ : doc_(doc) {}
CPDF_ViewerPreferences::~CPDF_ViewerPreferences() = default;
diff --git a/core/fpdfdoc/cpdf_viewerpreferences.h b/core/fpdfdoc/cpdf_viewerpreferences.h
index 4762cf0..2acbd09 100644
--- a/core/fpdfdoc/cpdf_viewerpreferences.h
+++ b/core/fpdfdoc/cpdf_viewerpreferences.h
@@ -21,7 +21,7 @@
class CPDF_ViewerPreferences {
public:
- explicit CPDF_ViewerPreferences(const CPDF_Document* pDoc);
+ explicit CPDF_ViewerPreferences(const CPDF_Document* doc);
~CPDF_ViewerPreferences();
bool IsDirectionR2L() const;
diff --git a/core/fpdfdoc/cpvt_fontmap.cpp b/core/fpdfdoc/cpvt_fontmap.cpp
index 12a0f8a..7f3ef70 100644
--- a/core/fpdfdoc/cpvt_fontmap.cpp
+++ b/core/fpdfdoc/cpvt_fontmap.cpp
@@ -18,11 +18,11 @@
#include "core/fxcrt/fx_codepage.h"
#include "core/fxcrt/notreached.h"
-CPVT_FontMap::CPVT_FontMap(CPDF_Document* pDoc,
+CPVT_FontMap::CPVT_FontMap(CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> pResDict,
RetainPtr<CPDF_Font> pDefFont,
const ByteString& sDefFontAlias)
- : document_(pDoc),
+ : document_(doc),
res_dict_(std::move(pResDict)),
def_font_(std::move(pDefFont)),
def_font_alias_(sDefFontAlias) {}
diff --git a/core/fpdfdoc/cpvt_fontmap.h b/core/fpdfdoc/cpvt_fontmap.h
index 2968cf1..861bb86 100644
--- a/core/fpdfdoc/cpvt_fontmap.h
+++ b/core/fpdfdoc/cpvt_fontmap.h
@@ -20,7 +20,7 @@
class CPVT_FontMap final : public IPVT_FontMap {
public:
- CPVT_FontMap(CPDF_Document* pDoc,
+ CPVT_FontMap(CPDF_Document* doc,
RetainPtr<CPDF_Dictionary> pResDict,
RetainPtr<CPDF_Font> pDefFont,
const ByteString& sDefFontAlias);