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

PdfObject * PoDoFo::PdfObject::GetIndirectKey ( const PdfName key ) const [inherited]

Get the keys value out of the dictionary. If the key is a reference, the reference is resolved and the object pointed to by the reference is returned.

Parameters:
keylook for the key named key in the dictionary
Returns:
the found value or NULL if the value is not in the dictionary or if this object is no dictionary

Definition at line 204 of file PdfObject.cpp.

References PoDoFo::ePdfError_InvalidHandle, PoDoFo::PdfVariant::GetDictionary(), PoDoFo::PdfDictionary::GetKey(), PoDoFo::PdfVecObjects::GetObject(), PoDoFo::PdfObject::GetOwner(), PoDoFo::PdfVariant::GetReference(), PoDoFo::PdfVariant::IsDictionary(), PoDoFo::PdfVariant::IsReference(), PODOFO_RAISE_ERROR_INFO, and PoDoFo::PdfObject::SetOwner().

Referenced by PoDoFo::PdfFontFactory::CreateFont(), PoDoFo::PdfWriter::FetchPagesTree(), PoDoFo::PdfWriter::FindCatalogDependencies(), PoDoFo::PdfMemStream::FlateCompress(), PoDoFo::PdfOutlineItem::GetAction(), PoDoFo::PdfAnnotation::GetAction(), PoDoFo::PdfPage::GetAnnotationsArray(), PoDoFo::PdfOutlineItem::GetDestination(), PoDoFo::PdfAnnotation::GetFileAttachement(), PoDoFo::PdfPage::GetFromResources(), PoDoFo::PdfPage::GetInheritedKeyFromObject(), PoDoFo::PdfMemDocument::GetNamedObjectFromCatalog(), PoDoFo::PdfDocument::GetNamedObjectFromCatalog(), PoDoFo::PdfDocument::GetPageMode(), PoDoFo::PdfPage::GetPageNumber(), PoDoFo::PdfNamesTree::GetRootNode(), PoDoFo::PdfOutlineItem::GetTextColorBlue(), PoDoFo::PdfOutlineItem::GetTextColorGreen(), PoDoFo::PdfOutlineItem::GetTextColorRed(), PoDoFo::PdfOutlineItem::GetTextFormat(), PoDoFo::PdfOutlineItem::GetTitle(), PoDoFo::PdfMemDocument::InitFromParser(), PoDoFo::PdfPage::InitNewPage(), PoDoFo::PdfDocument::InitPagesTree(), PoDoFo::PdfObject::MustGetIndirectKey(), PoDoFo::PdfFontMetricsObject::PdfFontMetricsObject(), PoDoFo::PdfPage::PdfPage(), PoDoFo::PdfXObject::PdfXObject(), PoDoFo::PdfDocument::SetViewerPreference(), and PoDoFo::PdfObject::WriteObject().

{
    const PdfObject* pObj = NULL;

    if( this->IsDictionary() && this->GetDictionary().HasKey( key ) )
    {
        pObj = this->GetDictionary().GetKey( key );
        if( pObj->IsReference() ) 
        {
            if( !m_pOwner )
            {
                PODOFO_RAISE_ERROR_INFO( ePdfError_InvalidHandle, "Object is a reference but does not have an owner!" );
            }

            pObj = m_pOwner->GetObject( pObj->GetReference() );
        }
        else
            const_cast<PdfObject*>(pObj)->SetOwner( GetOwner() );// even directs might want an owner...
    }

    // DominikS: TODO Remove const on GetIndirectKey
    return const_cast<PdfObject*>(pObj);
}

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