Logo Search packages:      
Sourcecode: libpodofo version File versions  Download package

PdfObject * PoDoFo::PdfVecObjects::GetObject ( const PdfReference ref ) const

Finds the object with the given reference in m_vecOffsets and returns a pointer to it if it is found.

Parameters:
refthe object to be found
Returns:
the found object or NULL if no object was found.

Definition at line 133 of file PdfVecObjects.cpp.

References Sort().

Referenced by PoDoFo::PdfCanvas::AddResource(), PoDoFo::PdfNamesTree::AddToDictionary(), PoDoFo::PdfDocument::Append(), PoDoFo::PdfEncodingFactory::CreateEncoding(), PoDoFo::PdfWriter::CreateFileIdentifier(), PoDoFo::PdfFontFactory::CreateFont(), PoDoFo::PdfWriter::FetchPagesTree(), PoDoFo::PdfDocument::FillXObjectFromDocumentPage(), PoDoFo::PdfPage::GetAnnotation(), PoDoFo::PdfPage::GetFromResources(), PoDoFo::PdfObject::GetIndirectKey(), PoDoFo::PdfNamesTree::GetKeyValue(), PoDoFo::PdfPage::GetPageBox(), PoDoFo::PdfPage::GetPageNumber(), PoDoFo::PdfNamesTree::GetValue(), PoDoFo::PdfParserObject::ParseStream(), PoDoFo::PdfContents::PdfContents(), PoDoFo::PdfContentsTokenizer::PdfContentsTokenizer(), PoDoFo::PdfOutlineItem::PdfOutlineItem(), PoDoFo::PdfParser::ReadObjectFromStream(), PoDoFo::PdfWriter::ReorderObjectsLinearized(), PoDoFo::Impose::PdfTranslator::setTarget(), and PoDoFo::PdfParser::UpdateDocumentVersion().

{
    if( !m_bSorted )
        const_cast<PdfVecObjects*>(this)->Sort();

    PdfObject refObj( ref, NULL );
    std::pair<TCIVecObjects,TCIVecObjects> it = 
        std::equal_range( m_vector.begin(), m_vector.end(), &refObj, ObjectComparatorPredicate() );

    if( it.first != it.second )
        return *(it.first);

    /*
    const TCIVecObjects it ( std::find_if( this->begin(), this->end(), ObjectsComparator( ref ) ) );
    if( it != this->end() )
        return (*it);
    */

    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index