summaryrefslogtreecommitdiff
path: root/fpdfsdk/fxedit/fxet_edit.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-08-29 12:52:56 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-29 12:52:56 -0700
commit91ddd3f7501429222f648b986a99f3959a398889 (patch)
treeb6a712b9caf63f1e344a6475281226394e1e07c2 /fpdfsdk/fxedit/fxet_edit.cpp
parentc37d7d452d6a37c997c8709576dd71406ecff618 (diff)
downloadpdfium-91ddd3f7501429222f648b986a99f3959a398889.tar.xz
Use ->() in CPDF_ColorState
Move methods to CPDF_ColorStateData. Move MakePrivateCopy() methods to call sites. Remove now-empty cpdf_colorstate.cpp file. Review-Url: https://codereview.chromium.org/2291763002
Diffstat (limited to 'fpdfsdk/fxedit/fxet_edit.cpp')
-rw-r--r--fpdfsdk/fxedit/fxet_edit.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp
index c744958e5e..97debe1764 100644
--- a/fpdfsdk/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/fxedit/fxet_edit.cpp
@@ -145,7 +145,8 @@ void AddRectToPageObjects(CPDF_PageObjectHolder* pObjectHolder,
rgb[0] = FXARGB_R(crFill) / 255.0f;
rgb[1] = FXARGB_G(crFill) / 255.0f;
rgb[2] = FXARGB_B(crFill) / 255.0f;
- pPathObj->m_ColorState.SetFillColor(
+ pPathObj->m_ColorState.MakePrivateCopy();
+ pPathObj->m_ColorState->SetFillColor(
CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
pPathObj->m_FillType = FXFILL_ALTERNATE;
@@ -177,9 +178,11 @@ CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjectHolder* pObjectHolder,
rgb[0] = FXARGB_R(crText) / 255.0f;
rgb[1] = FXARGB_G(crText) / 255.0f;
rgb[2] = FXARGB_B(crText) / 255.0f;
- pTxtObj->m_ColorState.SetFillColor(
+
+ pTxtObj->m_ColorState.MakePrivateCopy();
+ pTxtObj->m_ColorState->SetFillColor(
CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
- pTxtObj->m_ColorState.SetStrokeColor(
+ pTxtObj->m_ColorState->SetStrokeColor(
CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
pTxtObj->SetPosition(point.x, point.y);