Logo Search packages:      
Sourcecode: djvulibre version File versions

void DjVuDocEditor::remove_pages ( const GList< int > &  page_list,
bool  remove_unref = true 
)

Removes the specified pages from the document. If remove_unref# is TRUE#, the function will also remove from the document any file, which became unreferenced due to the pages' removal

Definition at line 1086 of file DjVuDocEditor.cpp.

References GListTemplate< TYPE, TYPE >::append(), DjVuDocument::get_djvm_dir(), and remove_page().

{
   DEBUG_MSG("DjVuDocEditor::remove_pages() called\n");
   DEBUG_MAKE_INDENT(3);

      // First we need to translate page numbers to IDs (they will
      // obviously be changing while we're removing pages one after another)
   GP<DjVmDir> djvm_dir=get_djvm_dir();
   GPosition pos ;
   if (djvm_dir)
   {
      GList<GUTF8String> id_list;
      for(pos=page_list;pos;++pos)
      {
         GP<DjVmDir::File> frec=djvm_dir->page_to_file(page_list[pos]);
         if (frec)
            id_list.append(frec->get_load_name());
      }

      for(pos=id_list;pos;++pos)
      {
         GP<DjVmDir::File> frec=djvm_dir->id_to_file(id_list[pos]);
         if (frec)
            remove_page(frec->get_page_num(), remove_unref);
      }
   }
}


Generated by  Doxygen 1.6.0   Back to index