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

void PoDoFo::PdfListField::RemoveItem ( int  nIndex )

Removes an item for the list

Parameters:
nIndexindex of the item to remove

Definition at line 780 of file PdfField.cpp.

References PoDoFo::PdfDictionary::AddKey(), PoDoFo::PdfArray::begin(), PoDoFo::ePdfError_ValueOutOfRange, PoDoFo::PdfVariant::GetArray(), PoDoFo::PdfVariant::GetDictionary(), PoDoFo::PdfDictionary::GetKey(), PoDoFo::PdfDictionary::HasKey(), PODOFO_RAISE_ERROR, and PoDoFo::PdfArray::size().

{
    PdfArray   opt;

    if( m_pObject->GetDictionary().HasKey( PdfName("Opt") ) )
        opt = m_pObject->GetDictionary().GetKey( PdfName("Opt") )->GetArray();
    
    if( nIndex < 0 || nIndex > static_cast<int>(opt.size()) )
    {
        PODOFO_RAISE_ERROR( ePdfError_ValueOutOfRange );
    }

    opt.erase( opt.begin() + nIndex );
    m_pObject->GetDictionary().AddKey( PdfName("Opt"), opt );
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index