summaryrefslogtreecommitdiff
path: root/glib
AgeCommit message (Collapse)AuthorFilesLines
2023-03-27clang 15Albert Astals Cid1-1/+1
2023-03-23Fix use of dangling memorySune Vuorela1-1/+2
g_strdup is a macro and thus the intermediate getSignerName() value would be destructed after the first line of code in the macro
2023-03-08Update (C)Albert Astals Cid1-0/+1
2023-03-08Use std::string for stringsSune Vuorela1-1/+1
not manual strdup/free
2022-12-04cmake: Add CAIRO_INCLUDE_DIRS to the appropriate targetsAlbert Astals Cid1-0/+1
2022-08-31Fix copy'n'paste bug in the check for bounding box correctnessOliver Sander2-2/+2
Found by https://sonarcloud.io/project/overview?id=tsdgeos_poppler_mirror
2022-08-23cmake: Better linking against GTK3Albert Astals Cid2-13/+1
2022-08-19glib: Fix two potential memory leaks in poppler_document_create_dests_treeAlbert Astals Cid1-3/+2
2022-07-04poppler 22.07.0poppler-22.07.0Albert Astals Cid1-1/+1
2022-07-03glib: add support for stamp annotationNelson Benítez León8-4/+507
Creates new PopplerAnnotStamp type with the following public api: PopplerAnnot *poppler_annot_stamp_new(PopplerDocument *doc, PopplerRectangle *rect); PopplerAnnotStampIcon poppler_annot_stamp_get_icon(PopplerAnnotStamp *poppler_annot); void poppler_annot_stamp_set_icon(PopplerAnnotStamp *poppler_annot, PopplerAnnotStampIcon icon); gboolean poppler_annot_stamp_set_custom_image(PopplerAnnotStamp *poppler_annot, cairo_surface_t *image, GError **error); Updates poppler-glib-demo to test PopplerAnnotStamp including the custom image support.
2022-06-20Fixes 2 MSVC compilation bugsFabian Keßler1-2/+2
2022-04-26fix multiline find_text() bug in two column docsNelson Benítez León1-3/+3
Fix for a bug in double column documents where some single line matches are wrongly returned as being multiline matches. Includes test case for the bug.
2022-04-13Correct typo in `poppler-structure-element.cc`Pablo Rodríguez1-1/+1
2022-04-01Annots: Just return the std::vector instead of two gettersAlbert Astals Cid1-4/+1
Simpler code to use and solves the int vs size_t mismatch by not having a type involved at all
2022-04-01Link: Just return the std::vector instead of two gettersAlbert Astals Cid1-4/+1
Simpler code to use and solves the int vs size_t mismatch by not having a type involved at all
2022-03-30Change GfxFont name into an optional std::stringAlbert Astals Cid1-3/+7
2022-03-30Remove the url from the CachedFileLoader::init functionAlbert Astals Cid3-8/+7
It was unused everywhere except in CurlCachedFileLoader, but there we can just pass it in the constructor. The use in one of the two glib cases was a memory leak
2022-03-30Make GooString::format[v] return an unique_ptrAlbert Astals Cid1-3/+3
2022-03-28glib: Fix mem leak in poppler_document_new_from_fdChristian Persch1-3/+14
Someone needs to own the GooFile that's referenced by FileStream. Add a simple OwningFileStream class that does that. Fixes: https://gitlab.freedesktop.org/poppler/poppler/-/issues/1227
2022-03-24Unify 2 enums and a set of defines into an enumAlbert Astals Cid1-3/+3
2022-03-11Add readability-braces-around-statementsAlbert Astals Cid34-335/+650
2022-03-11Make GooFile::open return an unique_ptrAlbert Astals Cid1-2/+3
Sadly uncovers a memory leak on poppler_document_new_from_fd
2022-03-08glib: Fix returning c_str() of temporal stringsAlbert Astals Cid1-3/+3
They go out of scope as soon as the function returns
2022-03-08Annot::getRect: Return a const & instead of a pointerAlbert Astals Cid2-18/+15
Makes it clear the result is never null
2022-03-02AnnotMarkup::setLabel: Take a unique_ptrAlbert Astals Cid1-4/+1
This was double deleting on the glib side
2022-03-02Annot::setContents: Take a unique_ptrAlbert Astals Cid1-4/+1
This was double deleting on the glib side
2022-02-21Store the strings in FontInfo in std::optional<std::string>Oliver Sander1-10/+7
This saves some memory allocations, because the strings are now stored by value rather than by a pointer pointing to the heap. Also, the costum copy constructor can be replaced by the default one with this change.
2022-02-16We don't use pthreads anymore, cleanup cmake stuff around itAlbert Astals Cid1-3/+0
Well, there's some pthread code still in pdftoppm but it's "test" related, and should just be ported to C++11 threads
2022-02-16PDFDoc: Make passwords std::optional instead of pointersAlbert Astals Cid1-38/+14
Makes it clearer that we're not taking ownership of them
2022-02-16Use Freetype::FreetypeKai Pastor1-1/+1
2022-02-15Make PDFDoc constructor take the filename as unique_ptrAlbert Astals Cid1-5/+2
Makes it clear that it will own the given GooString
2022-02-15Change PDFDoc::save from pointer to referenceAlbert Astals Cid1-4/+2
Makes it clear it's not going to be destructed and that it can't be null
2022-02-10Make Catalog::embeddedFile return an unique_ptrAlbert Astals Cid1-5/+2
2022-02-01Improve PDFDoc::getSignatureFieldsAlbert Astals Cid1-1/+1
2022-02-01Popppler 22.02.0poppler-22.02.0Albert Astals Cid1-1/+1
2022-01-31glib/CMakeLists.txt: allow the user to configure INTROSPECTION_COMPILER_ARGSFabrice Fontaine1-1/+1
Allow the user to add its own parameters such as --includedir=$(STAGING_DIR)/usr/share/gir-1.0 to INTROSPECTION_COMPILER_ARGS to avoid the following build failure when cross-compiling with buildroot: [ 98%] Generating Poppler-0.18.typelib Could not find GIR file 'GObject-2.0.gir'; check XDG_DATA_DIRS or use --includedir error parsing file /home/giuliobenetti/autobuild/run/instance-1/output-1/build/poppler-21.12.0/glib/Poppler-0.18.gir: Failed to parse included gir GObject-2.0 If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help. Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs" Fixes: - http://autobuild.buildroot.org/results/d2f50aa56410c2fff8a0538c57038104906e747e Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-01-25glib: New method for getting all signature fieldsMarek Kasik3-3/+34
This commit adds new method poppler_document_get_signature_fields() which returns GList of all signature fields for the document. This is needed as some documents have signature fields which are not associated to any page and hence are unaccessible now.
2022-01-20Fix glib compilation on MSVCAlbert Astals Cid1-2/+5
glib-mkenums is a python script and you can't tell Windows to run those, so tell windows to run python with glib-mkenums as script to run
2022-01-16glib: try with utf8 password if latin1 failsNelson Benítez León1-0/+47
when opening encrypted files in below functions. poppler_document_new_from_file(): poppler_document_new_from_data(): poppler_document_new_from_bytes(): poppler_document_new_from_stream(): poppler_document_new_from_fd(): Poppler-glib converts password to latin1 before opening, but as shown in issue #824 there could be files encrypted with a UTF8 password, and other pdf viewers handle this well, so let's do the same and try with UTF-8 if latin1 fails. Note: we originally receive the password in UTF-8 from GTK. Thanks @aacid for clue about how this was fixed in Okular side. Fixes issue #824
2021-12-15glib: Remove FD-taking functions on windowsChristian Persch6-5/+32
They don't compile, and are not useful on windows anyway. Remove the functions completely, not just stub out their implementation, since otherwise the API contract of consuming the FD would be violated. https://gitlab.freedesktop.org/poppler/poppler/-/issues/1180
2021-12-08PDFDoc::getDocInfoStringEntry return a unique_ptrAlbert Astals Cid1-45/+23
Makes clear that the ownership is transferred
2021-12-07glib: Plug some mem leaksChristian Persch1-4/+4
This code leaked a GooString each time it was called. ==1018012== 56 (32 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 11,042 of 19,178 ==1018012== at 0x4841FF5: operator new(unsigned long) (vg_replace_malloc.c:422) ==1018012== by 0x1EFE8DA5: copy (GooString.h:104) ==1018012== by 0x1EFE8DA5: Object::copy() const (Object.cc:52) ==1018012== by 0x1EFE8EE8: Object::fetch(XRef*, int) const (Object.cc:78) ==1018012== by 0x1EF6C0C7: Dict::lookup(char const*, int) const (Dict.cc:167) ==1018012== by 0x1EFF5592: dictLookup (Object.h:622) ==1018012== by 0x1EFF5592: PDFDoc::getDocInfoStringEntry(char const*) (PDFDoc.cc:779) ==1018012== by 0x1EA00E71: getDocInfoCreatDate (PDFDoc.h:277) ==1018012== by 0x1EA00E71: poppler_document_get_creation_date_time (poppler-document.cc:1596)
2021-12-07glib: Replace use of deprecated g_time_zone_new()Christian Persch1-0/+8
Use g_time_zone_new_identifier() instead.
2021-12-07glib: Replace use of deprecated g_memdupChristian Persch1-4/+8
g_memdup() is deprecated. Replace it with straight malloc + memcpy. This fixes two compile warnings with newer glib (>= 2.68).
2021-12-07glib: Close file descriptors on errorChristian Persch2-1/+2
When fdopen fails, the file descriptor must be closed manually so it doesn't leak.
2021-12-03glib: Include glib.h before using defines from itChristian Persch1-0/+2
Include glib.h which provides G_OS_WIN32. https://gitlab.freedesktop.org/poppler/poppler/-/issues/1180
2021-12-01poppler 21.12.0poppler-21.12.0Albert Astals Cid1-1/+1
2021-11-30glib: Close the file descriptor on fdopen errorChristian Persch1-1/+1
... and *not* the (nullptr) file. https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/995
2021-11-25Add validation of signatures API to glib frontendMarek Kasik9-2/+470
2021-11-25glib: Fix a warning about missing element-type annotationMarek Kasik1-1/+1
There was a missing colon right after argument name.