patch-libdjvu_DjVmDir_h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. $OpenBSD: patch-libdjvu_DjVmDir_h,v 1.1 2016/03/02 20:10:36 juanfra Exp $
  2. "accept documents with duplicate page titles"
  3. http://sourceforge.net/p/djvu/djvulibre-git/ci/77a4dca8dd3acd0acc1680fa14a352c11084e25d/
  4. https://bitbucket.org/jwilk/pdf2djvu/issues/113/duplicate-page-title-1
  5. --- libdjvu/DjVmDir.h.orig Tue Jul 8 23:15:07 2014
  6. +++ libdjvu/DjVmDir.h Wed Feb 3 01:51:28 2016
  7. @@ -181,7 +181,8 @@ class DJVUAPI DjVmDir : public GPEnabled (public)
  8. /** Translates file IDs to file records. */
  9. GP<File> id_to_file(const GUTF8String &id) const;
  10. /** Translates file shortcuts to file records. */
  11. - GP<File> title_to_file(const GUTF8String &title) const;
  12. + GP<File> title_to_file(const GUTF8String &title, GPosition spos) const;
  13. + GP<File> title_to_file(const GUTF8String &title) const;
  14. /** Access file record by position. */
  15. GP<File> pos_to_file(int fileno, int *ppageno=0) const;
  16. /** Returns position of the file in the directory. */
  17. @@ -216,7 +217,6 @@ class DJVUAPI DjVmDir : public GPEnabled (public)
  18. GPArray<File> page2file;
  19. GPMap<GUTF8String, File> name2file;
  20. GPMap<GUTF8String, File> id2file;
  21. - GPMap<GUTF8String, File> title2file;
  22. private: //dummy stuff
  23. static void decode(ByteStream *);
  24. static void encode(ByteStream *);
  25. @@ -438,6 +438,13 @@ DjVmDir::is_indirect(void) const
  26. GCriticalSectionLock lock((GCriticalSection *) &class_lock);
  27. return ( files_list.size() && files_list[files_list] != 0 &&
  28. files_list[files_list]->offset==0 );
  29. +}
  30. +
  31. +inline GP<DjVmDir::File>
  32. +DjVmDir::title_to_file(const GUTF8String &title) const
  33. +{
  34. + GPosition pos;
  35. + return title_to_file(title, pos);
  36. }