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

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render.cpp

Issue 1695633004: Fix the way to access marked content. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "render_int.h" 7 #include "render_int.h"
8 8
9 #include "core/include/fpdfapi/fpdf_module.h" 9 #include "core/include/fpdfapi/fpdf_module.h"
10 #include "core/include/fpdfapi/fpdf_render.h" 10 #include "core/include/fpdfapi/fpdf_render.h"
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, 1388 m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left,
1389 m_Rect.top, m_Rect.Width(), m_Rect.Height()); 1389 m_Rect.top, m_Rect.Width(), m_Rect.Height());
1390 } 1390 }
1391 } 1391 }
1392 FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) { 1392 FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) {
1393 const CPDF_ContentMarkData* pData = pObj->m_ContentMark; 1393 const CPDF_ContentMarkData* pData = pObj->m_ContentMark;
1394 int nItems = pData->CountItems(); 1394 int nItems = pData->CountItems();
1395 for (int i = 0; i < nItems; i++) { 1395 for (int i = 0; i < nItems; i++) {
1396 CPDF_ContentMarkItem& item = pData->GetItem(i); 1396 CPDF_ContentMarkItem& item = pData->GetItem(i);
1397 if (item.GetName() == "OC" && 1397 if (item.GetName() == "OC" &&
1398 item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) { 1398 item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict &&
1399 CPDF_Dictionary* pOCG = 1399 !CheckOCGVisible(item.GetParam())) {
1400 ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); 1400 return FALSE;
1401 if (!CheckOCGVisible(pOCG)) {
1402 return FALSE;
1403 }
1404 } 1401 }
1405 } 1402 }
1406 return TRUE; 1403 return TRUE;
1407 } 1404 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698