| Index: core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
|
| diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
|
| index 580b58a06a2498d517ea28b35a1b9410a1c5de12..88e9f561c32f7b2734d0bcb6b1a6be824172e764 100644
|
| --- a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
|
| +++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
|
| @@ -49,10 +49,11 @@ void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern,
|
| pData->m_FillColor.SetValue(pPattern, pValue, nValues);
|
| int R, G, B;
|
| FX_BOOL ret = pData->m_FillColor.GetRGB(R, G, B);
|
| - if (pPattern->m_PatternType == 1 &&
|
| - ((CPDF_TilingPattern*)pPattern)->m_bColored && !ret) {
|
| - pData->m_FillRGB = 0x00BFBFBF;
|
| - return;
|
| + if (CPDF_TilingPattern* pTilingPattern = pPattern->AsTilingPattern()) {
|
| + if (!ret && pTilingPattern->colored()) {
|
| + pData->m_FillRGB = 0x00BFBFBF;
|
| + return;
|
| + }
|
| }
|
| pData->m_FillRGB = ret ? FXSYS_RGB(R, G, B) : (uint32_t)-1;
|
| }
|
| @@ -64,10 +65,11 @@ void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern,
|
| pData->m_StrokeColor.SetValue(pPattern, pValue, nValues);
|
| int R, G, B;
|
| FX_BOOL ret = pData->m_StrokeColor.GetRGB(R, G, B);
|
| - if (pPattern->m_PatternType == 1 &&
|
| - ((CPDF_TilingPattern*)pPattern)->m_bColored && !ret) {
|
| - pData->m_StrokeRGB = 0x00BFBFBF;
|
| - return;
|
| + if (CPDF_TilingPattern* pTilingPattern = pPattern->AsTilingPattern()) {
|
| + if (!ret && pTilingPattern->colored()) {
|
| + pData->m_StrokeRGB = 0x00BFBFBF;
|
| + return;
|
| + }
|
| }
|
| pData->m_StrokeRGB =
|
| pData->m_StrokeColor.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (uint32_t)-1;
|
|
|