CFX_FloatRect CPDF_Array::GetRect() { CFX_FloatRect rect; if (!IsArray() || m_Objects.size() != 4) return rect; rect.left = GetNumberAt(0); rect.bottom = GetNumberAt(1); rect.right = GetNumberAt(2); rect.top = GetNumberAt(3); return rect; }
UIdType Sequence::GetNext(UIdType n, size_t& cookie) const { switch ( GetCharAt(cookie) ) { case ':': // we're inside a range, check if we didn't exhaust it { size_t pos = cookie + 1; UIdType last = GetNumberAt(pos); if ( n < last ) return n + 1; // done with this range, continue with the rest cookie = pos; } if ( GetCharAt(cookie) != '\0' ) { // nothing else can follow the end of the range ASSERT_MSG( GetCharAt(cookie) == ',', "bad sequence string format" ); cookie++; break; } //else: fall through case '\0': return UID_ILLEGAL; case ',': // skip comma and go to the next number cookie++; break; } return GetNumberAt(cookie); }
CFX_Matrix CPDF_Array::GetMatrix() { CFX_Matrix matrix; if (!IsArray() || m_Objects.size() != 6) return matrix; matrix.Set(GetNumberAt(0), GetNumberAt(1), GetNumberAt(2), GetNumberAt(3), GetNumberAt(4), GetNumberAt(5)); return matrix; }