summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-08-26 16:52:33 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-26 16:52:33 -0700
commitc10c23a2b1999b1cb0354fd4db9837dc63a3d833 (patch)
tree2f5b9f35d372de26476411295120146baa93f5fb /fpdfsdk
parent9ed91376d562f3c6e7ca0a99035a74502f648776 (diff)
downloadpdfium-c10c23a2b1999b1cb0354fd4db9837dc63a3d833.tar.xz
Add -> operators to CFX_CountRef.chromium/2842
Allows CFX_CountRefs to behave more like pointers. Rename SetNull() to Clear() for consistency with other ptrs. Change GetPrivateCopy() into MakePrivateCopy() with no return, since the -> operators are clearer than getting an object pointer. Review-Url: https://codereview.chromium.org/2283113002
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_transformpage.cpp4
-rw-r--r--fpdfsdk/fpdfeditimg.cpp4
-rw-r--r--fpdfsdk/fxedit/fxet_edit.cpp25
3 files changed, 17 insertions, 16 deletions
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 712080a9de..af8bb7de5b 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -220,9 +220,9 @@ DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left,
float right,
float top) {
CPDF_ClipPath* pNewClipPath = new CPDF_ClipPath();
- pNewClipPath->GetPrivateCopy();
+ pNewClipPath->MakePrivateCopy();
CPDF_Path Path;
- Path.GetPrivateCopy();
+ Path.MakePrivateCopy();
Path.AppendRect(left, bottom, right, top);
pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE);
return pNewClipPath;
diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp
index 1fe832b877..372e676127 100644
--- a/fpdfsdk/fpdfeditimg.cpp
+++ b/fpdfsdk/fpdfeditimg.cpp
@@ -33,7 +33,7 @@ FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages,
IFX_FileRead* pFile = new CPDF_CustomAccess(fileAccess);
CPDF_ImageObject* pImgObj = reinterpret_cast<CPDF_ImageObject*>(image_object);
- pImgObj->m_GeneralState.GetPrivateCopy();
+ pImgObj->m_GeneralState.MakePrivateCopy();
for (int index = 0; index < nCount; index++) {
CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]);
if (pPage)
@@ -73,7 +73,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,
return FALSE;
CPDF_ImageObject* pImgObj = reinterpret_cast<CPDF_ImageObject*>(image_object);
- pImgObj->m_GeneralState.GetPrivateCopy();
+ pImgObj->m_GeneralState.MakePrivateCopy();
for (int index = 0; index < nCount; index++) {
CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]);
if (pPage)
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp
index 479fa970a1..c744958e5e 100644
--- a/fpdfsdk/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/fxedit/fxet_edit.cpp
@@ -137,8 +137,9 @@ void AddRectToPageObjects(CPDF_PageObjectHolder* pObjectHolder,
FX_COLORREF crFill,
const CFX_FloatRect& rcFill) {
std::unique_ptr<CPDF_PathObject> pPathObj(new CPDF_PathObject);
- CFX_PathData* pPathData = pPathObj->m_Path.GetPrivateCopy();
- pPathData->AppendRect(rcFill.left, rcFill.bottom, rcFill.right, rcFill.top);
+ pPathObj->m_Path.MakePrivateCopy();
+ pPathObj->m_Path->AppendRect(rcFill.left, rcFill.bottom, rcFill.right,
+ rcFill.top);
FX_FLOAT rgb[3];
rgb[0] = FXARGB_R(crFill) / 255.0f;
@@ -161,16 +162,16 @@ CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjectHolder* pObjectHolder,
const CFX_FloatPoint& point,
const CFX_ByteString& text) {
std::unique_ptr<CPDF_TextObject> pTxtObj(new CPDF_TextObject);
- CPDF_TextStateData* pTextStateData = pTxtObj->m_TextState.GetPrivateCopy();
- pTextStateData->m_pFont = pFont;
- pTextStateData->m_FontSize = fFontSize;
- pTextStateData->m_CharSpace = fCharSpace;
- pTextStateData->m_WordSpace = 0;
- pTextStateData->m_TextMode = TextRenderingMode::MODE_FILL;
- pTextStateData->m_Matrix[0] = nHorzScale / 100.0f;
- pTextStateData->m_Matrix[1] = 0;
- pTextStateData->m_Matrix[2] = 0;
- pTextStateData->m_Matrix[3] = 1;
+ pTxtObj->m_TextState.MakePrivateCopy();
+ pTxtObj->m_TextState->m_pFont = pFont;
+ pTxtObj->m_TextState->m_FontSize = fFontSize;
+ pTxtObj->m_TextState->m_CharSpace = fCharSpace;
+ pTxtObj->m_TextState->m_WordSpace = 0;
+ pTxtObj->m_TextState->m_TextMode = TextRenderingMode::MODE_FILL;
+ pTxtObj->m_TextState->m_Matrix[0] = nHorzScale / 100.0f;
+ pTxtObj->m_TextState->m_Matrix[1] = 0;
+ pTxtObj->m_TextState->m_Matrix[2] = 0;
+ pTxtObj->m_TextState->m_Matrix[3] = 1;
FX_FLOAT rgb[3];
rgb[0] = FXARGB_R(crText) / 255.0f;