diff options
Diffstat (limited to 'core/fpdfapi/fpdf_render')
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render.cpp | 28 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render_text.cpp | 5 |
2 files changed, 17 insertions, 16 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp index f5ab9696c7..f77e46d923 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp @@ -199,16 +199,16 @@ FX_BOOL CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext, const CPDF_ColorStateData* pParentData = pParentState->m_InitialStates.m_ColorState.GetObject(); if (!pColorData || pColorData->m_FillColor.IsNull()) { - m_InitialStates.m_ColorState.MakePrivateCopy(); - m_InitialStates.m_ColorState->m_FillRGB = pParentData->m_FillRGB; - m_InitialStates.m_ColorState->m_FillColor.Copy( - &pParentData->m_FillColor); + CPDF_ColorStateData* pData = + m_InitialStates.m_ColorState.GetPrivateCopy(); + pData->m_FillRGB = pParentData->m_FillRGB; + pData->m_FillColor.Copy(&pParentData->m_FillColor); } if (!pColorData || pColorData->m_StrokeColor.IsNull()) { - m_InitialStates.m_ColorState.MakePrivateCopy(); - m_InitialStates.m_ColorState->m_StrokeRGB = pParentData->m_FillRGB; - m_InitialStates.m_ColorState->m_StrokeColor.Copy( - &pParentData->m_StrokeColor); + CPDF_ColorStateData* pData = + m_InitialStates.m_ColorState.GetPrivateCopy(); + pData->m_StrokeRGB = pParentData->m_FillRGB; + pData->m_StrokeColor.Copy(&pParentData->m_StrokeColor); } } } else { @@ -579,7 +579,7 @@ void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath, if (!ClipPath) { if (m_LastClipPath) { m_pDevice->RestoreState(true); - m_LastClipPath.Clear(); + m_LastClipPath.SetNull(); } return; } @@ -921,11 +921,11 @@ CPDF_GraphicStates* CPDF_RenderStatus::CloneObjStates( ? pSrcStates->m_ColorState.GetStrokeColor() : pSrcStates->m_ColorState.GetFillColor(); if (!pObjColor->IsNull()) { - pStates->m_ColorState.MakePrivateCopy(); - pStates->m_ColorState->m_FillRGB = - bStroke ? pSrcStates->m_ColorState->m_StrokeRGB - : pSrcStates->m_ColorState->m_FillRGB; - pStates->m_ColorState->m_StrokeRGB = pStates->m_ColorState->m_FillRGB; + CPDF_ColorStateData* pColorData = pStates->m_ColorState.GetPrivateCopy(); + pColorData->m_FillRGB = + bStroke ? pSrcStates->m_ColorState.GetObject()->m_StrokeRGB + : pSrcStates->m_ColorState.GetObject()->m_FillRGB; + pColorData->m_StrokeRGB = pColorData->m_FillRGB; } return pStates; } diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp index 4b59f1d61a..16d1235f4d 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp @@ -231,7 +231,8 @@ FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, if (textobj->m_nChars == 0) return TRUE; - const TextRenderingMode& text_render_mode = textobj->m_TextState->m_TextMode; + const TextRenderingMode& text_render_mode = + textobj->m_TextState.GetObject()->m_TextMode; if (text_render_mode == TextRenderingMode::MODE_INVISIBLE) return TRUE; @@ -307,7 +308,7 @@ FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX_Matrix* pDeviceMatrix = pObj2Device; CFX_Matrix device_matrix; if (bStroke) { - const FX_FLOAT* pCTM = textobj->m_TextState->m_CTM; + const FX_FLOAT* pCTM = textobj->m_TextState.GetObject()->m_CTM; if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) { CFX_Matrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0); text_matrix.ConcatInverse(ctm); |