diff options
author | Nelson Benítez León <nbenitezl@gmail.com> | 2018-09-10 15:51:56 +0100 |
---|---|---|
committer | Albert Astals Cid <tsdgeos@yahoo.es> | 2018-12-09 21:29:24 +0000 |
commit | 86326030f6989c79f8dd9e91cd4c249278cdbc49 (patch) | |
tree | ebf18f4ee4c21e33cee27f43bd1227ccc9b32f69 /glib | |
parent | 90a3778a8f73761c421991dca789d3a196940573 (diff) |
add new 'IgnoreDiacritics' option to ::findText()
This makes possible that simple ascii search terms
can match on their accented and other diacritics
counterparts.
This option will be ignored if the search term is
not pure Ascii.
Issue #637
Diffstat (limited to 'glib')
-rw-r--r-- | glib/poppler-page.cc | 1 | ||||
-rw-r--r-- | glib/poppler.h | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc index 34a1c77d..ce824cdc 100644 --- a/glib/poppler-page.cc +++ b/glib/poppler-page.cc @@ -915,6 +915,7 @@ poppler_page_find_text_with_options (PopplerPage *page, start_at_last, false, //stopAtLast options & POPPLER_FIND_CASE_SENSITIVE, + options & POPPLER_FIND_IGNORE_DIACRITICS, backwards, options & POPPLER_FIND_WHOLE_WORDS_ONLY, &xMin, &yMin, &xMax, &yMax)) diff --git a/glib/poppler.h b/glib/poppler.h index c0a6cd34..91b0b4f9 100644 --- a/glib/poppler.h +++ b/glib/poppler.h @@ -154,6 +154,9 @@ typedef enum /*< flags >*/ * @POPPLER_FIND_CASE_SENSITIVE: do case sensitive search * @POPPLER_FIND_BACKWARDS: search backwards * @POPPLER_FIND_WHOLE_WORDS_ONLY: search only whole words + * @POPPLER_FIND_IGNORE_DIACRITICS: do diacritics insensitive search, + * i.e. ignore accents, umlauts, diaeresis,etc. while matching. This + * option will be ignored if the search term is not pure ascii. Since 0.73. * * Flags using while searching text in a page * @@ -164,7 +167,8 @@ typedef enum /*< flags >*/ POPPLER_FIND_DEFAULT = 0, POPPLER_FIND_CASE_SENSITIVE = 1 << 0, POPPLER_FIND_BACKWARDS = 1 << 1, - POPPLER_FIND_WHOLE_WORDS_ONLY = 1 << 2 + POPPLER_FIND_WHOLE_WORDS_ONLY = 1 << 2, + POPPLER_FIND_IGNORE_DIACRITICS = 1 << 3 } PopplerFindFlags; typedef struct _PopplerDocument PopplerDocument; |