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

Unified Diff: fpdfsdk/fxedit/fxet_edit.cpp

Issue 2287313004: Make CPDF_TextState have a CPDF_TextStateData rather than inheriting one. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@moar_better_constness
Patch Set: Casts, Casts, New -> Emplace. Created 4 years, 4 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 | « core/fxge/ge/cfx_cliprgn.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fxedit/fxet_edit.cpp
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp
index 479fa970a12a4861d396a8476532eae17461172a..098ef7f10bf362a06325a1cb4a8b4467d438540d 100644
--- a/fpdfsdk/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/fxedit/fxet_edit.cpp
@@ -161,16 +161,17 @@ 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.SetFont(pFont);
+ pTxtObj->m_TextState.SetFontSize(fFontSize);
+ pTxtObj->m_TextState.SetCharSpace(fCharSpace);
+ pTxtObj->m_TextState.SetWordSpace(0);
+ pTxtObj->m_TextState.SetTextMode(TextRenderingMode::MODE_FILL);
+
+ FX_FLOAT* matrix = pTxtObj->m_TextState.GetMutableMatrix();
+ matrix[0] = nHorzScale / 100.0f;
+ matrix[1] = 0;
+ matrix[2] = 0;
+ matrix[3] = 1;
FX_FLOAT rgb[3];
rgb[0] = FXARGB_R(crText) / 255.0f;
« no previous file with comments | « core/fxge/ge/cfx_cliprgn.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698