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

void PoDoFo::PdfAction::AddToDictionary ( PdfDictionary dictionary ) const

Adds this action to an dictionary. This method handles the all the complexities of making sure it's added correctly

If this action is empty. Nothing will be added.

Parameters:
dictionarythe action will be added to this dictionary

Definition at line 122 of file PdfAction.cpp.

References PoDoFo::PdfDictionary::AddKey(), PoDoFo::ePdfError_ActionAlreadyPresent, PoDoFo::PdfElement::GetObject(), PoDoFo::PdfDictionary::HasKey(), and PoDoFo::PdfDictionary::RemoveKey().

Referenced by PoDoFo::PdfOutlineItem::SetAction().

{
    // Do not add empty destinations
//    if( !m_array.size() )
//        return;

    // since we can only have EITHER a Dest OR an Action
    // we check for an Action, and if already present, we throw
    if ( dictionary.HasKey( PdfName( "Dest" ) ) )
        PODOFO_RAISE_ERROR( ePdfError_ActionAlreadyPresent );

    dictionary.RemoveKey( "A" );
    dictionary.AddKey( "A", this->GetObject() );
}

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