From 081d41208489a318163a306789de4139b2dddfc7 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 28 Aug 2017 18:00:37 -0700 Subject: Make some CPDF_StreamContentParser methods static. For methods that are only exposed for testing. Once they are static, there is no need for dummy CPDF_StreamContentParser constructor calls in the unit tests. Adjust the CPDF_StreamContentParser constructor now that one of the parameters can no longer be a nullptr. Change-Id: If29b02ea216002a7bb325b1913281f58b70382aa Reviewed-on: https://pdfium-review.googlesource.com/12230 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fpdfapi/page/cpdf_streamcontentparser.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.cpp') diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp index 6f09f92c60..a6af91d9ff 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp @@ -241,7 +241,7 @@ CPDF_StreamContentParser::CPDF_StreamContentParser( const CFX_Matrix* pmtContentToUser, CPDF_PageObjectHolder* pObjHolder, CPDF_Dictionary* pResources, - CFX_FloatRect* pBBox, + const CFX_FloatRect& rcBBox, CPDF_AllStates* pStates, int level) : m_pDocument(pDocument), @@ -250,6 +250,7 @@ CPDF_StreamContentParser::CPDF_StreamContentParser( m_pResources(pResources), m_pObjectHolder(pObjHolder), m_Level(level), + m_BBox(rcBBox), m_ParamStartPos(0), m_ParamCount(0), m_pCurStates(pdfium::MakeUnique()), @@ -269,8 +270,6 @@ CPDF_StreamContentParser::CPDF_StreamContentParser( m_pResources = m_pParentResources; if (!m_pResources) m_pResources = m_pPageResources; - if (pBBox) - m_BBox = *pBBox; if (pStates) { m_pCurStates->Copy(*pStates); } else { @@ -1625,11 +1624,13 @@ void CPDF_StreamContentParser::ParsePathObject() { } } +// static CFX_ByteStringC CPDF_StreamContentParser::FindKeyAbbreviationForTesting( const CFX_ByteStringC& abbr) { return FindFullName(InlineKeyAbbr, FX_ArraySize(InlineKeyAbbr), abbr); } +// static CFX_ByteStringC CPDF_StreamContentParser::FindValueAbbreviationForTesting( const CFX_ByteStringC& abbr) { return FindFullName(InlineValueAbbr, FX_ArraySize(InlineValueAbbr), abbr); -- cgit v1.2.3