diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2024-02-10 08:13:48 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2024-02-10 08:13:48 +0000 |
commit | 90a8327e9b036ece000905d54a316b792d891e0b (patch) | |
tree | 45536c0f5666955912b04bcd20c14a57aad31872 /Build/source/libs/xpdf/xpdf-src | |
parent | 0357cc55904fda095727bb30f07b68dbf3439f8e (diff) |
revert (xpdf 4.05 to xpdf 4.04)
git-svn-id: svn://tug.org/texlive/trunk@69766 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-src')
196 files changed, 2441 insertions, 4454 deletions
diff --git a/Build/source/libs/xpdf/xpdf-src/ANNOUNCE b/Build/source/libs/xpdf/xpdf-src/ANNOUNCE index c7028e7ff0c..c20dcaf47ae 100644 --- a/Build/source/libs/xpdf/xpdf-src/ANNOUNCE +++ b/Build/source/libs/xpdf/xpdf-src/ANNOUNCE @@ -1,4 +1,4 @@ -Subject: ANNOUNCE: Xpdf 4.05 - a PDF viewer and related tools +Subject: ANNOUNCE: Xpdf 4.04 - a PDF viewer and related tools Glyph & Cog, LLC is pleased to announce a new version of Xpdf, the open source Portable Document Format (PDF) viewer. The Xpdf project @@ -10,29 +10,16 @@ non-graphical components (pdftops, pdftotext, etc.) run on Linux, Unix, Windows, MacOSX, and pretty much any other system with a decent C++ compiler. -4.05 is primarily a bug fix release. There are some new features: - -* New command line options/features: - - Added the '-overwrite' option to pdftohtml. - - Added the '-custom' flag to pdfinfo. - - Added the '-meta' flag to pdftohtml. - - Added the 'uses JavaScript' output to pdfinfo. - -* New configuration options: - - Added the 'ignoreWrongSizeToUnicode' xpdfrc setting. - - Added the zoomScaleFactor xpdfrc setting. - - Added the zoomValues xpdfrc setting. - - Added the separateRotatedText xpdfrc setting. - - Added the allowLinksToChangeZoom xpdfrc setting. +4.04 is primarily a bug fix release. There are some new features: * XpdfReader improvements: - - Added the loadSession and saveSession commands, and the 'Load last - session' menu item. - - Added code to automatically save and restore the xpdf session - under control of a session manager. (This has not been thoroughly - tested yet.) - - Added a 'smart case' option for search in xpdf. - - Added a color/gray/mono switch to the 'save image' dialog. + - Implemented selection extension via shift-click, and word/line + selection via double/triple click. + - Added default bindings for ctrl-mousewheel-up/down to zoom in/out. + - Added a help menu item that shows all of the key bindings. + +* Various new command line options for pdftotext, pdftohtml, pdftoppm, + pdftopng, and xpdf. See the `CHANGES' file for a complete list of changes. diff --git a/Build/source/libs/xpdf/xpdf-src/CHANGES b/Build/source/libs/xpdf/xpdf-src/CHANGES index 3a40c2995e0..564aff32b4f 100644 --- a/Build/source/libs/xpdf/xpdf-src/CHANGES +++ b/Build/source/libs/xpdf/xpdf-src/CHANGES @@ -2810,83 +2810,3 @@ Added an integer overflow check in JPXStream. (JPXStream issue) The DCT (JPEG) decoder was allowing the 'interleaved' flag to be changed after the first scan of the image. (CVE-2022-24106) [Thanks to Shin Ando @ Ricera Security for the bug report.] - -4.05 (2024-feb-08) ------------------- -Added the '-overwrite' option to pdftohtml. -Added the 'ignoreWrongSizeToUnicode' xpdfrc setting. -Added the loadSession and saveSession commands, and the 'Load last - session' menu item. -Added code to automatically save and restore the xpdf session under - control of a session manager. This has not been thoroughly tested - yet. -Added the zoomScaleFactor xpdfrc setting. -Added the zoomValues xpdfrc setting. -Added a 'smart case' option for search in xpdf. -Added the '-custom' flag to pdfinfo. -Added a color/gray/mono switch to the 'save image' dialog. -Added the separateRotatedText xpdfrc setting. -Added the '-meta' flag to pdftohtml. -Added the allowLinksToChangeZoom xpdfrc setting. -Added the 'uses JavaScript' output to pdfinfo. -Implemented pattern stroking of text. Also fixed the various - combinations of filling/stroking with color/pattern + clipping, some - of which weren't being handled correctly. -Pdftops now (re)compresses any uncompressed or RLE-compressed images. -On an out-of-memory error, the command line tools now exit with an - "out of memory" message, rather than an exception message. -Add code to pdfimages to extract images from tiling patterns. -Pdftops can now embed external 8-bit OpenType CFF fonts. -Fixed a corner case in the text extractor related to characters drawn - at extremely large coordinates. [Thanks to elvadisas for the bug - report.] -Fixed an integer overflow in the transparency group code. [Thanks to - elvadisas for the bug report.] -Modify Annots::Annots() to skip annotations that have been turned into - AcroFormFields -- invalid Widget-type annots will now be rendered as - annots. -Added a missing integer overflow check in the JBIG2 decoder. [Thanks - to sangjun for the bug report.] -Added some sanity checks to the JBIG2 decoder. [Thanks to sangjun and - ycdxsb for the bug reports.] -Tiling patterns that use non-Normal blend modes can't be cached. -Fixed a bitmap size sanity check in the JBIG2 decoder. [Thanks to Han - Zheng (NCNIPC of China, Hexhive), for the bug report.] -Fixed a missing bounds check in FoFiType1C::convertToOpenType (used in - pdftohtml). [Thanks to cyth for the bug report.] -Fixed a use-after-free bug in pdftohtml. [Thanks to FeRDNYC for the - bug report.] -Merged aconf2.h into aconf.h; corrected the cmake config settings for - paths; added the BASE14_FONT_DIR config option. [Thanks to FeRDNYC - for the suggestions.] -Fixed a missing check for a zero-length index in the CFF (Type1C) font - parser. [Thanks to Yuhang Huang (NCNIPC of China), Han Zheng - (NCNIPC of China, Hexhive), Wanying Cao, Jiayu Zhao (NCNIPC of - China) for the bug report.] -Add an object loop check to Catalog::countPageTree(). -The DCT decoder wasn't checking for an SOF before the first SOS. - [Thanks to cyth for the bug report.] -The inline image decoder was skipping to end-of-stream in the wrong - stream object. [Thanks to cyth for the bug report.] -Fixed a bug in the JPEG 2000 decoder when nLayers > 1 and the - 'termination on each coding pass' flag is set. -Removed the #pragma interface/implementation stuff (which is outdated - and useless at this point). -Fixed a bug in the ICCBased color space parser that was allowing the - number of components to be zero. (CVE-2023-2662) [Thanks to - huckleberry for the bug report.] -Added checks for PDF object loops in AcroForm::scanField() - (CVE-2018-7453, CVE-2018-16369, CVE-2022-36561, CVE-2022-41844), - Catalog::readPageLabelTree2() (CVE-2023-2663), and - Catalog::readEmbeddedFileTree() (CVE-2023-2664). -The zero-width character problem can also happen if the page size is - very large -- that needs to be limited too, the same way as - character position coordinates. (CVE-2023-3044) [Thanks to jlinliu - for the bug report.] -Add some missing bounds check code in DCTStream. [Thanks to Jiahao - Liu for the bug report.] -Fix a deadlock when an object stream's length field is contained in - another object stream. (CVE-2023-3436) [Thanks to Jiahao Liu for - the bug report.] -Correctly handle tiling patterns with negative step values. -Ignore overprint in soft masks (to match Adobe's behavior). diff --git a/Build/source/libs/xpdf/xpdf-src/INSTALL b/Build/source/libs/xpdf/xpdf-src/INSTALL index 0dd151ca26a..57ff61f2156 100644 --- a/Build/source/libs/xpdf/xpdf-src/INSTALL +++ b/Build/source/libs/xpdf/xpdf-src/INSTALL @@ -1,11 +1,11 @@ Xpdf ==== -version 4.05 -2024-feb-08 +version 4.04 +2022-apr-18 The Xpdf software and documentation are -copyright 1996-2024 Glyph & Cog, LLC. +copyright 1996-2022 Glyph & Cog, LLC. Email: xpdf@xpdfreader.com WWW: http://www.xpdfreader.com/ @@ -34,8 +34,8 @@ different systems. - CMake 2.8.8 or newer - FreeType 2.0.5 or newer - Qt 5.x or 6.x (for xpdf only) - - libpng (for pdftopng and pdftohtml) - - zlib (for pdftopng and pdftohtml) + - libpng (for pdftoppm and pdftohtml) + - zlib (for pdftoppm and pdftohtml) If Qt isn't found, the GUI viewer (xpdf) won't be built, but the command line tools will still be built. @@ -119,12 +119,6 @@ different systems. The ${DATADIR} variable in xpdfrc config files will expand to this string. - -DBASE14_FONT_DIR="/usr/share/fonts/type1" - By default, Xpdf will look for the URW Type 1 fonts in several - quasi-standard directories on Linux/Mac systems. This option - adds another directory to that search path. On Windows, this - does the same thing, except for the system TrueType fonts. - -DCMAKE_DISABLE_FIND_PACKAGE_Qt4=1 -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=1 Do not search for the Qt4/Qt5 libraries. This will disable @@ -147,11 +141,6 @@ different systems. Set the man directory, relative to CMAKE_INSTALL_PREFIX (typically "man" or "share/man"). - -DCMAKE_CXX_FLAGS="... -DDISABLE_SESSION_MANAGEMENT" - Disable the session manager interface, i.e., do not - automatically save and restore sessions under control of the - session manager. - * Build: make diff --git a/Build/source/libs/xpdf/xpdf-src/README b/Build/source/libs/xpdf/xpdf-src/README index e973db5e58e..026460dd24b 100644 --- a/Build/source/libs/xpdf/xpdf-src/README +++ b/Build/source/libs/xpdf/xpdf-src/README @@ -1,11 +1,11 @@ Xpdf ==== -version 4.05 -2024-feb-08 +version 4.04 +2022-apr-18 The Xpdf software and documentation are -copyright 1996-2024 Glyph & Cog, LLC. +copyright 1996-2022 Glyph & Cog, LLC. Email: xpdf@xpdfreader.com WWW: http://www.xpdfreader.com/ diff --git a/Build/source/libs/xpdf/xpdf-src/aconf2.h b/Build/source/libs/xpdf/xpdf-src/aconf2.h new file mode 100644 index 00000000000..05d785c274a --- /dev/null +++ b/Build/source/libs/xpdf/xpdf-src/aconf2.h @@ -0,0 +1,41 @@ +/* + * aconf2.h + * + * This gets included by aconf.h, and contains miscellaneous global + * settings not directly controlled by autoconf. This is a separate + * file because otherwise the configure script will munge any + * #define/#undef constructs. + * + * Copyright 2002-2003 Glyph & Cog, LLC + */ + +#ifndef ACONF2_H +#define ACONF2_H + +/* + * This controls the use of the interface/implementation pragmas. + */ +#if defined(__GNUC__) && !defined(__clang__) +#define USE_GCC_PRAGMAS +#endif +/* There is a bug in the version of gcc which ships with MacOS X 10.2 */ +#if defined(__APPLE__) && defined(__MACH__) +# include <AvailabilityMacros.h> +#endif +#ifdef MAC_OS_X_VERSION_MAX_ALLOWED +# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 +# undef USE_GCC_PRAGMAS +# endif +#endif + +/* + * Speed up Windows compilation. This will only work for the command + * line tools. + */ +/* + *#ifdef _WIN32 + *# define WIN32_LEAN_AND_MEAN + *#endif + */ + +#endif diff --git a/Build/source/libs/xpdf/xpdf-src/cmake-config.txt b/Build/source/libs/xpdf/xpdf-src/cmake-config.txt index e49962c5eea..f9339b9fc81 100644 --- a/Build/source/libs/xpdf/xpdf-src/cmake-config.txt +++ b/Build/source/libs/xpdf/xpdf-src/cmake-config.txt @@ -92,17 +92,24 @@ option(USE_EXCEPTIONS "use C++ exceptions" ON) option(USE_FIXEDPOINT "use fixed point (instead of floating point) arithmetic" OFF) option(SPLASH_CMYK "include support for CMYK rasterization" OFF) option(NO_FONTCONFIG "disable support for libfontconfig" OFF) +option(SYSTEM_XPDFRC "full path for system-wide xpdfrc file" "") +if (SYSTEM_XPDFRC) + set(SYSTEM_XPDFRC_DEFINE "#define SYSTEM_XPDFRC \"${SYSTEM_XPDFRC}\"") +else () + set(SYSTEM_XPDFRC_DEFINE "/* #undef SYSTEM_XPDFRC */") +endif () +option(XPDFRC_DATADIR "directory to use for the DATADIR xpdfrc variable" "") +if (XPDFRC_DATADIR) + set(XPDFRC_DATADIR_DEFINE "#define XPDFRC_DATADIR \"${XPDFRC_DATADIR}\"") +else () + set(XPDFRC_DATADIR_DEFINE "/* #undef XPDFRC_DATADIR */") +endif () if (WIN32) option(XPDFWIDGET_PRINTING "include printing support in XpdfWidget" OFF) else () option(XPDFWIDGET_PRINTING "include printing support in XpdfWidget" ON) endif () -#--- paths -set(SYSTEM_XPDFRC "${SYSTEM_XPDFRC}" CACHE FILEPATH "full path for system-wide xpdfrc file") -set(XPDFRC_DATADIR "${XPDFRC_DATADIR}" CACHE PATH "directory to use for the DATADIR xpdfrc variable") -set(BASE14_FONT_DIR "${BASE14_FONT_DIR}" CACHE PATH "directory where the Base14 fonts are installed") - #--- check for various library functions check_function_exists(mkstemp HAVE_MKSTEMP) check_function_exists(mkstemps HAVE_MKSTEMPS) @@ -201,13 +208,11 @@ find_package(PNG) find_package(Qt6Widgets QUIET) if (Qt6Widgets_FOUND) find_package(Qt6Network) - find_package(Qt6Concurrent) find_package(Qt6PrintSupport) else () find_package(Qt5Widgets QUIET) if (Qt5Widgets_FOUND) find_package(Qt5Network) - find_package(Qt5Concurrent) find_package(Qt5PrintSupport) else () find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork) @@ -216,12 +221,12 @@ endif () if (Qt5Widgets_FOUND) message(STATUS "Qt5 found") if (XPDFWIDGET_PRINTING) - set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Concurrent_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS}") - set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Concurrent_DEFINITIONS} ${Qt5PrintSupport_DEFINITIONS}") + set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS}") + set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5PrintSupport_DEFINITIONS}") set(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::PrintSupport) else () - set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Concurrent_INCLUDE_DIRS}") - set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Concurrent_DEFINITIONS}") + set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS}") + set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS}") set(QT_LIBRARIES Qt5::Widgets Qt5::Network) endif () if (XPDFWIDGET_PRINTING) @@ -243,13 +248,13 @@ if (Qt5Widgets_FOUND) elseif (Qt6Widgets_FOUND) message(STATUS "Qt6 found") if (XPDFWIDGET_PRINTING) - set(QT_INCLUDES ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS} ${Qt6Concurrent_INCLUDE_DIRS} ${Qt6PrintSupport_INCLUDE_DIRS}) - set(QT_DEFINITIONS "${Qt6Widgets_DEFINITIONS} ${Qt6Network_DEFINITIONS} ${Qt6Concurrent_DEFINITIONS} ${Qt6PrintSupport_DEFINITIONS}") - set(QT_LIBRARIES Qt6::Widgets Qt6::Network Qt6::Concurrent Qt6::PrintSupport) + set(QT_INCLUDES "${Qt6Widgets_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS} ${Qt6PrintSupport_INCLUDE_DIRS}") + set(QT_DEFINITIONS "${Qt6Widgets_DEFINITIONS} ${Qt6Network_DEFINITIONS} ${Qt6PrintSupport_DEFINITIONS}") + set(QT_LIBRARIES Qt6::Widgets Qt6::Network Qt6::PrintSupport) else () - set(QT_INCLUDES ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS} ${Qt6Concurrent_INCLUDE_DIRS}) - set(QT_DEFINITIONS "${Qt6Widgets_DEFINITIONS} ${Qt6Network_DEFINITIONS} ${Qt6Concurrent_DEFINITIONS}") - set(QT_LIBRARIES Qt6::Widgets Qt6::Network Qt6::Concurrent) + set(QT_INCLUDES "${Qt6Widgets_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS}") + set(QT_DEFINITIONS "${Qt6Widgets_DEFINITIONS} ${Qt6Network_DEFINITIONS}") + set(QT_LIBRARIES Qt6::Widgets Qt6::Network) endif () if (XPDFWIDGET_PRINTING) if (APPLE) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.1 index 16847b0563f..4d00f3722d6 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.1 @@ -1,8 +1,8 @@ -.\" Copyright 2013-2024 Glyph & Cog, LLC -.TH pdfdetach 1 "08 Feb 2024" +.\" Copyright 2013-2022 Glyph & Cog, LLC +.TH pdfdetach 1 "18 Apr 2022" .SH NAME pdfdetach \- Portable Document Format (PDF) document embedded file -extractor (version 4.05) +extractor (version 4.04) .SH SYNOPSIS .B pdfdetach [options] @@ -86,13 +86,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdfinfo software and documentation are copyright 1996-2024 Glyph & +The pdfinfo software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.cat index 73e397280a4..220bb752467 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfdetach.cat @@ -3,8 +3,8 @@ pdfdetach(1) General Commands Manual pdfdetach(1) NAME - pdfdetach - Portable Document Format (PDF) document embedded file ex- - tractor (version 4.05) + pdfdetach - Portable Document Format (PDF) document embedded file + extractor (version 4.04) SYNOPSIS pdfdetach [options] [PDF-file] @@ -76,12 +76,10 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdfinfo software and documentation are copyright 1996-2024 Glyph & + The pdfinfo software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -91,4 +89,4 @@ SEE ALSO - 08 Feb 2024 pdfdetach(1) + 18 Apr 2022 pdfdetach(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.1 index 7734d5cb284..6ee0226e677 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.1 @@ -1,8 +1,8 @@ -.\" Copyright 1999-2024 Glyph & Cog, LLC -.TH pdffonts 1 "08 Feb 2024" +.\" Copyright 1999-2022 Glyph & Cog, LLC +.TH pdffonts 1 "18 Apr 2022" .SH NAME pdffonts \- Portable Document Format (PDF) font analyzer (version -4.05) +4.04) .SH SYNOPSIS .B pdffonts [options] @@ -143,13 +143,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdffonts software and documentation are copyright 1996-2024 Glyph +The pdffonts software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.cat index 41ad2eabd29..77fef55fd64 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdffonts.cat @@ -3,7 +3,7 @@ pdffonts(1) General Commands Manual pdffonts(1) NAME - pdffonts - Portable Document Format (PDF) font analyzer (version 4.05) + pdffonts - Portable Document Format (PDF) font analyzer (version 4.04) SYNOPSIS pdffonts [options] [PDF-file] @@ -14,8 +14,8 @@ DESCRIPTION The following information is listed for each font: - name the font name, exactly as given in the PDF file (potentially in- - cluding a subset prefix) + name the font name, exactly as given in the PDF file (potentially + including a subset prefix) type the font type -- see below for details @@ -102,12 +102,10 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdffonts software and documentation are copyright 1996-2024 Glyph & + The pdffonts software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -117,4 +115,4 @@ SEE ALSO - 08 Feb 2024 pdffonts(1) + 18 Apr 2022 pdffonts(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.1 index 951b232eb16..06a9c1fc85c 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.1 @@ -1,8 +1,8 @@ -.\" Copyright 1998-2024 Glyph & Cog, LLC -.TH pdfimages 1 "08 Feb 2024" +.\" Copyright 1998-2022 Glyph & Cog, LLC +.TH pdfimages 1 "18 Apr 2022" .SH NAME pdfimages \- Portable Document Format (PDF) image extractor -(version 4.05) +(version 4.04) .SH SYNOPSIS .B pdfimages [options] @@ -78,11 +78,6 @@ Print a status message (to stdout) before processing each page. Don't print any messages or errors. .RB "[config file: " errQuiet ] .TP -.BI \-cfg " config-file" -Read -.I config-file -in place of ~/.xpdfrc or the system-wide config file. -.TP .B \-v Print copyright and version information. .TP @@ -107,13 +102,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdfimages software and documentation are copyright 1998-2024 Glyph +The pdfimages software and documentation are copyright 1998-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.cat index 25695487f83..7361a3bb11c 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfimages.cat @@ -4,7 +4,7 @@ pdfimages(1) General Commands Manual pdfimages(1) NAME pdfimages - Portable Document Format (PDF) image extractor (version - 4.05) + 4.04) SYNOPSIS pdfimages [options] PDF-file image-root @@ -71,10 +71,6 @@ OPTIONS -q Don't print any messages or errors. [config file: errQuiet] - -cfg config-file - Read config-file in place of ~/.xpdfrc or the system-wide config - file. - -v Print copyright and version information. -h Print usage information. (-help and --help are equivalent.) @@ -90,19 +86,17 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdfimages software and documentation are copyright 1998-2024 Glyph + The pdfimages software and documentation are copyright 1998-2022 Glyph & Cog, LLC. SEE ALSO - xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- + xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- fonts(1), pdfdetach(1), pdftoppm(1), pdftopng(1), xpdfrc(5) http://www.xpdfreader.com/ - 08 Feb 2024 pdfimages(1) + 18 Apr 2022 pdfimages(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.1 index f554e52fbc0..66f3e70bf3a 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.1 @@ -1,8 +1,8 @@ -.\" Copyright 1999-2024 Glyph & Cog, LLC -.TH pdfinfo 1 "08 Feb 2024" +.\" Copyright 1999-2022 Glyph & Cog, LLC +.TH pdfinfo 1 "18 Apr 2022" .SH NAME pdfinfo \- Portable Document Format (PDF) document information -extractor (version 4.05) +extractor (version 4.04) .SH SYNOPSIS .B pdfinfo [options] @@ -63,10 +63,7 @@ page size and rotation file size .RE .RS -optimized (aka linearized) (yes/no) -.RE -.RS -uses JavaScript (yes/no) +linearized (yes/no) .RE .RS PDF version @@ -106,9 +103,6 @@ the PDF file's Catalog object.) .B \-rawdates Prints the raw (undecoded) date strings, directly from the PDF file. .TP -.B \-custom -Prints any custom (non-standard) entries in the \'Info' dictionary. -.TP .BI \-enc " encoding-name" Sets the encoding to use for text output. The .I encoding\-name @@ -153,13 +147,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdfinfo software and documentation are copyright 1996-2024 Glyph & +The pdfinfo software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.cat index 90682eb2903..05dbc38f18b 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdfinfo.cat @@ -4,7 +4,7 @@ pdfinfo(1) General Commands Manual pdfinfo(1) NAME pdfinfo - Portable Document Format (PDF) document information extractor - (version 4.05) + (version 4.04) SYNOPSIS pdfinfo [options] [PDF-file] @@ -33,8 +33,7 @@ DESCRIPTION print and copy permissions (if encrypted) page size and rotation file size - optimized (aka linearized) (yes/no) - uses JavaScript (yes/no) + linearized (yes/no) PDF version metadata (only if requested) @@ -51,10 +50,10 @@ OPTIONS corresponding command line option. -f number - Specifies the first page to examine. If multiple pages are re- - quested using the "-f" and "-l" options, the size of each re- - quested page (and, optionally, the bounding boxes for each re- - quested page) are printed. Otherwise, only page one is exam- + Specifies the first page to examine. If multiple pages are + requested using the "-f" and "-l" options, the size of each + requested page (and, optionally, the bounding boxes for each + requested page) are printed. Otherwise, only page one is exam- ined. -l number @@ -70,18 +69,14 @@ OPTIONS Prints the raw (undecoded) date strings, directly from the PDF file. - -custom - Prints any custom (non-standard) entries in the 'Info' dictio- - nary. - -enc encoding-name - Sets the encoding to use for text output. The encoding-name - must be defined with the unicodeMap command (see xpdfrc(5)). + Sets the encoding to use for text output. The encoding-name + must be defined with the unicodeMap command (see xpdfrc(5)). This defaults to "Latin1" (which is a built-in encoding). [con- fig file: textEncoding] -opw password - Specify the owner password for the PDF file. Providing this + Specify the owner password for the PDF file. Providing this will bypass all security restrictions. -upw password @@ -106,19 +101,17 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdfinfo software and documentation are copyright 1996-2024 Glyph & + The pdfinfo software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO - xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdffonts(1), pdfde- + xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdffonts(1), pdfde- tach(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5) http://www.xpdfreader.com/ - 08 Feb 2024 pdfinfo(1) + 18 Apr 2022 pdfinfo(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.1 index bead853b7ad..5129f0dd4b9 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.1 @@ -1,8 +1,8 @@ -.\" Copyright 1997-2024 Glyph & Cog, LLC -.TH pdftohtml 1 "08 Feb 2024" +.\" Copyright 1997-2022 Glyph & Cog, LLC +.TH pdftohtml 1 "18 Apr 2022" .SH NAME pdftohtml \- Portable Document Format (PDF) to HTML converter -(version 4.05) +(version 4.04) .SH SYNOPSIS .B pdftohtml [options] @@ -84,21 +84,12 @@ Convert AcroForm text and checkbox fields to HTML input elements. This also removes text (e.g., underscore characters) and erases background image content (e.g., lines or boxes) in the field areas. .TP -.B \-meta -Include PDF document metadata as 'meta' elements in the HTML header. -.TP .B \-table Use table mode when performing the underlying text extraction. This will generally produce better output when the PDF content is a full-page table. NB: This does not generate HTML tables; it just changes the way text is split up. .TP -.B \-overwrite -By default pdftohtml will not overwrite the specified output -directory. If the directory already exists, pdftohtml will exit with -an error. This option tells pdftohtml to instead overwrite the -existing directory. -.TP .BI \-opw " password" Specify the owner password for the PDF file. Providing this will bypass all security restrictions. @@ -147,13 +138,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdftohtml software and documentation are copyright 1996-2024 Glyph +The pdftohtml software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.cat index d3f11b7ba0b..5ddbfa0c9fb 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftohtml.cat @@ -4,7 +4,7 @@ pdftohtml(1) General Commands Manual pdftohtml(1) NAME pdftohtml - Portable Document Format (PDF) to HTML converter (version - 4.05) + 4.04) SYNOPSIS pdftohtml [options] PDF-file HTML-dir @@ -59,8 +59,8 @@ OPTIONS the HTML file, rather than storing it as a separate file. -nofonts - Disable extraction of embedded fonts. By default, pdftohtml ex- - tracts TrueType and OpenType fonts. Disabling extraction can + Disable extraction of embedded fonts. By default, pdftohtml + extracts TrueType and OpenType fonts. Disabling extraction can work around problems with buggy fonts. -embedfonts @@ -70,8 +70,8 @@ OPTIONS -skipinvisible Don't draw invisible text. By default, invisible text (commonly used in OCR'ed PDF files) is drawn as transparent (alpha=0) HTML - text. This option tells pdftohtml to discard invisible text en- - tirely. + text. This option tells pdftohtml to discard invisible text + entirely. -allinvisible Treat all text as invisible. By default, regular (non-invisi- @@ -86,20 +86,11 @@ OPTIONS erases background image content (e.g., lines or boxes) in the field areas. - -meta Include PDF document metadata as 'meta' elements in the HTML - header. - - -table Use table mode when performing the underlying text extraction. - This will generally produce better output when the PDF content - is a full-page table. NB: This does not generate HTML tables; + -table Use table mode when performing the underlying text extraction. + This will generally produce better output when the PDF content + is a full-page table. NB: This does not generate HTML tables; it just changes the way text is split up. - -overwrite - By default pdftohtml will not overwrite the specified output di- - rectory. If the directory already exists, pdftohtml will exit - with an error. This option tells pdftohtml to instead overwrite - the existing directory. - -opw password Specify the owner password for the PDF file. Providing this will bypass all security restrictions. @@ -137,12 +128,10 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdftohtml software and documentation are copyright 1996-2024 Glyph + The pdftohtml software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -152,4 +141,4 @@ SEE ALSO - 08 Feb 2024 pdftohtml(1) + 18 Apr 2022 pdftohtml(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.1 index 8962a16ce65..1193120a54d 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.1 @@ -1,8 +1,8 @@ -.\" Copyright 2017-2024 Glyph & Cog, LLC -.TH pdftopng 1 "08 Feb 2024" +.\" Copyright 2017-2022 Glyph & Cog, LLC +.TH pdftopng 1 "18 Apr 2022" .SH NAME pdftopng \- Portable Document Format (PDF) to Portable Network Graphics -(PNG) converter (version 4.05) +(PNG) converter (version 4.04) .SH SYNOPSIS .B pdftopng [options] @@ -86,11 +86,6 @@ Print a status message (to stdout) before processing each page. Don't print any messages or errors. .RB "[config file: " errQuiet ] .TP -.BI \-cfg " config-file" -Read -.I config-file -in place of ~/.xpdfrc or the system-wide config file. -.TP .B \-v Print copyright and version information. .TP @@ -115,13 +110,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdftopng software and documentation are copyright 1996-2024 Glyph +The pdftopng software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.cat index b48d4720fc8..10a4408496f 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftopng.cat @@ -4,7 +4,7 @@ pdftopng(1) General Commands Manual pdftopng(1) NAME pdftopng - Portable Document Format (PDF) to Portable Network Graphics - (PNG) converter (version 4.05) + (PNG) converter (version 4.04) SYNOPSIS pdftopng [options] PDF-file PNG-root @@ -76,10 +76,6 @@ OPTIONS -q Don't print any messages or errors. [config file: errQuiet] - -cfg config-file - Read config-file in place of ~/.xpdfrc or the system-wide config - file. - -v Print copyright and version information. -h Print usage information. (-help and --help are equivalent.) @@ -95,19 +91,17 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdftopng software and documentation are copyright 1996-2024 Glyph & + The pdftopng software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO - xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- + xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- fonts(1), pdfdetach(1), pdftoppm(1), pdfimages(1), xpdfrc(5) http://www.xpdfreader.com/ - 08 Feb 2024 pdftopng(1) + 18 Apr 2022 pdftopng(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.1 index c5d981bc24b..d485b2bc48f 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.1 @@ -1,8 +1,8 @@ -.\" Copyright 2005-2024 Glyph & Cog, LLC -.TH pdftoppm 1 "08 Feb 2024" +.\" Copyright 2005-2022 Glyph & Cog, LLC +.TH pdftoppm 1 "18 Apr 2022" .SH NAME pdftoppm \- Portable Document Format (PDF) to Portable Pixmap (PPM) -converter (version 4.05) +converter (version 4.04) .SH SYNOPSIS .B pdftoppm [options] @@ -86,11 +86,6 @@ Print a status message (to stdout) before processing each page. Don't print any messages or errors. .RB "[config file: " errQuiet ] .TP -.BI \-cfg " config-file" -Read -.I config-file -in place of ~/.xpdfrc or the system-wide config file. -.TP .B \-v Print copyright and version information. .TP @@ -115,13 +110,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdftoppm software and documentation are copyright 1996-2024 Glyph +The pdftoppm software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.cat index 1c395f93c38..30d012df246 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftoppm.cat @@ -4,7 +4,7 @@ pdftoppm(1) General Commands Manual pdftoppm(1) NAME pdftoppm - Portable Document Format (PDF) to Portable Pixmap (PPM) con- - verter (version 4.05) + verter (version 4.04) SYNOPSIS pdftoppm [options] PDF-file PPM-root @@ -75,10 +75,6 @@ OPTIONS -q Don't print any messages or errors. [config file: errQuiet] - -cfg config-file - Read config-file in place of ~/.xpdfrc or the system-wide config - file. - -v Print copyright and version information. -h Print usage information. (-help and --help are equivalent.) @@ -94,19 +90,17 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdftoppm software and documentation are copyright 1996-2024 Glyph & + The pdftoppm software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO - xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- + xpdf(1), pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdf- fonts(1), pdfdetach(1), pdftopng(1), pdfimages(1), xpdfrc(5) http://www.xpdfreader.com/ - 08 Feb 2024 pdftoppm(1) + 18 Apr 2022 pdftoppm(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftops.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdftops.1 index be19dccb77e..028e983aec9 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftops.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftops.1 @@ -1,8 +1,8 @@ -.\" Copyright 1996-2024 Glyph & Cog, LLC -.TH pdftops 1 "08 Feb 2024" +.\" Copyright 1996-2022 Glyph & Cog, LLC +.TH pdftops 1 "18 Apr 2022" .SH NAME pdftops \- Portable Document Format (PDF) to PostScript converter -(version 4.05) +(version 4.04) .SH SYNOPSIS .B pdftops [options] @@ -237,13 +237,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdftops software and documentation are copyright 1996-2024 Glyph & +The pdftops software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftops.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdftops.cat index 904e17d1654..ed1c8b718cc 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftops.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftops.cat @@ -4,7 +4,7 @@ pdftops(1) General Commands Manual pdftops(1) NAME pdftops - Portable Document Format (PDF) to PostScript converter (ver- - sion 4.05) + sion 4.04) SYNOPSIS pdftops [options] [PDF-file [PS-file]] @@ -40,8 +40,8 @@ OPTIONS Generate Level 1 PostScript. The resulting PostScript files will be significantly larger (if they contain images), but will print on Level 1 printers. This also converts all images to - black and white. No more than one of the PostScript level op- - tions (-level1, -level1sep, -level2, -level2sep, -level3, + black and white. No more than one of the PostScript level + options (-level1, -level1sep, -level2, -level2sep, -level3, -level3sep) may be given. [config file: psLevel] -level1sep @@ -147,8 +147,8 @@ OPTIONS maller] -noshrink - Don't scale PDF pages which are larger than the paper. By de- - fault, pages larger than the paper are shrunk to fit. [config + Don't scale PDF pages which are larger than the paper. By + default, pages larger than the paper are shrunk to fit. [config file: psShrinkLarger] -nocenter @@ -162,8 +162,8 @@ OPTIONS Box is used as the page size. [config file: psUseCropBoxAsPage] -userunit - Honor the UserUnit settings on PDF pages when computing page/pa- - per size. By default, pdftops ignores UserUnit. + Honor the UserUnit settings on PDF pages when computing + page/paper size. By default, pdftops ignores UserUnit. -duplex Set the Duplex pagedevice entry in the PostScript file. This @@ -202,12 +202,10 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdftops software and documentation are copyright 1996-2024 Glyph & + The pdftops software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -217,4 +215,4 @@ SEE ALSO - 08 Feb 2024 pdftops(1) + 18 Apr 2022 pdftops(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.1 b/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.1 index afb77de0aba..e5e7d655bda 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.1 @@ -1,8 +1,8 @@ -.\" Copyright 1997-2024 Glyph & Cog, LLC -.TH pdftotext 1 "08 Feb 2024" +.\" Copyright 1997-2022 Glyph & Cog, LLC +.TH pdftotext 1 "18 Apr 2022" .SH NAME pdftotext \- Portable Document Format (PDF) to text converter -(version 4.05) +(version 4.04) .SH SYNOPSIS .B pdftotext [options] @@ -202,13 +202,10 @@ Error opening an output file. 3 Error related to PDF permissions. .TP -98 -Out of memory. -.TP 99 Other error. .SH AUTHOR -The pdftotext software and documentation are copyright 1996-2024 Glyph +The pdftotext software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.cat b/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.cat index 370a9a55dae..face2575a3f 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/pdftotext.cat @@ -4,7 +4,7 @@ pdftotext(1) General Commands Manual pdftotext(1) NAME pdftotext - Portable Document Format (PDF) to text converter (version - 4.05) + 4.04) SYNOPSIS pdftotext [options] [PDF-file [text-file]] @@ -55,8 +55,8 @@ OPTIONS -table Table mode is similar to physical layout mode, but optimized for tabular data, with the goal of keeping rows and columns aligned (at the expense of inserting extra whitespace). If the -fixed - option is given, character spacing within each line will be de- - termined by the specified character pitch. + option is given, character spacing within each line will be + determined by the specified character pitch. -lineprinter Line printer mode uses a strict fixed-character-pitch and @@ -168,12 +168,10 @@ EXIT CODES 3 Error related to PDF permissions. - 98 Out of memory. - 99 Other error. AUTHOR - The pdftotext software and documentation are copyright 1996-2024 Glyph + The pdftotext software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -183,4 +181,4 @@ SEE ALSO - 08 Feb 2024 pdftotext(1) + 18 Apr 2022 pdftotext(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/xpdf.1 b/Build/source/libs/xpdf/xpdf-src/doc/xpdf.1 index 3c71010129a..2eaa95af69b 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/xpdf.1 +++ b/Build/source/libs/xpdf/xpdf-src/doc/xpdf.1 @@ -1,7 +1,7 @@ -.\" Copyright 1996-2024 Glyph & Cog, LLC -.TH xpdf 1 "08 Feb 2024" +.\" Copyright 1996-2022 Glyph & Cog, LLC +.TH xpdf 1 "18 Apr 2022" .SH NAME -xpdf \- Portable Document Format (PDF) file viewer (version 4.05) +xpdf \- Portable Document Format (PDF) file viewer (version 4.04) .SH SYNOPSIS .B xpdf [options] @@ -146,7 +146,7 @@ password. Open xpdf in full-screen mode, useful for presentations. .TP .BI \-remote " remote-name" -Start Xpdf in remote server mode. See the REMOTE SERVER MODE section. +Start Xpdf in remote server mode. See the REMOVE SERVER MODE section. .TP .BI \-display " display" Set the X display (only available with X11). @@ -221,9 +221,8 @@ Find the next occurrence of the search string. Find the previous occurrence of the search string. .TP .B "find settings button" -Display the current find settings: case insensitive, case sensitive, -smart case (case sensitive only if the search string contains -uppercase characters), find whole words. +Display the current find settings: case sensitive (on/off), find whole +words (on/off). .PP .SS Menu bar The menu bar is above the toolbar. The menu items should be @@ -565,10 +564,6 @@ Switch to horizontal continuous view mode. Set linear selection mode. In this mode, the selection follows text. Non-text regions cannot be selected. .TP -.B loadSession -Load the session from the session save file. The path for the session file is specified with the sessionFile setting (see -.BR xpdfrc (5)). -.TP .BI loadTabState Load the tab state file (which was written via the saveTabState command), and restore the tabs listed in that file. The path for the @@ -735,13 +730,6 @@ Save PDF via a file requester. .B saveImage Open the \'save image' dialog. .TP -.B saveSession -Save the current session, consisting of all open windows and tabs, to -the session save file. This file can be loaded later with the -loadSession command. The path for the session file is specified with -the sessionFile setting (see -.BR xpdfrc (5)). -.TP .BI saveTabState Save a list of all tabs open in this window to the tab state file. For each tab, this writes the PDF file name and page number (on @@ -960,7 +948,7 @@ Error related to PDF permissions. 99 Other error. .SH AUTHOR -The xpdf software and documentation are copyright 1996-2024 Glyph & +The xpdf software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR pdftops (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/xpdf.cat b/Build/source/libs/xpdf/xpdf-src/doc/xpdf.cat index 374552235ca..ba20911962d 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/xpdf.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/xpdf.cat @@ -3,7 +3,7 @@ xpdf(1) General Commands Manual xpdf(1) NAME - xpdf - Portable Document Format (PDF) file viewer (version 4.05) + xpdf - Portable Document Format (PDF) file viewer (version 4.04) SYNOPSIS xpdf [options] [PDF-file [:page | +dest]] ... @@ -45,12 +45,12 @@ CONFIGURATION FILE Xpdf reads a configuration file at startup. It first tries to find the user's private config file, ~/.xpdfrc. If that doesn't exist, it looks for a system-wide config file, typically /etc/xpdfrc (but this location - can be changed when xpdf is built). See the xpdfrc(5) man page for de- - tails. + can be changed when xpdf is built). See the xpdfrc(5) man page for + details. OPTIONS - The following command line options are available. All command line op- - tions must come before any PDF files to be opened. + The following command line options are available. All command line + options must come before any PDF files to be opened. Many of the options can be set with configuration file commands. These are listed in square brackets with the description of the corresponding @@ -124,7 +124,7 @@ OPTIONS Open xpdf in full-screen mode, useful for presentations. -remote remote-name - Start Xpdf in remote server mode. See the REMOTE SERVER MODE + Start Xpdf in remote server mode. See the REMOVE SERVER MODE section. -display display @@ -194,54 +194,53 @@ CONTROLS Find the previous occurrence of the search string. find settings button - Display the current find settings: case insensitive, case sensi- - tive, smart case (case sensitive only if the search string con- - tains uppercase characters), find whole words. + Display the current find settings: case sensitive (on/off), find + whole words (on/off). Menu bar - The menu bar is above the toolbar. The menu items should be self-ex- - planatory. + The menu bar is above the toolbar. The menu items should be self- + explanatory. Tab list The tab list is on the left, just below the toolbar. It lists all open tabs. Outline/layers/attachments pane - This pane is on the left, below the tab list. The popup allows you to + This pane is on the left, below the tab list. The popup allows you to select from outline, layers, or attachments. - The outline is a tree-like structure of bookmarks that allows moving + The outline is a tree-like structure of bookmarks that allows moving within the PDF file. Not all PDF files have outlines. - Layers (a.k.a. optional content) allow parts of the PDF content to be + Layers (a.k.a. optional content) allow parts of the PDF content to be shown or hidden. Not all PDF files have layers. - Attachments are other files embedded within the PDF file. There is a - 'save' button for each attached file. Not all PDF files have attach- + Attachments are other files embedded within the PDF file. There is a + 'save' button for each attached file. Not all PDF files have attach- ments. Text selection - In block selection mode, dragging the mouse with the left button held + In block selection mode, dragging the mouse with the left button held down will highlight an arbitrary rectangle. Shift-clicking will extend the selection. - In linear selection mode, dragging with the left button will highlight - text in reading order. Double-clicking or triple-clicking will select - a word or a line, respectively. Shift-clicking will extend the selec- + In linear selection mode, dragging with the left button will highlight + text in reading order. Double-clicking or triple-clicking will select + a word or a line, respectively. Shift-clicking will extend the selec- tion. - Selected text can be copied to the clipboard (with the edit/copy menu + Selected text can be copied to the clipboard (with the edit/copy menu item). On X11, selected text will be available in the X selection buf- fer. Links - When the mouse is over a hyperlink, the link target will be shown in a + When the mouse is over a hyperlink, the link target will be shown in a popup near the bottom of the window. Clicking on a hyperlink will jump to the link's destination. A link to - another PDF document will make xpdf load that document. A 'launch' - link to an executable program will display a dialog, and if you click - 'ok', execute the program. URL links are opened in a system-dependent + another PDF document will make xpdf load that document. A 'launch' + link to an executable program will display a dialog, and if you click + 'ok', execute the program. URL links are opened in a system-dependent way. (On UNIX, Qt uses the $BROWSER environment variable.) Mouse bindings @@ -251,19 +250,19 @@ CONTROLS Dragging the mouse with the middle button held down pans the window. - The right mouse button opens a popup menu (see popupMenuCmd in + The right mouse button opens a popup menu (see popupMenuCmd in xpdfrc(5)). Key bindings - This section lists the default key bindings. Bindings can be changed + This section lists the default key bindings. Bindings can be changed using the config file (see xpdfrc(5)). control-o Open a new PDF file via a file requester. control-r - Reload the current PDF file. Note that Xpdf will reload the - file automatically (on a page change or redraw) if it has + Reload the current PDF file. Note that Xpdf will reload the + file automatically (on a page change or redraw) if it has changed since it was last loaded. control-f @@ -297,8 +296,8 @@ CONTROLS Open a new window. control-w - Close the current tab. Closes the window if this was the last - open tab. Quits the application if this was the last open win- + Close the current tab. Closes the window if this was the last + open tab. Quits the application if this was the last open win- dow. control-l @@ -333,11 +332,11 @@ CONTROLS Go to the last page. <space> or <PageDown> - Scroll down on the current page; if already at bottom, move to + Scroll down on the current page; if already at bottom, move to next page. control-<PageDown> or control-<down-arrow> - Go to the next page. If <ScrollLock> is active, this maintains + Go to the next page. If <ScrollLock> is active, this maintains the relative position on the page. <PageUp> @@ -345,7 +344,7 @@ CONTROLS ous page. control-<PageUp> or control-<up-arrow> - Go to the previous page. If <ScrollLock> is active, this main- + Go to the previous page. If <ScrollLock> is active, this main- tains the relative position on the page. <esc> Exit full-screen mode. @@ -359,26 +358,26 @@ CONTROLS w Set the zoom factor to 'width' (fit page width to window). Full-screen mode - Xpdf can be placed into full-screen mode via the -fullscreen command - line option, the 'full screen' menu item, or a binding to the + Xpdf can be placed into full-screen mode via the -fullscreen command + line option, the 'full screen' menu item, or a binding to the fullScreenMode or toggleFullScreenMode command. - Entering full-screen mode automatically switches to single-page view + Entering full-screen mode automatically switches to single-page view mode and to the fit-page zoom factor. - Full-screen mode can be exited via the default <esc> key binding, or + Full-screen mode can be exited via the default <esc> key binding, or via a binding to the windowMode or toggleFullScreenModecommand. COMMANDS Xpdf's key and mouse bindings are user-configurable, using the bind and - unbind commands in the config file (see xpdfrc(5)). The bind command - allows you to bind a key or mouse button to a sequence of one or more + unbind commands in the config file (see xpdfrc(5)). The bind command + allows you to bind a key or mouse button to a sequence of one or more commands. - In commands that take arguments (inside parentheses), special charac- - ters (namely '(', ')', ',', and '\x01') can be escaped by preceding - them with a '\x01' character. This is mostly useful in things like - scripts that need to be able to open arbitrary PDF files, using the + In commands that take arguments (inside parentheses), special charac- + ters (namely '(', ')', ',', and '\x01') can be escaped by preceding + them with a '\x01' character. This is mostly useful in things like + scripts that need to be able to open arbitrary PDF files, using the 'openFile' command. The following commands are supported: @@ -394,11 +393,11 @@ COMMANDS Check that file is open in the current tab, and open it if not. checkOpenFileAtDest(file,dest) - Check that file is open in the current tab, and open it if not. + Check that file is open in the current tab, and open it if not. In either case go to the specified named destination. checkOpenFileAtPage(file,page) - Check that file is open in the current tab, and open it if not. + Check that file is open in the current tab, and open it if not. In either case go to the specified page. closeSidebar @@ -426,7 +425,7 @@ COMMANDS copy Copy selected text to the clipboard. copyLinkTarget - Copy the target of the link under the mouse cursor to the clip- + Copy the target of the link under the mouse cursor to the clip- board. endPan End a pan operation. @@ -456,30 +455,30 @@ COMMANDS Set keyboard focus to the page number text box. followLink - Follow a hyperlink (does nothing if the mouse is not over a + Follow a hyperlink (does nothing if the mouse is not over a link). followLinkInNewTab Follow a hyperlink, opening PDF files in a new tab (does nothing - if the mouse is not over a link). For links to non-PDF files, + if the mouse is not over a link). For links to non-PDF files, this command is identical to followLink. followLinkInNewTabNoSel - Same as followLinkInNewTab, but does nothing if there is a non- + Same as followLinkInNewTab, but does nothing if there is a non- empty selection. (This is useful as a mouse button binding.) followLinkInNewWin - Follow a hyperlink, opening PDF files in a new window (does - nothing if the mouse is not over a link). For links to non-PDF + Follow a hyperlink, opening PDF files in a new window (does + nothing if the mouse is not over a link). For links to non-PDF files, this command is identical to followLink. followLinkInNewWinNoSel - Same as followLinkInNewWin, but does nothing if there is a non- + Same as followLinkInNewWin, but does nothing if there is a non- empty selection. (This is useful as a mouse button binding.) followLinkNoSel - Same as followLink, but does nothing if there is a non-empty se- - lection. (This is useful as a mouse button binding.) + Same as followLink, but does nothing if there is a non-empty + selection. (This is useful as a mouse button binding.) fullScreenMode Go to full-screen mode. @@ -511,18 +510,13 @@ COMMANDS Switch to horizontal continuous view mode. linearSelectMode - Set linear selection mode. In this mode, the selection follows + Set linear selection mode. In this mode, the selection follows text. Non-text regions cannot be selected. - loadSession - Load the session from the session save file. The path for the - session file is specified with the sessionFile setting (see - xpdfrc(5)). - loadTabState - Load the tab state file (which was written via the saveTabState - command), and restore the tabs listed in that file. The path - for the tab state file is specified with the tabStateFile set- + Load the tab state file (which was written via the saveTabState + command), and restore the tabs listed in that file. The path + for the tab state file is specified with the tabStateFile set- ting (see xpdfrc(5)). newTab Open an empty new tab. @@ -549,26 +543,26 @@ COMMANDS openFile2(file,page,dest,passwd,location) Open the specified file. If dest is not empty, go to the speci- - fied named destination. Else, if page is not empty, go to the - specified page number. If password is not empty, it is used as - the PDF password. If location is "win", open the file in a new - window; if it is "tab", open in a new tab; if it is "check", - open in the current tab, but only if the specified PDF file - isn't already open; else open in the current tab. Any/all of + fied named destination. Else, if page is not empty, go to the + specified page number. If password is not empty, it is used as + the PDF password. If location is "win", open the file in a new + window; if it is "tab", open in a new tab; if it is "check", + open in the current tab, but only if the specified PDF file + isn't already open; else open in the current tab. Any/all of the arguments, other than file, can be empty strings. For exam- ple: openFile2(test.pdf,7,,,tab) openFileAtDest(file,dest) - Open the specified file in the current tab at the specified + Open the specified file in the current tab at the specified named destination. openFileAtDestIn(file,dest,location) - Open the specified file at the specified named destination. Lo- - cation must be "win" for a new window or "tab" for a new tab. + Open the specified file at the specified named destination. + Location must be "win" for a new window or "tab" for a new tab. openFileAtPage(file,page) - Open the specified file in the current tab at the specified + Open the specified file in the current tab at the specified page. openFileAtPageIn(file,page,location) @@ -576,23 +570,23 @@ COMMANDS "win" for a new window or "tab" for a new tab. openFileIn(file,location) - Open the specified file. Location must be "win" for a new win- + Open the specified file. Location must be "win" for a new win- dow or "tab" for a new tab. openIn(location) - Open a PDF file, using the open dialog. Location must be "win" + Open a PDF file, using the open dialog. Location must be "win" for a new window or "tab" for a new tab. openSidebar Open the sidebar. openSidebarMoveResizeWin - Open the sidebar, resizing the window so that the document size + Open the sidebar, resizing the window so that the document size doesn't change, and moving the window so that the document stays in the same place on the screen. openSidebarResizeWin - Open the sidebar, resizing the window so that the document size + Open the sidebar, resizing the window so that the document size doesn't change. pageDown @@ -607,7 +601,7 @@ COMMANDS Go to the previous page. prevPageNoScroll - Go to the previous page, with the current relative scroll posi- + Go to the previous page, with the current relative scroll posi- tion. prevTab @@ -628,7 +622,7 @@ COMMANDS Rotate the page 90 degrees clockwise. run(external-command-string) - Run an external command. The following escapes are allowed in + Run an external command. The following escapes are allowed in the command string: %f => PDF file name (or an empty string if no @@ -653,14 +647,14 @@ COMMANDS %k => y coordinate of the mouse pointer %% => % - The external command string will often contain spaces, so the + The external command string will often contain spaces, so the whole command must be quoted in the xpdfrc file: bind x "run(ls -l)" The command string may not be run through a shell. It is recom- - mended to keep the command simple, so that it doesn't depend on - specific shell functionality. For complex things, you can have + mended to keep the command simple, so that it doesn't depend on + specific shell functionality. For complex things, you can have the command string run a shell script. saveAs Save PDF via a file requester. @@ -668,12 +662,6 @@ COMMANDS saveImage Open the 'save image' dialog. - saveSession - Save the current session, consisting of all open windows and - tabs, to the session save file. This file can be loaded later - with the loadSession command. The path for the session file is - specified with the sessionFile setting (see xpdfrc(5)). - saveTabState Save a list of all tabs open in this window to the tab state file. For each tab, this writes the PDF file name and page num- @@ -870,7 +858,7 @@ EXIT CODES 99 Other error. AUTHOR - The xpdf software and documentation are copyright 1996-2024 Glyph & + The xpdf software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -880,4 +868,4 @@ SEE ALSO - 08 Feb 2024 xpdf(1) + 18 Apr 2022 xpdf(1) diff --git a/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.5 b/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.5 index ad089b2a938..1c47e2ebb29 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.5 +++ b/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.5 @@ -1,7 +1,7 @@ -.\" Copyright 2002-2024 Glyph & Cog, LLC -.TH xpdfrc 5 "08 Feb 2024" +.\" Copyright 2002-2022 Glyph & Cog, LLC +.TH xpdfrc 5 "18 Apr 202" .SH NAME -xpdfrc \- configuration file for Xpdf tools (version 4.05) +xpdfrc \- configuration file for Xpdf tools (version 4.04) .SH DESCRIPTION All of the Xpdf tools read a single configuration file. .PP @@ -448,12 +448,6 @@ information in TrueType fonts (16-bit only), if avaiable, to override the PDF ToUnicode maps. Otherwise, the ToUnicode maps are always used when present. This defaults to "no". .TP -.BI ignoreWrongSizeToUnicode " yes | no" -If set to "yes", Xpdf will ignore any ToUnicode CMaps that don't match -the font type (8-bit vs 16-bit). The PDF spec requires ToUnicode -CMaps match, and Adobe appears to ignore CMaps that don't match. This -defaults to "no" (for backward compatibility). -.TP .BI dropFont " font-name" Drop all text drawn in the specified font. To drop text drawn in unnamed fonts, use: @@ -463,12 +457,6 @@ unnamed fonts, use: .fi There can be any number of dropFont commands. -.TP -.BI separateRotatedText " yes | no" -If set to "no", pdftotext will attempt to place rotated text into the -"correct" location in the output. If set to "yes", when using reading -order mode, pdftotext will append rotated text to the end, after -unrotated text. This defaults to "no". .SH RASTERIZER SETTINGS .TP .BR enableFreeType " yes | no" @@ -581,17 +569,6 @@ be chosen such that exactly one page will fit in the window at this zoom factor (which must be a percentage). The default value is based on the screen resolution. .TP -.BI zoomScaleFactor " \fIratio\fR | actual" -Zoom percentages will be scaled by this factor. By default, 100% zoom -corresponds to 72 dpi. Setting zoomScaleFactor to 1.5 will make 100% -zoom 1.5x larger, i.e., 108dpi. If this is set to \'actual', the zoom -scale factor will be computed based on the screen resolution. The -default value is 1.0. -.TP -.BI zoomValues " zoom1 zoom2 zoom3 ..." -Sets the list of zoom values (percentages) displayed in the zoom combo box. -The default list is: 25 50 75 100 110 125 150 175 200 300 400 600 800. -.TP .BR initialDisplayMode " single | continuous | sideBySideSingle | sideBySideContinuous | horizontalContinuous" Sets the initial display mode. The default setting is "continuous". .TP @@ -661,12 +638,6 @@ pages. This defaults to 10. Set the number of worker threads to be used by xpdf when rasterizing pages. This defaults to 1. .TP -.BI allowLinksToChangeZoom " yes | no" -PDF links, including outline items, can include a new zoom level. If -this setting is "yes", Xpdf changes the zoom when links are clicked; -if "no", Xpdf moves to the destination but does not change the zoom. -This defaults to "yes". -.TP .BI launchCommand " command" Sets the command executed when you click on a "launch"-type link. The intent is for the command to be a program/script which determines the @@ -769,20 +740,7 @@ want to create new key bindings for multiple contexts). Sets the file used by the loadTabState and saveTabState commands (see the .BR xpdf (1) -man page for more information). The default path is ~/.xpdf.tabstate. -.TP -.BI sessionFile " path" -Sets the file used by the saveSession and loadSession commands (see -the -.BR xpdf (1) -man page for more information). The default path is ~/.xpdf.session. -When xpdf automatically saves the session via a session manager, it -appends ".managed" to the path. -.TP -.BI saveSessionOnQuit " yes | no" -If set to "yes", xpdf will automatically save the current session -(equivalent to the saveSession command) when quitting (via the menu or -a key binding). The default value is "yes". +man page for more information). .SH MISCELLANEOUS SETTINGS .TP .BI drawAnnotations " yes | no" @@ -879,7 +837,7 @@ Depending on build options, it may be placed elsewhere. This is the user's configuration file. If it exists, it will be read in place of the system-wide file. .SH AUTHOR -The Xpdf software and documentation are copyright 1996-2024 Glyph & +The Xpdf software and documentation are copyright 1996-2022 Glyph & Cog, LLC. .SH "SEE ALSO" .BR xpdf (1), diff --git a/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.cat b/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.cat index 1fccf310325..c38791eaa28 100644 --- a/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.cat +++ b/Build/source/libs/xpdf/xpdf-src/doc/xpdfrc.cat @@ -3,7 +3,7 @@ xpdfrc(5) File Formats Manual xpdfrc(5) NAME - xpdfrc - configuration file for Xpdf tools (version 4.05) + xpdfrc - configuration file for Xpdf tools (version 4.04) DESCRIPTION All of the Xpdf tools read a single configuration file. @@ -18,8 +18,8 @@ DESCRIPTION (pdftotext.exe, xpdf.exe, etc.) The xpdfrc file consists of a series of configuration options, one per - line. Blank lines and lines starting with a '#' (comments) are ig- - nored. + line. Blank lines and lines starting with a '#' (comments) are + ignored. Arguments can be single-quoted or double-quoted, e.g., for file names that contain spaces ("aaa bbb", 'aaa bbb'). This quoting does not pro- @@ -49,8 +49,8 @@ INCLUDE FILES GENERAL FONT CONFIGURATION fontFile PDF-font-name font-file Maps a PDF font, PDF-font-name, to a font for display or Post- - Script output. The font file, font-file, can be any type al- - lowed in a PDF file. This command can be used for 8-bit or + Script output. The font file, font-file, can be any type + allowed in a PDF file. This command can be used for 8-bit or 16-bit (CID) fonts. fontDir dir @@ -80,8 +80,8 @@ POSTSCRIPT FONT CONFIGURATION When the 8-bit font PDF-font-name is used (without embedding) in a PDF file, it will be translated to the PostScript font PS-font-name, which is assumed to be resident in the printer. - Typically, PDF-font-name and PS-font-name are the same. By de- - fault, only the Base-14 fonts are assumed to be resident. + Typically, PDF-font-name and PS-font-name are the same. By + default, only the Base-14 fonts are assumed to be resident. psResidentFont16 PDF-font-name wMode PS-font-name encoding When the 16-bit (CID) font PDF-font-name with writing mode wMode @@ -140,8 +140,8 @@ POSTSCRIPT CONTROL gers are the coordinates of the lower-left and upper-right cor- ners of the imageable region, specified in points (with the ori- gin being the lower-left corner of the paper). This defaults to - the full paper size; the psPaperSize option will reset the im- - ageable area coordinates. + the full paper size; the psPaperSize option will reset the + imageable area coordinates. psCrop yes | no If set to "yes", PostScript output is cropped to the CropBox @@ -166,8 +166,8 @@ POSTSCRIPT CONTROL psCenter yes | no If set to yes, PDF pages smaller than the PostScript imageable area (after any scaling) are centered in the imageable area. - Otherwise, they are aligned at the lower-left corner of the im- - ageable area. This defaults to "yes". + Otherwise, they are aligned at the lower-left corner of the + imageable area. This defaults to "yes". psDuplex yes | no If set to "yes", the generated PostScript will set the "Duplex" @@ -187,9 +187,9 @@ POSTSCRIPT CONTROL of a long document. This defaults to "no". psOPI yes | no - If set to "yes", generates PostScript OPI comments for all im- - ages and forms which have OPI information. This option is only - available if the Xpdf tools were compiled with OPI support. + If set to "yes", generates PostScript OPI comments for all + images and forms which have OPI information. This option is + only available if the Xpdf tools were compiled with OPI support. This defaults to "no". psASCIIHex yes | no @@ -237,8 +237,8 @@ POSTSCRIPT CONTROL set to "yes", rasterization is disabled: pages will never be rasterized, even if they contain transparency. This will likely result in incorrect output for PDF files that use transparency, - and a warning message to that effect will be printed. This de- - faults to "no". + and a warning message to that effect will be printed. This + defaults to "no". fontDir dir See the description above, in the DISPLAY FONTS section. @@ -251,8 +251,8 @@ TEXT CONTROL AND CHARACTER MAPPING above). This defaults to "Latin1". textEOL unix | dos | mac - Sets the end-of-line convention to use for text output. The op- - tions are: + Sets the end-of-line convention to use for text output. The + options are: unix = LF dos = CR+LF @@ -269,8 +269,8 @@ TEXT CONTROL AND CHARACTER MAPPING textKeepTinyChars yes | no If set to "yes", text extraction will keep all characters. If set to "no", text extraction will discard tiny (smaller than 3 - point) characters after the first 50000 per page, avoiding ex- - tremely slow run times for PDF files that use special fonts to + point) characters after the first 50000 per page, avoiding + extremely slow run times for PDF files that use special fonts to do shading or cross-hatching. This defaults to "yes". nameToUnicode map-file @@ -312,9 +312,9 @@ TEXT CONTROL AND CHARACTER MAPPING in-hex out-hex1 out-hex2 ... The in-hex field is an input (incorrect) Unicode index, and the - rest of the fields are one or more output (correct) Unicode in- - dexes. Each occurrence of in-hex will be converted to the spec- - ified output sequence. + rest of the fields are one or more output (correct) Unicode + indexes. Each occurrence of in-hex will be converted to the + specified output sequence. unicodeRemapping remap-file Remap Unicode characters when doing text extraction. This spec- @@ -344,8 +344,8 @@ TEXT CONTROL AND CHARACTER MAPPING The in-start-hex and in-end-hex fields (or the single in-hex field) specify the Unicode range. The out-start-hex field (or the out-hex field) specifies the start of the output encoding - range. The length of the out-start-hex (or out-hex) string de- - termines the length of the output characters (e.g., UTF-8 uses + range. The length of the out-start-hex (or out-hex) string + determines the length of the output characters (e.g., UTF-8 uses different numbers of bytes to represent characters in different ranges). Entries must be given in increasing Unicode order. Only one file is allowed per encoding; the last specified file @@ -354,8 +354,8 @@ TEXT CONTROL AND CHARACTER MAPPING cMapDir registry-ordering dir Specifies a search directory, dir, for CMaps for the reg- - istry-ordering character collection. There can be multiple di- - rectories for a particular collection. There are no default + istry-ordering character collection. There can be multiple + directories for a particular collection. There are no default CMap directories. toUnicodeDir dir @@ -364,16 +364,16 @@ TEXT CONTROL AND CHARACTER MAPPING ToUnicode directories. mapNumericCharNames yes | no - If set to "yes", the Xpdf tools will attempt to map various nu- - meric character names sometimes used in font subsets. In some + If set to "yes", the Xpdf tools will attempt to map various + numeric character names sometimes used in font subsets. In some cases this leads to usable text, and in other cases it leads to gibberish -- there is no way for Xpdf to tell. This defaults to "yes". mapUnknownCharNames yes | no If set to "yes", and mapNumericCharNames is set to "no", the - Xpdf tools will apply a simple pass-through mapping (Unicode in- - dex = character code) for all unrecognized glyph names. (For + Xpdf tools will apply a simple pass-through mapping (Unicode + index = character code) for all unrecognized glyph names. (For CID fonts, setting mapNumericCharNames to "no" is unnecessary.) In some cases, this leads to usable text, and in other cases it leads to gibberish -- there is no way for Xpdf to tell. This @@ -395,13 +395,6 @@ TEXT CONTROL AND CHARACTER MAPPING override the PDF ToUnicode maps. Otherwise, the ToUnicode maps are always used when present. This defaults to "no". - ignoreWrongSizeToUnicode yes | no - If set to "yes", Xpdf will ignore any ToUnicode CMaps that don't - match the font type (8-bit vs 16-bit). The PDF spec requires - ToUnicode CMaps match, and Adobe appears to ignore CMaps that - don't match. This defaults to "no" (for backward compatibil- - ity). - dropFont font-name Drop all text drawn in the specified font. To drop text drawn in unnamed fonts, use: @@ -410,141 +403,123 @@ TEXT CONTROL AND CHARACTER MAPPING There can be any number of dropFont commands. - separateRotatedText yes | no - If set to "no", pdftotext will attempt to place rotated text - into the "correct" location in the output. If set to "yes", when - using reading order mode, pdftotext will append rotated text to - the end, after unrotated text. This defaults to "no". - RASTERIZER SETTINGS enableFreeType yes | no - Enables or disables use of FreeType (a TrueType / Type 1 font + Enables or disables use of FreeType (a TrueType / Type 1 font rasterizer). This is only relevant if the Xpdf tools were built with FreeType support. ("enableFreeType" replaces the old "freetypeControl" option.) This option defaults to "yes". disableFreeTypeHinting yes | no - If this is set to "yes", FreeType hinting will be forced off. + If this is set to "yes", FreeType hinting will be forced off. This option defaults to "no". antialias yes | no - Enables or disables font anti-aliasing in the PDF rasterizer. + Enables or disables font anti-aliasing in the PDF rasterizer. This option affects all font rasterizers. ("antialias" replaces the anti-aliasing control provided by the old "t1libControl" and "freetypeControl" options.) This default to "yes". vectorAntialias yes | no - Enables or disables anti-aliasing of vector graphics in the PDF + Enables or disables anti-aliasing of vector graphics in the PDF rasterizer. This defaults to "yes". imageMaskAntialias yes | no - Enables or disables anti-aliasing of image masks (when downsam- - pling or upsampling) in the PDF rasterizer. This defaults to + Enables or disables anti-aliasing of image masks (when downsam- + pling or upsampling) in the PDF rasterizer. This defaults to "yes". antialiasPrinting yes | no - If this is "yes", bitmaps sent to the printer will be an- - tialiased (according to the "antialias" and "vectorAntialias" - settings). If this is "no", printed bitmaps will not be an- - tialiased. This defaults to "no". + If this is "yes", bitmaps sent to the printer will be + antialiased (according to the "antialias" and "vectorAntialias" + settings). If this is "no", printed bitmaps will not be + antialiased. This defaults to "no". strokeAdjust yes | no | cad - Sets the stroke adjustment mode. If set to "no", no stroke ad- - justment will be done. If set to "yes", normal stroke adjust- - ment will be done: horizontal and vertical lines will be moved - by up to half a pixel to make them look cleaner when vector + Sets the stroke adjustment mode. If set to "no", no stroke + adjustment will be done. If set to "yes", normal stroke adjust- + ment will be done: horizontal and vertical lines will be moved + by up to half a pixel to make them look cleaner when vector anti-aliasing is enabled. If set to "cad", a slightly different stroke adjustment algorithm will be used to ensure that lines of the same original width will always have the same adjusted width - (at the expense of allowing gaps and overlaps between adjacent + (at the expense of allowing gaps and overlaps between adjacent lines). This defaults to "yes". forceAccurateTiling yes | no - If this is set to "yes", the TilingType is forced to 2 (no dis- - tortion) for all tiling patterns, regardless of the setting in + If this is set to "yes", the TilingType is forced to 2 (no dis- + tortion) for all tiling patterns, regardless of the setting in the pattern dictionary. This defaults to "no". screenType dispersed | clustered | stochasticClustered - Sets the halftone screen type, which will be used when generat- - ing a monochrome (1-bit) bitmap. The three options are dis- - persed-dot dithering, clustered-dot dithering (with a round dot - and 45-degree screen angle), and stochastic clustered-dot - dithering. By default, "stochasticClustered" is used for reso- + Sets the halftone screen type, which will be used when generat- + ing a monochrome (1-bit) bitmap. The three options are dis- + persed-dot dithering, clustered-dot dithering (with a round dot + and 45-degree screen angle), and stochastic clustered-dot + dithering. By default, "stochasticClustered" is used for reso- lutions of 300 dpi and higher, and "dispersed" is used for reso- lutions lower then 300 dpi. screenSize integer - Sets the size of the (square) halftone screen threshold matrix. - By default, this is 4 for dispersed-dot dithering, 10 for clus- - tered-dot dithering, and 100 for stochastic clustered-dot + Sets the size of the (square) halftone screen threshold matrix. + By default, this is 4 for dispersed-dot dithering, 10 for clus- + tered-dot dithering, and 100 for stochastic clustered-dot dithering. screenDotRadius integer - Sets the halftone screen dot radius. This is only used when - screenType is set to stochasticClustered, and it defaults to 2. - In clustered-dot mode, the dot radius is half of the screen + Sets the halftone screen dot radius. This is only used when + screenType is set to stochasticClustered, and it defaults to 2. + In clustered-dot mode, the dot radius is half of the screen size. Dispersed-dot dithering doesn't have a dot radius. screenGamma float Sets the halftone screen gamma correction parameter. Gamma val- - ues greater than 1 make the output brighter; gamma values less + ues greater than 1 make the output brighter; gamma values less than 1 make it darker. The default value is 1. screenBlackThreshold float - When halftoning, all values below this threshold are forced to + When halftoning, all values below this threshold are forced to solid black. This parameter is a floating point value between 0 (black) and 1 (white). The default value is 0. screenWhiteThreshold float - When halftoning, all values above this threshold are forced to + When halftoning, all values above this threshold are forced to solid white. This parameter is a floating point value between 0 (black) and 1 (white). The default value is 1. minLineWidth float - Set the minimum line width, in device pixels. This affects the - rasterizer only, not the PostScript converter (except when it - uses rasterization to handle transparency). The default value + Set the minimum line width, in device pixels. This affects the + rasterizer only, not the PostScript converter (except when it + uses rasterization to handle transparency). The default value is 0 (no minimum). enablePathSimplification yes | no - If set to "yes", simplify paths by removing points where it - won't make a significant difference to the shape. The default + If set to "yes", simplify paths by removing points where it + won't make a significant difference to the shape. The default value is "no". overprintPreview yes | no If set to "yes", generate overprint preview output, honoring the - OP/op/OPM settings in the PDF file. Ignored for non-CMYK out- + OP/op/OPM settings in the PDF file. Ignored for non-CMYK out- put. The default value is "no". VIEWER SETTINGS These settings only apply to the Xpdf GUI PDF viewer. initialZoom percentage | page | width - Sets the initial zoom factor. A number specifies a zoom per- - centage, where 100 means 72 dpi. You may also specify 'page', - to fit the page to the window size, or 'width', to fit the page + Sets the initial zoom factor. A number specifies a zoom per- + centage, where 100 means 72 dpi. You may also specify 'page', + to fit the page to the window size, or 'width', to fit the page width to the window width. defaultFitZoom percentage If xpdf is started with fit-page or fit-width zoom and no window - geometry, it will calculate a desired window size based on the - PDF page size and this defaultFitZoom value. I.e., the window - size will be chosen such that exactly one page will fit in the - window at this zoom factor (which must be a percentage). The + geometry, it will calculate a desired window size based on the + PDF page size and this defaultFitZoom value. I.e., the window + size will be chosen such that exactly one page will fit in the + window at this zoom factor (which must be a percentage). The default value is based on the screen resolution. - zoomScaleFactor ratio | actual - Zoom percentages will be scaled by this factor. By default, - 100% zoom corresponds to 72 dpi. Setting zoomScaleFactor to 1.5 - will make 100% zoom 1.5x larger, i.e., 108dpi. If this is set - to 'actual', the zoom scale factor will be computed based on the - screen resolution. The default value is 1.0. - - zoomValues zoom1 zoom2 zoom3 ... - Sets the list of zoom values (percentages) displayed in the zoom - combo box. The default list is: 25 50 75 100 110 125 150 175 - 200 300 400 600 800. - initialDisplayMode single | continuous | sideBySideSingle | sideBySide- Continuous | horizontalContinuous Sets the initial display mode. The default setting is "continu- @@ -555,23 +530,23 @@ VIEWER SETTINGS "no", xpdf opens with the toolbar hidden. The default is "yes". initialSidebarState yes | no - If set to "yes", xpdf opens with the sidebar (tabs, outline, - etc.) visible. If set to "no", xpdf opens with the sidebar + If set to "yes", xpdf opens with the sidebar (tabs, outline, + etc.) visible. If set to "no", xpdf opens with the sidebar collapsed. The default is "yes". initialSidebarWidth width - Sets the initial sidebar width, in pixels. This is only rele- - vant if initialSidebarState is "yes". The default value is + Sets the initial sidebar width, in pixels. This is only rele- + vant if initialSidebarState is "yes". The default value is zero, which tells xpdf to use an internal default size. initialSelectMode block | linear - Sets the initial selection mode. The default setting is "lin- + Sets the initial selection mode. The default setting is "lin- ear". paperColor color Set the "paper color", i.e., the background of the page display. - The color can be #RRGGBB (hexadecimal) or a named color. This - option will not work well with PDF files that do things like + The color can be #RRGGBB (hexadecimal) or a named color. This + option will not work well with PDF files that do things like filling in white behind the text. matteColor color @@ -580,7 +555,7 @@ VIEWER SETTINGS a named color. fullScreenMatteColor color - Set the matte color for full-screen mode. The color can be + Set the matte color for full-screen mode. The color can be #RRGGBB (hexadecimal) or a named color. selectionColor color @@ -588,14 +563,14 @@ VIEWER SETTINGS or a named color. reverseVideoInvertImages yes | no - If set to "no", xpdf's reverse-video mode inverts text and vec- - tor graphic content, but not images. If set to "yes", xpdf in- - verts images as well. The default is "no". + If set to "no", xpdf's reverse-video mode inverts text and vec- + tor graphic content, but not images. If set to "yes", xpdf + inverts images as well. The default is "no". popupMenuCmd title command ... - Add a command to the popup menu. Title is the text to be dis- - played in the menu. Command is an Xpdf command (see the COM- - MANDS section of the xpdf(1) man page for details). Multiple + Add a command to the popup menu. Title is the text to be dis- + played in the menu. Command is an Xpdf command (see the COM- + MANDS section of the xpdf(1) man page for details). Multiple commands are separated by whitespace. maxTileWidth pixels @@ -603,23 +578,17 @@ VIEWER SETTINGS ing pages. This defaults to 1500. maxTileHeight pixels - Set the maximum height of tiles to be used by xpdf when raster- + Set the maximum height of tiles to be used by xpdf when raster- izing pages. This defaults to 1500. tileCacheSize tiles - Set the maximum number of tiles to be cached by xpdf when ras- + Set the maximum number of tiles to be cached by xpdf when ras- terizing pages. This defaults to 10. workerThreads numThreads Set the number of worker threads to be used by xpdf when raster- izing pages. This defaults to 1. - allowLinksToChangeZoom yes | no - PDF links, including outline items, can include a new zoom - level. If this setting is "yes", Xpdf changes the zoom when - links are clicked; if "no", Xpdf moves to the destination but - does not change the zoom. This defaults to "yes". - launchCommand command Sets the command executed when you click on a "launch"-type link. The intent is for the command to be a program/script @@ -707,19 +676,7 @@ VIEWER SETTINGS tabStateFile path Sets the file used by the loadTabState and saveTabState commands - (see the xpdf(1) man page for more information). The default - path is ~/.xpdf.tabstate. - - sessionFile path - Sets the file used by the saveSession and loadSession commands - (see the xpdf(1) man page for more information). The default - path is ~/.xpdf.session. When xpdf automatically saves the ses- - sion via a session manager, it appends ".managed" to the path. - - saveSessionOnQuit yes | no - If set to "yes", xpdf will automatically save the current ses- - sion (equivalent to the saveSession command) when quitting (via - the menu or a key binding). The default value is "yes". + (see the xpdf(1) man page for more information). MISCELLANEOUS SETTINGS drawAnnotations yes | no @@ -816,7 +773,7 @@ FILES read in place of the system-wide file. AUTHOR - The Xpdf software and documentation are copyright 1996-2024 Glyph & + The Xpdf software and documentation are copyright 1996-2022 Glyph & Cog, LLC. SEE ALSO @@ -826,4 +783,4 @@ SEE ALSO - 08 Feb 2024 xpdfrc(5) + 18 Apr 202 xpdfrc(5) diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.cc index 73cf2f59c15..e1951b08b9f 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <limits.h> #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.h index ffa14cfeb6d..c9f93ebacda 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiBase.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc index 01ae5acdcc1..6b3debb9dab 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include "gmempp.h" #include "FoFiEncodings.h" diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.h index 6094387d62d..dd85458c070 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiEncodings.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc index fff1e26b346..4c6797ba9d6 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <string.h> #include <limits.h> @@ -839,8 +843,6 @@ static GList *getDfontFontList(FILE *f) { resNameListOffset >= resMapLength) { goto err2; } - nFonts = 0; - refListOffset = 0; for (i = 0; i < nTypes; ++i) { offset = resTypeListOffset + 2 + 8 * i; if (resMap[offset] == 0x73 && // 'sfnt' diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.h index 497be445d6d..b0307a0b8d2 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + class GList; //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc index a77b401cf55..57b12b14996 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #if HAVE_STD_SORT @@ -401,7 +405,7 @@ int FoFiTrueType::mapCodeToGID(int i, int c) { // to be 0xffff return 0; } - // invariant: seg[a].end < c <= seg[b].end + // invariant: seg[a].end < code <= seg[b].end while (b - a > 1 && ok) { m = (a + b) / 2; segEnd = getU16BE(pos + 14 + 2*m, &ok); @@ -435,31 +439,6 @@ int FoFiTrueType::mapCodeToGID(int i, int c) { } gid = getU16BE(pos + 10 + 2 * (c - cmapFirst), &ok); break; - case 12: - segCnt = getU32BE(pos + 12, &ok); - a = -1; - b = segCnt - 1; - segEnd = getU32BE(pos + 16 + 12*b + 4, &ok); - if (c > segEnd) { - return 0; - } - // invariant: seg[a].end < c <= seg[b].end - while (b - a > 1 && ok) { - m = (a + b) / 2; - segEnd = getU32BE(pos + 16 + 12*m + 4, &ok); - if (segEnd < c) { - a = m; - } else { - b = m; - } - } - segStart = getU32BE(pos + 16 + 12*b, &ok); - if (c < segStart) { - return 0; - } - segOffset = getU32BE(pos + 16 + 12*b + 8, &ok); - gid = segOffset + (c - segStart); - break; default: return 0; } diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h index 568ee845ff4..619e1bd6676 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "FoFiBase.h" diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.cc index 87278e755a5..83ec53ef5e8 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.h index 3576391f09e..4a64f246dcb 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "FoFiBase.h" diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc index 64d676b195f..b6a13390b40 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #include <math.h> @@ -177,16 +181,16 @@ GString *FoFiType1C::getGlyphName(int gid) { GHash *FoFiType1C::getNameToGIDMap() { GHash *map; - char glyphName[256]; + char name[256]; GBool ok; int gid; map = new GHash(gTrue); for (gid = 0; gid < nGlyphs; ++gid) { ok = gTrue; - getString(charset[gid], glyphName, &ok); + getString(charset[gid], name, &ok); if (ok) { - map->add(new GString(glyphName), gid); + map->add(new GString(name), gid); } } return map; @@ -1523,7 +1527,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GString *charBuf, if (nOps < 6 || nOps % 6 != 0) { //~ error(-1, "Wrong number of args (%d) to Type 2 rrcurveto", nOps); } - for (k = 0; k+5 < nOps; k += 6) { + for (k = 0; k < nOps; k += 6) { cvtNum(ops[k], charBuf); cvtNum(ops[k+1], charBuf); cvtNum(ops[k+2], charBuf); @@ -1692,11 +1696,9 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GString *charBuf, cvtNum(ops[k+5], charBuf); charBuf->append((char)8); } - if (k+1 < nOps) { - cvtNum(ops[k], charBuf); - cvtNum(ops[k+1], charBuf); - charBuf->append((char)5); - } + cvtNum(ops[k], charBuf); + cvtNum(ops[k+1], charBuf); + charBuf->append((char)5); nOps = 0; openPath = gTrue; break; @@ -1709,15 +1711,13 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GString *charBuf, cvtNum(ops[k+1], charBuf); charBuf->append((char)5); } - if (k+5 < nOps) { - cvtNum(ops[k], charBuf); - cvtNum(ops[k+1], charBuf); - cvtNum(ops[k+2], charBuf); - cvtNum(ops[k+3], charBuf); - cvtNum(ops[k+4], charBuf); - cvtNum(ops[k+5], charBuf); - charBuf->append((char)8); - } + cvtNum(ops[k], charBuf); + cvtNum(ops[k+1], charBuf); + cvtNum(ops[k+2], charBuf); + cvtNum(ops[k+3], charBuf); + cvtNum(ops[k+4], charBuf); + cvtNum(ops[k+5], charBuf); + charBuf->append((char)8); nOps = 0; openPath = gTrue; break; @@ -2251,7 +2251,43 @@ void FoFiType1C::convertToOpenType(FoFiOutputFunc outputFunc, void *outputStream, int nWidths, Gushort *widths, Guchar *cmapTable, int cmapTableLen) { - Guchar os2Table[96], headTable[54], hheaTable[36], maxpTable[6]; + // dummy OS/2 table (taken from FoFiTrueType::writeTTF) + static Guchar os2Tab[86] = { + 0, 1, // version + 0, 1, // xAvgCharWidth + 0x01, 0x90, // usWeightClass + 0, 5, // usWidthClass + 0, 0, // fsType + 0, 0, // ySubscriptXSize + 0, 0, // ySubscriptYSize + 0, 0, // ySubscriptXOffset + 0, 0, // ySubscriptYOffset + 0, 0, // ySuperscriptXSize + 0, 0, // ySuperscriptYSize + 0, 0, // ySuperscriptXOffset + 0, 0, // ySuperscriptYOffset + 0, 0, // yStrikeoutSize + 0, 0, // yStrikeoutPosition + 0, 0, // sFamilyClass + 0, 0, 0, 0, 0, // panose + 0, 0, 0, 0, 0, + 0, 0, 0, 0, // ulUnicodeRange1 + 0, 0, 0, 0, // ulUnicodeRange2 + 0, 0, 0, 0, // ulUnicodeRange3 + 0, 0, 0, 0, // ulUnicodeRange4 + 0, 0, 0, 0, // achVendID + 0, 0, // fsSelection + 0, 0, // usFirstCharIndex + 0, 0, // usLastCharIndex + 0, 0, // sTypoAscender + 0, 0, // sTypoDescender + 0, 0, // sTypoLineGap + 0x20, 0x00, // usWinAscent + 0x20, 0x00, // usWinDescent + 0, 0, 0, 1, // ulCodePageRange1 + 0, 0, 0, 0 // ulCodePageRange2 + }; + Guchar headTable[54], hheaTable[36], maxpTable[6]; Guchar nameTable[26], postTable[32]; Guchar *hmtxTable; static const char *tableTag[9] = { @@ -2271,118 +2307,15 @@ void FoFiType1C::convertToOpenType(FoFiOutputFunc outputFunc, double mat[6]; Gushort maxWidth; Guint checksum, fileChecksum; - int unitsPerEm, xMin, yMin, xMax, yMax, ascent, descent, offset, i; - - xMin = (int)(topDict.fontBBox[0] + 0.5); - yMin = (int)(topDict.fontBBox[1] + 0.5); - xMax = (int)(topDict.fontBBox[2] + 0.5); - yMax = (int)(topDict.fontBBox[3] + 0.5); - ascent = yMax; - descent = -yMin; + int unitsPerEm, xMin, yMin, xMax, yMax, offset, i; //--- CFF_ table tableData[0] = file; tableLength[0] = len; //--- OS/2 table - os2Table[ 0] = 0; // version - os2Table[ 1] = 4; - os2Table[ 2] = 0; // xAvgCharWidth - os2Table[ 3] = 1; - os2Table[ 4] = 0x01; // usWeightClass - os2Table[ 5] = 0x90; - os2Table[ 6] = 0; // usWidthClass - os2Table[ 7] = 5; - os2Table[ 8] = 0; // fsType - os2Table[ 9] = 0; - os2Table[10] = 0; // ySubscriptXSize - os2Table[11] = 0; - os2Table[12] = 0; // ySubscriptYSize - os2Table[13] = 0; - os2Table[14] = 0; // ySubscriptXOffset - os2Table[15] = 0; - os2Table[16] = 0; // ySubscriptYOffset - os2Table[17] = 0; - os2Table[18] = 0; // ySuperscriptXSize - os2Table[19] = 0; - os2Table[20] = 0; // ySuperscriptYSize - os2Table[21] = 0; - os2Table[22] = 0; // ySuperscriptXOffset - os2Table[23] = 0; - os2Table[24] = 0; // ySuperscriptYOffset - os2Table[25] = 0; - os2Table[26] = 0; // yStrikeoutSize - os2Table[27] = 0; - os2Table[28] = 0; // yStrikeoutPosition - os2Table[29] = 0; - os2Table[30] = 0; // sFamilyClass - os2Table[31] = 0; - os2Table[32] = 0; // panose - os2Table[33] = 0; - os2Table[34] = 0; - os2Table[35] = 0; - os2Table[36] = 0; - os2Table[37] = 0; - os2Table[38] = 0; - os2Table[39] = 0; - os2Table[40] = 0; - os2Table[41] = 0; - os2Table[42] = 0; // ulUnicodeRange1 - os2Table[43] = 0; - os2Table[44] = 0; - os2Table[45] = 0; - os2Table[46] = 0; // ulUnicodeRange2 - os2Table[47] = 0; - os2Table[48] = 0; - os2Table[49] = 0; - os2Table[50] = 0; // ulUnicodeRange3 - os2Table[51] = 0; - os2Table[52] = 0; - os2Table[53] = 0; - os2Table[54] = 0; // ulUnicodeRange4 - os2Table[55] = 0; - os2Table[56] = 0; - os2Table[57] = 0; - os2Table[58] = 0; // achVendID - os2Table[59] = 0; - os2Table[60] = 0; - os2Table[61] = 0; - os2Table[62] = 0; // fsSelection - os2Table[63] = 0; - os2Table[64] = 0; // usFirstCharIndex - os2Table[65] = 0; - os2Table[66] = 0; // usLastCharIndex - os2Table[67] = 0; - os2Table[68] = 0; // sTypoAscender - os2Table[69] = 0; - os2Table[70] = 0; // sTypoDescender - os2Table[71] = 0; - os2Table[72] = 0; // sTypoLineGap - os2Table[73] = 0; - os2Table[74] = (Guchar)(ascent >> 8); // usWinAscent - os2Table[75] = (Guchar)ascent; - os2Table[76] = (Guchar)(descent >> 8); // usWinDescent - os2Table[77] = (Guchar)descent; - os2Table[78] = 0; // ulCodePageRange1 - os2Table[79] = 0; - os2Table[80] = 0; - os2Table[81] = 1; - os2Table[82] = 0; // ulCodePageRange2 - os2Table[83] = 0; - os2Table[84] = 0; - os2Table[85] = 0; - os2Table[86] = 0; // sxHeight - os2Table[87] = 0; - os2Table[88] = 0; // sCapHeight - os2Table[89] = 0; - os2Table[90] = 0; // usDefaultChar - os2Table[91] = 0; - os2Table[92] = 0; // usBreakChar - os2Table[93] = 0; - os2Table[94] = 0; // usMaxContext - os2Table[95] = 0; - tableData[1] = os2Table; - tableLength[1] = 96; + tableData[1] = os2Tab; + tableLength[1] = 86; //--- cmap table tableData[2] = cmapTable; @@ -2395,14 +2328,18 @@ void FoFiType1C::convertToOpenType(FoFiOutputFunc outputFunc, } else { unitsPerEm = (int)(1 / mat[0] + 0.5); } + xMin = (int)(topDict.fontBBox[0] + 0.5); + yMin = (int)(topDict.fontBBox[1] + 0.5); + xMax = (int)(topDict.fontBBox[2] + 0.5); + yMax = (int)(topDict.fontBBox[3] + 0.5); headTable[ 0] = 0x00; // version headTable[ 1] = 0x01; headTable[ 2] = 0x00; headTable[ 3] = 0x00; headTable[ 4] = 0x00; // revision - headTable[ 5] = 0x01; // (needs to be non-zero) + headTable[ 5] = 0x00; headTable[ 6] = 0x00; - headTable[ 7] = 0x01; + headTable[ 7] = 0x00; headTable[ 8] = 0x00; // checksumAdjustment headTable[ 9] = 0x00; // (set later) headTable[10] = 0x00; @@ -2453,8 +2390,8 @@ void FoFiType1C::convertToOpenType(FoFiOutputFunc outputFunc, tableLength[3] = 54; //--- hhea table - maxWidth = 0; - for (i = 0; i < nWidths; ++i) { + maxWidth = widths[0]; + for (i = 1; i < nWidths; ++i) { if (widths[i] > maxWidth) { maxWidth = widths[i]; } @@ -2722,10 +2659,6 @@ GBool FoFiType1C::parse() { return gFalse; } nFDs = fdIdx.len; - if (nFDs < 1) { - parsedOk = gFalse; - return gFalse; - } privateDicts = (Type1CPrivateDict *) gmallocn(nFDs, sizeof(Type1CPrivateDict)); for (i = 0; i < nFDs; ++i) { diff --git a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.h b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.h index 301f42d85e8..15a823cffe6 100644 --- a/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.h +++ b/Build/source/libs/xpdf/xpdf-src/fofi/FoFiType1C.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "FoFiBase.h" diff --git a/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.cc b/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.cc index 8c4c474f5f1..503a06aa9c7 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.cc @@ -12,6 +12,10 @@ #if USE_FIXEDPOINT +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmempp.h" #include "FixedPoint.h" diff --git a/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.h b/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.h index 31f2ca4dad2..9f0c3240627 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.h +++ b/Build/source/libs/xpdf/xpdf-src/goo/FixedPoint.h @@ -15,6 +15,10 @@ #if USE_FIXEDPOINT +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <stdio.h> #include <stdlib.h> #include "gtypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GHash.cc b/Build/source/libs/xpdf/xpdf-src/goo/GHash.cc index c77a1b90db0..e6b32440fb9 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GHash.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/GHash.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmem.h" #include "gmempp.h" #include "GString.h" diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GHash.h b/Build/source/libs/xpdf/xpdf-src/goo/GHash.h index 92ce226d7bd..179753a50b4 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GHash.h +++ b/Build/source/libs/xpdf/xpdf-src/goo/GHash.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" class GString; diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GList.cc b/Build/source/libs/xpdf/xpdf-src/goo/GList.cc index 7aaa5d7176f..c194818a743 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GList.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/GList.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #include "gmem.h" @@ -96,11 +100,6 @@ void GList::sort(int (*cmp)(const void *obj1, const void *obj2)) { qsort(data, length, sizeof(void *), cmp); } -void GList::sort(int first, int n, - int (*cmp)(const void *ptr1, const void *ptr2)) { - qsort(data + first, n, sizeof(void *), cmp); -} - void GList::reverse() { void *t; int n, i; diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GList.h b/Build/source/libs/xpdf/xpdf-src/goo/GList.h index ee12346c5cf..005043726a5 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GList.h +++ b/Build/source/libs/xpdf/xpdf-src/goo/GList.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" //------------------------------------------------------------------------ @@ -66,9 +70,6 @@ public: // be double-dereferenced. void sort(int (*cmp)(const void *ptr1, const void *ptr2)); - // Sort <n> items starting at <first>. - void sort(int first, int n, int (*cmp)(const void *ptr1, const void *ptr2)); - // Reverse the list. void reverse(); diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GString.cc b/Build/source/libs/xpdf/xpdf-src/goo/GString.cc index 1e41bcaa172..54de35b0a75 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GString.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/GString.cc @@ -10,6 +10,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <stddef.h> #include <string.h> @@ -412,8 +416,6 @@ GString *GString::appendfv(const char *fmt, va_list argList) { // format the argument arg = args[idx]; - str = NULL; - len = 0; switch (ft) { case fmtIntDecimal: formatInt(arg.i, buf, sizeof(buf), zeroFill, width, 10, &str, &len); diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GString.h b/Build/source/libs/xpdf/xpdf-src/goo/GString.h index 2e67fd0c0d0..6b342f85ec7 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GString.h +++ b/Build/source/libs/xpdf/xpdf-src/goo/GString.h @@ -13,6 +13,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <limits.h> // for LLONG_MAX and ULLONG_MAX #include <stdarg.h> #include "gtypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc b/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc index e1fdf297689..c2e7512e188 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc @@ -418,18 +418,6 @@ GBool pathIsFile(const char *path) { #endif } -GBool pathIsDir(const char *path) { -#ifdef _WIN32 - wchar_t wPath[winMaxLongPath + 1]; - fileNameToUCS2(path, wPath, winMaxLongPath + 1); - DWORD attr = GetFileAttributesW(wPath); - return attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY); -#else - struct stat statBuf; - return stat(path, &statBuf) == 0 && S_ISDIR(statBuf.st_mode); -#endif -} - time_t getModTime(char *fileName) { #ifdef _WIN32 //~ should implement this, but it's (currently) only used in xpdf @@ -614,17 +602,6 @@ GString *fileNameToUTF8(wchar_t *path) { return s; } -GString *fileNameMultiByteToUTF8(char *path) { - wchar_t fileNameW[winMaxLongPath + 1]; - if (MultiByteToWideChar(CP_OEMCP, 0, path, -1, - fileNameW, sizeof(fileNameW) / sizeof(wchar_t))) { - return fileNameToUTF8(fileNameW); - } else { - // shouldn't happen, but just in case... - return new GString(path); - } -} - wchar_t *fileNameToUCS2(const char *path, wchar_t *out, size_t outSize) { const char *p; size_t i; @@ -703,7 +680,7 @@ void readWindowsShortcut(wchar_t *wPath, size_t wPathSize) { } hres = persistFile->Load(wPath, STGM_READ); if (FAILED(hres)) { - fprintf(stderr, "IPersistFile.Load failed: 0x%08lx\n", hres); + fprintf(stderr, "IPersistFile.Load failed: 0x%08x\n", hres); exit(1); } wchar_t target[winMaxLongPath + 1]; diff --git a/Build/source/libs/xpdf/xpdf-src/goo/gfile.h b/Build/source/libs/xpdf/xpdf-src/goo/gfile.h index 9dbb1c9b8ee..d0d2ad6f9e1 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/gfile.h +++ b/Build/source/libs/xpdf/xpdf-src/goo/gfile.h @@ -64,9 +64,6 @@ extern GString *makePathAbsolute(GString *path); // Returns true if [path] exists and is a regular file. extern GBool pathIsFile(const char *path); -// Returns true if [path] exists and is a directory. -extern GBool pathIsDir(const char *path); - // Get the modification time for <fileName>. Returns 0 if there is an // error. extern time_t getModTime(char *fileName); @@ -93,9 +90,6 @@ extern GString *fileNameToUTF8(char *path); // Convert a file name from UCS-2 to UTF-8. extern GString *fileNameToUTF8(wchar_t *path); -// Convert a file name from the OEM code page to UTF-8. -extern GString *fileNameMultiByteToUTF8(char *path); - // Convert a file name from UTF-8 to UCS-2. [out] has space for // [outSize] wchar_t elements (including the trailing zero). Returns // [out]. diff --git a/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc b/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc index 0ed8cf5d888..4afe21b4a25 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/Splash.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #include <limits.h> @@ -4926,7 +4930,7 @@ void Splash::clear(SplashColorPtr color, Guchar alpha) { SplashError Splash::stroke(SplashPath *path) { SplashPath *path2, *dPath; - SplashCoord w, w2, lineDashMax, lineDashTotal; + SplashCoord t0, t1, t2, t3, w, w2, lineDashMax, lineDashTotal; int lineCap, lineJoin, i; if (debugMode) { @@ -4938,9 +4942,6 @@ SplashError Splash::stroke(SplashPath *path) { if (path->length == 0) { return splashErrEmptyPath; } - if (pathAllOutside(path, gTrue)) { - return splashOk; - } path2 = flattenPath(path, state->matrix, state->flatness); // Compute an approximation of the transformed line width. @@ -4952,13 +4953,15 @@ SplashError Splash::stroke(SplashPath *path) { // [0 +/-s] [+/-s 0] // well, and still does something reasonable for the uncommon // case transforms. - double t0 = splashAbs(state->matrix[0]); - double t1 = splashAbs(state->matrix[1]); - double t2 = splashAbs(state->matrix[2]); - double t3 = splashAbs(state->matrix[3]); - double t01 = t0 * t0 + t1 * t1; - double t23 = t2 * t2 + t3 * t3; - w = sqrt((t01 > t23) ? t01 : t23); + t0 = splashAbs(state->matrix[0]); + t1 = splashAbs(state->matrix[1]); + t2 = splashAbs(state->matrix[2]); + t3 = splashAbs(state->matrix[3]); + if (t0 * t3 >= t1 * t2) { + w = (t0 < t3) ? t0 : t3; + } else { + w = (t1 < t2) ? t1 : t2; + } w2 = w * state->lineWidth; // construct the dashed path @@ -5053,7 +5056,7 @@ void Splash::strokeNarrow(SplashPath *path) { xPath = new SplashXPath(path, state->matrix, state->flatness, gFalse, state->enablePathSimplification, - state->strokeAdjust, state->clip); + state->strokeAdjust); pipeInit(&pipe, state->strokePattern, (Guchar)splashRound(state->strokeAlpha * 255), @@ -5071,44 +5074,6 @@ void Splash::strokeNarrow(SplashPath *path) { x0 = splashFloor(seg->x1); x1 = splashFloor(seg->x0); } - - // With CAD-mode stroke adjustment, and a simple rectangular clip - // region, horizontal and vertical stroke-adjusted edges that fall - // slightly outside the clip region are adjusted back inside the - // clip region. This avoids problems with narrow lines in - // slightly mismatched clip rectangles, which appear to be - // generated somewhat commonly by buggy CAD software. This is - // similar to the code in SplashXPath::strokeAdjust() -- narrow - // strokes aren't stroke-adjusted, so this tweak has to be done - // here. - if (y0 == y1 && - seg->y0 == seg->y1 && - state->clip->getIsSimple() && - state->strokeAdjust == splashStrokeAdjustCAD) { - SplashCoord cy0 = state->clip->getYMin(); - SplashCoord cy1 = state->clip->getYMax(); - int cyi0 = state->clip->getYMinI(state->strokeAdjust); - int cyi1 = state->clip->getYMaxI(state->strokeAdjust); - if (y0 == cyi0 - 1 && cy0 - seg->y0 < 0.5) { - y0 = y1 = y0 + 1; - } else if (y0 == cyi1 + 1 && seg->y0 - cy1 < 0.5) { - y0 = y1 = y0 - 1; - } - } else if (x0 == x1 && - seg->x0 == seg->x1 && - state->clip->getIsSimple() && - state->strokeAdjust == splashStrokeAdjustCAD) { - SplashCoord cx0 = state->clip->getXMin(); - SplashCoord cx1 = state->clip->getXMax(); - int cxi0 = state->clip->getXMinI(state->strokeAdjust); - int cxi1 = state->clip->getXMaxI(state->strokeAdjust); - if (x0 == cxi0 - 1 && cx0 - seg->x0 < 0.5) { - x0 = x1 = x0 + 1; - } else if (x0 == cxi1 + 1 && seg->x0 - cx1 < 0.5) { - x0 = x1 = x0 - 1; - } - } - if ((clipRes = state->clip->testRect(x0 <= x1 ? x0 : x1, y0, x0 <= x1 ? x1 : x0, y1, state->strokeAdjust)) @@ -5119,18 +5084,6 @@ void Splash::strokeNarrow(SplashPath *path) { } else { drawStrokeSpan(&pipe, x1, x0, y0, clipRes == splashClipAllInside); } - } else if (x0 == x1) { - y = state->clip->getYMinI(state->strokeAdjust); - if (y0 < y) { - y0 = y; - } - y = state->clip->getYMaxI(state->strokeAdjust); - if (y1 > y) { - y1 = y; - } - for (y = y0; y <= y1; ++y) { - drawStrokeSpan(&pipe, x0, x0, y, clipRes == splashClipAllInside); - } } else { dxdy = seg->dxdy; y = state->clip->getYMinI(state->strokeAdjust); @@ -5141,7 +5094,7 @@ void Splash::strokeNarrow(SplashPath *path) { y = state->clip->getYMaxI(state->strokeAdjust); if (y1 > y) { y1 = y; - x1 = splashFloor(seg->x0 + ((SplashCoord)y1 + 1 - seg->y0) * dxdy); + x1 = splashFloor(seg->x0 + ((SplashCoord)y1 - seg->y0) * dxdy); } if (x0 <= x1) { xa = x0; @@ -5182,7 +5135,6 @@ void Splash::strokeNarrow(SplashPath *path) { } ++nClipRes[clipRes]; } - if (nClipRes[splashClipPartial] || (nClipRes[splashClipAllInside] && nClipRes[splashClipAllOutside])) { opClipRes = splashClipPartial; @@ -5374,14 +5326,16 @@ SplashPath *Splash::makeDashedPath(SplashPath *path) { return new SplashPath(); } lineDashStartPhase = state->lineDashPhase; - if (lineDashStartPhase > 0) { - i = splashFloor(lineDashStartPhase / lineDashTotal); - lineDashStartPhase -= lineDashTotal * i; - } else { - i = splashCeil(-lineDashStartPhase / lineDashTotal); - lineDashStartPhase += lineDashTotal * i; - } - lineDashStartOn = !((state->lineDashLength & 1) && (i & 1)); + if (lineDashStartPhase > lineDashTotal * 2) { + i = splashFloor(lineDashStartPhase / (lineDashTotal * 2)); + lineDashStartPhase -= lineDashTotal * i * 2; + } else if (lineDashStartPhase < 0) { + i = splashCeil(-lineDashStartPhase / (lineDashTotal * 2)); + lineDashStartPhase += lineDashTotal * i * 2; + } + i = splashFloor(lineDashStartPhase / lineDashTotal); + lineDashStartPhase -= (SplashCoord)i * lineDashTotal; + lineDashStartOn = gTrue; lineDashStartIdx = 0; if (lineDashStartPhase > 0) { while (lineDashStartPhase >= state->lineDash[lineDashStartIdx]) { @@ -5423,14 +5377,6 @@ SplashPath *Splash::makeDashedPath(SplashPath *path) { y1 = path->pts[k+1].y; segLen = splashDist(x0, y0, x1, y1); - // Special case for zero-length subpath: copy the zero-length - // segment into the dashed path so that the round line cap - // special case is handled. - if (j == i+1 && segLen == 0) { - dPath->moveTo(x0, y0); - dPath->lineTo(x0, y0); - } - // process the segment while (segLen > 0) { @@ -5531,13 +5477,6 @@ SplashError Splash::fill(SplashPath *path, GBool eo) { printf("fill [eo:%d]:\n", eo); dumpPath(path); } - if (path->length == 0) { - return splashErrEmptyPath; - } - if (pathAllOutside(path, gFalse)) { - opClipRes = splashClipAllOutside; - return splashOk; - } return fillWithPattern(path, eo, state->fillPattern, state->fillAlpha); } @@ -5551,11 +5490,19 @@ SplashError Splash::fillWithPattern(SplashPath *path, GBool eo, int xMin, yMin, xMax, xMin2, xMax2, yMax, y, t; SplashClipResult clipRes; + if (path->length == 0) { + return splashErrEmptyPath; + } + if (pathAllOutside(path)) { + opClipRes = splashClipAllOutside; + return splashOk; + } + path2 = tweakFillPath(path); xPath = new SplashXPath(path2, state->matrix, state->flatness, gTrue, state->enablePathSimplification, - state->strokeAdjust, state->clip); + state->strokeAdjust); if (path2 != path) { delete path2; } @@ -5731,17 +5678,13 @@ SplashPath *Splash::tweakFillPath(SplashPath *path) { return path2; } -// Returns true if [path] is entirely outside the current clipping -// path. The path coordinates have not been stroke adjusted, so we -// compare against the floating point clip rect. If [stroke] is true, -// allow for the stroke width and miter limit. -GBool Splash::pathAllOutside(SplashPath *path, GBool stroke) { +GBool Splash::pathAllOutside(SplashPath *path) { SplashCoord xMin1, yMin1, xMax1, yMax1; SplashCoord xMin2, yMin2, xMax2, yMax2; SplashCoord x, y; + int xMinI, yMinI, xMaxI, yMaxI; int i; - //--- compute the path's bbox in user space xMin1 = xMax1 = path->pts[0].x; yMin1 = yMax1 = path->pts[0].y; for (i = 1; i < path->length; ++i) { @@ -5757,19 +5700,6 @@ GBool Splash::pathAllOutside(SplashPath *path, GBool stroke) { } } - //--- allow for stroke width and miter limit - if (stroke && state->lineWidth > 0) { - SplashCoord w = state->lineWidth * 0.5; - if (state->lineJoin == splashLineJoinMiter) { - w *= state->miterLimit; - } - xMin1 -= w; - yMin1 -= w; - xMax1 += w; - yMax1 += w; - } - - //--- convert path bbox to device space transform(state->matrix, xMin1, yMin1, &x, &y); xMin2 = xMax2 = x; yMin2 = yMax2 = y; @@ -5806,20 +5736,18 @@ GBool Splash::pathAllOutside(SplashPath *path, GBool stroke) { } else if (y > yMax2) { yMax2 = y; } + // sanity-check the coordinates - xMinI/yMinI/xMaxI/yMaxI are + // 32-bit integers, so coords need to be < 2^31 + SplashXPath::clampCoords(&xMin2, &yMin2); + SplashXPath::clampCoords(&xMax2, &yMax2); + xMinI = splashFloor(xMin2); + yMinI = splashFloor(yMin2); + xMaxI = splashFloor(xMax2); + yMaxI = splashFloor(yMax2); - //--- handle zero-width strokes - if (stroke && state->lineWidth == 0) { - xMin1 -= 1; - yMin1 -= 1; - xMax1 += 1; - yMax1 += 1; - } - - //--- check against the clip rect - return xMin2 > state->clip->getXMax() || - xMax2 < state->clip->getXMin() || - yMin2 > state->clip->getYMax() || - yMax2 < state->clip->getYMin(); + return state->clip->testRect(xMinI, yMinI, xMaxI, yMaxI, + state->strokeAdjust) == + splashClipAllOutside; } SplashError Splash::fillChar(SplashCoord x, SplashCoord y, @@ -6094,9 +6022,6 @@ SplashError Splash::fillImageMask(GString *imageTag, SplashClipResult clipRes = state->clip->testRect(xMin, yMin, xMax - 1, yMax - 1, state->strokeAdjust); - if (clipRes == splashClipAllOutside) { - return splashOk; - } // If the scaled mask is much wider and/or taller than the clip // region, we use the "arbitrary" scaling path, to avoid a // potentially very slow loop in the flips-only path (which scans @@ -6129,88 +6054,92 @@ SplashError Splash::fillImageMask(GString *imageTag, //--- horizontal/vertical flips only if (flipsOnly && !veryLarge) { - int scaledWidth = xMax - xMin; - int scaledHeight = yMax - yMin; - ImageMaskScaler scaler(src, srcData, w, h, - scaledWidth, scaledHeight, interpolate, antialias); - Guchar *tmpLine = NULL; - if (horizFlip) { - tmpLine = (Guchar *)gmalloc(scaledWidth); - } - if (vertFlip) { - if (horizFlip) { // bottom-up, mirrored - for (int y = 0; y < scaledHeight; ++y) { - scaler.nextLine(); - mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth); - (this->*drawRowFunc)(&dd, tmpLine, - xMin, yMax - 1 - y, scaledWidth); - } - } else { // bottom-up - for (int y = 0; y < scaledHeight; ++y) { - scaler.nextLine(); - (this->*drawRowFunc)(&dd, scaler.data(), - xMin, yMax - 1 - y, scaledWidth); - } + if (clipRes != splashClipAllOutside) { + int scaledWidth = xMax - xMin; + int scaledHeight = yMax - yMin; + ImageMaskScaler scaler(src, srcData, w, h, + scaledWidth, scaledHeight, interpolate, antialias); + Guchar *tmpLine = NULL; + if (horizFlip) { + tmpLine = (Guchar *)gmalloc(scaledWidth); } - } else { - if (horizFlip) { // top-down, mirrored - for (int y = 0; y < scaledHeight; ++y) { - scaler.nextLine(); - mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth); - (this->*drawRowFunc)(&dd, tmpLine, - xMin, yMin + y, scaledWidth); + if (vertFlip) { + if (horizFlip) { // bottom-up, mirrored + for (int y = 0; y < scaledHeight; ++y) { + scaler.nextLine(); + mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth); + (this->*drawRowFunc)(&dd, tmpLine, + xMin, yMax - 1 - y, scaledWidth); + } + } else { // bottom-up + for (int y = 0; y < scaledHeight; ++y) { + scaler.nextLine(); + (this->*drawRowFunc)(&dd, scaler.data(), + xMin, yMax - 1 - y, scaledWidth); + } } - } else { // top-down - for (int y = 0; y < scaledHeight; ++y) { - scaler.nextLine(); - (this->*drawRowFunc)(&dd, scaler.data(), - xMin, yMin + y, scaledWidth); + } else { + if (horizFlip) { // top-down, mirrored + for (int y = 0; y < scaledHeight; ++y) { + scaler.nextLine(); + mirrorImageMaskRow(scaler.data(), tmpLine, scaledWidth); + (this->*drawRowFunc)(&dd, tmpLine, + xMin, yMin + y, scaledWidth); + } + } else { // top-down + for (int y = 0; y < scaledHeight; ++y) { + scaler.nextLine(); + (this->*drawRowFunc)(&dd, scaler.data(), + xMin, yMin + y, scaledWidth); + } } } + gfree(tmpLine); } - gfree(tmpLine); //--- 90/270 rotation } else if (rot90Only && !veryLarge) { + if (clipRes != splashClipAllOutside) { - // scale the mask - int scaledWidth = yMax - yMin; - int scaledHeight = xMax - xMin; - ImageMaskScaler scaler(src, srcData, w, h, - scaledWidth, scaledHeight, interpolate, antialias); - Guchar *scaledMask = (Guchar *)gmallocn64(scaledHeight, scaledWidth); - Guchar *ptr = scaledMask; - for (int y = 0; y < scaledHeight; ++y) { - scaler.nextLine(); - memcpy(ptr, scaler.data(), scaledWidth); - ptr += scaledWidth; - } - - // draw it - Guchar *tmpLine = (Guchar *)gmalloc(scaledHeight); - for (int y = 0; y < scaledWidth; ++y) { - if (vertFlip) { - ptr = scaledMask + (scaledWidth - 1 - y); - } else { - ptr = scaledMask + y; + // scale the mask + int scaledWidth = yMax - yMin; + int scaledHeight = xMax - xMin; + ImageMaskScaler scaler(src, srcData, w, h, + scaledWidth, scaledHeight, interpolate, antialias); + Guchar *scaledMask = (Guchar *)gmallocn(scaledHeight, scaledWidth); + Guchar *ptr = scaledMask; + for (int y = 0; y < scaledHeight; ++y) { + scaler.nextLine(); + memcpy(ptr, scaler.data(), scaledWidth); + ptr += scaledWidth; } - if (horizFlip) { - ptr += (scaledHeight - 1) * scaledWidth; - for (int x = 0; x < scaledHeight; ++x) { - tmpLine[x] = *ptr; - ptr -= scaledWidth; + + // draw it + Guchar *tmpLine = (Guchar *)gmalloc(scaledHeight); + for (int y = 0; y < scaledWidth; ++y) { + if (vertFlip) { + ptr = scaledMask + (scaledWidth - 1 - y); + } else { + ptr = scaledMask + y; } - } else { - for (int x = 0; x < scaledHeight; ++x) { - tmpLine[x] = *ptr; - ptr += scaledWidth; + if (horizFlip) { + ptr += (scaledHeight - 1) * scaledWidth; + for (int x = 0; x < scaledHeight; ++x) { + tmpLine[x] = *ptr; + ptr -= scaledWidth; + } + } else { + for (int x = 0; x < scaledHeight; ++x) { + tmpLine[x] = *ptr; + ptr += scaledWidth; + } } + (this->*drawRowFunc)(&dd, tmpLine, xMin, yMin + y, scaledHeight); } - (this->*drawRowFunc)(&dd, tmpLine, xMin, yMin + y, scaledHeight); - } - gfree(tmpLine); - gfree(scaledMask); + gfree(tmpLine); + gfree(scaledMask); + } //--- arbitrary transform } else { @@ -6260,7 +6189,7 @@ SplashError Splash::fillImageMask(GString *imageTag, // if downscaling: store the downscaled image mask // if upscaling: store the unscaled image mask - Guchar *scaledMask = (Guchar *)gmallocn64(scaledHeight, scaledWidth); + Guchar *scaledMask = (Guchar *)gmallocn(scaledHeight, scaledWidth); if (downscaling) { ImageMaskScaler scaler(src, srcData, w, h, scaledWidth, scaledHeight, interpolate, antialias); @@ -6342,7 +6271,7 @@ void Splash::drawImageMaskArbitraryNoInterp( + (SplashCoord)y * invMat[3] + invMat[5]); if (xx >= 0 && xx < scaledWidth && yy >= 0 && yy < scaledHeight) { - Guchar *p = scaledMask + (yy * (SplashBitmapRowSize)scaledWidth + xx); + Guchar *p = scaledMask + (yy * scaledWidth + xx); Guchar *q = buf + (x - xMin); *q = *p; if (x < rowMin) { @@ -6420,10 +6349,10 @@ void Splash::drawImageMaskArbitraryInterp( if (y1 >= scaledHeight) { y1 = scaledHeight - 1; } - Guchar *p00 = scaledMask + (y0 * (SplashBitmapRowSize)scaledWidth + x0); - Guchar *p10 = scaledMask + (y0 * (SplashBitmapRowSize)scaledWidth + x1); - Guchar *p01 = scaledMask + (y1 * (SplashBitmapRowSize)scaledWidth + x0); - Guchar *p11 = scaledMask + (y1 * (SplashBitmapRowSize)scaledWidth + x1); + Guchar *p00 = scaledMask + (y0 * scaledWidth + x0); + Guchar *p10 = scaledMask + (y0 * scaledWidth + x1); + Guchar *p01 = scaledMask + (y1 * scaledWidth + x0); + Guchar *p11 = scaledMask + (y1 * scaledWidth + x1); Guchar *q = buf + (x - xMin); *q = (Guchar)(int)(sx0 * (sy0 * (int)*p00 + sy1 * (int)*p01) + sx1 * (sy0 * (int)*p10 + sy1 * (int)*p11)); @@ -6640,9 +6569,6 @@ SplashError Splash::drawImage(GString *imageTag, SplashClipResult clipRes = state->clip->testRect(xMin, yMin, xMax - 1, yMax - 1, state->strokeAdjust); - if (clipRes == splashClipAllOutside) { - return splashOk; - } // If the scaled image is much wider and/or taller than the clip // region, we use the arbitrary transform path, to avoid a // potentially very slow loop in the flips-only path (which scans @@ -6690,133 +6616,136 @@ SplashError Splash::drawImage(GString *imageTag, //--- horizontal/vertical flips only if (flipsOnly && !veryLarge) { - int scaledWidth = xMax - xMin; - int scaledHeight = yMax - yMin; - ImageScaler *scaler = getImageScaler(imageTag, src, srcData, - w, h, nComps, - scaledWidth, scaledHeight, - srcMode, srcAlpha, interpolate); - Guchar *tmpLine = NULL; - Guchar *tmpAlphaLine = NULL; - if (horizFlip) { - tmpLine = (Guchar *)gmallocn(scaledWidth, nComps); - if (srcAlpha) { - tmpAlphaLine = (Guchar *)gmalloc(scaledWidth); - } - } - if (vertFlip) { - if (horizFlip) { // bottom-up, mirrored - for (int y = 0; y < scaledHeight; ++y) { - scaler->nextLine(); - mirrorImageRow(scaler->colorData(), scaler->alphaData(), - tmpLine, tmpAlphaLine, - scaledWidth, nComps, srcAlpha); - (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, - xMin, yMax - 1 - y, scaledWidth); - } - } else { // bottom-up - for (int y = 0; y < scaledHeight; ++y) { - scaler->nextLine(); - (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(), - xMin, yMax - 1 - y, scaledWidth); + if (clipRes != splashClipAllOutside) { + int scaledWidth = xMax - xMin; + int scaledHeight = yMax - yMin; + ImageScaler *scaler = getImageScaler(imageTag, src, srcData, + w, h, nComps, + scaledWidth, scaledHeight, + srcMode, srcAlpha, interpolate); + Guchar *tmpLine = NULL; + Guchar *tmpAlphaLine = NULL; + if (horizFlip) { + tmpLine = (Guchar *)gmallocn(scaledWidth, nComps); + if (srcAlpha) { + tmpAlphaLine = (Guchar *)gmalloc(scaledWidth); } } - } else { - if (horizFlip) { // top-down, mirrored - for (int y = 0; y < scaledHeight; ++y) { - scaler->nextLine(); - mirrorImageRow(scaler->colorData(), scaler->alphaData(), - tmpLine, tmpAlphaLine, - scaledWidth, nComps, srcAlpha); - (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, - xMin, yMin + y, scaledWidth); + if (vertFlip) { + if (horizFlip) { // bottom-up, mirrored + for (int y = 0; y < scaledHeight; ++y) { + scaler->nextLine(); + mirrorImageRow(scaler->colorData(), scaler->alphaData(), + tmpLine, tmpAlphaLine, + scaledWidth, nComps, srcAlpha); + (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, + xMin, yMax - 1 - y, scaledWidth); + } + } else { // bottom-up + for (int y = 0; y < scaledHeight; ++y) { + scaler->nextLine(); + (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(), + xMin, yMax - 1 - y, scaledWidth); + } } - } else { // top-down - for (int y = 0; y < scaledHeight; ++y) { - scaler->nextLine(); - (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(), - xMin, yMin + y, scaledWidth); + } else { + if (horizFlip) { // top-down, mirrored + for (int y = 0; y < scaledHeight; ++y) { + scaler->nextLine(); + mirrorImageRow(scaler->colorData(), scaler->alphaData(), + tmpLine, tmpAlphaLine, + scaledWidth, nComps, srcAlpha); + (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, + xMin, yMin + y, scaledWidth); + } + } else { // top-down + for (int y = 0; y < scaledHeight; ++y) { + scaler->nextLine(); + (this->*drawRowFunc)(&dd, scaler->colorData(), scaler->alphaData(), + xMin, yMin + y, scaledWidth); + } } } + gfree(tmpLine); + gfree(tmpAlphaLine); + delete scaler; } - gfree(tmpLine); - gfree(tmpAlphaLine); - delete scaler; //--- 90/270 rotation } else if (rot90Only && !veryLarge) { - - // scale the image - int scaledWidth = yMax - yMin; - int scaledHeight = xMax - xMin; - Guchar *scaledColor, *scaledAlpha; - GBool freeScaledImage; - getScaledImage(imageTag, src, srcData, w, h, nComps, - scaledWidth, scaledHeight, srcMode, srcAlpha, interpolate, - &scaledColor, &scaledAlpha, &freeScaledImage); - - // draw it - Guchar *tmpLine = (Guchar *)gmallocn(scaledHeight, nComps); - Guchar *tmpAlphaLine = NULL; - if (srcAlpha) { - tmpAlphaLine = (Guchar *)gmalloc(scaledHeight); - } - for (int y = 0; y < scaledWidth; ++y) { - Guchar *ptr = NULL; - Guchar *alphaPtr = NULL; - if (vertFlip) { - ptr = scaledColor + ((SplashBitmapRowSize)scaledWidth - 1 - y) * nComps; - if (srcAlpha) { - alphaPtr = scaledAlpha + (scaledWidth - 1 - y); - } - } else { - ptr = scaledColor + y * nComps; - if (srcAlpha) { - alphaPtr = scaledAlpha + y; - } + if (clipRes != splashClipAllOutside) { + + // scale the image + int scaledWidth = yMax - yMin; + int scaledHeight = xMax - xMin; + Guchar *scaledColor, *scaledAlpha; + GBool freeScaledImage; + getScaledImage(imageTag, src, srcData, w, h, nComps, + scaledWidth, scaledHeight, srcMode, srcAlpha, interpolate, + &scaledColor, &scaledAlpha, &freeScaledImage); + + // draw it + Guchar *tmpLine = (Guchar *)gmallocn(scaledHeight, nComps); + Guchar *tmpAlphaLine = NULL; + if (srcAlpha) { + tmpAlphaLine = (Guchar *)gmalloc(scaledHeight); } - if (horizFlip) { - ptr += (scaledHeight - 1) * (SplashBitmapRowSize)scaledWidth * nComps; - Guchar *q = tmpLine; - for (int x = 0; x < scaledHeight; ++x) { - for (int i = 0; i < nComps; ++i) { - *q++ = ptr[i]; + for (int y = 0; y < scaledWidth; ++y) { + Guchar *ptr, *alphaPtr; + if (vertFlip) { + ptr = scaledColor + (scaledWidth - 1 - y) * nComps; + if (srcAlpha) { + alphaPtr = scaledAlpha + (scaledWidth - 1 - y); + } + } else { + ptr = scaledColor + y * nComps; + if (srcAlpha) { + alphaPtr = scaledAlpha + y; } - ptr -= scaledWidth * nComps; } - if (srcAlpha) { - alphaPtr += (scaledHeight - 1) * (SplashBitmapRowSize)scaledWidth; - q = tmpAlphaLine; + if (horizFlip) { + ptr += (scaledHeight - 1) * scaledWidth * nComps; + Guchar *q = tmpLine; for (int x = 0; x < scaledHeight; ++x) { - *q++ = *alphaPtr; - alphaPtr -= scaledWidth; + for (int i = 0; i < nComps; ++i) { + *q++ = ptr[i]; + } + ptr -= scaledWidth * nComps; } - } - } else { - Guchar *q = tmpLine; - for (int x = 0; x < scaledHeight; ++x) { - for (int i = 0; i < nComps; ++i) { - *q++ = ptr[i]; + if (srcAlpha) { + alphaPtr += (scaledHeight - 1) * scaledWidth; + q = tmpAlphaLine; + for (int x = 0; x < scaledHeight; ++x) { + *q++ = *alphaPtr; + alphaPtr -= scaledWidth; + } } - ptr += scaledWidth * nComps; - } - if (srcAlpha) { - q = tmpAlphaLine; + } else { + Guchar *q = tmpLine; for (int x = 0; x < scaledHeight; ++x) { - *q++ = *alphaPtr; - alphaPtr += scaledWidth; + for (int i = 0; i < nComps; ++i) { + *q++ = ptr[i]; + } + ptr += scaledWidth * nComps; + } + if (srcAlpha) { + q = tmpAlphaLine; + for (int x = 0; x < scaledHeight; ++x) { + *q++ = *alphaPtr; + alphaPtr += scaledWidth; + } } } + (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, + xMin, yMin + y, scaledHeight); } - (this->*drawRowFunc)(&dd, tmpLine, tmpAlphaLine, - xMin, yMin + y, scaledHeight); - } - gfree(tmpLine); - gfree(tmpAlphaLine); - if (freeScaledImage) { - gfree(scaledColor); - gfree(scaledAlpha); + gfree(tmpLine); + gfree(tmpAlphaLine); + if (freeScaledImage) { + gfree(scaledColor); + gfree(scaledAlpha); + } } //--- arbitrary transform @@ -6922,9 +6851,9 @@ ImageScaler *Splash::getImageScaler(GString *imageTag, } else { lineSize = -1; } - imageCache->colorData = (Guchar *)gmallocn64(scaledHeight, lineSize); + imageCache->colorData = (Guchar *)gmallocn(scaledHeight, lineSize); if (srcAlpha) { - imageCache->alphaData = (Guchar *)gmallocn64(scaledHeight, scaledWidth); + imageCache->alphaData = (Guchar *)gmallocn(scaledHeight, scaledWidth); } return new SavingImageScaler(src, srcData, w, h, nComps, srcAlpha, @@ -6965,9 +6894,9 @@ void Splash::getScaledImage(GString *imageTag, } else { lineSize = -1; } - *scaledColor = (Guchar *)gmallocn64(scaledHeight, lineSize); + *scaledColor = (Guchar *)gmallocn(scaledHeight, lineSize); if (srcAlpha) { - *scaledAlpha = (Guchar *)gmallocn64(scaledHeight, scaledWidth); + *scaledAlpha = (Guchar *)gmallocn(scaledHeight, scaledWidth); } else { *scaledAlpha = NULL; } @@ -7009,9 +6938,9 @@ void Splash::getScaledImage(GString *imageTag, } else { lineSize = -1; } - imageCache->colorData = (Guchar *)gmallocn64(scaledHeight, lineSize); + imageCache->colorData = (Guchar *)gmallocn(scaledHeight, lineSize); if (srcAlpha) { - imageCache->alphaData = (Guchar *)gmallocn64(scaledHeight, scaledWidth); + imageCache->alphaData = (Guchar *)gmallocn(scaledHeight, scaledWidth); } if (scaledWidth == w && scaledHeight == h) { Guchar *colorPtr = imageCache->colorData; @@ -7092,15 +7021,13 @@ void Splash::drawImageArbitraryNoInterp(Guchar *scaledColor, + (SplashCoord)y * invMat[3] + invMat[5]); if (xx >= 0 && xx < scaledWidth && yy >= 0 && yy < scaledHeight) { - Guchar *p = scaledColor + - (yy * (SplashBitmapRowSize)scaledWidth + xx) * nComps; + Guchar *p = scaledColor + (yy * scaledWidth + xx) * nComps; Guchar *q = colorBuf + (x - xMin) * nComps; for (int i = 0; i < nComps; ++i) { *q++ = *p++; } if (srcAlpha) { - alphaBuf[x - xMin] = - scaledAlpha[yy * (SplashBitmapRowSize)scaledWidth + xx]; + alphaBuf[x - xMin] = scaledAlpha[yy * scaledWidth + xx]; } if (x < rowMin) { rowMin = x; @@ -7184,24 +7111,20 @@ void Splash::drawImageArbitraryInterp(Guchar *scaledColor, Guchar *scaledAlpha, if (y1 >= scaledHeight) { y1 = scaledHeight - 1; } - Guchar *p00 = scaledColor + - (y0 * (SplashBitmapRowSize)scaledWidth + x0) * nComps; - Guchar *p10 = scaledColor + - (y0 * (SplashBitmapRowSize)scaledWidth + x1) * nComps; - Guchar *p01 = scaledColor + - (y1 * (SplashBitmapRowSize)scaledWidth + x0) * nComps; - Guchar *p11 = scaledColor + - (y1 * (SplashBitmapRowSize)scaledWidth + x1) * nComps; + Guchar *p00 = scaledColor + (y0 * scaledWidth + x0) * nComps; + Guchar *p10 = scaledColor + (y0 * scaledWidth + x1) * nComps; + Guchar *p01 = scaledColor + (y1 * scaledWidth + x0) * nComps; + Guchar *p11 = scaledColor + (y1 * scaledWidth + x1) * nComps; Guchar *q = colorBuf + (x - xMin) * nComps; for (int i = 0; i < nComps; ++i) { *q++ = (Guchar)(int)(sx0 * (sy0 * (int)*p00++ + sy1 * (int)*p01++) + sx1 * (sy0 * (int)*p10++ + sy1 * (int)*p11++)); } if (srcAlpha) { - p00 = scaledAlpha + (y0 * (SplashBitmapRowSize)scaledWidth + x0); - p10 = scaledAlpha + (y0 * (SplashBitmapRowSize)scaledWidth + x1); - p01 = scaledAlpha + (y1 * (SplashBitmapRowSize)scaledWidth + x0); - p11 = scaledAlpha + (y1 * (SplashBitmapRowSize)scaledWidth + x1); + p00 = scaledAlpha + (y0 * scaledWidth + x0); + p10 = scaledAlpha + (y0 * scaledWidth + x1); + p01 = scaledAlpha + (y1 * scaledWidth + x0); + p11 = scaledAlpha + (y1 * scaledWidth + x1); q = alphaBuf + (x - xMin); *q = (Guchar)(int)(sx0 * (sy0 * (int)*p00 + sy1 * (int)*p01) + sx1 * (sy0 * (int)*p10 + sy1 * (int)*p11)); diff --git a/Build/source/libs/xpdf/xpdf-src/splash/Splash.h b/Build/source/libs/xpdf/xpdf-src/splash/Splash.h index f79a948e045..9622b07fc27 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/Splash.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/Splash.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" #include "SplashClip.h" @@ -421,7 +425,7 @@ private: SplashError fillWithPattern(SplashPath *path, GBool eo, SplashPattern *pattern, SplashCoord alpha); SplashPath *tweakFillPath(SplashPath *path); - GBool pathAllOutside(SplashPath *path, GBool stroke); + GBool pathAllOutside(SplashPath *path); SplashError fillGlyph2(int x0, int y0, SplashGlyphBitmap *glyph); void getImageBounds(SplashCoord xyMin, SplashCoord xyMax, int *xyMinI, int *xyMaxI); diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc index 3870f7a4808..db341d7c733 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <limits.h> #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h index db9f2f4b2cb..54975a377a2 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <stdio.h> #include <limits.h> // older compilers won't define SIZE_MAX in stdint.h without this diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc index 4b491aa019d..bf7b802cf0d 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #include "gmem.h" @@ -206,7 +210,7 @@ SplashError SplashClip::clipToPath(SplashPath *path, SplashCoord *matrix, xPath = new SplashXPath(path, matrix, flatness, gTrue, enablePathSimplification, - strokeAdjust, NULL); + strokeAdjust); // check for an empty path if (xPath->length == 0) { diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h index 093c65c12c4..fb86ed8fd72 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashClip.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" #include "SplashMath.h" @@ -96,9 +100,6 @@ public: // Get the number of arbitrary paths used by the clip region. int getNumPaths(); - // Return true if the clip path is a simple rectangle. - GBool getIsSimple() { return isSimple; } - private: SplashClip(SplashClip *clip); @@ -109,11 +110,10 @@ private: hardXMax, hardYMax; // [hardXMin, hardXMax), [hardYMin, hardYMax) SplashCoord xMin, yMin, // current clip bounding rectangle - xMax, yMax; - - int xMinI, yMinI, // integer clip bounding rectangle - xMaxI, yMaxI; // (these coordinates are adjusted if + xMax, yMax; // (these coordinates may be adjusted if // stroke adjustment is enabled) + + int xMinI, yMinI, xMaxI, yMaxI; GBool intBoundsValid; // true if xMinI, etc. are valid GBool intBoundsStrokeAdjust; // value of strokeAdjust used to compute // xMinI, etc. diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc index 79849e63cfe..91481444bca 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.cc @@ -10,6 +10,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <ft2build.h> #include FT_OUTLINE_H #include FT_SIZES_H diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h index f7254b23d9f..ac08b007747 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFont.h @@ -13,6 +13,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <ft2build.h> #include FT_FREETYPE_H #include "SplashFont.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc index 4b995869f24..33939541051 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc @@ -10,6 +10,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #ifndef _WIN32 # include <unistd.h> diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h index e6612e13a18..24db3c6cdba 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h @@ -13,6 +13,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <ft2build.h> #include FT_FREETYPE_H #include "gtypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc index b76e5430aef..b5fd02af4a0 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc @@ -10,6 +10,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmem.h" #include "gmempp.h" #include "GString.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h index 3720d0501ac..3a6b9b7aa43 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h @@ -13,6 +13,10 @@ #if HAVE_FREETYPE_H +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <ft2build.h> #include FT_FREETYPE_H #include "SplashFontFile.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc index eb02c67664c..2fcd83d1266 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <string.h> #include "gmem.h" #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h index 3612924a6a4..2bb96545867 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFont.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "SplashTypes.h" #include "SplashMath.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc index 70338a84666..81afe0cd914 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <stdio.h> #ifndef _WIN32 diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h index 99d7b1b2b94..59adb95858a 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontEngine.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" class GString; class GList; diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc index 8d846a9376a..2d260e38239 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #ifndef _WIN32 # include <unistd.h> diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h index 72c51b84014..133e6ab87dc 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFile.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "SplashTypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc index 2c03cf10e83..27f52031d50 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmempp.h" #include "SplashFontFileID.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h index c4a0d7efa9d..384018a2f3a 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashFontFileID.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc index ff993d5a8ac..792166715e5 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <string.h> #include "gmem.h" #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h index 648b3208073..b5732b8b408 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPath.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc index 344a449830e..0c5b5093fd5 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmempp.h" #include "SplashMath.h" #include "SplashScreen.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h index 45a9dcdc6ba..fcbe21d31cb 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashPattern.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" class SplashScreen; diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc index 04286836cc2..9993edc2a38 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #if HAVE_STD_SORT diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h index 9edf8e88e7a..560e2759d82 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashScreen.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc index e0139fda393..7fc510439b1 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <string.h> #include "gmem.h" #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h index 695db28b610..be64b472333 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashState.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" class SplashPattern; diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc index 72e8afd4706..4c77765723e 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #if HAVE_STD_SORT @@ -17,7 +21,6 @@ #include "gmempp.h" #include "SplashMath.h" #include "SplashPath.h" -#include "SplashClip.h" #include "SplashXPath.h" //------------------------------------------------------------------------ @@ -80,8 +83,7 @@ void SplashXPath::clampCoords(SplashCoord *x, SplashCoord *y) { SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix, SplashCoord flatness, GBool closeSubpaths, GBool simplify, - SplashStrokeAdjustMode strokeAdjMode, - SplashClip *clip) { + SplashStrokeAdjustMode strokeAdjMode) { SplashXPathPoint *pts; SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xsp, ysp, t; int curSubpath, firstSegInSubpath, i; @@ -97,7 +99,7 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix, //--- do stroke adjustment if (path->hints) { adjusted = strokeAdjust(pts, path->hints, path->hintsLength, - strokeAdjMode, clip); + strokeAdjMode); } else { adjusted = gFalse; } @@ -225,8 +227,7 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord *matrix, GBool SplashXPath::strokeAdjust(SplashXPathPoint *pts, SplashPathHint *hints, int nHints, - SplashStrokeAdjustMode strokeAdjMode, - SplashClip *clip) { + SplashStrokeAdjustMode strokeAdjMode) { SplashXPathAdjust *adjusts, *adjust; SplashPathHint *hint; SplashCoord x0, y0, x1, y1, x2, y2, x3, y3; @@ -237,28 +238,6 @@ GBool SplashXPath::strokeAdjust(SplashXPathPoint *pts, adjusted = gFalse; - // With CAD-mode stroke adjustment, and a simple rectangular clip - // region, stroke-adjusted edges that fall slightly outside the clip - // region are adjusted back inside the clip region. This avoids - // problems with narrow lines in slightly mismatched clip - // rectangles, which appear to be generated somewhat commonly by - // buggy CAD software. (Note: [clip] is NULL when called to build a - // clip path.) - GBool clipTweak = clip && clip->getIsSimple() && - strokeAdjMode == splashStrokeAdjustCAD; - SplashCoord cx0 = 0, cx1 = 0, cy0 = 0, cy1 = 0; - int cxi0 = 0, cxi1 = 0, cyi0 = 0, cyi1 = 0; - if (clipTweak) { - cx0 = clip->getXMin(); - cx1 = clip->getXMax(); - cy0 = clip->getYMin(); - cy1 = clip->getYMax(); - cxi0 = clip->getXMinI(strokeAdjMode); - cxi1 = clip->getXMaxI(strokeAdjMode); - cyi0 = clip->getYMinI(strokeAdjMode); - cyi1 = clip->getYMaxI(strokeAdjMode); - } - // set up the stroke adjustment hints adjusts = (SplashXPathAdjust *)gmallocn(nHints, sizeof(SplashXPathAdjust)); for (i = 0; i < nHints; ++i) { @@ -303,32 +282,6 @@ GBool SplashXPath::strokeAdjust(SplashXPathPoint *pts, adjusts[i].x1a = adj1 - d; adjusts[i].x1b = adj1 + d; splashStrokeAdjust(adj0, adj1, &xi0, &xi1, strokeAdjMode, w); - if (clipTweak) { - SplashCoord c0, c1; - int ci0, ci1; - if (adjusts[i].vert) { - c0 = cx0; - c1 = cx1; - ci0 = cxi0; - ci1 = cxi1; - } else { - c0 = cy0; - c1 = cy1; - ci0 = cyi0; - ci1 = cyi1; - } - if (adj0 < c0 && c0 < adj1 && adj1 < c1 && - adj1 - c0 > (adj1 - adj0) * 0.2 && - xi1 <= ci0) { - xi0 = ci0; - xi1 = xi0 + 1; - } else if (c0 < adj0 && adj0 < c1 && c1 < adj1 && - c1 - adj0 > (adj1 - adj0) * 0.2 && - ci1 < xi0) { - xi0 = ci1; - xi1 = ci1 + 1; - } - } adjusts[i].x0 = (SplashCoord)xi0; // the "minus epsilon" thing here is needed when vector // antialiasing is turned off -- otherwise stroke adjusted lines diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h index 3318866a16e..82d7889c447 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h @@ -11,10 +11,13 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" class SplashPath; -class SplashClip; struct SplashXPathPoint; struct SplashPathHint; @@ -91,8 +94,7 @@ public: // subpaths. SplashXPath(SplashPath *path, SplashCoord *matrix, SplashCoord flatness, GBool closeSubpaths, - GBool simplify, SplashStrokeAdjustMode strokeAdjMode, - SplashClip *clip); + GBool simplify, SplashStrokeAdjustMode strokeAdjMode); // Copy an expanded path. SplashXPath *copy() { return new SplashXPath(this); } @@ -112,8 +114,7 @@ private: SplashCoord *xo, SplashCoord *yo); GBool strokeAdjust(SplashXPathPoint *pts, SplashPathHint *hints, int nHints, - SplashStrokeAdjustMode strokeAdjMode, - SplashClip *clip); + SplashStrokeAdjustMode strokeAdjMode); void grow(int nSegs); void addCurve(SplashCoord x0, SplashCoord y0, SplashCoord x1, SplashCoord y1, diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc index 6477abf85c3..3f167b8b311 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #if HAVE_STD_SORT diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h index decfc50aa7c..39cc0eb022a 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" #include "SplashXPath.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.cc index 33534dafd60..7b2b9855669 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <math.h> #include "gmem.h" @@ -339,12 +343,8 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) { AcroForm *acroForm; AcroFormField *field; Object xfaObj, fieldsObj, annotsObj, annotRef, annotObj, obj1, obj2; - char *touchedObjs; int pageNum, i, j; - touchedObjs = (char *)gmalloc(docA->getXRef()->getNumObjects()); - memset(touchedObjs, 0, docA->getXRef()->getNumObjects()); - // this is the normal case: acroFormObj is a dictionary, as expected if (acroFormObjA->isDict()) { acroForm = new AcroForm(docA, acroFormObjA); @@ -372,12 +372,11 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) { } obj1.free(); delete acroForm; - gfree(touchedObjs); return NULL; } for (i = 0; i < obj1.arrayGetLength(); ++i) { obj1.arrayGetNF(i, &obj2); - acroForm->scanField(&obj2, touchedObjs); + acroForm->scanField(&obj2); obj2.free(); } obj1.free(); @@ -401,7 +400,7 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) { annotRef.fetch(acroForm->doc->getXRef(), &annotObj); if (annotObj.isDict()) { if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) { - acroForm->scanField(&annotRef, touchedObjs); + acroForm->scanField(&annotRef); } obj1.free(); } @@ -432,7 +431,7 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) { annotRef.fetch(acroForm->doc->getXRef(), &annotObj); if (annotObj.isDict()) { if (annotObj.dictLookup("Subtype", &obj1)->isName("Widget")) { - acroForm->scanField(&annotRef, touchedObjs); + acroForm->scanField(&annotRef); } obj1.free(); } @@ -450,8 +449,6 @@ AcroForm *AcroForm::load(PDFDoc *docA, Catalog *catalog, Object *acroFormObjA) { } } - gfree(touchedObjs); - return acroForm; } @@ -515,22 +512,12 @@ int AcroForm::lookupAnnotPage(Object *annotRef) { return 0; } -void AcroForm::scanField(Object *fieldRef, char *touchedObjs) { +void AcroForm::scanField(Object *fieldRef) { AcroFormField *field; Object fieldObj, kidsObj, kidRef, kidObj, subtypeObj; GBool isTerminal; int i; - // check for an object loop - if (fieldRef->isRef()) { - if (fieldRef->getRefNum() < 0 || - fieldRef->getRefNum() >= doc->getXRef()->getNumObjects() || - touchedObjs[fieldRef->getRefNum()]) { - return; - } - touchedObjs[fieldRef->getRefNum()] = 1; - } - fieldRef->fetch(doc->getXRef(), &fieldObj); if (!fieldObj.isDict()) { error(errSyntaxError, -1, "AcroForm field object is wrong type"); @@ -558,7 +545,7 @@ void AcroForm::scanField(Object *fieldRef, char *touchedObjs) { if (!isTerminal) { for (i = 0; !isTerminal && i < kidsObj.arrayGetLength(); ++i) { kidsObj.arrayGetNF(i, &kidRef); - scanField(&kidRef, touchedObjs); + scanField(&kidRef); kidRef.free(); } } @@ -2046,18 +2033,21 @@ void AcroFormField::drawText(GString *text, GString *da, GfxFontDict *fontDict, wMax = dx - 2 * border - 4; +#if 1 //~tmp // this is a kludge that appears to match Adobe's behavior if (height > 15) { topBorder = 5; } else { topBorder = 2; } +#else + topBorder = 5; +#endif // compute font autosize if (fontSize == 0) { for (fontSize = 10; fontSize > 1; --fontSize) { yy = dy - topBorder; - w = 0; i = 0; while (i < text2->getLength()) { getNextLine(text2, i, font, fontSize, wMax, &j, &w, &k); @@ -3193,7 +3183,7 @@ GBool AcroFormField::unicodeStringEqual(Unicode *u, int unicodeLength, return gFalse; } for (int i = 0; i < unicodeLength; ++i) { - if ((Unicode)(s->getChar(i) & 0xff) != u[i]) { + if ((s->getChar(i) & 0xff) != u[i]) { return gFalse; } } @@ -3203,7 +3193,7 @@ GBool AcroFormField::unicodeStringEqual(Unicode *u, int unicodeLength, GBool AcroFormField::unicodeStringEqual(Unicode *u, int unicodeLength, const char *s) { for (int i = 0; i < unicodeLength; ++i) { - if (!s[i] || (Unicode)(s[i] & 0xff) != u[i]) { + if (!s[i] || (s[i] & 0xff) != u[i]) { return gFalse; } } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.h b/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.h index 0e922d17afc..7678d46dbc8 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/AcroForm.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + class TextString; class Gfx; class GfxFont; @@ -43,7 +47,7 @@ private: AcroForm(PDFDoc *docA, Object *acroFormObjA); void buildAnnotPageList(Catalog *catalog); int lookupAnnotPage(Object *annotRef); - void scanField(Object *fieldRef, char *touchedObjs); + void scanField(Object *fieldRef); PDFDoc *doc; Object acroFormObj; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.cc index 465bda6194a..82ef600be73 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.cc @@ -2,15 +2,18 @@ // // Annot.cc // -// Copyright 2000-2022 Glyph & Cog, LLC +// Copyright 2000-2003 Glyph & Cog, LLC // //======================================================================== #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <math.h> -#include <limits.h> #include "gmem.h" #include "gmempp.h" #include "GList.h" @@ -275,8 +278,6 @@ Annot::Annot(PDFDoc *docA, Dict *dict, Ref *refA) { obj3.free(); } else if (obj2.isRef()) { obj2.copy(&appearance); - } else if (obj2.isStream()) { - obj2.copy(&appearance); } obj1.free(); obj2.free(); @@ -305,48 +306,29 @@ Annot::~Annot() { ocObj.free(); } -void Annot::generateAnnotAppearance(Object *annotObj) { +void Annot::generateAnnotAppearance() { Object obj; - appearance.fetch(doc->getXRef(), &obj); - GBool alreadyHaveAppearance = obj.isStream(); - obj.free(); - if (alreadyHaveAppearance) { - return; - } - if (!type || (type->cmp("Line") && - type->cmp("PolyLine") && - type->cmp("Polygon") && - type->cmp("FreeText"))) { - return; - } - - Object annotObj2; - if (!annotObj) { - getObject(&annotObj2); - annotObj = &annotObj2; - } - if (!annotObj->isDict()) { - annotObj2.free(); - return; - } - - if (!type->cmp("Line")) { - generateLineAppearance(annotObj); - } else if (!type->cmp("PolyLine")) { - generatePolyLineAppearance(annotObj); - } else if (!type->cmp("Polygon")) { - generatePolygonAppearance(annotObj); - } else if (!type->cmp("FreeText")) { - generateFreeTextAppearance(annotObj); + appearance.fetch(doc->getXRef(), &obj); + if (!obj.isStream()) { + if (type) { + if (!type->cmp("Line")) { + generateLineAppearance(); + } else if (!type->cmp("PolyLine")) { + generatePolyLineAppearance(); + } else if (!type->cmp("Polygon")) { + generatePolygonAppearance(); + } else if (!type->cmp("FreeText")) { + generateFreeTextAppearance(); + } + } } - - annotObj2.free(); + obj.free(); } //~ this doesn't draw the caption -void Annot::generateLineAppearance(Object *annotObj) { - Object gfxStateDict, appearDict, obj1, obj2; +void Annot::generateLineAppearance() { + Object annotObj, gfxStateDict, appearDict, obj1, obj2; MemStream *appearStream; double x1, y1, x2, y2, dx, dy, len, w; double lx1, ly1, lx2, ly2; @@ -357,10 +339,15 @@ void Annot::generateLineAppearance(Object *annotObj) { AnnotLineEndType lineEnd1, lineEnd2; GBool fill; + if (!getObject(&annotObj)->isDict()) { + annotObj.free(); + return; + } + appearBuf = new GString(); //----- check for transparency - if (annotObj->dictLookup("CA", &obj1)->isNum()) { + if (annotObj.dictLookup("CA", &obj1)->isNum()) { gfxStateDict.initDict(doc->getXRef()); gfxStateDict.dictAdd(copyString("ca"), obj1.copy(&obj2)); appearBuf->append("/GS1 gs\n"); @@ -371,7 +358,7 @@ void Annot::generateLineAppearance(Object *annotObj) { setLineStyle(borderStyle, &w); setStrokeColor(borderStyle->getColor(), borderStyle->getNumColorComps()); fill = gFalse; - if (annotObj->dictLookup("IC", &obj1)->isArray()) { + if (annotObj.dictLookup("IC", &obj1)->isArray()) { if (setFillColor(&obj1)) { fill = gTrue; } @@ -379,14 +366,14 @@ void Annot::generateLineAppearance(Object *annotObj) { obj1.free(); //----- get line properties - if (annotObj->dictLookup("L", &obj1)->isArray() && + if (annotObj.dictLookup("L", &obj1)->isArray() && obj1.arrayGetLength() == 4) { if (obj1.arrayGet(0, &obj2)->isNum()) { x1 = obj2.getNum(); } else { obj2.free(); obj1.free(); - return; + goto err1; } obj2.free(); if (obj1.arrayGet(1, &obj2)->isNum()) { @@ -394,7 +381,7 @@ void Annot::generateLineAppearance(Object *annotObj) { } else { obj2.free(); obj1.free(); - return; + goto err1; } obj2.free(); if (obj1.arrayGet(2, &obj2)->isNum()) { @@ -402,7 +389,7 @@ void Annot::generateLineAppearance(Object *annotObj) { } else { obj2.free(); obj1.free(); - return; + goto err1; } obj2.free(); if (obj1.arrayGet(3, &obj2)->isNum()) { @@ -410,16 +397,16 @@ void Annot::generateLineAppearance(Object *annotObj) { } else { obj2.free(); obj1.free(); - return; + goto err1; } obj2.free(); } else { obj1.free(); - return; + goto err1; } obj1.free(); lineEnd1 = lineEnd2 = annotLineEndNone; - if (annotObj->dictLookup("LE", &obj1)->isArray() && + if (annotObj.dictLookup("LE", &obj1)->isArray() && obj1.arrayGetLength() == 2) { lineEnd1 = parseLineEndType(obj1.arrayGet(0, &obj2)); obj2.free(); @@ -427,19 +414,19 @@ void Annot::generateLineAppearance(Object *annotObj) { obj2.free(); } obj1.free(); - if (annotObj->dictLookup("LL", &obj1)->isNum()) { + if (annotObj.dictLookup("LL", &obj1)->isNum()) { leaderLen = obj1.getNum(); } else { leaderLen = 0; } obj1.free(); - if (annotObj->dictLookup("LLE", &obj1)->isNum()) { + if (annotObj.dictLookup("LLE", &obj1)->isNum()) { leaderExtLen = obj1.getNum(); } else { leaderExtLen = 0; } obj1.free(); - if (annotObj->dictLookup("LLO", &obj1)->isNum()) { + if (annotObj.dictLookup("LLO", &obj1)->isNum()) { leaderOffLen = obj1.getNum(); } else { leaderOffLen = 0; @@ -526,19 +513,27 @@ void Annot::generateLineAppearance(Object *annotObj) { appearBuf->getLength(), &appearDict); appearance.free(); appearance.initStream(appearStream); + + err1: + annotObj.free(); } //~ this doesn't handle line ends (arrows) -void Annot::generatePolyLineAppearance(Object *annotObj) { - Object gfxStateDict, appearDict, obj1, obj2; +void Annot::generatePolyLineAppearance() { + Object annotObj, gfxStateDict, appearDict, obj1, obj2; MemStream *appearStream; double x1, y1, w; int i; + if (!getObject(&annotObj)->isDict()) { + annotObj.free(); + return; + } + appearBuf = new GString(); //----- check for transparency - if (annotObj->dictLookup("CA", &obj1)->isNum()) { + if (annotObj.dictLookup("CA", &obj1)->isNum()) { gfxStateDict.initDict(doc->getXRef()); gfxStateDict.dictAdd(copyString("ca"), obj1.copy(&obj2)); appearBuf->append("/GS1 gs\n"); @@ -549,7 +544,7 @@ void Annot::generatePolyLineAppearance(Object *annotObj) { setLineStyle(borderStyle, &w); setStrokeColor(borderStyle->getColor(), borderStyle->getNumColorComps()); // fill = gFalse; - // if (annotObj->dictLookup("IC", &obj1)->isArray()) { + // if (annotObj.dictLookup("IC", &obj1)->isArray()) { // if (setFillColor(&obj1)) { // fill = gTrue; // } @@ -557,22 +552,22 @@ void Annot::generatePolyLineAppearance(Object *annotObj) { // obj1.free(); //----- draw line - if (!annotObj->dictLookup("Vertices", &obj1)->isArray()) { + if (!annotObj.dictLookup("Vertices", &obj1)->isArray()) { obj1.free(); - return; + goto err1; } for (i = 0; i+1 < obj1.arrayGetLength(); i += 2) { if (!obj1.arrayGet(i, &obj2)->isNum()) { obj2.free(); obj1.free(); - return; + goto err1; } x1 = obj2.getNum(); obj2.free(); if (!obj1.arrayGet(i+1, &obj2)->isNum()) { obj2.free(); obj1.free(); - return; + goto err1; } y1 = obj2.getNum(); obj2.free(); @@ -611,18 +606,26 @@ void Annot::generatePolyLineAppearance(Object *annotObj) { appearBuf->getLength(), &appearDict); appearance.free(); appearance.initStream(appearStream); + + err1: + annotObj.free(); } -void Annot::generatePolygonAppearance(Object *annotObj) { - Object gfxStateDict, appearDict, obj1, obj2; +void Annot::generatePolygonAppearance() { + Object annotObj, gfxStateDict, appearDict, obj1, obj2; MemStream *appearStream; double x1, y1; int i; + if (!getObject(&annotObj)->isDict()) { + annotObj.free(); + return; + } + appearBuf = new GString(); //----- check for transparency - if (annotObj->dictLookup("CA", &obj1)->isNum()) { + if (annotObj.dictLookup("CA", &obj1)->isNum()) { gfxStateDict.initDict(doc->getXRef()); gfxStateDict.dictAdd(copyString("ca"), obj1.copy(&obj2)); appearBuf->append("/GS1 gs\n"); @@ -630,30 +633,30 @@ void Annot::generatePolygonAppearance(Object *annotObj) { obj1.free(); //----- set fill color - if (!annotObj->dictLookup("IC", &obj1)->isArray() || + if (!annotObj.dictLookup("IC", &obj1)->isArray() || !setFillColor(&obj1)) { obj1.free(); - return; + goto err1; } obj1.free(); //----- fill polygon - if (!annotObj->dictLookup("Vertices", &obj1)->isArray()) { + if (!annotObj.dictLookup("Vertices", &obj1)->isArray()) { obj1.free(); - return; + goto err1; } for (i = 0; i+1 < obj1.arrayGetLength(); i += 2) { if (!obj1.arrayGet(i, &obj2)->isNum()) { obj2.free(); obj1.free(); - return; + goto err1; } x1 = obj2.getNum(); obj2.free(); if (!obj1.arrayGet(i+1, &obj2)->isNum()) { obj2.free(); obj1.free(); - return; + goto err1; } y1 = obj2.getNum(); obj2.free(); @@ -692,23 +695,31 @@ void Annot::generatePolygonAppearance(Object *annotObj) { appearBuf->getLength(), &appearDict); appearance.free(); appearance.initStream(appearStream); + + err1: + annotObj.free(); } //~ this doesn't handle rich text //~ this doesn't handle the callout //~ this doesn't handle the RD field -void Annot::generateFreeTextAppearance(Object *annotObj) { - Object gfxStateDict, appearDict, obj1, obj2; +void Annot::generateFreeTextAppearance() { + Object annotObj, gfxStateDict, appearDict, obj1, obj2; Object resources, gsResources, fontResources, defaultFont; GString *text, *da; double lineWidth; int quadding, rot; MemStream *appearStream; + if (!getObject(&annotObj)->isDict()) { + annotObj.free(); + return; + } + appearBuf = new GString(); //----- check for transparency - if (annotObj->dictLookup("CA", &obj1)->isNum()) { + if (annotObj.dictLookup("CA", &obj1)->isNum()) { gfxStateDict.initDict(doc->getXRef()); gfxStateDict.dictAdd(copyString("ca"), obj1.copy(&obj2)); appearBuf->append("/GS1 gs\n"); @@ -716,19 +727,19 @@ void Annot::generateFreeTextAppearance(Object *annotObj) { obj1.free(); //----- draw the text - if (annotObj->dictLookup("Contents", &obj1)->isString()) { + if (annotObj.dictLookup("Contents", &obj1)->isString()) { text = obj1.getString()->copy(); } else { text = new GString(); } obj1.free(); - if (annotObj->dictLookup("Q", &obj1)->isInt()) { + if (annotObj.dictLookup("Q", &obj1)->isInt()) { quadding = obj1.getInt(); } else { quadding = 0; } obj1.free(); - if (annotObj->dictLookup("DA", &obj1)->isString()) { + if (annotObj.dictLookup("DA", &obj1)->isString()) { da = obj1.getString()->copy(); } else { da = new GString(); @@ -736,7 +747,7 @@ void Annot::generateFreeTextAppearance(Object *annotObj) { obj1.free(); // the "Rotate" field is not defined in the PDF spec, but Acrobat // looks at it - if (annotObj->dictLookup("Rotate", &obj1)->isInt()) { + if (annotObj.dictLookup("Rotate", &obj1)->isInt()) { rot = obj1.getInt(); } else { rot = 0; @@ -786,6 +797,8 @@ void Annot::generateFreeTextAppearance(Object *annotObj) { appearBuf->getLength(), &appearDict); appearance.free(); appearance.initStream(appearStream); + + annotObj.free(); } void Annot::setLineStyle(AnnotBorderStyle *bs, double *lineWidth) { @@ -1331,192 +1344,105 @@ Object *Annot::getObject(Object *obj) { } //------------------------------------------------------------------------ -// PageAnnots -//------------------------------------------------------------------------ - -class PageAnnots { -public: - - PageAnnots(); - ~PageAnnots(); - - GList *annots; // list of annots on the page [Annot] - GBool appearancesGenerated; // set after appearances have been generated -}; - -PageAnnots::PageAnnots() { - annots = new GList(); - appearancesGenerated = gFalse; -} - -PageAnnots::~PageAnnots() { - deleteGList(annots, Annot); -} - -//------------------------------------------------------------------------ // Annots //------------------------------------------------------------------------ -Annots::Annots(PDFDoc *docA) { - doc = docA; - pageAnnots = (PageAnnots **)gmallocn(doc->getNumPages(), sizeof(PageAnnots*)); - for (int page = 1; page <= doc->getNumPages(); ++page) { - pageAnnots[page - 1] = NULL; - } - formFieldRefsSize = 0; - formFieldRefs = NULL; -} - -Annots::~Annots() { - for (int page = 1; page <= doc->getNumPages(); ++page) { - delete pageAnnots[page - 1]; - } - gfree(pageAnnots); - gfree(formFieldRefs); -} - -void Annots::loadAnnots(int page) { - if (pageAnnots[page - 1]) { - return; - } - - pageAnnots[page - 1] = new PageAnnots(); - - Object annotsObj; - doc->getCatalog()->getPage(page)->getAnnots(&annotsObj); - if (!annotsObj.isArray()) { - annotsObj.free(); - return; - } - - loadFormFieldRefs(); - - for (int i = 0; i < annotsObj.arrayGetLength(); ++i) { - Object annotObj; - Ref annotRef; - if (annotsObj.arrayGetNF(i, &annotObj)->isRef()) { - annotRef = annotObj.getRef(); - annotObj.free(); - annotsObj.arrayGet(i, &annotObj); - } else { - annotRef.num = annotRef.gen = -1; - } - if (!annotObj.isDict()) { - annotObj.free(); - continue; - } - - // skip any annotations which are used as AcroForm fields -- - // they'll be rendered by the AcroForm module - if (annotRef.num >= 0 && annotRef.num < formFieldRefsSize && - formFieldRefs[annotRef.num]) { - annotObj.free(); - continue; - } - - Annot *annot = new Annot(doc, annotObj.getDict(), &annotRef); - annotObj.free(); - if (annot->isOk()) { - pageAnnots[page - 1]->annots->append(annot); - } else { - delete annot; - } - } - - annotsObj.free(); -} - -// Build a set of object refs for AcroForm fields. -void Annots::loadFormFieldRefs() { - if (formFieldRefs) { - return; - } - - AcroForm *form = doc->getCatalog()->getForm(); - if (!form) { - return; - } +Annots::Annots(PDFDoc *docA, Object *annotsObj) { + Annot *annot; + Object obj1, obj2; + Ref ref; + GBool drawWidgetAnnots; + int size; + int i; - int newFormFieldRefsSize = 256; - for (int i = 0; i < form->getNumFields(); ++i) { - AcroFormField *field = form->getField(i); - Object fieldRef; - field->getFieldRef(&fieldRef); - if (fieldRef.getRefNum() >= formFieldRefsSize) { - while (fieldRef.getRefNum() >= newFormFieldRefsSize && - newFormFieldRefsSize <= INT_MAX / 2) { - newFormFieldRefsSize *= 2; - } - if (fieldRef.getRefNum() >= newFormFieldRefsSize) { - continue; + doc = docA; + annots = NULL; + size = 0; + nAnnots = 0; + + if (annotsObj->isArray()) { + // Kludge: some PDF files define an empty AcroForm, but still + // include Widget-type annotations -- in that case, we want to + // draw the widgets (since the form code won't). This really + // ought to look for Widget-type annotations that are not included + // in any form field. + drawWidgetAnnots = !doc->getCatalog()->getForm() || + doc->getCatalog()->getForm()->getNumFields() == 0; + for (i = 0; i < annotsObj->arrayGetLength(); ++i) { + if (annotsObj->arrayGetNF(i, &obj1)->isRef()) { + ref = obj1.getRef(); + obj1.free(); + annotsObj->arrayGet(i, &obj1); + } else { + ref.num = ref.gen = -1; } - formFieldRefs = (char *)grealloc(formFieldRefs, newFormFieldRefsSize); - for (int j = formFieldRefsSize; j < newFormFieldRefsSize; ++j) { - formFieldRefs[j] = (char)0; + if (obj1.isDict()) { + if (drawWidgetAnnots || + !obj1.dictLookup("Subtype", &obj2)->isName("Widget")) { + annot = new Annot(doc, obj1.getDict(), &ref); + if (annot->isOk()) { + if (nAnnots >= size) { + size += 16; + annots = (Annot **)greallocn(annots, size, sizeof(Annot *)); + } + annots[nAnnots++] = annot; + } else { + delete annot; + } + } + obj2.free(); } - formFieldRefsSize = newFormFieldRefsSize; + obj1.free(); } - formFieldRefs[fieldRef.getRefNum()] = (char)1; - fieldRef.free(); } } -int Annots::getNumAnnots(int page) { - loadAnnots(page); - return pageAnnots[page - 1]->annots->getLength(); -} +Annots::~Annots() { + int i; -Annot *Annots::getAnnot(int page, int idx) { - loadAnnots(page); - return (Annot *)pageAnnots[page - 1]->annots->get(idx); + for (i = 0; i < nAnnots; ++i) { + delete annots[i]; + } + gfree(annots); } -Annot *Annots::find(int page, double x, double y) { - loadAnnots(page); - PageAnnots *pa = pageAnnots[page - 1]; - for (int i = pa->annots->getLength() - 1; i >= 0; --i) { - Annot *annot = (Annot *)pa->annots->get(i); - if (annot->inRect(x, y)) { - return annot; +Annot *Annots::find(double x, double y) { + int i; + + for (i = nAnnots - 1; i >= 0; --i) { + if (annots[i]->inRect(x, y)) { + return annots[i]; } } return NULL; } -int Annots::findIdx(int page, double x, double y) { - loadAnnots(page); - PageAnnots *pa = pageAnnots[page - 1]; - for (int i = pa->annots->getLength() - 1; i >= 0; --i) { - Annot *annot = (Annot *)pa->annots->get(i); - if (annot->inRect(x, y)) { +int Annots::findIdx(double x, double y) { + int i; + + for (i = nAnnots - 1; i >= 0; --i) { + if (annots[i]->inRect(x, y)) { return i; } } return -1; } -void Annots::add(int page, Object *annotObj) { - if (!annotObj->isDict()) { - return; - } - Ref annotRef = {-1, -1}; - Annot *annot = new Annot(doc, annotObj->getDict(), &annotRef); - if (annot->isOk()) { - annot->generateAnnotAppearance(annotObj); - pageAnnots[page - 1]->annots->append(annot); - } else { - delete annot; +void Annots::generateAnnotAppearances() { + int i; + + for (i = 0; i < nAnnots; ++i) { + annots[i]->generateAnnotAppearance(); } } -void Annots::generateAnnotAppearances(int page) { - loadAnnots(page); - PageAnnots *pa = pageAnnots[page - 1]; - if (!pa->appearancesGenerated) { - for (int i = 0; i < pa->annots->getLength(); ++i) { - Annot *annot = (Annot *)pa->annots->get(i); - annot->generateAnnotAppearance(NULL); +Annot *Annots::findAnnot(Ref *ref) { + int i; + + for (i = 0; i < nAnnots; ++i) { + if (annots[i]->match(ref)) { + return annots[i]; } - pa->appearancesGenerated = gTrue; } + return NULL; } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.h index 168061fc262..6ba5ff490da 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Annot.h @@ -2,7 +2,7 @@ // // Annot.h // -// Copyright 2000-2022 Glyph & Cog, LLC +// Copyright 2000-2003 Glyph & Cog, LLC // //======================================================================== @@ -11,12 +11,15 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + class XRef; class Catalog; class Gfx; class GfxFontDict; class PDFDoc; -class PageAnnots; //------------------------------------------------------------------------ // AnnotBorderStyle @@ -102,14 +105,14 @@ public: GBool match(Ref *refA) { return ref.num == refA->num && ref.gen == refA->gen; } - void generateAnnotAppearance(Object *annotObj); + void generateAnnotAppearance(); private: - void generateLineAppearance(Object *annotObj); - void generatePolyLineAppearance(Object *annotObj); - void generatePolygonAppearance(Object *annotObj); - void generateFreeTextAppearance(Object *annotObj); + void generateLineAppearance(); + void generatePolyLineAppearance(); + void generatePolygonAppearance(); + void generateFreeTextAppearance(); void setLineStyle(AnnotBorderStyle *bs, double *lineWidth); void setStrokeColor(double *color, int nComps); GBool setFillColor(Object *colorObj); @@ -149,35 +152,34 @@ private: class Annots { public: - Annots(PDFDoc *docA); + // Build a list of Annot objects. + Annots(PDFDoc *docA, Object *annotsObj); ~Annots(); - // Iterate over annotations on a specific page. - int getNumAnnots(int page); - Annot *getAnnot(int page, int idx); + // Iterate through list of annotations. + int getNumAnnots() { return nAnnots; } + Annot *getAnnot(int i) { return annots[i]; } - // If point (<x>,<y>) is in an annotation, return the associated - // annotation (or annotation index); else return NULL (or -1). - Annot *find(int page, double x, double y); - int findIdx(int page, double x, double y); - - // Add an annotation [annotObj] on page [page]. - void add(int page, Object *annotObj); + // If point <x>,<y> is in an annotation, return the associated + // annotation; else return NULL. + Annot *find(double x, double y); + int findIdx(double x, double y); // Generate an appearance stream for any non-form-field annotation - // on the specified page that is missing an appearance. - void generateAnnotAppearances(int page); + // that is missing it. + void generateAnnotAppearances(); private: - void loadAnnots(int page); - void loadFormFieldRefs(); + void scanFieldAppearances(Dict *node, Ref *ref, Dict *parent, + Dict *acroForm); + + Annot *findAnnot(Ref *ref); PDFDoc *doc; - PageAnnots **pageAnnots; // list of annots for each page - int formFieldRefsSize; // number of entries in formFieldRefs[] - char *formFieldRefs; // set of AcroForm field refs + Annot **annots; + int nAnnots; }; #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Array.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Array.cc index 2771186152a..2bf948ec65c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Array.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Array.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <stddef.h> #include "gmem.h" @@ -49,7 +53,7 @@ void Array::add(Object *elem) { Object *Array::get(int i, Object *obj, int recursion) { if (i < 0 || i >= length) { -#ifdef DEBUG_OBJECT_MEM +#ifdef DEBUG_MEM abort(); #else return obj->initNull(); @@ -60,7 +64,7 @@ Object *Array::get(int i, Object *obj, int recursion) { Object *Array::getNF(int i, Object *obj) { if (i < 0 || i >= length) { -#ifdef DEBUG_OBJECT_MEM +#ifdef DEBUG_MEM abort(); #else return obj->initNull(); diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Array.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Array.h index 9a887f41e46..8d10eadc8dd 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Array.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Array.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #if MULTITHREADED #include "GMutex.h" #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.cc index 51c2d33b3f9..d2f875e45fd 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h b/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h index 042e4e0d634..f24cbf98f9f 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" struct BuiltinFont; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.cc index c898ac5737d..12632c5992c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.h b/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.h index 5731ef09f01..55692b4f337 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/CMap.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "CharTypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc index 7a9b0701ca3..ddcbad55f07 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <string.h> #include <stddef.h> #include <limits.h> @@ -522,10 +526,7 @@ GBool Catalog::readPageTree(Object *catDict) { // because other code tries to fetch pages 1 through n. // In both cases: ignore the given page count and scan the tree // instead. - char *touchedObjs = (char *)gmalloc(xref->getNumObjects()); - memset(touchedObjs, 0, xref->getNumObjects()); - numPages = countPageTree(&topPagesRef, touchedObjs); - gfree(touchedObjs); + numPages = countPageTree(&topPagesObj); } } else { // assume we got a Page node instead of a Pages node @@ -552,53 +553,30 @@ GBool Catalog::readPageTree(Object *catDict) { return gTrue; } -int Catalog::countPageTree(Object *pagesNodeRef, char *touchedObjs) { - // check for invalid reference - if (pagesNodeRef->isRef() && - (pagesNodeRef->getRefNum() < 0 || - pagesNodeRef->getRefNum() >= xref->getNumObjects())) { +int Catalog::countPageTree(Object *pagesObj) { + Object kids, kid; + int n, n2, i; + + if (!pagesObj->isDict()) { return 0; } - - // check for a page tree loop; fetch the node object - Object pagesNode; - if (pagesNodeRef->isRef()) { - if (touchedObjs[pagesNodeRef->getRefNum()]) { - error(errSyntaxError, -1, "Loop in Pages tree"); - return 0; - } - touchedObjs[pagesNodeRef->getRefNum()] = 1; - xref->fetch(pagesNodeRef->getRefNum(), pagesNodeRef->getRefGen(), - &pagesNode); - } else { - pagesNodeRef->copy(&pagesNode); - } - - // count the subtree - int n = 0; - if (pagesNode.isDict()) { - Object kids; - if (pagesNode.dictLookup("Kids", &kids)->isArray()) { - for (int i = 0; i < kids.arrayGetLength(); ++i) { - Object kid; - kids.arrayGetNF(i, &kid); - int n2 = countPageTree(&kid, touchedObjs); - if (n2 < INT_MAX - n) { - n += n2; - } else { - error(errSyntaxError, -1, "Page tree contains too many pages"); - n = INT_MAX; - } - kid.free(); + if (pagesObj->dictLookup("Kids", &kids)->isArray()) { + n = 0; + for (i = 0; i < kids.arrayGetLength(); ++i) { + kids.arrayGet(i, &kid); + n2 = countPageTree(&kid); + if (n2 < INT_MAX - n) { + n += n2; + } else { + error(errSyntaxError, -1, "Page tree contains too many pages"); + n = INT_MAX; } - } else { - n = 1; + kid.free(); } - kids.free(); + } else { + n = 1; } - - pagesNode.free(); - + kids.free(); return n; } @@ -760,55 +738,37 @@ void Catalog::readEmbeddedFileList(Dict *catDict) { Object obj1, obj2; char *touchedObjs; - touchedObjs = (char *)gmalloc(xref->getNumObjects()); - memset(touchedObjs, 0, xref->getNumObjects()); - // read the embedded file name tree if (catDict->lookup("Names", &obj1)->isDict()) { - obj1.dictLookupNF("EmbeddedFiles", &obj2); - readEmbeddedFileTree(&obj2, touchedObjs); + if (obj1.dictLookup("EmbeddedFiles", &obj2)->isDict()) { + readEmbeddedFileTree(&obj2); + } obj2.free(); } obj1.free(); // look for file attachment annotations + touchedObjs = (char *)gmalloc(xref->getNumObjects()); + memset(touchedObjs, 0, xref->getNumObjects()); readFileAttachmentAnnots(catDict->lookupNF("Pages", &obj1), touchedObjs); obj1.free(); - gfree(touchedObjs); } -void Catalog::readEmbeddedFileTree(Object *nodeRef, char *touchedObjs) { - Object node, kidsObj, kidObj; +void Catalog::readEmbeddedFileTree(Object *node) { + Object kidsObj, kidObj; Object namesObj, nameObj, fileSpecObj; int i; - // check for an object loop - if (nodeRef->isRef()) { - if (nodeRef->getRefNum() < 0 || - nodeRef->getRefNum() >= xref->getNumObjects() || - touchedObjs[nodeRef->getRefNum()]) { - return; - } - touchedObjs[nodeRef->getRefNum()] = 1; - xref->fetch(nodeRef->getRefNum(), nodeRef->getRefGen(), &node); - } else { - nodeRef->copy(&node); - } - - if (!node.isDict()) { - node.free(); - return; - } - - if (node.dictLookup("Kids", &kidsObj)->isArray()) { + if (node->dictLookup("Kids", &kidsObj)->isArray()) { for (i = 0; i < kidsObj.arrayGetLength(); ++i) { - kidsObj.arrayGetNF(i, &kidObj); - readEmbeddedFileTree(&kidObj, touchedObjs); + if (kidsObj.arrayGet(i, &kidObj)->isDict()) { + readEmbeddedFileTree(&kidObj); + } kidObj.free(); } } else { - if (node.dictLookup("Names", &namesObj)->isArray()) { + if (node->dictLookup("Names", &namesObj)->isArray()) { for (i = 0; i+1 < namesObj.arrayGetLength(); ++i) { namesObj.arrayGet(i, &nameObj); namesObj.arrayGet(i+1, &fileSpecObj); @@ -820,8 +780,6 @@ void Catalog::readEmbeddedFileTree(Object *nodeRef, char *touchedObjs) { namesObj.free(); } kidsObj.free(); - - node.free(); } void Catalog::readFileAttachmentAnnots(Object *pageNodeRef, @@ -830,9 +788,8 @@ void Catalog::readFileAttachmentAnnots(Object *pageNodeRef, int i; // check for an invalid object reference (e.g., in a damaged PDF file) - if (pageNodeRef->isRef() && - (pageNodeRef->getRefNum() < 0 || - pageNodeRef->getRefNum() >= xref->getNumObjects())) { + if (pageNodeRef->getRefNum() < 0 || + pageNodeRef->getRefNum() >= xref->getNumObjects()) { return; } @@ -944,14 +901,10 @@ Object *Catalog::getEmbeddedFileStreamObj(int idx, Object *strObj) { void Catalog::readPageLabelTree(Object *root) { PageLabelNode *label0, *label1; - char *touchedObjs; int i; - touchedObjs = (char *)gmalloc(xref->getNumObjects()); - memset(touchedObjs, 0, xref->getNumObjects()); pageLabels = new GList(); - readPageLabelTree2(root, touchedObjs); - gfree(touchedObjs); + readPageLabelTree2(root); if (pageLabels->getLength() == 0) { deleteGList(pageLabels, PageLabelNode); @@ -969,29 +922,15 @@ void Catalog::readPageLabelTree(Object *root) { label0->lastPage = numPages; } -void Catalog::readPageLabelTree2(Object *nodeRef, char *touchedObjs) { - Object node, nums, num, labelObj, kids, kid; +void Catalog::readPageLabelTree2(Object *node) { + Object nums, num, labelObj, kids, kid; int i; - // check for an object loop - if (nodeRef->isRef()) { - if (nodeRef->getRefNum() < 0 || - nodeRef->getRefNum() >= xref->getNumObjects() || - touchedObjs[nodeRef->getRefNum()]) { - return; - } - touchedObjs[nodeRef->getRefNum()] = 1; - xref->fetch(nodeRef->getRefNum(), nodeRef->getRefGen(), &node); - } else { - nodeRef->copy(&node); - } - - if (!node.isDict()) { - node.free(); + if (!node->isDict()) { return; } - if (node.dictLookup("Nums", &nums)->isArray()) { + if (node->dictLookup("Nums", &nums)->isArray()) { for (i = 0; i < nums.arrayGetLength() - 1; i += 2) { if (nums.arrayGet(i, &num)->isInt()) { if (nums.arrayGet(i+1, &labelObj)->isDict()) { @@ -1005,16 +944,14 @@ void Catalog::readPageLabelTree2(Object *nodeRef, char *touchedObjs) { } nums.free(); - if (node.dictLookup("Kids", &kids)->isArray()) { + if (node->dictLookup("Kids", &kids)->isArray()) { for (i = 0; i < kids.arrayGetLength(); ++i) { - kids.arrayGetNF(i, &kid); - readPageLabelTree2(&kid, touchedObjs); + kids.arrayGet(i, &kid); + readPageLabelTree2(&kid); kid.free(); } } kids.free(); - - node.free(); } TextString *Catalog::getPageLabel(int pageNum) { @@ -1258,130 +1195,3 @@ GBool Catalog::convertPageLabelToInt(TextString *pageLabel, int prefixLength, } return gFalse; } - -GBool Catalog::usesJavaScript() { - Object catDict; - if (!xref->getCatalog(&catDict)->isDict()) { - catDict.free(); - return gFalse; - } - - GBool usesJS = gFalse; - - // check for Catalog.Names.JavaScript - Object namesObj; - if (catDict.dictLookup("Names", &namesObj)->isDict()) { - Object jsNamesObj; - namesObj.dictLookup("JavaScript", &jsNamesObj); - if (jsNamesObj.isDict()) { - usesJS = gTrue; - } - jsNamesObj.free(); - } - namesObj.free(); - - // look for JavaScript actionas in Page.AA - if (!usesJS) { - char *touchedObjs = (char *)gmalloc(xref->getNumObjects()); - memset(touchedObjs, 0, xref->getNumObjects()); - Object pagesObj; - usesJS = scanPageTreeForJavaScript(catDict.dictLookupNF("Pages", &pagesObj), - touchedObjs); - pagesObj.free(); - gfree(touchedObjs); - } - - catDict.free(); - - return usesJS; -} - -GBool Catalog::scanPageTreeForJavaScript(Object *pageNodeRef, - char *touchedObjs) { - // check for an invalid object reference (e.g., in a damaged PDF file) - if (pageNodeRef->isRef() && - (pageNodeRef->getRefNum() < 0 || - pageNodeRef->getRefNum() >= xref->getNumObjects())) { - return gFalse; - } - - // check for a page tree loop - Object pageNode; - if (pageNodeRef->isRef()) { - if (touchedObjs[pageNodeRef->getRefNum()]) { - return gFalse; - } - touchedObjs[pageNodeRef->getRefNum()] = 1; - xref->fetch(pageNodeRef->getRefNum(), pageNodeRef->getRefGen(), &pageNode); - } else { - pageNodeRef->copy(&pageNode); - } - - // scan the page tree node - GBool usesJS = gFalse; - if (pageNode.isDict()) { - Object kids; - if (pageNode.dictLookup("Kids", &kids)->isArray()) { - for (int i = 0; i < kids.arrayGetLength() && !usesJS; ++i) { - Object kid; - if (scanPageTreeForJavaScript(kids.arrayGetNF(i, &kid), touchedObjs)) { - usesJS = gTrue; - } - kid.free(); - } - } else { - - // scan Page.AA - Object pageAA; - if (pageNode.dictLookup("AA", &pageAA)->isDict()) { - if (scanAAForJavaScript(&pageAA)) { - usesJS = gTrue; - } - } - pageAA.free(); - - // scanPage.Annots - if (!usesJS) { - Object annots; - if (pageNode.dictLookup("Annots", &annots)->isArray()) { - for (int i = 0; i < annots.arrayGetLength() && !usesJS; ++i) { - Object annot; - if (annots.arrayGet(i, &annot)->isDict()) { - Object annotAA; - if (annot.dictLookup("AA", &annotAA)->isDict()) { - if (scanAAForJavaScript(&annotAA)) { - usesJS = gTrue; - } - } - annotAA.free(); - } - annot.free(); - } - } - annots.free(); - } - } - kids.free(); - } - - pageNode.free(); - - return usesJS; -} - -GBool Catalog::scanAAForJavaScript(Object *aaObj) { - GBool usesJS = gFalse; - for (int i = 0; i < aaObj->dictGetLength() && !usesJS; ++i) { - Object action; - if (aaObj->dictGetVal(i, &action)->isDict()) { - Object js; - if (!action.dictLookupNF("JS", &js)->isNull()) { - usesJS = gTrue; - } - js.free(); - } - action.free(); - } - return usesJS; -} - diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.h index 91597e54137..0acdd2d1574 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #if MULTITHREADED #include "GMutex.h" #endif @@ -114,9 +118,6 @@ public: Object *getViewerPreferences() { return &viewerPrefs; } - // Return true if the document uses JavaScript. - GBool usesJavaScript(); - private: PDFDoc *doc; @@ -145,23 +146,21 @@ private: Object *findDestInTree(Object *tree, GString *name, Object *obj); GBool readPageTree(Object *catDict); - int countPageTree(Object *pagesNodeRef, char *touchedObjs); + int countPageTree(Object *pagesObj); void loadPage(int pg); void loadPage2(int pg, int relPg, PageTreeNode *node); void readEmbeddedFileList(Dict *catDict); - void readEmbeddedFileTree(Object *nodeRef, char *touchedObjs); + void readEmbeddedFileTree(Object *node); void readFileAttachmentAnnots(Object *pageNodeRef, char *touchedObjs); void readEmbeddedFile(Object *fileSpec, Object *name1); void readPageLabelTree(Object *root); - void readPageLabelTree2(Object *node, char *touchedObjs); + void readPageLabelTree2(Object *node); PageLabelNode *findPageLabel(int pageNum); GString *makeRomanNumeral(int num, GBool uppercase); GString *makeLetterLabel(int num, GBool uppercase); GBool convertPageLabelToInt(TextString *pageLabel, int prefixLength, char style, int *n); - GBool scanPageTreeForJavaScript(Object *pageNodeRef, char *touchedObjs); - GBool scanAAForJavaScript(Object *aaObj); }; #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc index 83720069e64..0a2100fde9b 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <string.h> #include "gmem.h" @@ -270,18 +274,7 @@ GBool CharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data, pst = new PSTokenizer(getCharFunc, data); pst->getToken(tok1, sizeof(tok1), &n1); while (pst->getToken(tok2, sizeof(tok2), &n2)) { - if (!strcmp(tok1, "begincodespacerange")) { - if (globalParams->getIgnoreWrongSizeToUnicode() && - tok2[0] == '<' && tok2[n2 - 1] == '>' && - n2 - 2 != nBits / 4) { - error(errSyntaxWarning, -1, - "Incorrect character size in ToUnicode CMap"); - ok = gFalse; - break; - } - while (pst->getToken(tok1, sizeof(tok1), &n1) && - strcmp(tok1, "endcodespacerange")) ; - } else if (!strcmp(tok2, "usecmap")) { + if (!strcmp(tok2, "usecmap")) { if (tok1[0] == '/') { name = new GString(tok1 + 1); if ((f = globalParams->findToUnicodeFile(name))) { @@ -472,7 +465,6 @@ GBool CharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data, pst->getToken(tok1, sizeof(tok1), &n1); } else { strcpy(tok1, tok2); - n1 = n2; } } delete pst; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.h b/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.h index 7bbc97f834e..be9025107aa 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.h @@ -13,6 +13,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "CharTypes.h" #if MULTITHREADED diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.cc index d36626dc344..d4f8d4ec336 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <string.h> #include "gmem.h" #include "gmempp.h" @@ -1488,14 +1492,14 @@ static void sha512(Guchar *msg, int msgLen, Guchar *hash) { SHA512Uint64 H[8]; int blkLen, i; - H[0] = 0x6a09e667f3bcc908ULL; - H[1] = 0xbb67ae8584caa73bULL; - H[2] = 0x3c6ef372fe94f82bULL; - H[3] = 0xa54ff53a5f1d36f1ULL; - H[4] = 0x510e527fade682d1ULL; - H[5] = 0x9b05688c2b3e6c1fULL; - H[6] = 0x1f83d9abfb41bd6bULL; - H[7] = 0x5be0cd19137e2179ULL; + H[0] = 0x6a09e667f3bcc908LL; + H[1] = 0xbb67ae8584caa73bLL; + H[2] = 0x3c6ef372fe94f82bLL; + H[3] = 0xa54ff53a5f1d36f1LL; + H[4] = 0x510e527fade682d1LL; + H[5] = 0x9b05688c2b3e6c1fLL; + H[6] = 0x1f83d9abfb41bd6bLL; + H[7] = 0x5be0cd19137e2179LL; blkLen = 0; for (i = 0; i + 128 <= msgLen; i += 128) { @@ -1554,14 +1558,14 @@ static void sha384(Guchar *msg, int msgLen, Guchar *hash) { SHA512Uint64 H[8]; int blkLen, i; - H[0] = 0xcbbb9d5dc1059ed8ULL; - H[1] = 0x629a292a367cd507ULL; - H[2] = 0x9159015a3070dd17ULL; - H[3] = 0x152fecd8f70e5939ULL; - H[4] = 0x67332667ffc00b31ULL; - H[5] = 0x8eb44a8768581511ULL; - H[6] = 0xdb0c2e0d64f98fa7ULL; - H[7] = 0x47b5481dbefa4fa4ULL; + H[0] = 0xcbbb9d5dc1059ed8LL; + H[1] = 0x629a292a367cd507LL; + H[2] = 0x9159015a3070dd17LL; + H[3] = 0x152fecd8f70e5939LL; + H[4] = 0x67332667ffc00b31LL; + H[5] = 0x8eb44a8768581511LL; + H[6] = 0xdb0c2e0d64f98fa7LL; + H[7] = 0x47b5481dbefa4fa4LL; blkLen = 0; for (i = 0; i + 128 <= msgLen; i += 128) { diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.h index d0f38409109..2b10abd050b 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Decrypt.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "GString.h" #include "Object.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.cc index 71ea377f8a7..c8c29736fe9 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stddef.h> #include <string.h> #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.h index 804fcdf1312..b05f729e0a8 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Dict.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #if MULTITHREADED #include "GMutex.h" #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.cc index f1e8dcffeac..e0d306857ca 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include "gmempp.h" #include "GString.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.h b/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.h index a078c757d33..12c8170f0b3 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/DisplayState.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "SplashTypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Error.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Error.cc index 111f277d3c2..aec27dc5099 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Error.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Error.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <stddef.h> #include <stdarg.h> diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Error.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Error.h index 574330f6446..39e7613e4e6 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Error.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Error.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <stdio.h> #include "config.h" #include "gfile.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Function.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Function.cc index 966a3155c50..82f32b9dd93 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Function.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Function.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <string.h> #include <ctype.h> diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Function.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Function.h index 73c92abe30c..bf1f25e51cc 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Function.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Function.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "Object.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.cc index ea7951a75fc..1539b8404bc 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <stdio.h> #include <stddef.h> @@ -532,7 +536,6 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, int pageNum, Dict *resDict, out = outA; state = new GfxState(hDPI, vDPI, box, rotate, out->upsideDown()); fontChanged = gFalse; - haveSavedClipPath = gFalse; clip = clipNone; ignoreUndef = 0; out->startPage(pageNum, state); @@ -581,7 +584,6 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, Dict *resDict, out = outA; state = new GfxState(72, 72, box, 0, gFalse); fontChanged = gFalse; - haveSavedClipPath = gFalse; clip = clipNone; ignoreUndef = 0; for (i = 0; i < 6; ++i) { @@ -1827,20 +1829,15 @@ void Gfx::opFillStroke(Object args[], int numArgs) { } if (state->isPath()) { if (ocState) { - if (state->getFillColorSpace()->getMode() == csPattern || - state->getStrokeColorSpace()->getMode() == csPattern) { - if (state->getFillColorSpace()->getMode() == csPattern) { - doPatternFill(gFalse); - } else { - out->fill(state); - } - if (state->getStrokeColorSpace()->getMode() == csPattern) { - doPatternStroke(); - } else { - out->stroke(state); - } + if (state->getFillColorSpace()->getMode() == csPattern) { + doPatternFill(gFalse); + } else { + out->fill(state); + } + if (state->getStrokeColorSpace()->getMode() == csPattern) { + doPatternStroke(); } else { - out->fillStroke(state, gFalse); + out->stroke(state); } } } @@ -1855,20 +1852,15 @@ void Gfx::opCloseFillStroke(Object args[], int numArgs) { if (state->isPath()) { state->closePath(); if (ocState) { - if (state->getFillColorSpace()->getMode() == csPattern || - state->getStrokeColorSpace()->getMode() == csPattern) { - if (state->getFillColorSpace()->getMode() == csPattern) { - doPatternFill(gFalse); - } else { - out->fill(state); - } - if (state->getStrokeColorSpace()->getMode() == csPattern) { - doPatternStroke(); - } else { - out->stroke(state); - } + if (state->getFillColorSpace()->getMode() == csPattern) { + doPatternFill(gFalse); } else { - out->fillStroke(state, gFalse); + out->fill(state); + } + if (state->getStrokeColorSpace()->getMode() == csPattern) { + doPatternStroke(); + } else { + out->stroke(state); } } } @@ -1882,20 +1874,15 @@ void Gfx::opEOFillStroke(Object args[], int numArgs) { } if (state->isPath()) { if (ocState) { - if (state->getFillColorSpace()->getMode() == csPattern || - state->getStrokeColorSpace()->getMode() == csPattern) { - if (state->getFillColorSpace()->getMode() == csPattern) { - doPatternFill(gTrue); - } else { - out->eoFill(state); - } - if (state->getStrokeColorSpace()->getMode() == csPattern) { - doPatternStroke(); - } else { - out->stroke(state); - } + if (state->getFillColorSpace()->getMode() == csPattern) { + doPatternFill(gTrue); + } else { + out->eoFill(state); + } + if (state->getStrokeColorSpace()->getMode() == csPattern) { + doPatternStroke(); } else { - out->fillStroke(state, gTrue); + out->stroke(state); } } } @@ -1910,20 +1897,15 @@ void Gfx::opCloseEOFillStroke(Object args[], int numArgs) { if (state->isPath()) { state->closePath(); if (ocState) { - if (state->getFillColorSpace()->getMode() == csPattern || - state->getStrokeColorSpace()->getMode() == csPattern) { - if (state->getFillColorSpace()->getMode() == csPattern) { - doPatternFill(gTrue); - } else { - out->eoFill(state); - } - if (state->getStrokeColorSpace()->getMode() == csPattern) { - doPatternStroke(); - } else { - out->stroke(state); - } + if (state->getFillColorSpace()->getMode() == csPattern) { + doPatternFill(gTrue); } else { - out->fillStroke(state, gTrue); + out->eoFill(state); + } + if (state->getStrokeColorSpace()->getMode() == csPattern) { + doPatternStroke(); + } else { + out->stroke(state); } } } @@ -1984,7 +1966,7 @@ void Gfx::doPatternStroke() { } } -void Gfx::doPatternText(GBool stroke) { +void Gfx::doPatternText() { GfxPattern *pattern; // this is a bit of a kludge -- patterns can be really slow, so we @@ -1994,8 +1976,7 @@ void Gfx::doPatternText(GBool stroke) { return; } - pattern = stroke ? state->getStrokePattern() : state->getFillPattern(); - if (!pattern) { + if (!(pattern = state->getFillPattern())) { return; } switch (pattern->getType()) { @@ -2212,30 +2193,16 @@ void Gfx::doTilingPatternFill(GfxTilingPattern *tPat, if (bbox[1] > bbox[3]) { t = bbox[1]; bbox[1] = bbox[3]; bbox[3] = t; } - xstep = tPat->getXStep(); - ystep = tPat->getYStep(); - if (xstep == 0 || ystep == 0) { - error(errSyntaxError, getPos(), "Zero x or y step in tiling pattern fill"); - goto err; - } - if (xstep > 0) { - xi0 = (int)ceil((xMin - bbox[2]) / xstep); - xi1 = (int)floor((xMax - bbox[0]) / xstep) + 1; - } else { - xi0 = (int)ceil((xMax - bbox[0]) / xstep); - xi1 = (int)floor((xMin - bbox[2]) / xstep) + 1; - } - if (ystep > 0) { - yi0 = (int)ceil((yMin - bbox[3]) / ystep); - yi1 = (int)floor((yMax - bbox[1]) / ystep) + 1; - } else { - yi0 = (int)ceil((yMax - bbox[1]) / ystep); - yi1 = (int)floor((yMin - bbox[3]) / ystep) + 1; - } + xstep = fabs(tPat->getXStep()); + ystep = fabs(tPat->getYStep()); + xi0 = (int)ceil((xMin - bbox[2]) / xstep); + xi1 = (int)floor((xMax - bbox[0]) / xstep) + 1; + yi0 = (int)ceil((yMin - bbox[3]) / ystep); + yi1 = (int)floor((yMax - bbox[1]) / ystep) + 1; for (i = 0; i < 4; ++i) { m1[i] = m[i]; } - if (out->useTilingPatternFill() && !tPat->usesBlendMode(xref)) { + if (out->useTilingPatternFill()) { m1[4] = m[4]; m1[5] = m[5]; out->tilingPatternFill(state, this, tPat->getContentStreamRef(), @@ -3554,16 +3521,12 @@ void Gfx::fillPatch(GfxPatch *patch, GfxPatchMeshShading *shading, int depth) { } void Gfx::doEndPath() { - if (clip != clipNone) { - if (state->isCurPt()) { - state->clip(); - if (clip == clipNormal) { - out->clip(state); - } else { - out->eoClip(state); - } + if (state->isCurPt() && clip != clipNone) { + state->clip(); + if (clip == clipNormal) { + out->clip(state); } else { - error(errSyntaxError, getPos(), "Empty path in clip"); + out->eoClip(state); } } clip = clipNone; @@ -3592,15 +3555,9 @@ void Gfx::opBeginText(Object args[], int numArgs) { out->updateTextMat(state); out->updateTextPos(state); fontChanged = gTrue; - haveSavedClipPath = gFalse; } void Gfx::opEndText(Object args[], int numArgs) { - if (haveSavedClipPath) { - out->clipToSavedClipPath(state); - haveSavedClipPath = gFalse; - } - out->endTextObject(state); } @@ -3829,8 +3786,27 @@ void Gfx::opShowSpaceText(Object args[], int numArgs) { } void Gfx::doShowText(GString *s) { - GfxFont *font = state->getFont(); - int wMode = font->getWMode(); + GfxFont *font; + int wMode; + double riseX, riseY; + CharCode code; + Unicode u[8]; + double x, y, dx, dy, dx2, dy2, curX, curY, tdx, tdy, ddx, ddy; + double originX, originY, tOriginX, tOriginY; + double x0, y0, x1, y1; + double oldCTM[6], newCTM[6]; + double *mat; + Object charProcRef, charProc; + Dict *resDict; + Parser *oldParser; + GfxState *savedState; + char *p; + int render; + GBool patternFill; + int len, n, uLen, nChars, nSpaces, i; + + font = state->getFont(); + wMode = font->getWMode(); if (globalParams->isDroppedFont(font->getName() ? font->getName()->getCString() : "")) { @@ -3842,63 +3818,35 @@ void Gfx::doShowText(GString *s) { out->beginString(state, s); } - // figure out the drawing mode - // note: clipping, pattern fill, and pattern stroke are all handled - // by saving the path and then performing the appropriate - // actions in opEndText() - GBool doFill = gFalse; - GBool doStroke = gFalse; - GBool doMakePath = gFalse; - int render = state->getRender() & 7; - switch (render & 7) { - case 0: // fill - if (state->getFillColorSpace()->getMode() == csPattern) { - doMakePath = gTrue; - } else { - doFill = gTrue; - } - break; - case 1: // stroke - if (state->getStrokeColorSpace()->getMode() == csPattern) { - doMakePath = gTrue; + // if we're doing a pattern fill, set up clipping + render = state->getRender(); + if (!(render & 1) && + state->getFillColorSpace()->getMode() == csPattern) { + patternFill = gTrue; + saveState(); + // disable fill, enable clipping, leave stroke unchanged + if ((render ^ (render >> 1)) & 1) { + render = 5; } else { - doStroke = gTrue; + render = 7; } - break; - case 2: // fill + stroke - if (state->getFillColorSpace()->getMode() == csPattern || - state->getStrokeColorSpace()->getMode() == csPattern) { - doMakePath = gTrue; - } else { - doFill = gTrue; - doStroke = gTrue; - } - break; - case 3: // invisible - // nothing - break; - case 4: // fill + clip - case 5: // stroke + clip - case 6: // fill + stroke + clip - case 7: // clip - doMakePath = gTrue; - break; + state->setRender(render); + out->updateRender(state); + } else { + patternFill = gFalse; } - double riseX, riseY; state->textTransformDelta(0, state->getRise(), &riseX, &riseY); - double xMin = state->getCurX() + riseX; - double yMin = state->getCurY() + riseY; + x0 = state->getCurX() + riseX; + y0 = state->getCurY() + riseY; // handle a Type 3 char if (font->getType() == fontType3 && out->interpretType3Chars()) { - double *mat = state->getCTM(); - double oldCTM[6]; - for (int i = 0; i < 6; ++i) { + mat = state->getCTM(); + for (i = 0; i < 6; ++i) { oldCTM[i] = mat[i]; } mat = state->getTextMat(); - double newCTM[6]; newCTM[0] = mat[0] * oldCTM[0] + mat[1] * oldCTM[2]; newCTM[1] = mat[0] * oldCTM[1] + mat[1] * oldCTM[3]; newCTM[2] = mat[2] * oldCTM[0] + mat[3] * oldCTM[2]; @@ -3914,29 +3862,24 @@ void Gfx::doShowText(GString *s) { newCTM[3] *= state->getFontSize(); newCTM[0] *= state->getHorizScaling(); newCTM[1] *= state->getHorizScaling(); - double curX = state->getCurX(); - double curY = state->getCurY(); - Parser *oldParser = parser; - char *p = s->getCString(); - int len = s->getLength(); + curX = state->getCurX(); + curY = state->getCurY(); + oldParser = parser; + p = s->getCString(); + len = s->getLength(); while (len > 0) { - CharCode code; - Unicode u[8]; - int uLen; - double dx, dy, originX, originY; - int n = font->getNextChar(p, len, &code, - u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, - &dx, &dy, &originX, &originY); + n = font->getNextChar(p, len, &code, + u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, + &dx, &dy, &originX, &originY); dx = dx * state->getFontSize() + state->getCharSpace(); if (n == 1 && *p == ' ') { dx += state->getWordSpace(); } dx *= state->getHorizScaling(); dy *= state->getFontSize(); - double tdx, tdy, ddx, ddy, x, y; state->textTransformDelta(dx, dy, &tdx, &tdy); state->transform(curX + riseX, curY + riseY, &x, &y); - GfxState *savedState = saveStateStack(); + savedState = saveStateStack(); state->setCTM(newCTM[0], newCTM[1], newCTM[2], newCTM[3], x, y); //~ the CTM concat values here are wrong (but never used) out->updateCTM(state, 1, 0, 0, 1, 0, 0); @@ -3956,11 +3899,9 @@ void Gfx::doShowText(GString *s) { #endif if (!out->beginType3Char(state, curX + riseX, curY + riseY, ddx, ddy, code, u, uLen)) { - Object charProcRef, charProc; ((Gfx8BitFont *)font)->getCharProcNF(code, &charProcRef); charProcRef.fetch(xref, &charProc); - Dict *resDict = ((Gfx8BitFont *)font)->getResources(); - if (resDict) { + if ((resDict = ((Gfx8BitFont *)font)->getResources())) { pushResources(resDict); } if (charProc.isStream()) { @@ -3986,16 +3927,12 @@ void Gfx::doShowText(GString *s) { parser = oldParser; } else if (out->useDrawChar()) { - char *p = s->getCString(); - int len = s->getLength(); + p = s->getCString(); + len = s->getLength(); while (len > 0) { - CharCode code; - Unicode u[8]; - int uLen; - double dx, dy, originX, originY; - int n = font->getNextChar(p, len, &code, - u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, - &dx, &dy, &originX, &originY); + n = font->getNextChar(p, len, &code, + u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, + &dx, &dy, &originX, &originY); if (wMode) { dx *= state->getFontSize(); dy = dy * state->getFontSize() + state->getCharSpace(); @@ -4010,32 +3947,26 @@ void Gfx::doShowText(GString *s) { dx *= state->getHorizScaling(); dy *= state->getFontSize(); } - double tdx, tdy, tOriginX, tOriginY; state->textTransformDelta(dx, dy, &tdx, &tdy); originX *= state->getFontSize(); originY *= state->getFontSize(); state->textTransformDelta(originX, originY, &tOriginX, &tOriginY); out->drawChar(state, state->getCurX() + riseX, state->getCurY() + riseY, - tdx, tdy, tOriginX, tOriginY, code, n, u, uLen, - doFill, doStroke, doMakePath); + tdx, tdy, tOriginX, tOriginY, code, n, u, uLen); state->shift(tdx, tdy); p += n; len -= n; } } else { - double dx = 0, dy = 0; - char *p = s->getCString(); - int len = s->getLength(); - int nChars = 0, nSpaces = 0; + dx = dy = 0; + p = s->getCString(); + len = s->getLength(); + nChars = nSpaces = 0; while (len > 0) { - CharCode code; - Unicode u[8]; - int uLen; - double dx2, dy2, originX, originY; - int n = font->getNextChar(p, len, &code, - u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, - &dx2, &dy2, &originX, &originY); + n = font->getNextChar(p, len, &code, + u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, + &dx2, &dy2, &originX, &originY); dx += dx2; dy += dy2; if (n == 1 && *p == ' ') { @@ -4057,9 +3988,8 @@ void Gfx::doShowText(GString *s) { dx *= state->getHorizScaling(); dy *= state->getFontSize(); } - double tdx, tdy; state->textTransformDelta(dx, dy, &tdx, &tdy); - out->drawString(state, s, doFill, doStroke, doMakePath); + out->drawString(state, s); state->shift(tdx, tdy); } @@ -4067,70 +3997,40 @@ void Gfx::doShowText(GString *s) { out->endString(state); } - if (doMakePath) { - // compute the clipping bbox for the saved text path -- assume + if (patternFill) { + out->saveTextPos(state); + // tell the OutputDev to do the clipping + out->endTextObject(state); + // set up a clipping bbox so doPatternText will work -- assume // that the text bounding box does not extend past the baseline in // any direction by more than twice the font size - double xMax = state->getCurX() + riseX; - double yMax = state->getCurY() + riseY; - double t; - if (xMin > xMax) { - t = xMin; xMin = xMax; xMax = t; + x1 = state->getCurX() + riseX; + y1 = state->getCurY() + riseY; + if (x0 > x1) { + x = x0; x0 = x1; x1 = x; } - if (yMin > yMax) { - t = yMin; yMin = yMax; yMax = t; + if (y0 > y1) { + y = y0; y0 = y1; y1 = y; } - double dx1, dy1, dx2, dy2; - state->textTransformDelta(0, state->getFontSize(), &dx1, &dy1); + state->textTransformDelta(0, state->getFontSize(), &dx, &dy); state->textTransformDelta(state->getFontSize(), 0, &dx2, &dy2); - dx1 = fabs(dx1); + dx = fabs(dx); dx2 = fabs(dx2); - if (dx2 > dx1) { - dx1 = dx2; + if (dx2 > dx) { + dx = dx2; } - dy1 = fabs(dy1); + dy = fabs(dy); dy2 = fabs(dy2); - if (dy2 > dy1) { - dy1 = dy2; - } - xMin -= 2 * dx1; - yMin -= 2 * dy1; - xMax += 2 * dx1; - yMax += 2 * dy1; - - //--- fill - if ((render & 3) == 0 || (render & 3) == 2) { - if (state->getFillColorSpace()->getMode() == csPattern) { - saveState(); - state->clipToRect(xMin, yMin, xMax, yMax); - out->clipToTextPath(state); - doPatternText(gFalse); - restoreState(); - } else { - out->fillTextPath(state); - } - } - - //--- stroke - if ((render & 3) == 1 || (render & 3) == 2) { - if (state->getStrokeColorSpace()->getMode() == csPattern) { - saveState(); - state->clipToRect(xMin, yMin, xMax, yMax); - out->clipToTextStrokePath(state); - doPatternText(gTrue); - restoreState(); - } else { - out->strokeTextPath(state); - } - } - - //--- clip - if (render & 4) { - out->addTextPathToSavedClipPath(state); - haveSavedClipPath = gTrue; - } else { - out->clearTextPath(state); - } + if (dy2 > dy) { + dy = dy2; + } + state->clipToRect(x0 - 2 * dx, y0 - 2 * dy, x1 + 2 * dx, y1 + 2 * dy); + // set render mode to fill-only + state->setRender(0); + out->updateRender(state); + doPatternText(); + restoreState(); + out->restoreTextPos(state); } opCounter += 10 * s->getLength(); @@ -4216,7 +4116,6 @@ void Gfx::opXObject(Object args[], int numArgs) { xObj.streamGetDict()->lookup("Level1", &obj3); out->psXObject(xObj.getStream(), obj3.isStream() ? obj3.getStream() : (Stream *)NULL); - obj3.free(); } } else if (obj2.isName()) { error(errSyntaxError, getPos(), @@ -4292,14 +4191,10 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); dict->lookup("W", &obj1); } - if (obj1.isInt()) { - width = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image width"); - width = (int)obj1.getReal(); - } else { + if (!obj1.isInt()) { goto err2; } + width = obj1.getInt(); obj1.free(); if (width <= 0) { goto err1; @@ -4309,14 +4204,10 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); dict->lookup("H", &obj1); } - if (obj1.isInt()) { - height = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image height"); - height = (int)obj1.getReal(); - } else { + if (!obj1.isInt()) { goto err2; } + height = obj1.getInt(); obj1.free(); if (height <= 0) { goto err1; @@ -4342,14 +4233,8 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); dict->lookup("BPC", &obj1); } - if (obj1.isNum()) { - if (obj1.isInt()) { - bits = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), - "Non-integer image bits per component"); - bits = (int)obj1.getReal(); - } + if (obj1.isInt()) { + bits = obj1.getInt(); if (bits < 1 || bits > 16) { goto err2; } @@ -4492,34 +4377,26 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); maskDict->lookup("W", &obj1); } - if (obj1.isInt()) { - maskWidth = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image mask width"); - maskWidth = (int)obj1.getReal(); - } else { + if (!obj1.isInt()) { delete colorMap; maskObj.free(); smaskObj.free(); goto err2; } + maskWidth = obj1.getInt(); obj1.free(); maskDict->lookup("Height", &obj1); if (obj1.isNull()) { obj1.free(); maskDict->lookup("H", &obj1); } - if (obj1.isInt()) { - maskHeight = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image mask height"); - maskHeight = (int)obj1.getReal(); - } else { + if (!obj1.isInt()) { delete colorMap; maskObj.free(); smaskObj.free(); goto err2; } + maskHeight = obj1.getInt(); obj1.free(); if (maskWidth <= 0 || maskHeight <= 0) { delete colorMap; @@ -4532,18 +4409,13 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); maskDict->lookup("BPC", &obj1); } - if (obj1.isInt()) { - maskBits = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), - "Non-integer image mask bits per component"); - maskBits = (int)obj1.getReal(); - } else { + if (!obj1.isInt()) { delete colorMap; maskObj.free(); smaskObj.free(); goto err2; } + maskBits = obj1.getInt(); obj1.free(); if (maskBits < 1 || maskBits > 16) { delete colorMap; @@ -4640,7 +4512,6 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { } } else if (maskObj.isStream()) { // explicit mask - haveExplicitMask = gTrue; if (inlineImg) { delete colorMap; maskObj.free(); @@ -4655,31 +4526,32 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { obj1.free(); maskDict->lookup("W", &obj1); } - if (obj1.isInt()) { - maskWidth = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image mask width"); - maskWidth = (int)obj1.getReal(); - } else { - haveExplicitMask = gFalse; + if (!obj1.isInt()) { + delete colorMap; + maskObj.free(); + smaskObj.free(); + goto err2; } + maskWidth = obj1.getInt(); obj1.free(); maskDict->lookup("Height", &obj1); if (obj1.isNull()) { obj1.free(); maskDict->lookup("H", &obj1); } - if (obj1.isInt()) { - maskHeight = obj1.getInt(); - } else if (obj1.isReal()) { - error(errSyntaxWarning, getPos(), "Non-integer image mask height"); - maskHeight = (int)obj1.getReal(); - } else { - haveExplicitMask = gFalse; + if (!obj1.isInt()) { + delete colorMap; + maskObj.free(); + smaskObj.free(); + goto err2; } + maskHeight = obj1.getInt(); obj1.free(); if (maskWidth <= 0 || maskHeight <= 0) { - haveExplicitMask = gFalse; + delete colorMap; + maskObj.free(); + smaskObj.free(); + goto err2; } maskDict->lookup("ImageMask", &obj1); if (obj1.isNull()) { @@ -4687,7 +4559,10 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { maskDict->lookup("IM", &obj1); } if (!obj1.isBool() || !obj1.getBool()) { - haveExplicitMask = gFalse; + delete colorMap; + maskObj.free(); + smaskObj.free(); + goto err2; } obj1.free(); maskInvert = gFalse; @@ -4701,12 +4576,13 @@ GBool Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) { maskInvert = obj2.isNum() && obj2.getNum() == 1; obj2.free(); } else if (!obj1.isNull()) { - haveExplicitMask = gFalse; + delete colorMap; + maskObj.free(); + smaskObj.free(); + goto err2; } obj1.free(); - if (!haveExplicitMask) { - error(errSyntaxError, getPos(), "Bad image parameters"); - } + haveExplicitMask = gTrue; } // if drawing is disabled, skip over inline image data @@ -4892,8 +4768,6 @@ void Gfx::drawForm(Object *strRef, Dict *resDict, double oldBaseMatrix[6]; int i; - out->startStream(strRef->getRef(), state); - // push new resources on stack pushResources(resDict); @@ -5023,7 +4897,7 @@ void Gfx::drawForm(Object *strRef, Dict *resDict, delete blendingColorSpace; } - out->endStream(strRef->getRef()); + return; } void Gfx::takeContentStreamStack(Gfx *oldGfx) { @@ -5062,9 +4936,7 @@ void Gfx::opBeginImage(Object args[], int numArgs) { // if we have the stream length, skip to end-of-stream and then // skip 'EI' in the original stream } else if (haveLength) { - // NB: getUndecodedStream() returns the EmbedStream created by - // buildImageStream() - while ((c1 = str->getUndecodedStream()->getChar()) != EOF) ; + while ((c1 = str->getChar()) != EOF) ; delete str; str = parser->getStream(); c1 = str->getChar(); @@ -5219,28 +5091,15 @@ void Gfx::opBeginMarkedContent(Object args[], int numArgs) { } obj.free(); mcKind = gfxMCOptionalContent; - } else if (numArgs == 2 && args[1].isDict()) { - if (args[0].isName("Span")) { - if (args[1].dictLookup("ActualText", &obj)->isString()) { - s = new TextString(obj.getString()); - out->beginActualText(state, s->getUnicode(), s->getLength()); - delete s; - mcKind = gfxMCActualText; - } - obj.free(); - } - if (args[1].dictLookup("MCID", &obj)->isInt()) { - out->beginStructureItem(args[0].getName(), obj.getInt(), - args[1].getDict()); - if (mcKind == gfxMCActualText) { - mcKind = gfxMCStructureItemAndActualText; - } else { - mcKind = gfxMCStructureItem; - } + } else if (args[0].isName("Span") && numArgs == 2 && args[1].isDict()) { + if (args[1].dictLookup("ActualText", &obj)->isString()) { + s = new TextString(obj.getString()); + out->beginActualText(state, s->getUnicode(), s->getLength()); + delete s; + mcKind = gfxMCActualText; } obj.free(); } - mc = new GfxMarkedContent(mcKind, ocState); markedContentStack->append(mc); } @@ -5264,11 +5123,6 @@ void Gfx::opEndMarkedContent(Object args[], int numArgs) { } } else if (mcKind == gfxMCActualText) { out->endActualText(state); - } else if (mcKind == gfxMCStructureItem) { - out->endStructureItem(); - } else if (mcKind == gfxMCStructureItemAndActualText) { - out->endStructureItem(); - out->endActualText(state); } } else { error(errSyntaxWarning, getPos(), "Mismatched EMC operator"); diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.h index 0f288cf3b9d..14d7a608438 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Gfx.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "gfile.h" #include "GfxState.h" @@ -102,8 +106,6 @@ private: enum GfxMarkedContentKind { gfxMCOptionalContent, gfxMCActualText, - gfxMCStructureItem, - gfxMCStructureItemAndActualText, gfxMCOther }; @@ -192,7 +194,6 @@ private: GfxState *state; // current graphics state GBool fontChanged; // set if font or text matrix has changed - GBool haveSavedClipPath; GfxClipType clip; // do a clip? int ignoreUndef; // current BX/EX nesting level double baseMatrix[6]; // default matrix for most recent @@ -272,7 +273,7 @@ private: void opCloseEOFillStroke(Object args[], int numArgs); void doPatternFill(GBool eoFill); void doPatternStroke(); - void doPatternText(GBool stroke); + void doPatternText(); void doPatternImageMask(Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg, GBool interpolate); void doTilingPatternFill(GfxTilingPattern *tPat, diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.cc index c3db4e8651b..30e8bd1c79c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -303,10 +307,26 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) { obj2.initNull(); } - // NB: the PDF spec doesn't say anything about precedence, but Adobe - // uses FontFile3 over FontFile2 if both are present. if (fontDict2->lookup("FontDescriptor", &fontDesc)->isDict()) { - if (fontDesc.dictLookupNF("FontFile3", &obj3)->isRef()) { + if (fontDesc.dictLookupNF("FontFile", &obj3)->isRef()) { + *embID = obj3.getRef(); + if (expectedType != fontType1) { + err = gTrue; + } + } + obj3.free(); + if (embID->num == -1 && + fontDesc.dictLookupNF("FontFile2", &obj3)->isRef()) { + *embID = obj3.getRef(); + if (isType0) { + expectedType = fontCIDType2; + } else if (expectedType != fontTrueType) { + err = gTrue; + } + } + obj3.free(); + if (embID->num == -1 && + fontDesc.dictLookupNF("FontFile3", &obj3)->isRef()) { *embID = obj3.getRef(); if (obj3.fetch(xref, &obj4)->isStream()) { obj4.streamGetDict()->lookup("Subtype", &subtype); @@ -355,26 +375,6 @@ GfxFontType GfxFont::getFontType(XRef *xref, Dict *fontDict, Ref *embID) { obj4.free(); } obj3.free(); - if (embID->num == -1) { - if (fontDesc.dictLookupNF("FontFile2", &obj3)->isRef()) { - *embID = obj3.getRef(); - if (isType0) { - expectedType = fontCIDType2; - } else if (expectedType != fontTrueType) { - err = gTrue; - } - } - obj3.free(); - } - if (embID->num == -1) { - if (fontDesc.dictLookupNF("FontFile", &obj3)->isRef()) { - *embID = obj3.getRef(); - if (expectedType != fontType1) { - err = gTrue; - } - } - obj3.free(); - } } fontDesc.free(); @@ -533,33 +533,6 @@ void GfxFont::readFontDescriptor(XRef *xref, Dict *fontDict) { } obj1.free(); - - // scan font name for bold/italic tags and update the flags - if (name) { - i = name->getLength(); - if (i > 2 && !strncmp(name->getCString() + i - 2, "MT", 2)) { - i -= 2; - } - if (i > 6 && !strncmp(name->getCString() + i - 6, "Italic", 6)) { - flags |= fontItalic; - i -= 6; - } else if (i > 2 && !strncmp(name->getCString() + i - 2, "It", 2)) { - flags |= fontItalic; - i -= 2; - } else if (i > 7 && !strncmp(name->getCString() + i - 7, "Oblique", 7)) { - flags |= fontItalic; - i -= 7; - } - char c = name->getChar(i-1); - if (!((c >= 'A' && c <= 'Z') || - (c >= 'a' && c <= 'z') || - (c >= '0' && c <= '9'))) { - --i; - } - if (i > 4 && !strncmp(name->getCString() + i - 4, "Bold", 4)) { - flags |= fontBold; - } - } } CharCodeToUnicode *GfxFont::readToUnicodeCMap(Dict *fontDict, int nBits, @@ -1463,7 +1436,7 @@ CharCodeToUnicode *Gfx8BitFont::getToUnicode() { int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) { int *map; int cmapPlatform, cmapEncoding; - int unicodeCmap, macRomanCmap, macUnicodeCmap, msSymbolCmap, cmap; + int unicodeCmap, macRomanCmap, msSymbolCmap, cmap; GBool nonsymbolic, useMacRoman, useUnicode; char *charName; Unicode u; @@ -1477,16 +1450,15 @@ int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) { // This is based on the cmap/encoding selection algorithm in the PDF // 2.0 spec, but with some differences to match up with Adobe's // behavior. - unicodeCmap = macRomanCmap = macUnicodeCmap = msSymbolCmap = -1; + unicodeCmap = macRomanCmap = msSymbolCmap = -1; for (i = 0; i < ff->getNumCmaps(); ++i) { cmapPlatform = ff->getCmapPlatform(i); cmapEncoding = ff->getCmapEncoding(i); - if (cmapPlatform == 3 && cmapEncoding == 1) { + if ((cmapPlatform == 3 && cmapEncoding == 1) || + (cmapPlatform == 0 && cmapEncoding <= 4)) { unicodeCmap = i; } else if (cmapPlatform == 1 && cmapEncoding == 0) { macRomanCmap = i; - } else if (cmapPlatform == 0 && cmapEncoding <= 4) { - macUnicodeCmap = i; } else if (cmapPlatform == 3 && cmapEncoding == 0) { msSymbolCmap = i; } @@ -1494,25 +1466,24 @@ int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) { useMacRoman = gFalse; useUnicode = gFalse; nonsymbolic = !(flags & fontSymbolic); - if (embFontID.num < 0 && hasEncoding && unicodeCmap >= 0) { + if (usesMacRomanEnc && macRomanCmap >= 0) { + cmap = macRomanCmap; + useMacRoman = gTrue; + } else if (embFontID.num < 0 && hasEncoding && unicodeCmap >= 0) { cmap = unicodeCmap; useUnicode = gTrue; - } else if (!nonsymbolic && msSymbolCmap >= 0) { - cmap = msSymbolCmap; - } else if (unicodeCmap >= 0) { + } else if (nonsymbolic && unicodeCmap >= 0) { cmap = unicodeCmap; - useUnicode = nonsymbolic; - } else if (usesMacRomanEnc && macRomanCmap >= 0) { - // MacRoman cmap has higher precedence than Mac Unicode only if - // the font uses the MacRoman encoding + useUnicode = gTrue; + } else if (nonsymbolic && macRomanCmap >= 0) { cmap = macRomanCmap; useMacRoman = gTrue; - } else if (macUnicodeCmap >= 0) { - cmap = macUnicodeCmap; - useUnicode = nonsymbolic; + } else if (msSymbolCmap >= 0) { + cmap = msSymbolCmap; + } else if (unicodeCmap >= 0) { + cmap = unicodeCmap; } else if (macRomanCmap >= 0) { cmap = macRomanCmap; - useMacRoman = nonsymbolic; } else { cmap = 0; } @@ -2258,99 +2229,75 @@ GBool GfxCIDFont::problematicForUnicode() { // GfxFontDict //------------------------------------------------------------------------ -class GfxFontDictEntry { -public: - - GfxFontDictEntry(Ref refA, Object *fontObjA); - ~GfxFontDictEntry(); - void load(GfxFont *fontA); - - GBool loaded; - Ref ref; - Object fontObj; // valid if unloaded - GfxFont *font; // valid if loaded -}; - -GfxFontDictEntry::GfxFontDictEntry(Ref refA, Object *fontObjA) { - loaded = gFalse; - ref = refA; - fontObjA->copy(&fontObj); - font = NULL; -} - -GfxFontDictEntry::~GfxFontDictEntry() { - // NB: If the font has been loaded, font is non-NULL and is owned by - // GfxFontDict.uniqueFonts. - if (!loaded) { - fontObj.free(); - } -} - -void GfxFontDictEntry::load(GfxFont *fontA) { - loaded = gTrue; - font = fontA; - fontObj.free(); -} +GfxFontDict::GfxFontDict(XRef *xref, Ref *fontDictRef, Dict *fontDict) { + GfxFont *font; + char *tag; + Object obj1, obj2; + Ref r; + int i; -GfxFontDict::GfxFontDict(XRef *xrefA, Ref *fontDictRef, Dict *fontDict) { - xref = xrefA; fonts = new GHash(gTrue); uniqueFonts = new GList(); - - for (int i = 0; i < fontDict->getLength(); ++i) { - char *tag = fontDict->getKey(i); - Object fontObj; - fontDict->getValNF(i, &fontObj); - Ref r; - if (fontObj.isRef()) { - r = fontObj.getRef(); - } else if (fontDictRef) { - // legal generation numbers are five digits, so we use a - // 6-digit number here - r.gen = 100000 + fontDictRef->num; - r.num = i; + for (i = 0; i < fontDict->getLength(); ++i) { + tag = fontDict->getKey(i); + fontDict->getValNF(i, &obj1); + obj1.fetch(xref, &obj2); + if (!obj2.isDict()) { + error(errSyntaxError, -1, "font resource is not a dictionary"); + } else if (obj1.isRef() && (font = lookupByRef(obj1.getRef()))) { + fonts->add(new GString(tag), font); } else { - // no indirect reference for this font, or for the containing - // font dict, so hash the font and use that - r.gen = 100000; - r.num = hashFontObject(&fontObj); + if (obj1.isRef()) { + r = obj1.getRef(); + } else if (fontDictRef) { + // legal generation numbers are five digits, so we use a + // 6-digit number here + r.gen = 100000 + fontDictRef->num; + r.num = i; + } else { + // no indirect reference for this font, or for the containing + // font dict, so hash the font and use that + r.gen = 100000; + r.num = hashFontObject(&obj2); + } + if ((font = GfxFont::makeFont(xref, tag, r, obj2.getDict()))) { + if (!font->isOk()) { + delete font; + } else { + uniqueFonts->append(font); + fonts->add(new GString(tag), font); + } + } } - fonts->add(new GString(tag), new GfxFontDictEntry(r, &fontObj)); - fontObj.free(); + obj1.free(); + obj2.free(); } } GfxFontDict::~GfxFontDict() { deleteGList(uniqueFonts, GfxFont); - deleteGHash(fonts, GfxFontDictEntry); + delete fonts; } GfxFont *GfxFontDict::lookup(char *tag) { - GfxFontDictEntry *entry = (GfxFontDictEntry *)fonts->lookup(tag); - if (!entry) { - return NULL; - } - load(tag, entry); - return entry->font; + return (GfxFont *)fonts->lookup(tag); } GfxFont *GfxFontDict::lookupByRef(Ref ref) { - GHashIter *iter; - GString *tag; - GfxFontDictEntry *entry; - fonts->startIter(&iter); - while (fonts->getNext(&iter, &tag, (void **)&entry)) { - if (entry->ref.num == ref.num && entry->ref.gen == ref.gen) { - fonts->killIter(&iter); - load(tag->getCString(), entry); - return entry->font; + GfxFont *font; + int i; + + for (i = 0; i < uniqueFonts->getLength(); ++i) { + font = (GfxFont *)uniqueFonts->get(i); + if (font->getID()->num == ref.num && + font->getID()->gen == ref.gen) { + return font; } } return NULL; } int GfxFontDict::getNumFonts() { - loadAll(); return uniqueFonts->getLength(); } @@ -2358,52 +2305,6 @@ GfxFont *GfxFontDict::getFont(int i) { return (GfxFont *)uniqueFonts->get(i); } -void GfxFontDict::loadAll() { - GHashIter *iter; - GString *tag; - GfxFontDictEntry *entry; - fonts->startIter(&iter); - while (fonts->getNext(&iter, &tag, (void **)&entry)) { - load(tag->getCString(), entry); - } -} - -void GfxFontDict::load(char *tag, GfxFontDictEntry *entry) { - if (entry->loaded) { - return; - } - - // check for a duplicate that has already been loaded - // (don't do this for "synthetic" refs) - if (entry->fontObj.isRef()) { - for (int i = 0; i < uniqueFonts->getLength(); ++i) { - GfxFont *font = (GfxFont *)uniqueFonts->get(i); - if (font->getID()->num == entry->ref.num && - font->getID()->gen == entry->ref.gen) { - entry->load(font); - return; - } - } - } - - GfxFont *font = NULL; - Object obj; - entry->fontObj.fetch(xref, &obj); - if (obj.isDict()) { - font = GfxFont::makeFont(xref, tag, entry->ref, obj.getDict()); - if (font->isOk()) { - uniqueFonts->append(font); - } else { - delete font; - font = NULL; - } - } else { - error(errSyntaxError, -1, "font resource is not a dictionary"); - } - obj.free(); - entry->load(font); -} - // FNV-1a hash class FNVHash { public: diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.h b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.h index ec6d3c3d246..e752ded62f8 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxFont.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "GString.h" #include "Object.h" @@ -25,7 +29,6 @@ class FoFiTrueType; class FoFiType1C; struct GfxFontCIDWidths; struct Base14FontMapEntry; -class GfxFontDictEntry; class FNVHash; //------------------------------------------------------------------------ @@ -385,7 +388,7 @@ class GfxFontDict { public: // Build the font dictionary, given the PDF font dictionary. - GfxFontDict(XRef *xrefA, Ref *fontDictRef, Dict *fontDict); + GfxFontDict(XRef *xref, Ref *fontDictRef, Dict *fontDict); // Destructor. ~GfxFontDict(); @@ -402,18 +405,13 @@ private: friend class GfxFont; - void loadAll(); - void load(char *tag, GfxFontDictEntry *entry); static int hashFontObject(Object *obj); static void hashFontObject1(Object *obj, FNVHash *h); - XRef *xref; - GHash *fonts; // hash table of fonts, mapping from - // tag to GfxFontDictEntry; this may - // contain duplicates, i.e., two - // tags that map to the same font + GHash *fonts; // hash table of fonts -- this may + // include duplicates, i.e., when + // two tags map to the same font GList *uniqueFonts; // list of all unique font objects (no dups) - // that have been loaded }; #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.cc index 9aed7345ad2..43503aaedb8 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stddef.h> #include <math.h> #include <string.h> @@ -932,15 +936,15 @@ GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr, } nCompsA = obj2.getInt(); obj2.free(); - if (!dict->lookup("Alternate", &obj2)->isNull() && - (altA = GfxColorSpace::parse(&obj2, - recursion + 1))) { - if (altA->getNComps() != nCompsA) { - error(errSyntaxError, -1, - "Number of components in ICCBased color space doesn't match alternate color space"); - nCompsA = altA->getNComps(); - } - } else { + if (nCompsA > 4) { + error(errSyntaxError, -1, + "ICCBased color space with too many ({0:d} > 4) components", + nCompsA); + nCompsA = 4; + } + if (dict->lookup("Alternate", &obj2)->isNull() || + !(altA = GfxColorSpace::parse(&obj2, + recursion + 1))) { switch (nCompsA) { case 1: altA = GfxColorSpace::create(csDeviceGray); @@ -1780,258 +1784,6 @@ GfxPattern *GfxTilingPattern::copy() { &resDict, matrix, &contentStreamRef); } -GBool GfxTilingPattern::usesBlendMode(XRef *xref) { - char *scannedObjs = (char *)gmalloc(xref->getNumObjects()); - memset(scannedObjs, 0, xref->getNumObjects()); - GBool ret = scanResourcesForBlendMode(&resDict, scannedObjs, xref); - gfree(scannedObjs); - return ret; -} - -GBool GfxTilingPattern::scanResourcesForBlendMode(Object *resDict2, - char *scannedObjs, - XRef *xref) { - Object ref1, obj1, obj2; - - if (!resDict2->isDict()) { - return gFalse; - } - - //----- ExtGStates - resDict2->dictLookupNF("ExtGState", &ref1); - if (!ref1.isRef() || (ref1.getRefNum() < xref->getNumObjects() && - !scannedObjs[ref1.getRefNum()])) { - if (ref1.isRef()) { - scannedObjs[ref1.getRefNum()] = 1; - ref1.fetch(xref, &obj1); - } else { - ref1.copy(&obj1); - } - if (obj1.isDict()) { - for (int i = 0; i < obj1.dictGetLength(); ++i) { - if (scanExtGStateForBlendMode(obj1.dictGetValNF(i, &obj2), - scannedObjs, xref)) { - obj2.free(); - obj1.free(); - ref1.free(); - return gTrue; - } - obj2.free(); - } - } - obj1.free(); - } - ref1.free(); - - //----- patterns - resDict2->dictLookupNF("Pattern", &ref1); - if (!ref1.isRef() || (ref1.getRefNum() < xref->getNumObjects() && - !scannedObjs[ref1.getRefNum()])) { - if (ref1.isRef()) { - scannedObjs[ref1.getRefNum()] = 1; - ref1.fetch(xref, &obj1); - } else { - ref1.copy(&obj1); - } - if (obj1.isDict()) { - for (int i = 0; i < obj1.dictGetLength(); ++i) { - if (scanPatternForBlendMode(obj1.dictGetValNF(i, &obj2), - scannedObjs, xref)) { - obj2.free(); - obj1.free(); - ref1.free(); - return gTrue; - } - obj2.free(); - } - } - obj1.free(); - } - ref1.free(); - - //----- XObjects - resDict2->dictLookupNF("XObject", &ref1); - if (!ref1.isRef() || (ref1.getRefNum() < xref->getNumObjects() && - !scannedObjs[ref1.getRefNum()])) { - if (ref1.isRef()) { - scannedObjs[ref1.getRefNum()] = 1; - ref1.fetch(xref, &obj1); - } else { - ref1.copy(&obj1); - } - if (obj1.isDict()) { - for (int i = 0; i < obj1.dictGetLength(); ++i) { - if (scanXObjectForBlendMode(obj1.dictGetValNF(i, &obj2), - scannedObjs, xref)) { - obj2.free(); - obj1.free(); - ref1.free(); - return gTrue; - } - obj2.free(); - } - } - obj1.free(); - } - ref1.free(); - - return gFalse; -} - -GBool GfxTilingPattern::scanExtGStateForBlendMode(Object *gsObj, - char *scannedObjs, - XRef *xref) { - Object gsDict, obj1; - - if (gsObj->isRef()) { - if (gsObj->getRefNum() >= xref->getNumObjects() || - scannedObjs[gsObj->getRefNum()]) { - return gFalse; - } - scannedObjs[gsObj->getRefNum()] = 1; - gsObj->fetch(xref, &gsDict); - } else { - gsObj->copy(&gsDict); - } - if (!gsDict.isDict()) { - gsDict.free(); - return gFalse; - } - - gsDict.dictLookup("BM", &obj1); - if (obj1.isName() && !obj1.isName("Normal")) { - obj1.free(); - gsDict.free(); - return gTrue; - } - obj1.free(); - - if (!gsDict.dictLookupNF("SMask", &obj1)->isNull()) { - if (scanSoftMaskForBlendMode(&obj1, scannedObjs, xref)) { - obj1.free(); - gsDict.free(); - return gTrue; - } - } - obj1.free(); - - gsDict.free(); - - return gFalse; -} - -GBool GfxTilingPattern::scanSoftMaskForBlendMode(Object *softMaskObj, - char *scannedObjs, - XRef *xref) { - Object softMaskDict, obj1; - - if (softMaskObj->isRef()) { - if (softMaskObj->getRefNum() >= xref->getNumObjects() || - scannedObjs[softMaskObj->getRefNum()]) { - return gFalse; - } - scannedObjs[softMaskObj->getRefNum()] = 1; - softMaskObj->fetch(xref, &softMaskDict); - } else { - softMaskObj->copy(&softMaskDict); - } - if (!softMaskDict.isDict()) { - softMaskDict.free(); - return gFalse; - } - - if (!softMaskDict.dictLookupNF("G", &obj1)->isNull()) { - if (scanXObjectForBlendMode(&obj1, scannedObjs, xref)) { - obj1.free(); - softMaskDict.free(); - return gTrue; - } - } - obj1.free(); - - softMaskDict.free(); - - return gFalse; -} - -GBool GfxTilingPattern::scanPatternForBlendMode(Object *patternObj, - char *scannedObjs, - XRef *xref) { - Object patternObj2, obj1; - Dict *patternDict; - - if (patternObj->isRef()) { - if (patternObj->getRefNum() >= xref->getNumObjects() || - scannedObjs[patternObj->getRefNum()]) { - return gFalse; - } - scannedObjs[patternObj->getRefNum()] = 1; - patternObj->fetch(xref, &patternObj2); - } else { - patternObj->copy(&patternObj2); - } - if (patternObj2.isDict()) { - patternDict = patternObj2.getDict(); - } else if (patternObj2.isStream()) { - patternDict = patternObj2.streamGetDict(); - } else { - patternObj2.free(); - return gFalse; - } - - if (!patternDict->lookupNF("Resources", &obj1)->isNull()) { - if (scanResourcesForBlendMode(&obj1, scannedObjs, xref)) { - obj1.free(); - patternObj2.free(); - return gTrue; - } - } - obj1.free(); - - patternObj2.free(); - - return gFalse; -} - -GBool GfxTilingPattern::scanXObjectForBlendMode(Object *xObj, - char *scannedObjs, - XRef *xref) { - Object xObj2, obj1; - Dict *dict; - - if (xObj->isRef()) { - if (xObj->getRefNum() >= xref->getNumObjects() || - scannedObjs[xObj->getRefNum()]) { - return gFalse; - } - scannedObjs[xObj->getRefNum()] = 1; - xObj->fetch(xref, &xObj2); - } else { - xObj->copy(&xObj2); - } - if (xObj2.isDict()) { - dict = xObj2.getDict(); - } else if (xObj2.isStream()) { - dict = xObj2.streamGetDict(); - } else { - xObj2.free(); - return gFalse; - } - - if (!dict->lookupNF("Resources", &obj1)->isNull()) { - if (scanResourcesForBlendMode(&obj1, scannedObjs, xref)) { - obj1.free(); - xObj2.free(); - return gTrue; - } - } - obj1.free(); - - xObj2.free(); - - return gFalse; -} - //------------------------------------------------------------------------ // GfxShadingPattern //------------------------------------------------------------------------ @@ -3211,8 +2963,8 @@ void GfxGouraudTriangleShading::getTriangle( } } -void GfxGouraudTriangleShading::getBBox(double *xMinA, double *yMinA, - double *xMaxA, double *yMaxA) { +void GfxGouraudTriangleShading::getBBox(double *xMin, double *yMin, + double *xMax, double *yMax) { double xxMin = 0; double yyMin = 0; double xxMax = 0; @@ -3233,10 +2985,10 @@ void GfxGouraudTriangleShading::getBBox(double *xMinA, double *yMinA, yyMax = vertices[i].y; } } - *xMinA = xxMin; - *yMinA = yyMin; - *xMaxA = xxMax; - *yMaxA = yyMax; + *xMin = xxMin; + *yMin = yyMin; + *xMax = xxMax; + *yMax = yyMax; } void GfxGouraudTriangleShading::getColor(double *in, GfxColor *out) { @@ -3869,8 +3621,8 @@ GfxShading *GfxPatchMeshShading::copy() { return new GfxPatchMeshShading(this); } -void GfxPatchMeshShading::getBBox(double *xMinA, double *yMinA, - double *xMaxA, double *yMaxA) { +void GfxPatchMeshShading::getBBox(double *xMin, double *yMin, + double *xMax, double *yMax) { double xxMin = 0; double yyMin = 0; double xxMax = 0; @@ -3895,10 +3647,10 @@ void GfxPatchMeshShading::getBBox(double *xMinA, double *yMinA, } } } - *xMinA = xxMin; - *yMinA = yyMin; - *xMaxA = xxMax; - *yMaxA = yyMax; + *xMin = xxMin; + *yMin = yyMin; + *xMax = xxMax; + *yMax = yyMax; } void GfxPatchMeshShading::getColor(double *in, GfxColor *out) { @@ -4899,36 +4651,35 @@ void GfxState::clipToStrokePath() { // There are two cases for each point on the path: // (1) miter join, under miter limit => compute the miter point // (2) all other joins and caps => use the path point +/- 0.5 * line width - double uxMin = 0, uyMin = 0, uxMax = 0, uyMax = 0; + double xMin = 0, yMin = 0, xMax = 0, yMax = 0; double w = 0.5 * lineWidth; for (int i = 0; i < path->getNumSubpaths(); ++i) { GfxSubpath *subpath = path->getSubpath(i); - int nPoints; - if (subpath->isClosed()) { - nPoints = subpath->getNumPoints() - 1; - } else { - nPoints = subpath->getNumPoints(); - } - for (int j = 0; j < nPoints; ++j) { + for (int j = 0; j < subpath->getNumPoints(); ++j) { double x1 = subpath->getX(j); double y1 = subpath->getY(j); if (i == 0 && j == 0) { - uxMin = uxMax = x1; - uyMin = uyMax = y1; + xMin = xMax = x1; + yMin = yMax = y1; } GBool useMiter = gFalse; if (lineJoin == 0 && // miter join - (subpath->isClosed() || (j > 0 && j < subpath->getNumPoints() - 1))) { + ((j > 0 && j < subpath->getNumPoints() - 1) || subpath->isClosed())) { double x0, y0, x2, y2; - if (j == 0) { - x0 = subpath->getX(nPoints - 1); - y0 = subpath->getY(nPoints - 1); - } else { + if (j > 0) { x0 = subpath->getX(j - 1); y0 = subpath->getY(j - 1); + } else { + x0 = subpath->getLastX(); + y0 = subpath->getLastY(); + } + if (j < subpath->getNumPoints() - 1) { + x2 = subpath->getX(j + 1); + y2 = subpath->getY(j + 1); + } else { + x2 = subpath->getX(0); + y2 = subpath->getY(0); } - x2 = subpath->getX(j + 1); - y2 = subpath->getY(j + 1); if ((fabs(x1 - x0) > 0.0001 || fabs(y1 - y0) > 0.0001) && (fabs(x2 - x1) > 0.0001 || fabs(y2 - y1) > 0.0001)) { double d01 = 1 / sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)); @@ -4953,15 +4704,15 @@ void GfxState::clipToStrokePath() { } double mx = ax + m * w * ux; double my = ay + m * w * uy; - if (mx < uxMin) { - uxMin = mx; - } else if (mx > uxMax) { - uxMax = mx; + if (mx < xMin) { + xMin = mx; + } else if (mx > xMax) { + xMax = mx; } - if (my < uyMin) { - uyMin = my; - } else if (my > uyMax) { - uyMax = my; + if (my < yMin) { + yMin = my; + } else if (my > yMax) { + yMax = my; } useMiter = gTrue; } @@ -4969,71 +4720,66 @@ void GfxState::clipToStrokePath() { } } if (!useMiter) { - if (x1 - w < uxMin) { - uxMin = x1 - w; + if (x1 - w < xMin) { + xMin = x1 - w; } - if (x1 + w > uxMax) { - uxMax = x1 + w; + if (x1 + w > xMax) { + xMax = x1 + w; } - if (y1 - w < uyMin) { - uyMin = y1 - w; + if (y1 - w < yMin) { + yMin = y1 - w; } - if (y1 + w > uyMax) { - uyMax = y1 + w; + if (y1 + w > yMax) { + yMax = y1 + w; } } } } - double dxMin, dyMin, dxMax, dyMax, xx, yy; - transform(uxMin, uyMin, &xx, &yy); - dxMin = dxMax = xx; - dyMin = dyMax = yy; - transform(uxMin, uyMax, &xx, &yy); - if (xx < dxMin) { - dxMin = xx; - } else if (xx > dxMax) { - dxMax = xx; - } - if (yy < dyMin) { - dyMin = yy; - } else if (yy > dyMax) { - dyMax = yy; - } - transform(uxMax, uyMin, &xx, &yy); - if (xx < dxMin) { - dxMin = xx; - } else if (xx > dxMax) { - dxMax = xx; - } - if (yy < dyMin) { - dyMin = yy; - } else if (yy > dyMax) { - dyMax = yy; - } - transform(uxMax, uyMax, &xx, &yy); - if (xx < dxMin) { - dxMin = xx; - } else if (xx > dxMax) { - dxMax = xx; - } - if (yy < dyMin) { - dyMin = yy; - } else if (yy > dyMax) { - dyMax = yy; - } - - if (dxMin > clipXMin) { - clipXMin = dxMin; - } - if (dyMin > clipYMin) { - clipYMin = dyMin; - } - if (dxMax < clipXMax) { - clipXMax = dxMax; - } - if (dyMax < clipYMax) { - clipYMax = dyMax; + double xx, yy; + transform(xMin, yMin, &xx, &yy); + if (xx < clipXMin) { + clipXMin = xx; + } else if (xx > clipXMax) { + clipXMax = xx; + } + if (yy < clipYMin) { + clipYMin = yy; + } else if (yy > clipYMax) { + clipYMax = yy; + } + transform(xMin, yMax, &xx, &yy); + if (xx < clipXMin) { + clipXMin = xx; + } else if (xx > clipXMax) { + clipXMax = xx; + } + if (yy < clipYMin) { + clipYMin = yy; + } else if (yy > clipYMax) { + clipYMax = yy; + } + transform(xMax, yMin, &xx, &yy); + if (xx < clipXMin) { + clipXMin = xx; + } else if (xx > clipXMax) { + clipXMax = xx; + } + if (yy < clipYMin) { + clipYMin = yy; + } else if (yy > clipYMax) { + clipYMax = yy; + } + transform(xMax, yMax, &xx, &yy); + if (xx < clipXMin) { + clipXMin = xx; + } else if (xx > clipXMax) { + clipXMax = xx; + } + if (yy < clipYMin) { + clipYMin = yy; + } else if (yy > clipYMax) { + clipYMax = yy; } } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.h b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.h index 57b57e06a66..60d48527c29 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GfxState.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "Object.h" #include "Function.h" @@ -659,7 +663,6 @@ public: { return resDict.isDict() ? resDict.getDict() : (Dict *)NULL; } double *getMatrix() { return matrix; } Object *getContentStreamRef() { return &contentStreamRef; } - GBool usesBlendMode(XRef *xref); private: @@ -667,16 +670,6 @@ private: double *bboxA, double xStepA, double yStepA, Object *resDictA, double *matrixA, Object *contentStreamA); - GBool scanResourcesForBlendMode(Object *resDict2, - char *scannedObjs, XRef *xref); - GBool scanExtGStateForBlendMode(Object *gsObj, - char *scannedObjs, XRef *xref); - GBool scanSoftMaskForBlendMode(Object *softMaskObj, - char *scannedObjs, XRef *xref); - GBool scanPatternForBlendMode(Object *patternObj, - char *scannedObjs, XRef *xref); - GBool scanXObjectForBlendMode(Object *xObj, - char *scannedObjs, XRef *xref); int paintType; int tilingType; @@ -890,7 +883,7 @@ public: void getTriangle(int i, double *x0, double *y0, double *color0, double *x1, double *y1, double *color1, double *x2, double *y2, double *color2); - void getBBox(double *xMinA, double *yMinA, double *xMaxA, double *yMaxA); + void getBBox(double *xMin, double *yMin, double *xMax, double *yMax); void getColor(double *in, GfxColor *out); private: @@ -930,7 +923,7 @@ public: int getNComps() { return nComps; } int getNPatches() { return nPatches; } GfxPatch *getPatch(int i) { return &patches[i]; } - void getBBox(double *xMinA, double *yMinA, double *xMaxA, double *yMaxA); + void getBBox(double *xMin, double *yMin, double *xMax, double *yMax); void getColor(double *in, GfxColor *out); private: diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc index fcacd7f1e71..e7cc594b12d 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <string.h> #include <stdio.h> #include <stdarg.h> @@ -40,12 +44,10 @@ #include "GlobalParams.h" #ifdef _WIN32 -#ifndef __GNUC__ # undef strcasecmp # undef strncasecmp # define strcasecmp _stricmp # define strncasecmp _strnicmp -#endif #else # include <strings.h> #endif @@ -103,14 +105,14 @@ static struct { {NULL} }; -static const char *displayFontDirs[] = { -#ifdef BASE14_FONT_DIR - BASE14_FONT_DIR, -#endif #ifdef _WIN32 +static const char *displayFontDirs[] = { "c:/windows/fonts", "c:/winnt/fonts", -#else // _WIN32 + NULL +}; +#else +static const char *displayFontDirs[] = { "/usr/share/ghostscript/fonts", "/usr/local/share/ghostscript/fonts", "/usr/share/fonts/default/Type1", @@ -119,9 +121,9 @@ static const char *displayFontDirs[] = { #if defined(__sun) && defined(__SVR4) "/usr/sfw/share/ghostscript/fonts", #endif -#endif // _WIN32 NULL }; +#endif #ifdef __APPLE__ static const char *macSystemFontPath = "/System/Library/Fonts"; @@ -181,7 +183,7 @@ public: ~SysFontInfo(); GString *mungeName1(GString *in); GString *mungeName2(GString *in); - void mungeName3(GString *nameA, GBool *bold, GBool *italic); + void mungeName3(GString *name, GBool *bold, GBool *italic); int match(GString *nameA); }; @@ -258,24 +260,24 @@ GString *SysFontInfo::mungeName2(GString *in) { // Remove trailing bold/italic/regular/roman tags from the name. // (Note: the names have already been uppercased by mungeName1/2.) -void SysFontInfo::mungeName3(GString *nameA, GBool *bold, GBool *italic) { +void SysFontInfo::mungeName3(GString *name, GBool *bold, GBool *italic) { *bold = gFalse; *italic = gFalse; - int n = nameA->getLength(); + int n = name->getLength(); while (1) { - if (n >= 4 && !strcmp(nameA->getCString() + n - 4, "BOLD")) { - nameA->del(n - 4, 4); + if (n >= 4 && !strcmp(name->getCString() + n - 4, "BOLD")) { + name->del(n - 4, 4); n -= 4; *bold = gTrue; - } else if (n >= 6 && !strcmp(nameA->getCString() + n - 6, "ITALIC")) { - nameA->del(n - 6, 6); + } else if (n >= 6 && !strcmp(name->getCString() + n - 6, "ITALIC")) { + name->del(n - 6, 6); n -= 6; *italic = gTrue; - } else if (n >= 7 && !strcmp(nameA->getCString() + n - 7, "REGULAR")) { - nameA->del(n - 7, 7); + } else if (n >= 7 && !strcmp(name->getCString() + n - 7, "REGULAR")) { + name->del(n - 7, 7); n -= 7; - } else if (n >= 5 && !strcmp(nameA->getCString() + n - 5, "ROMAN")) { - nameA->del(n - 5, 5); + } else if (n >= 5 && !strcmp(name->getCString() + n - 5, "ROMAN")) { + name->del(n - 5, 5); n -= 5; } else { break; @@ -657,7 +659,7 @@ GlobalParams::GlobalParams(const char *cfgFileName) { base14SysFonts = new GHash(gTrue); sysFonts = new SysFontList(); #if HAVE_PAPER_H - const char *paperName; + char *paperName; const struct paper *paperType; paperinit(); if ((paperName = systempapername())) { @@ -713,21 +715,6 @@ GlobalParams::GlobalParams(const char *cfgFileName) { textKeepTinyChars = gTrue; initialZoom = new GString("125"); defaultFitZoom = 0; - zoomScaleFactor = 1; - zoomValues = new GList(); - zoomValues->append(new GString("25")); - zoomValues->append(new GString("50")); - zoomValues->append(new GString("75")); - zoomValues->append(new GString("100")); - zoomValues->append(new GString("110")); - zoomValues->append(new GString("125")); - zoomValues->append(new GString("150")); - zoomValues->append(new GString("175")); - zoomValues->append(new GString("200")); - zoomValues->append(new GString("300")); - zoomValues->append(new GString("400")); - zoomValues->append(new GString("600")); - zoomValues->append(new GString("800")); initialDisplayMode = new GString("continuous"); initialToolbarState = gTrue; initialSidebarState = gTrue; @@ -761,7 +748,6 @@ GlobalParams::GlobalParams(const char *cfgFileName) { fullScreenMatteColor = new GString("#000000"); selectionColor = new GString("#8080ff"); reverseVideoInvertImages = gFalse; - allowLinksToChangeZoom = gTrue; launchCommand = NULL; movieCommand = NULL; defaultPrinter = NULL; @@ -769,15 +755,10 @@ GlobalParams::GlobalParams(const char *cfgFileName) { mapUnknownCharNames = gFalse; mapExtTrueTypeFontsViaUnicode = gTrue; useTrueTypeUnicodeMapping = gFalse; - ignoreWrongSizeToUnicode = gFalse; droppedFonts = new GHash(gTrue); - separateRotatedText = gFalse; createDefaultKeyBindings(); popupMenuCmds = new GList(); -#ifndef PDF_PARSER_ONLY - initStateFilePaths(); -#endif - saveSessionOnQuit = gTrue; + tabStateFile = appendToPath(getHomeDir(), ".xpdf.tab-state"); savePageNumbers = gTrue; printCommands = gFalse; printStatusInfo = gFalse; @@ -1036,27 +1017,6 @@ void GlobalParams::createDefaultKeyBindings() { xpdfKeyContextAny, "zoomFitWidth")); } -#ifndef PDF_PARSER_ONLY -void GlobalParams::initStateFilePaths() { -#ifdef _WIN32 - char path[MAX_PATH]; - if (SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, - SHGFP_TYPE_CURRENT, path) != S_OK) { - return; - } - GString *dir = appendToPath(new GString(path), "xpdf"); - CreateDirectoryA(dir->getCString(), NULL); - pagesFile = appendToPath(dir->copy(), "xpdf.pages"); - tabStateFile = appendToPath(dir->copy(), "xpdf.tab-state"); - sessionFile = appendToPath(dir, "xpdf.session"); -#else - pagesFile = appendToPath(getHomeDir(), ".xpdf.pages"); - tabStateFile = appendToPath(getHomeDir(), ".xpdf.tab-state"); - sessionFile = appendToPath(getHomeDir(), ".xpdf.session"); -#endif -} -#endif - void GlobalParams::parseFile(GString *fileName, FILE *f) { int line; char buf[512]; @@ -1197,10 +1157,6 @@ void GlobalParams::parseLine(char *buf, GString *fileName, int line) { parseString("initialZoom", &initialZoom, tokens, fileName, line); } else if (!cmd->cmp("defaultFitZoom")) { parseInteger("defaultFitZoom", &defaultFitZoom, tokens, fileName, line); - } else if (!cmd->cmp("zoomScaleFactor")) { - parseZoomScaleFactor(tokens, fileName, line); - } else if (!cmd->cmp("zoomValues")) { - parseZoomValues(tokens, fileName, line); } else if (!cmd->cmp("initialDisplayMode")) { parseString("initialDisplayMode", &initialDisplayMode, tokens, fileName, line); @@ -1288,9 +1244,6 @@ void GlobalParams::parseLine(char *buf, GString *fileName, int line) { } else if (!cmd->cmp("reverseVideoInvertImages")) { parseYesNo("reverseVideoInvertImages", &reverseVideoInvertImages, tokens, fileName, line); - } else if (!cmd->cmp("allowLinksToChangeZoom")) { - parseYesNo("allowLinksToChangeZoom", &allowLinksToChangeZoom, - tokens, fileName, line); } else if (!cmd->cmp("launchCommand")) { parseString("launchCommand", &launchCommand, tokens, fileName, line); } else if (!cmd->cmp("movieCommand")) { @@ -1308,16 +1261,11 @@ void GlobalParams::parseLine(char *buf, GString *fileName, int line) { &mapExtTrueTypeFontsViaUnicode, tokens, fileName, line); } else if (!cmd->cmp("useTrueTypeUnicodeMapping")) { - parseYesNo("useTrueTypeUnicodeMapping", &useTrueTypeUnicodeMapping, - tokens, fileName, line); - } else if (!cmd->cmp("ignoreWrongSizeToUnicode")) { - parseYesNo("ignoreWrongSizeToUnicode", &ignoreWrongSizeToUnicode, + parseYesNo("useTrueTypeUnicodeMapping", + &useTrueTypeUnicodeMapping, tokens, fileName, line); } else if (!cmd->cmp("dropFont")) { parseDropFont(tokens, fileName, line); - } else if (!cmd->cmp("separateRotatedText")) { - parseYesNo("separateRotatedText", &separateRotatedText, - tokens, fileName, line); } else if (!cmd->cmp("bind")) { parseBind(tokens, fileName, line); } else if (!cmd->cmp("unbind")) { @@ -1326,11 +1274,6 @@ void GlobalParams::parseLine(char *buf, GString *fileName, int line) { parsePopupMenuCmd(tokens, fileName, line); } else if (!cmd->cmp("tabStateFile")) { parseString("tabStateFile", &tabStateFile, tokens, fileName, line); - } else if (!cmd->cmp("sessionFile")) { - parseString("sessionFile", &sessionFile, tokens, fileName, line); - } else if (!cmd->cmp("saveSessionOnQuit")) { - parseYesNo("saveSessionOnQuit", &saveSessionOnQuit, - tokens, fileName, line); } else if (!cmd->cmp("savePageNumbers")) { parseYesNo("savePageNumbers", &savePageNumbers, tokens, fileName, line); } else if (!cmd->cmp("printCommands")) { @@ -2030,59 +1973,6 @@ void GlobalParams::parsePopupMenuCmd(GList *tokens, cmds)); } -void GlobalParams::parseZoomScaleFactor(GList *tokens, - GString *fileName, int line) { - if (tokens->getLength() != 2) { - error(errConfig, -1, "Bad 'zoomScaleFactor' config file command ({0:t}:{1:d})", - fileName, line); - return; - } - GString *tok = (GString *)tokens->get(1); - if (tok->getLength() == 0) { - error(errConfig, -1, "Bad 'zoomScaleFactor' config file command ({0:t}:{1:d})", - fileName, line); - return; - } - if (tok->cmp("actual") == 0) { - zoomScaleFactor = -1; - } else { - for (int i = 0; i < tok->getLength(); ++i) { - if (!((tok->getChar(i) >= '0' && tok->getChar(i) <= '9') || - tok->getChar(i) == '.')) { - error(errConfig, -1, "Bad 'zoomScaleFactor' config file command ({0:t}:{1:d})", - fileName, line); - return; - } - } - zoomScaleFactor = atof(tok->getCString()); - } -} - -void GlobalParams::parseZoomValues(GList *tokens, - GString *fileName, int line) { - if (tokens->getLength() < 2) { - error(errConfig, -1, "Bad 'zoomValues' config file command ({0:t}:{1:d})", - fileName, line); - return; - } - for (int i = 1; i < tokens->getLength(); ++i) { - GString *tok = (GString *)tokens->get(i); - for (int j = 0; j < tok->getLength(); ++j) { - if (tok->getChar(j) < '0' || tok->getChar(j) > '9') { - error(errConfig, -1, "Bad 'zoomValues' config file command ({0:t}:{1:d})", - fileName, line); - return; - } - } - } - deleteGList(zoomValues, GString); - zoomValues = new GList(); - for (int i = 1; i < tokens->getLength(); ++i) { - GString *tok = (GString *)tokens->get(i); - zoomValues->append(tok->copy()); - } -} - void GlobalParams::parseYesNo(const char *cmdName, GBool *flag, GList *tokens, GString *fileName, int line) { GString *tok; @@ -2214,7 +2104,6 @@ GlobalParams::~GlobalParams() { deleteGList(psResidentFontsCC, PSFontParam16); delete textEncoding; delete initialZoom; - deleteGList(zoomValues, GString); delete initialDisplayMode; delete initialSelectMode; if (paperColor) { @@ -2241,9 +2130,7 @@ GlobalParams::~GlobalParams() { delete droppedFonts; deleteGList(keyBindings, KeyBinding); deleteGList(popupMenuCmds, PopupMenuCmd); - delete pagesFile; delete tabStateFile; - delete sessionFile; delete debugLogFile; cMapDirs->startIter(&iter); @@ -3072,19 +2959,6 @@ int GlobalParams::getDefaultFitZoom() { return z; } -double GlobalParams::getZoomScaleFactor() { - double z; - - lockGlobalParams; - z = zoomScaleFactor; - unlockGlobalParams; - return z; -} - -GList *GlobalParams::getZoomValues() { - return zoomValues; -} - GString *GlobalParams::getInitialDisplayMode() { GString *s; @@ -3376,15 +3250,6 @@ GBool GlobalParams::getReverseVideoInvertImages() { return invert; } -GBool GlobalParams::getAllowLinksToChangeZoom() { - GBool allow; - - lockGlobalParams; - allow = allowLinksToChangeZoom; - unlockGlobalParams; - return allow; -} - GString *GlobalParams::getDefaultPrinter() { GString *s; @@ -3430,15 +3295,6 @@ GBool GlobalParams::getUseTrueTypeUnicodeMapping() { return use; } -GBool GlobalParams::getIgnoreWrongSizeToUnicode() { - GBool ignore; - - lockGlobalParams; - ignore = ignoreWrongSizeToUnicode; - unlockGlobalParams; - return ignore; -} - GBool GlobalParams::isDroppedFont(const char *fontName) { GBool isDropped; @@ -3448,15 +3304,6 @@ GBool GlobalParams::isDroppedFont(const char *fontName) { return isDropped; } -GBool GlobalParams::getSeparateRotatedText() { - GBool sep; - - lockGlobalParams; - sep = separateRotatedText; - unlockGlobalParams; - return sep; -} - GList *GlobalParams::getKeyBinding(int code, int mods, int context) { KeyBinding *binding; GList *cmds; @@ -3509,15 +3356,6 @@ PopupMenuCmd *GlobalParams::getPopupMenuCmd(int idx) { return cmd; } -GString *GlobalParams::getPagesFile() { - GString *s; - - lockGlobalParams; - s = pagesFile->copy(); - unlockGlobalParams; - return s; -} - GString *GlobalParams::getTabStateFile() { GString *s; @@ -3527,15 +3365,6 @@ GString *GlobalParams::getTabStateFile() { return s; } -GString *GlobalParams::getSessionFile() { - GString *s; - - lockGlobalParams; - s = sessionFile->copy(); - unlockGlobalParams; - return s; -} - GBool GlobalParams::getSavePageNumbers() { GBool s; @@ -3545,15 +3374,6 @@ GBool GlobalParams::getSavePageNumbers() { return s; } -GBool GlobalParams::getSaveSessionOnQuit() { - GBool s; - - lockGlobalParams; - s = saveSessionOnQuit; - unlockGlobalParams; - return s; -} - GBool GlobalParams::getPrintCommands() { GBool p; @@ -3892,12 +3712,6 @@ void GlobalParams::setInitialZoom(char *s) { unlockGlobalParams; } -void GlobalParams::setDefaultFitZoom(int z) { - lockGlobalParams; - defaultFitZoom = z; - unlockGlobalParams; -} - GBool GlobalParams::setEnableFreeType(char *s) { GBool ok; @@ -4001,13 +3815,6 @@ void GlobalParams::setTabStateFile(char *tabStateFileA) { unlockGlobalParams; } -void GlobalParams::setSessionFile(char *sessionFileA) { - lockGlobalParams; - delete sessionFile; - sessionFile = new GString(sessionFileA); - unlockGlobalParams; -} - void GlobalParams::setPrintCommands(GBool printCommandsA) { lockGlobalParams; printCommands = printCommandsA; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.h b/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.h index c9b4c7bdc09..d72473f2a46 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/GlobalParams.h @@ -14,6 +14,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <stdio.h> #ifdef _WIN32 # include <windows.h> @@ -299,8 +303,6 @@ public: GBool getTextKeepTinyChars(); GString *getInitialZoom(); int getDefaultFitZoom(); - double getZoomScaleFactor(); - GList *getZoomValues(); GString *getInitialDisplayMode(); GBool getInitialToolbarState(); GBool getInitialSidebarState(); @@ -334,7 +336,6 @@ public: GString *getFullScreenMatteColor(); GString *getSelectionColor(); GBool getReverseVideoInvertImages(); - GBool getAllowLinksToChangeZoom(); GString *getLaunchCommand() { return launchCommand; } GString *getMovieCommand() { return movieCommand; } GString *getDefaultPrinter(); @@ -342,17 +343,12 @@ public: GBool getMapUnknownCharNames(); GBool getMapExtTrueTypeFontsViaUnicode(); GBool getUseTrueTypeUnicodeMapping(); - GBool getIgnoreWrongSizeToUnicode(); GBool isDroppedFont(const char *fontName); - GBool getSeparateRotatedText(); GList *getKeyBinding(int code, int mods, int context); GList *getAllKeyBindings(); int getNumPopupMenuCmds(); PopupMenuCmd *getPopupMenuCmd(int idx); - GString *getPagesFile(); GString *getTabStateFile(); - GString *getSessionFile(); - GBool getSaveSessionOnQuit(); GBool getSavePageNumbers(); GBool getPrintCommands(); GBool getPrintStatusInfo(); @@ -394,7 +390,6 @@ public: void setTextPageBreaks(GBool pageBreaks); void setTextKeepTinyChars(GBool keep); void setInitialZoom(char *s); - void setDefaultFitZoom(int z); GBool setEnableFreeType(char *s); GBool setAntialias(char *s); GBool setVectorAntialias(char *s); @@ -410,7 +405,6 @@ public: void setMapUnknownCharNames(GBool map); void setMapExtTrueTypeFontsViaUnicode(GBool map); void setTabStateFile(char *tabStateFileA); - void setSessionFile(char *sessionFileA); void setPrintCommands(GBool printCommandsA); void setPrintStatusInfo(GBool printStatusInfoA); void setErrQuiet(GBool errQuietA); @@ -426,9 +420,6 @@ private: void setDataDirVar(); void createDefaultKeyBindings(); -#ifndef PDF_PARSER_ONLY - void initStateFilePaths(); -#endif void parseFile(GString *fileName, FILE *f); GList *parseLineTokens(char *buf, GString *fileName, int line); void parseNameToUnicode(GList *tokens, GString *fileName, int line); @@ -459,8 +450,6 @@ private: const char *cmdName, GList *tokens, GString *fileName, int line); void parsePopupMenuCmd(GList *tokens, GString *fileName, int line); - void parseZoomScaleFactor(GList *tokens, GString *fileName, int line); - void parseZoomValues(GList *tokens, GString *fileName, int line); void parseYesNo(const char *cmdName, GBool *flag, GList *tokens, GString *fileName, int line); GBool parseYesNo2(char *token, GBool *flag); @@ -559,9 +548,7 @@ private: GBool textKeepTinyChars; // keep all characters in text output GString *initialZoom; // initial zoom level int defaultFitZoom; // default zoom factor if initialZoom is - // 'page' or 'width' - double zoomScaleFactor; // displayed zoom values are scaled by this - GList *zoomValues; // zoom values for the combo box + // 'page' or 'width'. GString *initialDisplayMode; // initial display mode (single, // continuous, etc.) GBool initialToolbarState; // initial toolbar state - open (true) @@ -599,7 +586,6 @@ private: GString *fullScreenMatteColor; // matte color in full-screen mode GString *selectionColor; // selection color GBool reverseVideoInvertImages; // invert images in reverse video mode - GBool allowLinksToChangeZoom; // allow clicking on a link to change the zoom GString *launchCommand; // command executed for 'launch' links GString *movieCommand; // command executed for movie annotations GString *defaultPrinter; // default printer (for interactive printing @@ -611,16 +597,10 @@ private: GBool useTrueTypeUnicodeMapping; // use the Unicode cmaps in TrueType // fonts, rather than the PDF // ToUnicode mapping - GBool ignoreWrongSizeToUnicode; // ignore ToUnicode CMaps if their size - // (8-bit vs 16-bit) doesn't match the font GHash *droppedFonts; // dropped fonts [int] - GBool separateRotatedText; // separate text at each rotation GList *keyBindings; // key & mouse button bindings [KeyBinding] GList *popupMenuCmds; // popup menu commands [PopupMenuCmd] - GString *pagesFile; // path for the page number save file GString *tabStateFile; // path for the tab state save file - GString *sessionFile; // path for the session save file - GBool saveSessionOnQuit; // save session info when xpdf is quit GBool savePageNumbers; // save page number when file is closed // and restore page number when opened GBool printCommands; // print the drawing commands diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc index 0183d3a14f4..a077655ef43 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc @@ -21,6 +21,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <png.h> #include "gmem.h" @@ -31,7 +35,6 @@ #include "PDFDoc.h" #include "GfxFont.h" #include "AcroForm.h" -#include "TextString.h" #include "TextOutputDev.h" #include "SplashOutputDev.h" #include "ErrorCodes.h" @@ -39,11 +42,9 @@ #include "HTMLGen.h" #ifdef _WIN32 -#ifndef __GNUC__ # define strcasecmp stricmp # define strncasecmp strnicmp #endif -#endif //------------------------------------------------------------------------ @@ -296,7 +297,6 @@ HTMLGen::HTMLGen(double backgroundResolutionA, GBool tableMode) { convertFormFields = gFalse; embedBackgroundImage = gFalse; embedFonts = gFalse; - includeMetadata = gFalse; // set up the TextOutputDev textOutControl.mode = tableMode ? textOutTableLayout : textOutReadingOrder; @@ -312,10 +312,6 @@ HTMLGen::HTMLGen(double backgroundResolutionA, GBool tableMode) { splashOut = new SplashOutputDev(splashModeRGB8, 1, gFalse, paperColor); fontDefns = NULL; - - nVisibleChars = 0; - nInvisibleChars = 0; - nRemovedDupChars = 0; } HTMLGen::~HTMLGen() { @@ -466,11 +462,11 @@ int HTMLGen::convertPage( llyI = bitmap->getHeight() - 1; } if (uryI <= llyI && llxI <= urxI) { - SplashColorPtr pix = bitmap->getDataPtr() - + uryI * bitmap->getRowSize() + llxI * 3; - for (y = uryI; y <= llyI; ++y) { - memset(pix, 0xff, (urxI - llxI + 1) * 3); - pix += bitmap->getRowSize(); + SplashColorPtr p = bitmap->getDataPtr() + + uryI * bitmap->getRowSize() + llxI * 3; + for (int y = uryI; y <= llyI; ++y) { + memset(p, 0xff, (urxI - llxI + 1) * 3); + p += bitmap->getRowSize(); } } @@ -487,9 +483,6 @@ int HTMLGen::convertPage( pr(writeHTML, htmlStream, "<html>\n"); pr(writeHTML, htmlStream, "<head>\n"); pr(writeHTML, htmlStream, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n"); - if (includeMetadata) { - genDocMetadata(writeHTML, htmlStream); - } pr(writeHTML, htmlStream, "<style type=\"text/css\">\n"); pr(writeHTML, htmlStream, ".txt { white-space:nowrap; }\n"); if (convertFormFields) { @@ -578,9 +571,6 @@ int HTMLGen::convertPage( // generate the HTML text nextFieldID = 0; cols = text->makeColumns(); - nVisibleChars = text->getNumVisibleChars(); - nInvisibleChars = text->getNumInvisibleChars(); - nRemovedDupChars = text->getNumRemovedDupChars(); for (colIdx = 0; colIdx < cols->getLength(); ++colIdx) { col = (TextColumn *)cols->get(colIdx); pars = col->getParagraphs(); @@ -1128,47 +1118,3 @@ void HTMLGen::getFontDetails(TextFontInfo *font, const char **family, *weight = bold ? "bold" : "normal"; *style = italic ? "italic" : "normal"; } - -void HTMLGen::genDocMetadata(int (*writeHTML)(void *stream, - const char *data, int size), - void *htmlStream) { - Object info; - doc->getDocInfo(&info); - if (info.isDict()) { - genDocMetadataItem(writeHTML, htmlStream, info.getDict(), "Title"); - genDocMetadataItem(writeHTML, htmlStream, info.getDict(), "Subject"); - genDocMetadataItem(writeHTML, htmlStream, info.getDict(), "Keywords"); - genDocMetadataItem(writeHTML, htmlStream, info.getDict(), "Author"); - genDocMetadataItem(writeHTML, htmlStream, info.getDict(), "Creator"); - genDocMetadataItem(writeHTML, htmlStream, info.getDict(), "Producer"); - genDocMetadataItem(writeHTML, htmlStream, info.getDict(), "CreationDate"); - genDocMetadataItem(writeHTML, htmlStream, info.getDict(), "ModDate"); - } - info.free(); -} - -void HTMLGen::genDocMetadataItem(int (*writeHTML)(void *stream, - const char *data, int size), - void *htmlStream, - Dict *infoDict, const char *key) { - Object val; - if (infoDict->lookup(key, &val)->isString()) { - GString *s = GString::format("<meta name=\"{0:s}\" content=\"", key); - TextString *ts = new TextString(val.getString()); - Unicode *u = ts->getUnicode(); - for (int i = 0; i < ts->getLength(); ++i) { - if (u[i] == '"') { - s->append("""); - } else if (u[i] == '&') { - s->append("&"); - } else { - appendUTF8(u[i], s); - } - } - delete ts; - s->append("\">\n"); - writeHTML(htmlStream, s->getCString(), s->getLength()); - delete s; - } - val.free(); -} diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.h b/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.h index 47e361f78fa..66ee2d27406 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/HTMLGen.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + class GString; class PDFDoc; class TextOutputDev; @@ -57,9 +61,6 @@ public: void setEmbedFonts(GBool embedFontsA) { embedFonts = embedFontsA; } - void setIncludeMetadata(GBool includeMetadataA) - { includeMetadata = includeMetadataA; } - void startDoc(PDFDoc *docA); int convertPage(int pg, const char *pngURL, const char *htmlDir, int (*writeHTML)(void *stream, const char *data, int size), @@ -67,11 +68,6 @@ public: int (*writePNG)(void *stream, const char *data, int size), void *pngStream); - // Get the counter values. - int getNumVisibleChars() { return nVisibleChars; } - int getNumInvisibleChars() { return nInvisibleChars; } - int getNumRemovedDupChars() { return nRemovedDupChars; } - private: int findDirSpan(GList *words, int firstWordIdx, int primaryDir, @@ -86,13 +82,6 @@ private: void getFontDetails(TextFontInfo *font, const char **family, const char **weight, const char **style, double *scale); - void genDocMetadata(int (*writeHTML)(void *stream, - const char *data, int size), - void *htmlStream); - void genDocMetadataItem(int (*writeHTML)(void *stream, - const char *data, int size), - void *htmlStream, - Dict *infoDict, const char *key); double backgroundResolution; double zoom; @@ -103,7 +92,6 @@ private: GBool convertFormFields; GBool embedBackgroundImage; GBool embedFonts; - GBool includeMetadata; PDFDoc *doc; TextOutputDev *textOut; @@ -119,10 +107,6 @@ private: GList *formFieldInfo; // [HTMLGenFormFieldInfo] int nextFieldID; - int nVisibleChars; // number of visible chars on the page - int nInvisibleChars; // number of invisible chars on the page - int nRemovedDupChars; // number of duplicate chars removed - GBool ok; }; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.cc index 2c2db13fa4d..5a694d7b665 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <stdlib.h> #include <stddef.h> @@ -18,7 +22,6 @@ #include "config.h" #include "Error.h" #include "GfxState.h" -#include "Gfx.h" #include "Object.h" #include "Stream.h" #include "ImageOutputDev.h" @@ -49,8 +52,7 @@ void ImageOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx, double *mat, double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep) { - // draw the tile once, just in case it contains image(s) - gfx->drawForm(strRef, resDict, mat, bbox); + // do nothing -- this avoids the potentially slow loop in Gfx.cc } void ImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.h b/Build/source/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.h index 0abe6f1bb55..5a72925aee9 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <stdio.h> #include "gtypes.h" #include "OutputDev.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.cc index f00063e8ec2..3d10cb4acad 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmempp.h" #include "Object.h" #include "Stream.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.h b/Build/source/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.h index 8714b46a9ef..c0f773fb107 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.h @@ -13,6 +13,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" class Stream; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.cc index 8d71e17f96c..02450b4f816 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <limits.h> #include "gmempp.h" @@ -1794,11 +1798,6 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length, break; } } - if (refAggNum <= 0 || refAggNum > 10000) { - error(errSyntaxError, getPos(), - "Invalid refinement/aggregation instance count in JBIG2 symbol dictionary"); - goto syntaxError; - } #if 0 //~ This special case was added about a year before the final draft //~ of the JBIG2 spec was released. I have encountered some old //~ JBIG2 images that predate it. @@ -2441,18 +2440,6 @@ JBIG2Bitmap *JBIG2Stream::readTextRegion(GBool huff, GBool refine, refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx; refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy; - if (rdw > INT_MAX - syms[symID]->getWidth() || - rdh > INT_MAX - syms[symID]->getHeight()) { - error(errSyntaxError, getPos(), - "Invalid refinement size in JBIG2 text region"); - continue; - } - // sanity check - if (rdw > 1000 || rdh > 1000) { - error(errSyntaxError, getPos(), - "Invalid refinement size in JBIG2 text region"); - continue; - } symbolBitmap = readGenericRefinementRegion(rdw + syms[symID]->getWidth(), rdh + syms[symID]->getHeight(), @@ -2540,8 +2527,7 @@ void JBIG2Stream::readPatternDictSeg(Guint segNum, Guint length) { !readULong(&grayMax)) { goto eofError; } - if (patternW == 0 || patternH == 0 || - grayMax > UINT_MAX / patternW - 1) { + if (patternW == 0 || patternH == 0) { error(errSyntaxError, getPos(), "Bad size in JBIG2 pattern dictionary segment"); return; @@ -3962,9 +3948,7 @@ void JBIG2Stream::readPageInfoSeg(Guint length) { !readUByte(&flags) || !readUWord(&striping)) { goto eofError; } - if (pageW == 0 || pageH == 0 || - pageW > INT_MAX || pageH > INT_MAX || - pageH > INT_MAX / pageW) { + if (pageW == 0 || pageH == 0 || pageW > INT_MAX / pageW) { error(errSyntaxError, getPos(), "Bad page size in JBIG2 stream"); return; } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.h b/Build/source/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.h index 4964255bbf7..bb44ba1ab01 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "Object.h" #include "Stream.h" @@ -41,7 +45,6 @@ public: virtual GString *getPSFilter(int psLevel, const char *indent, GBool okToReadStream); virtual GBool isBinary(GBool last = gTrue); - virtual GBool hasStrongCompression() { return gTrue; } private: diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/JPXStream.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/JPXStream.cc index 5ed1890a1d3..a1f7395dd57 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/JPXStream.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/JPXStream.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <limits.h> #include "gmem.h" #include "gmempp.h" @@ -1113,7 +1117,6 @@ JPXDecodeResult JPXStream::readCodestream(Guint len) { "JPX COC marker segment before COD segment"); return jpxDecodeFatalError; } - comp = 0; if ((img.nComps > 256 && !readUWord(&comp)) || (img.nComps <= 256 && !readUByte(&comp)) || comp >= img.nComps || @@ -1266,7 +1269,6 @@ JPXDecodeResult JPXStream::readCodestream(Guint len) { "JPX QCC marker segment before QCD segment"); return jpxDecodeFatalError; } - comp = 0; if ((img.nComps > 256 && !readUWord(&comp)) || (img.nComps <= 256 && !readUByte(&comp)) || comp >= img.nComps || @@ -1639,7 +1641,6 @@ GBool JPXStream::readTilePart() { error(errSyntaxError, getPos(), "Extraneous JPX COC marker segment"); return gFalse; } - comp = 0; if ((img.nComps > 256 && !readUWord(&comp)) || (img.nComps <= 256 && !readUByte(&comp)) || comp >= img.nComps || @@ -1773,7 +1774,6 @@ GBool JPXStream::readTilePart() { error(errSyntaxError, getPos(), "Extraneous JPX QCC marker segment"); return gFalse; } - comp = 0; if ((img.nComps > 256 && !readUWord(&comp)) || (img.nComps <= 256 && !readUByte(&comp)) || comp >= img.nComps || @@ -2619,12 +2619,7 @@ GBool JPXStream::readCodeBlockData(JPXTileComp *tileComp, if (cb->arithDecoder) { cover(63); - if (tileComp->codeBlockStyle & 0x04) { - cb->arithDecoder->setStream(bufStr, cb->dataLen[0]); - cb->arithDecoder->start(); - } else { - cb->arithDecoder->restart(cb->dataLen[0]); - } + cb->arithDecoder->restart(cb->dataLen[0]); } else { cover(64); cb->arithDecoder = new JArithmeticDecoder(); @@ -3324,7 +3319,7 @@ void JPXStream::inverseTransform1D(JPXTileComp *tileComp, int *data, // converts fixed point samples back to integers. GBool JPXStream::inverseMultiCompAndDC(JPXTile *tile) { JPXTileComp *tileComp; - int coeff, d0, d1, d2, t, minVal, maxVal, zeroVal, shift, rounding; + int coeff, d0, d1, d2, t, minVal, maxVal, zeroVal; int *dataPtr; Guint j, comp, x, y; @@ -3409,14 +3404,12 @@ GBool JPXStream::inverseMultiCompAndDC(JPXTile *tile) { maxVal = (1 << tileComp->prec) - 1; zeroVal = 1 << (tileComp->prec - 1); dataPtr = tileComp->data; - shift = fracBits - tileComp->prec; - rounding = 1 << (shift - 1); for (y = 0; y < tileComp->h; ++y) { for (x = 0; x < tileComp->w; ++x) { coeff = *dataPtr; if (tileComp->transform == 0) { cover(112); - coeff = (coeff + rounding) >> shift; + coeff >>= fracBits - tileComp->prec; } coeff += zeroVal; if (coeff < 0) { diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/JPXStream.h b/Build/source/libs/xpdf/xpdf-src/xpdf/JPXStream.h index ce12427ced9..4b8587b0fb2 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/JPXStream.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/JPXStream.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "Object.h" #include "Stream.h" @@ -287,7 +291,6 @@ public: virtual GString *getPSFilter(int psLevel, const char *indent, GBool okToReadStream); virtual GBool isBinary(GBool last = gTrue); - virtual GBool hasStrongCompression() { return gTrue; } virtual void getImageParams(int *bitsPerComponent, StreamColorSpaceMode *csMode); void reduceResolution(int reductionA) { reduction = reductionA; } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Lexer.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Lexer.cc index d1066d33837..0c74dbb04ea 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Lexer.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Lexer.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <stddef.h> #include <string.h> @@ -109,7 +113,7 @@ Object *Lexer::getObj(Object *obj) { char *p; int c, c2; GBool comment, neg, doubleMinus, done, invalid; - int numParen, nErrors; + int numParen; int xi; double xf, scale; GString *s; @@ -430,8 +434,7 @@ Object *Lexer::getObj(Object *obj) { m = n = 0; c2 = 0; s = NULL; - nErrors = 0; - while (nErrors < 100) { + while (1) { c = getChar(); if (c == '>') { break; @@ -440,17 +443,15 @@ Object *Lexer::getObj(Object *obj) { break; } else if (specialChars[c] != 1) { c2 = c2 << 4; - if (c >= '0' && c <= '9') { + if (c >= '0' && c <= '9') c2 += c - '0'; - } else if (c >= 'A' && c <= 'F') { + else if (c >= 'A' && c <= 'F') c2 += c - 'A' + 10; - } else if (c >= 'a' && c <= 'f') { + else if (c >= 'a' && c <= 'f') c2 += c - 'a' + 10; - } else { + else error(errSyntaxError, getPos(), "Illegal character <{0:02x}> in hex string", c); - ++nErrors; - } if (++m == 2) { if (n == tokBufSize) { if (!s) diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Lexer.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Lexer.h index 458a5851584..d481c2c5a2b 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Lexer.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Lexer.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "Object.h" #include "Stream.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Link.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Link.cc index 60f20867338..900f79ddf85 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Link.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Link.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stddef.h> #include <string.h> #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Link.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Link.h index d6155447e92..480496ad176 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Link.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Link.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "Object.h" class GString; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/NameToCharCode.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/NameToCharCode.cc index 0088986d2f0..f846d8e940d 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/NameToCharCode.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/NameToCharCode.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <string.h> #include "gmem.h" #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/NameToCharCode.h b/Build/source/libs/xpdf/xpdf-src/xpdf/NameToCharCode.h index cf2170bfd46..6548133cdcd 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/NameToCharCode.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/NameToCharCode.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "CharTypes.h" struct NameToCharCodeEntry; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Object.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Object.cc index dbb785868c8..898fbc99e2b 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Object.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Object.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stddef.h> #include "gmempp.h" #include "Object.h" @@ -38,7 +42,7 @@ const char *objTypeNames[numObjTypes] = { "none" }; -#ifdef DEBUG_OBJECT_MEM +#ifdef DEBUG_MEM #if MULTITHREADED GAtomicCounter Object::numAlloc[numObjTypes] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -46,7 +50,7 @@ GAtomicCounter Object::numAlloc[numObjTypes] = long Object::numAlloc[numObjTypes] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; #endif -#endif // DEBUG_OBJECT_MEM +#endif // DEBUG_MEM Object *Object::initArray(XRef *xref) { initObj(objArray); @@ -97,7 +101,7 @@ Object *Object::copy(Object *obj) { default: break; } -#ifdef DEBUG_OBJECT_MEM +#ifdef DEBUG_MEM #if MULTITHREADED gAtomicIncrement(&numAlloc[type]); #else @@ -139,7 +143,7 @@ void Object::free() { default: break; } -#ifdef DEBUG_OBJECT_MEM +#ifdef DEBUG_MEM #if MULTITHREADED gAtomicDecrement(&numAlloc[type]); #else @@ -221,7 +225,7 @@ void Object::print(FILE *f) { } void Object::memCheck(FILE *f) { -#ifdef DEBUG_OBJECT_MEM +#ifdef DEBUG_MEM int i; long t; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Object.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Object.h index 17c082041b7..cb636510149 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Object.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Object.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <stdio.h> #include <string.h> #include "gtypes.h" @@ -67,7 +71,7 @@ enum ObjType { // Object //------------------------------------------------------------------------ -#ifdef DEBUG_OBJECT_MEM +#ifdef DEBUG_MEM # if MULTITHREADED # define initObj(t) gAtomicIncrement(&numAlloc[type = t]) # else @@ -212,7 +216,7 @@ private: char *cmd; // command }; -#ifdef DEBUG_OBJECT_MEM +#ifdef DEBUG_MEM #if MULTITHREADED static GAtomicCounter // number of each type of object numAlloc[numObjTypes]; // currently allocated diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/OptionalContent.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/OptionalContent.cc index 501ad2d1220..a0fbb1b06c2 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/OptionalContent.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/OptionalContent.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmempp.h" #include "GString.h" #include "GList.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/OptionalContent.h b/Build/source/libs/xpdf/xpdf-src/xpdf/OptionalContent.h index f4eb1e95cb7..f00ef296a0c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/OptionalContent.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/OptionalContent.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "Object.h" #include "CharTypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Outline.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Outline.cc index 09e3b754bef..9593956f8d0 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Outline.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Outline.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmem.h" #include "gmempp.h" #include "GString.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Outline.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Outline.h index 80943ab8be9..e9bce83cdad 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Outline.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Outline.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "Object.h" #include "CharTypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/OutputDev.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/OutputDev.cc index 93dc1bc1273..f2be88edfdc 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/OutputDev.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/OutputDev.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stddef.h> #include "gmempp.h" #include "Object.h" @@ -72,15 +76,6 @@ void OutputDev::updateAll(GfxState *state) { updateFont(state); } -void OutputDev::fillStroke(GfxState *state, GBool eo) { - if (eo) { - eoFill(state); - } else { - fill(state); - } - stroke(state); -} - GBool OutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen) { diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/OutputDev.h b/Build/source/libs/xpdf/xpdf-src/xpdf/OutputDev.h index 0b31d14a50c..54483cfcc43 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/OutputDev.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/OutputDev.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "CharTypes.h" @@ -95,10 +99,6 @@ public: // End a page. virtual void endPage() {} - // Start/end a sub-page stream (Form XObject, annotation). - virtual void startStream(Ref streamRef, GfxState *state) {} - virtual void endStream(Ref streamRef) {} - //----- coordinate conversion // Convert between device and user coordinates. @@ -147,12 +147,13 @@ public: virtual void updateHorizScaling(GfxState *state) {} virtual void updateTextPos(GfxState *state) {} virtual void updateTextShift(GfxState *state, double shift) {} + virtual void saveTextPos(GfxState *state) {} + virtual void restoreTextPos(GfxState *state) {} //----- path painting virtual void stroke(GfxState *state) {} virtual void fill(GfxState *state) {} virtual void eoFill(GfxState *state) {} - virtual void fillStroke(GfxState *state, GBool eo); virtual void tilingPatternFill(GfxState *state, Gfx *gfx, Object *strRef, int paintType, int tilingType, Dict *resDict, double *mat, double *bbox, @@ -174,17 +175,8 @@ public: virtual void drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, - CharCode code, int nBytes, Unicode *u, int uLen, - GBool fill, GBool stroke, GBool makePath) {} - virtual void drawString(GfxState *state, GString *s, - GBool fill, GBool stroke, GBool makePath) {} - virtual void fillTextPath(GfxState *state) {} - virtual void strokeTextPath(GfxState *state) {} - virtual void clipToTextPath(GfxState *state) {} - virtual void clipToTextStrokePath(GfxState *state) {} - virtual void clearTextPath(GfxState *state) {} - virtual void addTextPathToSavedClipPath(GfxState *state) {} - virtual void clipToSavedClipPath(GfxState *state) {} + CharCode code, int nBytes, Unicode *u, int uLen) {} + virtual void drawString(GfxState *state, GString *s) {} virtual GBool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen); @@ -250,10 +242,6 @@ public: //----- links virtual void processLink(Link *link) {} - //----- structure tree - virtual void beginStructureItem(const char *tag, int mcid, Dict *dict) {} - virtual void endStructureItem() {} - private: double defCTM[6]; // default coordinate transform matrix diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.cc index bb273b6161d..0dd35ee4902 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <math.h> #include "gtypes.h" #include "GString.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.h b/Build/source/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.h index c86f1df4508..8166865280b 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + class GString; // Draw a PDF417 barcode: diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PDFCore.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/PDFCore.cc index baf2353de1c..b833d5dabf0 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PDFCore.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PDFCore.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <math.h> #include "gmempp.h" #include "GString.h" @@ -43,6 +47,9 @@ PDFCore::PDFCore(SplashColorMode colorMode, int bitmapRowPad, linksPage = 0; links = NULL; + annotsPage = 0; + annots = NULL; + textPage = 0; textDPI = 0; textRotate = 0; @@ -109,7 +116,6 @@ PDFCore::~PDFCore() { delete state; clearPage(); if (doc) { - aboutToDeleteDoc(); delete doc; } for (i = 0; i < pdfHistorySize; ++i) { @@ -195,7 +201,6 @@ int PDFCore::loadFile2(PDFDoc *newDoc) { // NB: do not delete doc until after DisplayState::setDoc() returns state->setDoc(newDoc); if (doc) { - aboutToDeleteDoc(); delete doc; } doc = newDoc; @@ -214,7 +219,6 @@ void PDFCore::clear() { // no document // NB: do not delete doc until after DisplayState::setDoc() returns state->setDoc(NULL); - aboutToDeleteDoc(); delete doc; doc = NULL; clearPage(); @@ -296,8 +300,6 @@ void PDFCore::displayDest(LinkDest *dest) { page = 1; } - GBool changeZoom = globalParams->getAllowLinksToChangeZoom(); - switch (dest->getKind()) { case destXYZ: cvtUserToDev(page, dest->getLeft(), dest->getTop(), &dx, &dy); @@ -315,9 +317,7 @@ void PDFCore::displayDest(LinkDest *dest) { break; case destFit: case destFitB: - if (changeZoom) { - state->setZoom(zoomPage); - } + state->setZoom(zoomPage); scrollX = tileMap->getPageLeftX(page); scrollY = tileMap->getPageTopY(page); startUpdate(); @@ -326,9 +326,7 @@ void PDFCore::displayDest(LinkDest *dest) { break; case destFitH: case destFitBH: - if (changeZoom) { - state->setZoom(zoomWidth); - } + state->setZoom(zoomWidth); scrollX = tileMap->getPageLeftX(page); scrollY = tileMap->getPageTopY(page); if (dest->getChangeTop()) { @@ -341,9 +339,7 @@ void PDFCore::displayDest(LinkDest *dest) { break; case destFitV: case destFitBV: - if (changeZoom) { - state->setZoom(zoomHeight); - } + state->setZoom(zoomHeight); scrollX = tileMap->getPageLeftX(page); scrollY = tileMap->getPageTopY(page); if (dest->getChangeTop()) { @@ -355,13 +351,8 @@ void PDFCore::displayDest(LinkDest *dest) { finishUpdate(gTrue, gTrue); break; case destFitR: - if (changeZoom) { - zoomToRect(page, dest->getLeft(), dest->getTop(), - dest->getRight(), dest->getBottom()); - } else { - scrollToCentered(page, 0.5 * (dest->getLeft() + dest->getRight()), - 0.5 * (dest->getTop(), dest->getBottom())); - } + zoomToRect(page, dest->getLeft(), dest->getTop(), + dest->getRight(), dest->getBottom()); break; } } @@ -435,16 +426,9 @@ void PDFCore::finishUpdate(GBool addToHist, GBool checkForChangedFile) { // tileDone or tick (incremental update) to avoid "flashing" the // screen (drawing a blank background, followed by the actual // content slightly later) - // - this postponement actually causes flickering in certain cases - // (the Qt QML backend) -- don't do it if alwaysInvalidateOnUpdate() - // returns true - if (alwaysInvalidateOnUpdate()) { + getWindowBitmap(gTrue); + if (bitmapFinished) { invalidateWholeWindow(); - } else { - getWindowBitmap(gTrue); - if (bitmapFinished) { - invalidateWholeWindow(); - } } updateScrollbars(); @@ -1653,50 +1637,6 @@ GList *PDFCore::findAll(Unicode *u, int len, GBool caseSensitive, return results; } -GList *AsyncFindAll::run(PDFDoc *doc, Unicode *u, int len, GBool caseSensitive, - GBool wholeWord, int firstPage, int lastPage) { - GList *results = new GList(); - - TextOutputDev *textOut = new TextOutputDev(NULL, &core->textOutCtrl, gFalse); - if (!textOut->isOk()) { - delete textOut; - return results; - } - - for (int pg = firstPage; pg <= lastPage && !canceled; ++pg) { - doc->displayPage(textOut, pg, 72, 72, 0, gFalse, gTrue, gFalse); - GBool first = gTrue; - while (!canceled) { - double xMin, yMin, xMax, yMax; - if (!textOut->findText(u, len, first, gTrue, !first, gFalse, - caseSensitive, gFalse, wholeWord, - &xMin, &yMin, &xMax, &yMax)) { - break; - } - double uxMin, uyMin, uxMax, uyMax, t; - textOut->cvtDevToUser(xMin, yMin, &uxMin, &uyMin); - textOut->cvtDevToUser(xMax, yMax, &uxMax, &uyMax); - if (uxMin > uxMax) { - t = uxMin; uxMin = uxMax; uxMax = t; - } - if (uyMin > uyMax) { - t = uyMin; uyMin = uyMax; uyMax = t; - } - results->append(new FindResult(pg, uxMin, uyMin, uxMax, uyMax)); - first = gFalse; - } - } - - delete textOut; - - if (canceled) { - deleteGList(results, FindResult); - return NULL; - } - - return results; -} - GBool PDFCore::cvtWindowToUser(int xw, int yw, int *pg, double *xu, double *yu) { @@ -1811,11 +1751,23 @@ LinkAction *PDFCore::findLink(int pg, double x, double y) { } Annot *PDFCore::findAnnot(int pg, double x, double y) { - return doc->getAnnots()->find(pg, x, y); + loadAnnots(pg); + return annots->find(x, y); } int PDFCore::findAnnotIdx(int pg, double x, double y) { - return doc->getAnnots()->findIdx(pg, x, y); + loadAnnots(pg); + return annots->findIdx(x, y); +} + +Annot *PDFCore::getAnnot(int idx) { + if (!annots) { + return NULL; + } + if (idx < 0 || idx >= annots->getNumAnnots()) { + return NULL; + } + return annots->getAnnot(idx); } AcroFormField *PDFCore::findFormField(int pg, double x, double y) { @@ -1864,8 +1816,7 @@ void PDFCore::setWindowSize(int winWidth, int winHeight) { startUpdate(); - page = wx0 = wy0 = 0; // make gcc happy - ux = uy = 0; + wx0 = wy0 = 0; // make gcc happy doScroll = gFalse; if (state->getZoom() < 0 && state->displayModeIsContinuous()) { // save the user coordinates of the appropriate edge of the window @@ -1928,6 +1879,12 @@ void PDFCore::clearPage() { links = NULL; linksPage = 0; + if (annots) { + delete annots; + } + annots = NULL; + annotsPage = 0; + if (text) { delete text; } @@ -1949,6 +1906,22 @@ void PDFCore::loadLinks(int pg) { linksPage = pg; } +// Load the annotations for <pg>. +void PDFCore::loadAnnots(int pg) { + Object annotsObj; + + if (annots && annotsPage == pg) { + return; + } + if (annots) { + delete annots; + } + doc->getCatalog()->getPage(pg)->getAnnots(&annotsObj); + annots = new Annots(doc, &annotsObj); + annotsObj.free(); + annotsPage = pg; +} + // Extract text from <pg>. void PDFCore::loadText(int pg) { TextOutputDev *textOut; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PDFCore.h b/Build/source/libs/xpdf/xpdf-src/xpdf/PDFCore.h index 56ecd958c21..accf19d82ef 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PDFCore.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PDFCore.h @@ -11,10 +11,11 @@ #include <aconf.h> -#include <stdlib.h> -#ifndef PDF_PARSER_ONLY -#include <atomic> +#ifdef USE_GCC_PRAGMAS +#pragma interface #endif + +#include <stdlib.h> #include "SplashTypes.h" #include "CharTypes.h" #include "DisplayState.h" @@ -30,6 +31,7 @@ class Links; class LinkDest; class LinkAction; class Annot; +class Annots; class AcroFormField; class TextPage; class HighlightFile; @@ -75,34 +77,6 @@ struct FindResult { }; //------------------------------------------------------------------------ -// AsyncFindAll -//------------------------------------------------------------------------ -#ifndef PDF_PARSER_ONLY -class AsyncFindAll { -public: - - AsyncFindAll(PDFCore *coreA): core(coreA), canceled(gFalse) {} - - void reset() { canceled = false; } - - // Run the search, returning a list of FindResults -- same as - // PDFCore::findAll(). This can be run on a separate thread. If - // cancel() is called while the search is running, this function - // returns null. - GList *run(PDFDoc *doc, Unicode *u, int len, GBool caseSensitive, - GBool wholeWord, int firstPage, int lastPage); - - // Cancel a running search, causing run() to return null. - void cancel() { canceled = true; } - -private: - - PDFCore *core; - std::atomic<bool> canceled; -}; -#endif - -//------------------------------------------------------------------------ // PDFCore //------------------------------------------------------------------------ @@ -282,6 +256,7 @@ public: LinkAction *findLink(int pg, double x, double y); Annot *findAnnot(int pg, double x, double y); int findAnnotIdx(int pg, double x, double y); + Annot *getAnnot(int idx); AcroFormField *findFormField(int pg, double x, double y); int findFormFieldIdx(int pg, double x, double y); AcroFormField *getFormField(int idx); @@ -313,11 +288,6 @@ protected: //--- callbacks to PDFCore subclass - // Subclasses can return true here to force PDFCore::finishUpdate() - // to always invalidate the window. This is necessary to avoid - // flickering on some backends. - virtual GBool alwaysInvalidateOnUpdate() { return gFalse; } - // Invalidate the specified rectangle (in window coordinates). virtual void invalidate(int x, int y, int w, int h) = 0; @@ -334,17 +304,13 @@ protected: // This is called just after a PDF file is loaded. virtual void postLoad() {} - // This is called just before deleting the PDFDoc. The PDFCore - // subclass must shut down any secondary threads that are using the - // PDFDoc pointer. - virtual void aboutToDeleteDoc() {} - //--- internal int loadFile2(PDFDoc *newDoc); void addToHistory(); void clearPage(); void loadLinks(int pg); + void loadAnnots(int pg); void loadText(int pg); void getSelectionBBox(int *wxMin, int *wyMin, int *wxMax, int *wyMax); void getSelectRectListBBox(GList *rects, int *wxMin, int *wyMin, @@ -352,13 +318,14 @@ protected: void checkInvalidate(int x, int y, int w, int h); void invalidateWholeWindow(); - friend class AsyncFindAll; - PDFDoc *doc; int linksPage; // cached links for one page Links *links; + int annotsPage; // cached annotations for one page + Annots *annots; + int textPage; // cached extracted text for one page double textDPI; int textRotate; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc index 7030904214f..a6663ea4222 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <stdlib.h> #include <stddef.h> @@ -22,7 +26,6 @@ #include "GlobalParams.h" #include "Page.h" #include "Catalog.h" -#include "Annot.h" #include "Stream.h" #include "XRef.h" #include "Link.h" @@ -175,7 +178,6 @@ PDFDoc::PDFDoc(char *fileNameA, GString *ownerPassword, int i, j; #endif #endif /* 0 */ - init(coreA); fileName = new GString(fileNameA); @@ -202,7 +204,7 @@ PDFDoc::PDFDoc(char *fileNameA, GString *ownerPassword, file = _wfopen(fileNameU, wfopenReadMode); } else { #endif /* 0 */ - file = fopen(fileName->getCString(), fopenReadMode); + file = fopen(fileName->getCString(), fopenReadMode); #if 0 } #endif /* 0 */ @@ -261,7 +263,6 @@ void PDFDoc::init(PDFCore *coreA) { str = NULL; xref = NULL; catalog = NULL; - annots = NULL; #ifndef DISABLE_OUTLINE outline = NULL; #endif @@ -334,9 +335,6 @@ GBool PDFDoc::setup2(GString *ownerPassword, GString *userPassword, return gFalse; } - // initialize the Annots object - annots = new Annots(this); - return gTrue; } @@ -349,9 +347,6 @@ PDFDoc::~PDFDoc() { delete outline; } #endif - if (annots) { - delete annots; - } if (catalog) { delete catalog; } @@ -490,7 +485,6 @@ void PDFDoc::displayPageSlice(OutputDev *out, int page, abortCheckCbk, abortCheckCbkData); } - Links *PDFDoc::getLinks(int page) { return catalog->getPage(page)->getLinks(); } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.h b/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.h index 3c1c71c41ed..2b8eba2cba7 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <stdio.h> #include "XRef.h" #include "Catalog.h" @@ -19,7 +23,6 @@ class GString; class BaseStream; class OutputDev; -class Annots; class Links; class LinkAction; class LinkDest; @@ -71,9 +74,6 @@ public: // Get catalog. Catalog *getCatalog() { return catalog; } - // Get annotations. - Annots *getAnnots() { return annots; } - // Get base stream. BaseStream *getBaseStream() { return str; } @@ -121,7 +121,6 @@ public: GBool (*abortCheckCbk)(void *data) = NULL, void *abortCheckCbkData = NULL); - // Find a page, given its object ID. Returns page number, or 0 if // not found. int findPage(int num, int gen) { return catalog->findPage(num, gen); } @@ -196,9 +195,6 @@ public: #endif char *getEmbeddedFileMem(int idx, int *size); - // Return true if the document uses JavaScript. - GBool usesJavaScript() { return catalog->usesJavaScript(); } - private: @@ -220,7 +216,6 @@ private: double pdfVersion; XRef *xref; Catalog *catalog; - Annots *annots; #ifndef DISABLE_OUTLINE Outline *outline; #endif diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PSOutputDev.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/PSOutputDev.cc index 4cb4304e172..b9fff4ffaed 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PSOutputDev.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PSOutputDev.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <stddef.h> #include <stdarg.h> @@ -104,8 +108,7 @@ static const char *prolog[] = { "/pdfOpNames [", " /pdfFill /pdfStroke /pdfLastFill /pdfLastStroke", " /pdfTextMat /pdfFontSize /pdfCharSpacing /pdfTextRender", - " /pdfTextRise /pdfWordSpacing /pdfHorizScaling /pdfTextPath", - " /pdfTextClipPath", + " /pdfTextRise /pdfWordSpacing /pdfHorizScaling /pdfTextClipPath", "] def", "~123ngs", "/pdfStartPage {", @@ -142,7 +145,6 @@ static const char *prolog[] = { " /pdfTextRise 0 def", " /pdfWordSpacing 0 def", " /pdfHorizScaling 1 def", - " /pdfTextPath [] def", " /pdfTextClipPath [] def", "} def", "/pdfEndPage { end } def", @@ -473,34 +475,32 @@ static const char *prolog[] = { "/Tj {", " fCol", // because stringwidth has to draw Type 3 chars " 0 pdfTextRise pdfTextMat dtransform rmoveto", - " xyshow2", - " 0 pdfTextRise neg pdfTextMat dtransform rmoveto", - "} def", - "/TjS {", - " fCol", // because stringwidth has to draw Type 3 chars - " 0 pdfTextRise pdfTextMat dtransform rmoveto", - " currentfont /FontType get 3 eq { fCol } { sCol } ifelse", - " xycp currentpoint stroke moveto", - " 0 pdfTextRise neg pdfTextMat dtransform rmoveto", - "} def", - "/TjFS {", - " 2 copy currentpoint 4 2 roll Tj moveto TjS", - "} def", - "/TjSave {", - " fCol", // because stringwidth has to draw Type 3 chars - " 0 pdfTextRise pdfTextMat dtransform rmoveto", - " xycp", - " /pdfTextPath [ pdfTextPath aload pop", - " {/moveto cvx}", - " {/lineto cvx}", - " {/curveto cvx}", - " {/closepath cvx}", - " pathforall ] def", - " currentpoint newpath moveto", + " currentpoint 4 2 roll", + " pdfTextRender 1 and 0 eq {", + " 2 copy xyshow2", + " } if", + " pdfTextRender 3 and dup 1 eq exch 2 eq or {", + " 3 index 3 index moveto", + " 2 copy", + " currentfont /FontType get 3 eq { fCol } { sCol } ifelse", + " xycp currentpoint stroke moveto", + " } if", + " pdfTextRender 4 and 0 ne {", + " 4 2 roll moveto xycp", + " /pdfTextClipPath [ pdfTextClipPath aload pop", + " {/moveto cvx}", + " {/lineto cvx}", + " {/curveto cvx}", + " {/closepath cvx}", + " pathforall ] def", + " currentpoint newpath moveto", + " } {", + " pop pop pop pop", + " } ifelse", " 0 pdfTextRise neg pdfTextMat dtransform rmoveto", "} def", "/Tj3 {", - " pdfTextRender 3 and 3 ne {", + " pdfTextRender 3 and 3 ne {" " fCol", // because stringwidth has to draw Type 3 chars " 0 pdfTextRise pdfTextMat dtransform rmoveto", " xyshow2", @@ -513,18 +513,8 @@ static const char *prolog[] = { " pdfTextMat dtransform rmoveto } def", "/TJmV { 0.001 mul pdfFontSize mul neg 0 exch", " pdfTextMat dtransform rmoveto } def", - "/Tfill { fCol pdfTextPath cvx exec fill } def", - "/Tstroke { sCol pdfTextPath cvx exec stroke } def", - "/Tclip { pdfTextPath cvx exec clip newpath } def", - "/Tstrokeclip { pdfTextPath cvx exec strokepath clip newpath } def", - "/Tclear { /pdfTextPath [] def } def", - "/Tsave {", - " /pdfTextClipPath [ pdfTextClipPath aload pop pdfTextPath aload pop ] def", - "} def", - "/Tclip2 {", - " pdfTextClipPath cvx exec clip newpath", - " /pdfTextClipPath [] def", - "} def", + "/Tclip { pdfTextClipPath cvx exec clip newpath", + " /pdfTextClipPath [] def } def", "~1ns", "% Level 1 image operators", "~1n", @@ -1319,8 +1309,7 @@ PSOutputDev::PSOutputDev(char *fileName, PDFDoc *docA, paperSizes = NULL; embFontList = NULL; customColors = NULL; - haveSavedTextPath = gFalse; - haveSavedClipPath = gFalse; + haveTextClip = gFalse; t3String = NULL; // open file or pipe @@ -1387,8 +1376,7 @@ PSOutputDev::PSOutputDev(PSOutputFunc outputFuncA, void *outputStreamA, paperSizes = NULL; embFontList = NULL; customColors = NULL; - haveSavedTextPath = gFalse; - haveSavedClipPath = gFalse; + haveTextClip = gFalse; t3String = NULL; init(outputFuncA, outputStreamA, psGeneric, @@ -1760,6 +1748,7 @@ void PSOutputDev::writeXpdfProcset() { void PSOutputDev::writeDocSetup(Catalog *catalog) { Page *page; Dict *resDict; + Annots *annots; AcroForm *form; Object obj1, obj2, obj3; GString *s; @@ -1785,7 +1774,6 @@ void PSOutputDev::writeDocSetup(Catalog *catalog) { } else { writePS("xpdf begin\n"); } - Annots *annots = doc->getAnnots(); needDefaultFont = gFalse; for (pg = firstPage; pg <= lastPage; ++pg) { if (rasterizePage[pg - firstPage]) { @@ -1795,12 +1783,13 @@ void PSOutputDev::writeDocSetup(Catalog *catalog) { if ((resDict = page->getResourceDict())) { setupResources(resDict); } - int nAnnots = annots->getNumAnnots(pg); - if (nAnnots > 0) { + annots = new Annots(doc, page->getAnnots(&obj1)); + obj1.free(); + if (annots->getNumAnnots()) { needDefaultFont = gTrue; } - for (i = 0; i < nAnnots; ++i) { - if (annots->getAnnot(pg, i)->getAppearance(&obj1)->isStream()) { + for (i = 0; i < annots->getNumAnnots(); ++i) { + if (annots->getAnnot(i)->getAppearance(&obj1)->isStream()) { obj1.streamGetDict()->lookup("Resources", &obj2); if (obj2.isDict()) { setupResources(obj2.getDict()); @@ -1809,6 +1798,7 @@ void PSOutputDev::writeDocSetup(Catalog *catalog) { } obj1.free(); } + delete annots; } if ((form = catalog->getForm())) { if (form->getNumFields() > 0) { @@ -2160,9 +2150,6 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) { case fontType1: fi->ff = setupExternalType1Font(font, fontLoc->path); break; - case fontType1COT: - fi->ff = setupExternalOpenTypeT1CFont(font, fontLoc->path); - break; case fontTrueType: case fontTrueTypeOT: fi->ff = setupExternalTrueTypeFont(font, fontLoc->path, @@ -2586,48 +2573,6 @@ PSFontFileInfo *PSOutputDev::setupEmbeddedOpenTypeT1CFont(GfxFont *font, return ff; } -PSFontFileInfo *PSOutputDev::setupExternalOpenTypeT1CFont(GfxFont *font, - GString *fileName) { - GString *psName; - PSFontFileInfo *ff; - FoFiTrueType *ffTT; - - if (font->getName()) { - // check if font is already embedded - if ((ff = (PSFontFileInfo *)fontFileInfo->lookup(font->getName()))) { - return ff; - } - // this assumes that the PS font name matches the PDF font name - psName = font->getName()->copy(); - } else { - // generate name - psName = makePSFontName(font, font->getID()); - } - - // beginning comment - writePSFmt("%%BeginResource: font {0:t}\n", psName); - embFontList->append("%%+ font "); - embFontList->append(psName->getCString()); - embFontList->append("\n"); - - // convert it to a Type 1 font - if ((ffTT = FoFiTrueType::load(fileName->getCString(), 0, gTrue))) { - if (ffTT->isOpenTypeCFF()) { - ffTT->convertToType1(psName->getCString(), NULL, gTrue, - outputFunc, outputStream); - } - delete ffTT; - } - - // ending comment - writePS("%%EndResource\n"); - - ff = new PSFontFileInfo(psName, font->getType(), psFontFileExternal); - ff->extFileName = fileName->copy(); - fontFileInfo->add(ff->psName, ff); - return ff; -} - PSFontFileInfo *PSOutputDev::setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id) { GString *psName; PSFontFileInfo *ff; @@ -3922,14 +3867,8 @@ void PSOutputDev::setupImage(Ref id, Stream *str, GBool mask, } else { s = str->getPSFilter(level < psLevel3 ? 2 : 3, "", gTrue); if (s) { - if (globalParams->getPSLZW() && !str->hasStrongCompression()) { - useRLE = gFalse; - useLZW = gTrue; - useCompressed = gFalse; - } else { - useLZW = useRLE = gFalse; - useCompressed = gTrue; - } + useLZW = useRLE = gFalse; + useCompressed = gTrue; delete s; } else { if (globalParams->getPSLZW()) { @@ -4602,21 +4541,10 @@ void PSOutputDev::startPage(int pageNum, GfxState *state) { tx -= xScale * x1; ty -= yScale * y1; } - // offset or center + // center if (tx0 >= 0 && ty0 >= 0) { - if (rotate == 0) { - tx += tx0; - ty += ty0; - } else if (rotate == 90) { - tx += ty0; - ty += (imgWidth - yScale * height) - tx0; - } else if (rotate == 180) { - tx += (imgWidth - xScale * width) - tx0; - ty += (imgHeight - yScale * height) - ty0; - } else { // rotate == 270 - tx += (imgHeight - xScale * width) - ty0; - ty += tx0; - } + tx += (rotate == 0 || rotate == 180) ? tx0 : ty0; + ty += (rotate == 0 || rotate == 180) ? ty0 : -tx0; } else if (globalParams->getPSCenter()) { if (clipLLX0 < clipURX0 && clipLLY0 < clipURY0) { tx += (imgWidth2 - xScale * (clipURX0 - clipLLX0)) / 2; @@ -5175,6 +5103,16 @@ void PSOutputDev::updateTextShift(GfxState *state, double shift) { noStateChanges = gFalse; } +void PSOutputDev::saveTextPos(GfxState *state) { + writePS("currentpoint\n"); + noStateChanges = gFalse; +} + +void PSOutputDev::restoreTextPos(GfxState *state) { + writePS("m\n"); + noStateChanges = gFalse; +} + void PSOutputDev::stroke(GfxState *state) { doPath(state->getPath()); if (inType3Char && t3FillColorOnly) { @@ -5828,10 +5766,23 @@ void PSOutputDev::doPath(GfxPath *path) { } } -void PSOutputDev::drawString(GfxState *state, GString *s, - GBool fill, GBool stroke, GBool makePath) { +void PSOutputDev::drawString(GfxState *state, GString *s) { + GfxFont *font; + int wMode; + int *codeToGID; + GString *s2; + double dx, dy, originX, originY, originX0, originY0, tOriginX0, tOriginY0; + char *p; + PSFontInfo *fi; + UnicodeMap *uMap; + CharCode code; + Unicode u[8]; + char buf[8]; + double *dxdy; + int dxdySize, len, nChars, uLen, n, m, i, j; + // check for invisible text -- this is used by Acrobat Capture - if (!fill && !stroke && !makePath) { + if (state->getRender() == 3) { return; } @@ -5841,14 +5792,13 @@ void PSOutputDev::drawString(GfxState *state, GString *s, } // get the font - GfxFont *font = state->getFont(); - if (!font) { + if (!(font = state->getFont())) { return; } - int wMode = font->getWMode(); + wMode = font->getWMode(); - PSFontInfo *fi = NULL; - for (int i = 0; i < fontInfo->getLength(); ++i) { + fi = NULL; + for (i = 0; i < fontInfo->getLength(); ++i) { fi = (PSFontInfo *)fontInfo->get(i); if (fi->fontID.num == font->getID()->num && fi->fontID.gen == font->getID()->gen) { @@ -5858,8 +5808,8 @@ void PSOutputDev::drawString(GfxState *state, GString *s, } // check for a subtitute 16-bit font - UnicodeMap *uMap = NULL; - int *codeToGID = NULL; + uMap = NULL; + codeToGID = NULL; if (font->isCIDFont()) { if (!(fi && fi->ff)) { // font substitution failed, so don't output any text @@ -5877,21 +5827,17 @@ void PSOutputDev::drawString(GfxState *state, GString *s, } // compute the positioning (dx, dy) for each char in the string - int nChars = 0; - char *p = s->getCString(); - int len = s->getLength(); - GString *s2 = new GString(); - int dxdySize = font->isCIDFont() ? 8 : s->getLength(); - double *dxdy = (double *)gmallocn(2 * dxdySize, sizeof(double)); - double originX0 = 0, originY0 = 0; + nChars = 0; + p = s->getCString(); + len = s->getLength(); + s2 = new GString(); + dxdySize = font->isCIDFont() ? 8 : s->getLength(); + dxdy = (double *)gmallocn(2 * dxdySize, sizeof(double)); + originX0 = originY0 = 0; // make gcc happy while (len > 0) { - CharCode code; - Unicode u[8]; - int uLen; - double dx, dy, originX, originY; - int n = font->getNextChar(p, len, &code, - u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, - &dx, &dy, &originX, &originY); + n = font->getNextChar(p, len, &code, + u, (int)(sizeof(u) / sizeof(Unicode)), &uLen, + &dx, &dy, &originX, &originY); //~ this doesn't handle the case where the origin offset changes //~ within a string of characters -- which could be fixed by //~ modifying dx,dy as needed for each character @@ -5921,10 +5867,9 @@ void PSOutputDev::drawString(GfxState *state, GString *s, } while (nChars + uLen > dxdySize); dxdy = (double *)greallocn(dxdy, 2 * dxdySize, sizeof(double)); } - char buf[8]; - for (int i = 0; i < uLen; ++i) { - int m = uMap->mapUnicode(u[i], buf, (int)sizeof(buf)); - for (int j = 0; j < m; ++j) { + for (i = 0; i < uLen; ++i) { + m = uMap->mapUnicode(u[i], buf, (int)sizeof(buf)); + for (j = 0; j < m; ++j) { s2->append(buf[j]); } //~ this really needs to get the number of chars in the target @@ -5961,45 +5906,25 @@ void PSOutputDev::drawString(GfxState *state, GString *s, } originX0 *= state->getFontSize(); originY0 *= state->getFontSize(); - double tOriginX0, tOriginY0; state->textTransformDelta(originX0, originY0, &tOriginX0, &tOriginY0); if (nChars > 0) { if (wMode) { writePSFmt("{0:.6g} {1:.6g} rmoveto\n", -tOriginX0, -tOriginY0); } - writePSString(s2); writePS("\n["); - for (int i = 0; i < 2 * nChars; ++i) { + for (i = 0; i < 2 * nChars; ++i) { if (i > 0) { writePS("\n"); } writePSFmt("{0:.6g}", dxdy[i]); } - writePS("] "); - - // the possible operations are: - // - fill - // - stroke - // - fill + stroke - // - makePath - if (font->getType() == fontType3) { - writePS("Tj3\n"); + writePS("] Tj3\n"); } else { - if (fill && stroke) { - writePS("TjFS\n"); - } else if (fill) { - writePS("Tj\n"); - } else if (stroke) { - writePS("TjS\n"); - } else if (makePath) { - writePS("TjSave\n"); - haveSavedTextPath = gTrue; - } + writePS("] Tj\n"); } - if (wMode) { writePSFmt("{0:.6g} {1:.6g} rmoveto\n", tOriginX0, tOriginY0); } @@ -6007,49 +5932,19 @@ void PSOutputDev::drawString(GfxState *state, GString *s, gfree(dxdy); delete s2; - noStateChanges = gFalse; -} - -void PSOutputDev::fillTextPath(GfxState *state) { - writePS("Tfill\n"); -} - -void PSOutputDev::strokeTextPath(GfxState *state) { - writePS("Tstroke\n"); -} - -void PSOutputDev::clipToTextPath(GfxState *state) { - writePS("Tclip\n"); -} - -void PSOutputDev::clipToTextStrokePath(GfxState *state) { - writePS("Tstrokeclip\n"); -} - -void PSOutputDev::clearTextPath(GfxState *state) { - if (haveSavedTextPath) { - writePS("Tclear\n"); - haveSavedTextPath = gFalse; + if ((state->getRender() & 4) && font->getType() != fontType3) { + haveTextClip = gTrue; } -} -void PSOutputDev::addTextPathToSavedClipPath(GfxState *state) { - if (haveSavedTextPath) { - writePS("Tsave\n"); - haveSavedTextPath = gFalse; - haveSavedClipPath = gTrue; - } -} - -void PSOutputDev::clipToSavedClipPath(GfxState *state) { - if (!haveSavedClipPath) { - return; - } - writePS("Tclip2\n"); - haveSavedClipPath = gFalse; + noStateChanges = gFalse; } void PSOutputDev::endTextObject(GfxState *state) { + if (haveTextClip) { + writePS("Tclip\n"); + haveTextClip = gFalse; + noStateChanges = gFalse; + } } void PSOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, @@ -6501,11 +6396,6 @@ void PSOutputDev::doImageL2(Object *ref, GfxState *state, } useASCII = !(mode == psModeForm || inType3Char || preload); useCompressed = gFalse; - } else if (globalParams->getPSLZW() && !str->hasStrongCompression()) { - useRLE = gFalse; - useLZW = gTrue; - useASCII = !(mode == psModeForm || inType3Char || preload); - useCompressed = gFalse; } else { useLZW = useRLE = gFalse; useASCII = str->isBinary() && @@ -6979,11 +6869,6 @@ void PSOutputDev::doImageL3(Object *ref, GfxState *state, } maskUseASCII = !(mode == psModeForm || inType3Char || preload); maskUseCompressed = gFalse; - } else if (globalParams->getPSLZW() && !maskStr->hasStrongCompression()) { - maskUseRLE = gFalse; - maskUseLZW = gTrue; - maskUseASCII = !(mode == psModeForm || inType3Char || preload); - maskUseCompressed = gFalse; } else { maskUseLZW = maskUseRLE = gFalse; maskUseASCII = maskStr->isBinary() && @@ -7212,11 +7097,6 @@ void PSOutputDev::doImageL3(Object *ref, GfxState *state, } useASCII = !(mode == psModeForm || inType3Char || preload); useCompressed = gFalse; - } else if (globalParams->getPSLZW() && !str->hasStrongCompression()) { - useRLE = gFalse; - useLZW = gTrue; - useASCII = !(mode == psModeForm || inType3Char || preload); - useCompressed = gFalse; } else { useLZW = useRLE = gFalse; useASCII = str->isBinary() && diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PSOutputDev.h b/Build/source/libs/xpdf/xpdf-src/xpdf/PSOutputDev.h index 95908dbe675..b7223c6cdd8 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PSOutputDev.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PSOutputDev.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <stddef.h> #include "config.h" #include "Object.h" @@ -195,6 +199,8 @@ public: virtual void updateHorizScaling(GfxState *state); virtual void updateTextPos(GfxState *state); virtual void updateTextShift(GfxState *state, double shift); + virtual void saveTextPos(GfxState *state); + virtual void restoreTextPos(GfxState *state); //----- path painting virtual void stroke(GfxState *state); @@ -213,15 +219,7 @@ public: virtual void clipToStrokePath(GfxState *state); //----- text drawing - virtual void drawString(GfxState *state, GString *s, - GBool fill, GBool stroke, GBool makePath); - virtual void fillTextPath(GfxState *state); - virtual void strokeTextPath(GfxState *state); - virtual void clipToTextPath(GfxState *state); - virtual void clipToTextStrokePath(GfxState *state); - virtual void clearTextPath(GfxState *state); - virtual void addTextPathToSavedClipPath(GfxState *state); - virtual void clipToSavedClipPath(GfxState *state); + virtual void drawString(GfxState *state, GString *s); virtual void endTextObject(GfxState *state); //----- image drawing @@ -297,8 +295,6 @@ private: PSFontFileInfo *setupExternalType1Font(GfxFont *font, GString *fileName); PSFontFileInfo *setupEmbeddedType1CFont(GfxFont *font, Ref *id); PSFontFileInfo *setupEmbeddedOpenTypeT1CFont(GfxFont *font, Ref *id); - PSFontFileInfo *setupExternalOpenTypeT1CFont(GfxFont *font, - GString *fileName); PSFontFileInfo *setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id); PSFontFileInfo *setupExternalTrueTypeFont(GfxFont *font, GString *fileName, int fontNum); @@ -493,11 +489,8 @@ private: PSOutCustomColor // used custom colors *customColors; - GBool haveSavedTextPath; // set if text has been drawn with the - // 'makePath' argument - GBool haveSavedClipPath; // set if the text path has been added - // to the saved clipping path (with - // addTextPathToSavedClipPath) + GBool haveTextClip; // set if text has been drawn with a + // clipping render mode GBool inType3Char; // inside a Type 3 CharProc GString *t3String; // Type 3 content string diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PSTokenizer.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/PSTokenizer.cc index cb525f1be60..bbdb0ec44d5 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PSTokenizer.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PSTokenizer.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <stdlib.h> #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PSTokenizer.h b/Build/source/libs/xpdf/xpdf-src/xpdf/PSTokenizer.h index 3f3c8f4066d..4d5ee97f4dd 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PSTokenizer.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PSTokenizer.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Page.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Page.cc index 322f07063e7..368bc68dd8a 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Page.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Page.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stddef.h> #include "gmempp.h" #include "Trace.h" @@ -377,6 +381,7 @@ void Page::displaySlice(OutputDev *out, double hDPI, double vDPI, PDFRectangle box; Gfx *gfx; Object obj; + Annots *annotList; AcroForm *form; int i; @@ -421,20 +426,21 @@ void Page::displaySlice(OutputDev *out, double hDPI, double vDPI, // draw (non-form) annotations if (globalParams->getDrawAnnotations()) { - Annots *annots2 = doc->getAnnots(); - annots2->generateAnnotAppearances(num); - int n = annots2->getNumAnnots(num); - if (n > 0) { + annotList = new Annots(doc, getAnnots(&obj)); + obj.free(); + annotList->generateAnnotAppearances(); + if (annotList->getNumAnnots() > 0) { if (globalParams->getPrintCommands()) { printf("***** Annotations\n"); } - for (i = 0; i < n; ++i) { + for (i = 0; i < annotList->getNumAnnots(); ++i) { if (abortCheckCbk && (*abortCheckCbk)(abortCheckCbkData)) { break; } - annots2->getAnnot(num, i)->draw(gfx, printing); + annotList->getAnnot(i)->draw(gfx, printing); } } + delete annotList; } // draw form fields @@ -546,4 +552,3 @@ void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI, delete state; #endif } - diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Page.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Page.h index 0a862265d0f..fe579e7b3af 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Page.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Page.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "Object.h" class Dict; @@ -188,7 +192,6 @@ public: void getDefaultCTM(double *ctm, double hDPI, double vDPI, int rotate, GBool useMediaBox, GBool upsideDown); - private: PDFDoc *doc; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Parser.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Parser.cc index c594cf9413b..4fad6afae13 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Parser.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Parser.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stddef.h> #include <string.h> #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Parser.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Parser.h index 6e175eb1cea..bfe5a52bdfc 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Parser.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Parser.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "Lexer.h" //------------------------------------------------------------------------ diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.cc index e844e49142f..29f26c00cee 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <math.h> #include "gmempp.h" #include "GlobalParams.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.h b/Build/source/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.h index 703026ba19f..ee21e98b148 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "GfxState.h" #include "OutputDev.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/SecurityHandler.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/SecurityHandler.cc index 6f614496859..a61a84e8fa2 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/SecurityHandler.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/SecurityHandler.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmempp.h" #include "GString.h" #include "PDFDoc.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/SecurityHandler.h b/Build/source/libs/xpdf/xpdf-src/xpdf/SecurityHandler.h index 05e58cf64c3..63462339bff 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/SecurityHandler.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/SecurityHandler.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "Object.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/ShadingImage.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/ShadingImage.cc index b40c05d52e1..d8dc24e0fc6 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/ShadingImage.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/ShadingImage.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <math.h> #include "Trace.h" #include "GfxState.h" @@ -66,14 +70,6 @@ SplashBitmap *ShadingImage::generateBitmap(GfxState *state, } } -static double max4(double x0, double x1, double x2, double x3) { - double t = x0; - t = (x1 > t) ? x1 : t; - t = (x2 > t) ? x2 : t; - t = (x3 > t) ? x3 : t; - return t; -} - SplashBitmap *ShadingImage::generateFunctionBitmap(GfxState *state, GfxFunctionShading *shading, SplashColorMode mode, @@ -208,8 +204,7 @@ SplashBitmap *ShadingImage::generateAxialBitmap(GfxState *state, // compute the inverse CTM double *ctm = state->getCTM(); double det = ctm[0] * ctm[3] - ctm[1] * ctm[2]; - if (fabs(det) < 1e-10 * max4(fabs(ctm[0]), fabs(ctm[1]), - fabs(ctm[2]), fabs(ctm[3]))) { + if (fabs(det) < 0.000001) { return NULL; } det = 1 / det; @@ -473,8 +468,7 @@ SplashBitmap *ShadingImage::generateRadialBitmap(GfxState *state, // compute the inverse CTM double *ctm = state->getCTM(); double det = ctm[0] * ctm[3] - ctm[1] * ctm[2]; - if (fabs(det) < 1e-10 * max4(fabs(ctm[0]), fabs(ctm[1]), - fabs(ctm[2]), fabs(ctm[3]))) { + if (fabs(det) < 0.000001) { return NULL; } det = 1 / det; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/ShadingImage.h b/Build/source/libs/xpdf/xpdf-src/xpdf/ShadingImage.h index 54f193a9c89..3bbff6922a4 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/ShadingImage.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/ShadingImage.h @@ -13,6 +13,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" class GfxState; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.cc index 581b804f3b0..d758e25b306 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <string.h> #include <math.h> #include <limits.h> @@ -594,8 +598,6 @@ struct SplashTransparencyGroup { SplashBitmap *tBitmap; // bitmap for transparency group GfxColorSpace *blendingColorSpace; GBool isolated; - GBool inSoftMask; // true if this, or any containing - // group, is a soft mask //----- modified region in tBitmap int modXMin, modYMin, modXMax, modYMax; @@ -652,8 +654,7 @@ SplashOutputDev::SplashOutputDev(SplashColorMode colorModeA, font = NULL; needFontUpdate = gFalse; - savedTextPath = NULL; - savedClipPath = NULL; + textClipPath = NULL; transpGroupStack = NULL; @@ -730,11 +731,8 @@ SplashOutputDev::~SplashOutputDev() { if (bitmap) { delete bitmap; } - if (savedTextPath) { - delete savedTextPath; - } - if (savedClipPath) { - delete savedClipPath; + if (textClipPath) { + delete textClipPath; } } @@ -1076,10 +1074,7 @@ void SplashOutputDev::setOverprintMask(GfxState *state, Guint mask; GfxCMYK cmyk; - // Adobe ignores overprint in soft masks. - if (overprintFlag && - !(transpGroupStack && transpGroupStack->inSoftMask) && - globalParams->getOverprintPreview()) { + if (overprintFlag && globalParams->getOverprintPreview()) { mask = colorSpace->getOverprintMask(); // The OPM (overprintMode) setting is only relevant when the color // space is DeviceCMYK or is "implicitly converted to DeviceCMYK". @@ -2223,24 +2218,27 @@ void SplashOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, - Unicode *u, int uLen, - GBool fill, GBool stroke, GBool makePath) { + Unicode *u, int uLen) { + SplashPath *path; + int render; + GBool doFill, doStroke, doClip; + SplashStrokeAdjustMode strokeAdjust; + double m[4]; + GBool horiz; + if (skipHorizText || skipRotatedText) { - double m[4]; state->getFontTransMat(&m[0], &m[1], &m[2], &m[3]); // this matches the 'diagonal' test in TextPage::updateFont() - GBool horiz = m[0] > 0 && fabs(m[1]) < 0.001 && - fabs(m[2]) < 0.001 && m[3] < 0; + horiz = m[0] > 0 && fabs(m[1]) < 0.001 && + fabs(m[2]) < 0.001 && m[3] < 0; if ((skipHorizText && horiz) || (skipRotatedText && !horiz)) { return; } } - fill = fill && !state->getFillColorSpace()->isNonMarking(); - stroke = stroke && !state->getStrokeColorSpace()->isNonMarking(); - // check for invisible text -- this is used by Acrobat Capture - if (!fill && !stroke && !makePath) { + render = state->getRender(); + if (render == 3) { return; } @@ -2254,8 +2252,13 @@ void SplashOutputDev::drawChar(GfxState *state, double x, double y, x -= originX; y -= originY; - SplashPath *path = NULL; - if (stroke || makePath) { + doFill = !(render & 1) && !state->getFillColorSpace()->isNonMarking(); + doStroke = ((render & 3) == 1 || (render & 3) == 2) && + !state->getStrokeColorSpace()->isNonMarking(); + doClip = render & 4; + + path = NULL; + if (doStroke || doClip) { if ((path = font->getGlyphPath(code))) { path->offset((SplashCoord)x, (SplashCoord)y); } @@ -2264,19 +2267,14 @@ void SplashOutputDev::drawChar(GfxState *state, double x, double y, // don't use stroke adjustment when stroking text -- the results // tend to be ugly (because characters with horizontal upper or // lower edges get misaligned relative to the other characters) - SplashStrokeAdjustMode savedStrokeAdjust = splashStrokeAdjustOff; - if (stroke) { - savedStrokeAdjust = splash->getStrokeAdjust(); + strokeAdjust = splashStrokeAdjustOff; // make gcc happy + if (doStroke) { + strokeAdjust = splash->getStrokeAdjust(); splash->setStrokeAdjust(splashStrokeAdjustOff); } - // the possible operations are: - // - fill - // - stroke - // - fill + stroke - // - makePath - - if (fill && stroke) { + // fill and stroke + if (doFill && doStroke) { if (path) { setOverprintMask(state, state->getFillColorSpace(), state->getFillOverprint(), state->getOverprintMode(), @@ -2288,33 +2286,37 @@ void SplashOutputDev::drawChar(GfxState *state, double x, double y, splash->stroke(path); } - } else if (fill) { + // fill + } else if (doFill) { setOverprintMask(state, state->getFillColorSpace(), state->getFillOverprint(), state->getOverprintMode(), state->getFillColor()); splash->fillChar((SplashCoord)x, (SplashCoord)y, code, font); - } else if (stroke) { + // stroke + } else if (doStroke) { if (path) { setOverprintMask(state, state->getStrokeColorSpace(), state->getStrokeOverprint(), state->getOverprintMode(), state->getStrokeColor()); splash->stroke(path); } + } - } else if (makePath) { + // clip + if (doClip) { if (path) { - if (savedTextPath) { - savedTextPath->append(path); + if (textClipPath) { + textClipPath->append(path); } else { - savedTextPath = path; + textClipPath = path; path = NULL; } } } - if (stroke) { - splash->setStrokeAdjust(savedStrokeAdjust); + if (doStroke) { + splash->setStrokeAdjust(strokeAdjust); } if (path) { @@ -2322,73 +2324,6 @@ void SplashOutputDev::drawChar(GfxState *state, double x, double y, } } -void SplashOutputDev::fillTextPath(GfxState *state) { - if (!savedTextPath) { - return; - } - setOverprintMask(state, state->getFillColorSpace(), - state->getFillOverprint(), state->getOverprintMode(), - state->getFillColor()); - splash->fill(savedTextPath, gFalse); -} - -void SplashOutputDev::strokeTextPath(GfxState *state) { - if (!savedTextPath) { - return; - } - setOverprintMask(state, state->getStrokeColorSpace(), - state->getStrokeOverprint(), state->getOverprintMode(), - state->getStrokeColor()); - splash->stroke(savedTextPath); -} - -void SplashOutputDev::clipToTextPath(GfxState *state) { - if (!savedTextPath) { - return; - } - splash->clipToPath(savedTextPath, gFalse); -} - -void SplashOutputDev::clipToTextStrokePath(GfxState *state) { - if (!savedTextPath) { - return; - } - SplashPath *path = splash->makeStrokePath(savedTextPath, - state->getLineWidth(), - state->getLineCap(), - state->getLineJoin()); - splash->clipToPath(path, gFalse); - delete path; -} - -void SplashOutputDev::clearTextPath(GfxState *state) { - if (savedTextPath) { - delete savedTextPath; - savedTextPath = NULL; - } -} - -void SplashOutputDev::addTextPathToSavedClipPath(GfxState *state) { - if (savedTextPath) { - if (savedClipPath) { - savedClipPath->append(savedTextPath); - delete savedTextPath; - } else { - savedClipPath = savedTextPath; - } - savedTextPath = NULL; - } -} - -void SplashOutputDev::clipToSavedClipPath(GfxState *state) { - if (!savedClipPath) { - return; - } - splash->clipToPath(savedClipPath, gFalse); - delete savedClipPath; - savedClipPath = NULL; -} - GBool SplashOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen) { @@ -2744,6 +2679,11 @@ void SplashOutputDev::drawType3Glyph(GfxState *state, T3FontCache *t3Font, } void SplashOutputDev::endTextObject(GfxState *state) { + if (textClipPath) { + splash->clipToPath(textClipPath, gFalse); + delete textClipPath; + textClipPath = NULL; + } } struct SplashOutImageMaskData { @@ -3915,7 +3855,7 @@ GBool SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, SplashBitmap *backdropBitmap; SplashColor color; double xMin, yMin, xMax, yMax, x, y; - int bw, bh, tx, ty, w, h, xx, yy, i; + int bw, bh, tx, ty, w, h, i; // transform the bbox state->transform(bbox[0], bbox[1], &x, &y); @@ -3988,23 +3928,21 @@ GBool SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, } else if (ty >= bh) { ty = bh - 1; } - xx = (int)ceil(xMax); - if (xx < tx) { - w = 1; - } else if (xx > bw - 1) { - // NB bw and tx are both non-negative, so 'bw - tx' can't overflow + w = (int)ceil(xMax) - tx + 1; + // NB bw and tx are both non-negative, so 'bw - tx' can't overflow + if (bw - tx < w) { w = bw - tx; - } else { - w = xx - tx + 1; } - yy = (int)ceil(yMax); - if (yy < ty) { - h = 1; - } else if (yy > bh - 1) { - // NB bh and ty are both non-negative, so 'bh - ty' can't overflow + if (w < 1) { + w = 1; + } + h = (int)ceil(yMax) - ty + 1; + // NB bh and ty are both non-negative, so 'bh - ty' can't overflow + if (bh - ty < h) { h = bh - ty; - } else { - h = yy - ty + 1; + } + if (h < 1) { + h = 1; } // optimization: a non-isolated group drawn with alpha=1 and @@ -4035,8 +3973,6 @@ GBool SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, transpGroup->ty = ty; transpGroup->blendingColorSpace = blendingColorSpace; transpGroup->isolated = isolated; - transpGroup->inSoftMask = (transpGroupStack && transpGroupStack->inSoftMask) - || forSoftMask; transpGroup->next = transpGroupStack; transpGroupStack = transpGroup; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.h b/Build/source/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.h index d021d8922b0..5ec70e95509 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "SplashTypes.h" #include "config.h" @@ -125,15 +129,7 @@ public: virtual void drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, - CharCode code, int nBytes, Unicode *u, int uLen, - GBool fill, GBool stroke, GBool makePath); - virtual void fillTextPath(GfxState *state); - virtual void strokeTextPath(GfxState *state); - virtual void clipToTextPath(GfxState *state); - virtual void clipToTextStrokePath(GfxState *state); - virtual void clearTextPath(GfxState *state); - virtual void addTextPathToSavedClipPath(GfxState *state); - virtual void clipToSavedClipPath(GfxState *state); + CharCode code, int nBytes, Unicode *u, int uLen); virtual GBool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen); @@ -310,8 +306,7 @@ private: SplashFont *font; // current font GBool needFontUpdate; // set when the font needs to be updated - SplashPath *savedTextPath; // path built for text string - SplashPath *savedClipPath; // clipping path built with text object + SplashPath *textClipPath; // clipping path built with text object SplashTransparencyGroup * // transparency group stack transpGroupStack; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.cc index 8387e55d0b0..383ac5478ff 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <stdlib.h> #include <stddef.h> @@ -2669,7 +2673,6 @@ DCTStream::DCTStream(Stream *strA, GBool colorXformA): frameBuf[i] = NULL; } rowBuf = NULL; - memset(quantTables, 0, sizeof(quantTables)); memset(dcHuffTables, 0, sizeof(dcHuffTables)); memset(acHuffTables, 0, sizeof(acHuffTables)); @@ -2891,7 +2894,7 @@ void DCTStream::prepare() { bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth; bufHeight = ((height + mcuHeight - 1) / mcuHeight) * mcuHeight; if (bufWidth <= 0 || bufHeight <= 0 || - bufWidth > INT_MAX / bufHeight / (int)sizeof(int)) { + bufWidth > INT_MAX / bufWidth / (int)sizeof(int)) { error(errSyntaxError, getPos(), "Invalid image size in DCT stream"); y = height; prepared = gTrue; @@ -2939,13 +2942,7 @@ void DCTStream::prepare() { // allocate a buffer for one row of MCUs bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth; - if (bufWidth <= 0 || bufWidth > INT_MAX / numComps / mcuHeight) { - error(errSyntaxError, getPos(), "Invalid image size in DCT stream"); - y = height; - prepared = gTrue; - return; - } - rowBuf = (Guchar *)gmallocn(bufWidth, numComps * mcuHeight); + rowBuf = (Guchar *)gmallocn(numComps * mcuHeight, bufWidth); rowBufPtr = rowBufEnd = rowBuf; // initialize counters @@ -3851,12 +3848,11 @@ int DCTStream::readBit() { } GBool DCTStream::readHeader(GBool frame) { - GBool haveSOF, doScan; + GBool doScan; int n, i; int c = 0; // read headers - haveSOF = gFalse; doScan = gFalse; while (!doScan) { c = readMarker(); @@ -3871,7 +3867,6 @@ GBool DCTStream::readHeader(GBool frame) { if (!readBaselineSOF()) { return gFalse; } - haveSOF = gTrue; break; case 0xc2: // SOF2 (progressive) if (!frame) { @@ -3882,7 +3877,6 @@ GBool DCTStream::readHeader(GBool frame) { if (!readProgressiveSOF()) { return gFalse; } - haveSOF = gTrue; break; case 0xc4: // DHT if (!readHuffmanTables()) { @@ -3899,10 +3893,6 @@ GBool DCTStream::readHeader(GBool frame) { case 0xd9: // EOI return gFalse; case 0xda: // SOS - if (frame && !haveSOF) { - error(errSyntaxError, getPos(), "Missing SOF in DCT stream"); - return gFalse; - } if (!readScanInfo()) { return gFalse; } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h index dc850151bc5..9d084c94895 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <stdio.h> #if HAVE_JPEGLIB #include <jpeglib.h> @@ -126,10 +130,6 @@ public: // Does this stream type potentially contain non-printable chars? virtual GBool isBinary(GBool last = gTrue) = 0; - // Does this stream include a "strong" compression filter (anything - // other than RLE)? - virtual GBool hasStrongCompression() { return gFalse; } - // Get the BaseStream of this stream. virtual BaseStream *getBaseStream() = 0; @@ -490,7 +490,6 @@ public: virtual GString *getPSFilter(int psLevel, const char *indent, GBool okToReadStream); virtual GBool isBinary(GBool last = gTrue); - virtual GBool hasStrongCompression() { return gTrue; } private: @@ -574,7 +573,6 @@ public: virtual GString *getPSFilter(int psLevel, const char *indent, GBool okToReadStream); virtual GBool isBinary(GBool last = gTrue); - virtual GBool hasStrongCompression() { return gTrue; } private: @@ -674,7 +672,6 @@ public: virtual GString *getPSFilter(int psLevel, const char *indent, GBool okToReadStream); virtual GBool isBinary(GBool last = gTrue); - virtual GBool hasStrongCompression() { return gTrue; } Stream *getRawStream() { return str; } private: @@ -816,7 +813,6 @@ public: virtual GString *getPSFilter(int psLevel, const char *indent, GBool okToReadStream); virtual GBool isBinary(GBool last = gTrue); - virtual GBool hasStrongCompression() { return gTrue; } private: diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/TextOutputDev.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/TextOutputDev.cc index 86d08414476..e2da940bb41 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/TextOutputDev.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/TextOutputDev.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <stdlib.h> #include <stddef.h> @@ -61,11 +65,7 @@ // A large character has a font size larger than // largeCharThreshold * avgFontSize. -#define largeCharThreshold 2.0 - -// Max ratio of large-to-total chars to prefer a large char split over -// a line split. -#define largeCharRatio 0.2 +#define largeCharThreshold 1.5 // A block will be split vertically only if the resulting chunk widths // are greater than minChunkWidth * avgFontSize. However, Blocks of @@ -83,9 +83,9 @@ #define maxWordGapSize 2.5 #define tableModeMaxWordGapSize 1.1 -// Chars whose baseline is within baselineRange * avgFontSize of a -// line's current average baseline are added to the line. -#define baselineRange 0.5 +// Adjacent lines can overlap by at most lineOverlapThreshold * +// lineHeight. +#define lineOverlapThreshold 0.33 // Subscripts (superscripts) must overlap the next (previous) line by // minSubSuperscriptVertOverlap * fontSize. @@ -214,14 +214,12 @@ public: static int cmpX(const void *p1, const void *p2); static int cmpY(const void *p1, const void *p2); - static int cmpBase(const void *p1, const void *p2); static int cmpCharPos(const void *p1, const void *p2); Unicode c; int charPos; int charLen; double xMin, yMin, xMax, yMax; - double base; TextFontInfo *font; double fontSize; double colorR, @@ -251,50 +249,38 @@ TextChar::TextChar(Unicode cA, int charPosA, int charLenA, yMin = yMinA; xMax = xMaxA; yMax = yMaxA; - switch (rotA) { - case 0: - default: base = yMax + fontSizeA * fontA->getDescent(); break; - case 1: base = xMin - fontSizeA * fontA->getDescent(); break; - case 2: base = yMin - fontSizeA * fontA->getDescent(); break; - case 3: base = xMax + fontSizeA * fontA->getDescent(); break; + // this can happen with vertical writing mode, or with odd values + // for the char/word spacing parameters + if (xMin > xMax) { + t = xMin; xMin = xMax; xMax = t; + } + if (yMin > yMax) { + t = yMin; yMin = yMax; yMax = t; } // TextPage::findGaps uses integer coordinates, so clip the char // bbox to fit in a 32-bit int (this is generally only a problem in // damaged PDF files) if (xMin < -1e8) { xMin = -1e8; - } else if (xMin > 1e8) { - xMin = 1e8; } - if (xMax < -1e8) { - xMax = -1e8; - } else if (xMax > 1e8) { + if (xMax > 1e8) { xMax = 1e8; } if (yMin < -1e8) { yMin = -1e8; - } else if (yMin > 1e8) { - yMin = 1e8; } - if (yMax < -1e8) { - yMax = -1e8; - } else if (yMax > 1e8) { + if (yMax > 1e8) { yMax = 1e8; } - // this can happen with vertical writing mode, or with odd values - // for the char/word spacing parameters - if (xMin > xMax) { - t = xMin; xMin = xMax; xMax = t; - } - if (yMin > yMax) { - t = yMin; yMin = yMax; yMax = t; - } - // zero-width/height characters will cause problems in the splitting code - if (xMax - xMin < 1e-6) { - xMax = xMin + 1e-6; - } - if (yMax - yMin < 1e-6) { - yMax = yMin + 1e-6; + // zero-width characters will cause problems in the splitting code + if (rotA & 1) { + if (yMax - yMin < 1e-6) { + yMax = yMin + 1e-6; + } + } else { + if (xMax - xMin < 1e-6) { + xMax = xMin + 1e-6; + } } rot = (Guchar)rotA; rotated = (char)rotatedA; @@ -335,19 +321,6 @@ int TextChar::cmpY(const void *p1, const void *p2) { } } -int TextChar::cmpBase(const void *p1, const void *p2) { - const TextChar *ch1 = *(const TextChar **)p1; - const TextChar *ch2 = *(const TextChar **)p2; - - if (ch1->base < ch2->base) { - return -1; - } else if (ch1->base > ch2->base) { - return 1; - } else { - return ch1->charPos - ch2->charPos; - } -} - int TextChar::cmpCharPos(const void *p1, const void *p2) { const TextChar *ch1 = *(const TextChar **)p1; const TextChar *ch2 = *(const TextChar **)p2; @@ -1012,8 +985,7 @@ TextLine::TextLine(GList *wordsA, double xMinA, double yMinA, } } //~ need to check for other Unicode chars used as hyphens - hyphenated = text[len - 1] == (Unicode)'-' || - text[len - 1] == (Unicode)0xad; + hyphenated = text[len - 1] == (Unicode)'-'; } TextLine::~TextLine() { @@ -1240,7 +1212,6 @@ TextPage::TextPage(TextOutputControl *controlA) { chars = new GList(); fonts = new GList(); - primaryRot = 0; underlines = new GList(); links = new GList(); @@ -1269,15 +1240,6 @@ void TextPage::startPage(GfxState *state) { if (state) { pageWidth = state->getPageWidth(); pageHeight = state->getPageHeight(); - // When rotating characters, the coordinates are flipped using the - // page size. See the comment in TextChar::TextChar() about - // integer coordinates. - if (pageWidth > 1e8) { - pageWidth = 1e8; - } - if (pageHeight > 1e8) { - pageHeight = 1e8; - } } else { pageWidth = pageHeight = 0; } @@ -1304,9 +1266,6 @@ void TextPage::clear() { underlines = new GList(); deleteGList(links, TextLink); links = new GList(); - nVisibleChars = 0; - nInvisibleChars = 0; - nRemovedDupChars = 0; if (findCols) { deleteGList(findCols, TextColumn); @@ -1601,18 +1560,13 @@ void TextPage::addChar(GfxState *state, double x, double y, } else { j = i; } - GBool invisible = state->getRender() == 3 || alpha < 0.001; chars->append(new TextChar(uBuf[j], charPos, nBytes, xMin, yMin, xMax, yMax, - curRot, rotated, clipped, invisible, + curRot, rotated, clipped, + state->getRender() == 3 || alpha < 0.001, curFont, curFontSize, colToDbl(rgb.r), colToDbl(rgb.g), colToDbl(rgb.b))); - if (invisible) { - ++nInvisibleChars; - } else { - ++nVisibleChars; - } } } @@ -1776,7 +1730,7 @@ void TextPage::writeReadingOrder(void *outputStream, GList *columns; GBool primaryLR; GString *s; - int colIdx, parIdx, lineIdx, n; + int colIdx, parIdx, lineIdx, rot, n; #if 0 //~debug dumpChars(chars); @@ -1786,7 +1740,7 @@ void TextPage::writeReadingOrder(void *outputStream, } else { overlappingChars = NULL; } - primaryRot = rotateChars(chars); + rot = rotateChars(chars); primaryLR = checkPrimaryLR(chars); tree = splitChars(chars); #if 0 //~debug @@ -1794,14 +1748,14 @@ void TextPage::writeReadingOrder(void *outputStream, #endif if (!tree) { // no text - unrotateChars(chars, primaryRot); + unrotateChars(chars, rot); return; } columns = buildColumns(tree, primaryLR); delete tree; - unrotateChars(chars, primaryRot); + unrotateChars(chars, rot); if (control.html) { - rotateUnderlinesAndLinks(primaryRot); + rotateUnderlinesAndLinks(rot); generateUnderlinesAndLinks(columns); } if (overlappingChars) { @@ -1845,10 +1799,10 @@ GList *TextPage::makeColumns() { GList *overlappingChars; GList *columns; GBool primaryLR; + int rot; if (control.mode == textOutSimple2Layout) { primaryLR = checkPrimaryLR(chars); - primaryRot = 0; rotateCharsToZero(chars); columns = buildSimple2Columns(chars); unrotateCharsFromZero(chars); @@ -1859,7 +1813,7 @@ GList *TextPage::makeColumns() { } else { overlappingChars = NULL; } - primaryRot = rotateChars(chars); + rot = rotateChars(chars); primaryLR = checkPrimaryLR(chars); if ((tree = splitChars(chars))) { columns = buildColumns(tree, primaryLR); @@ -1868,8 +1822,8 @@ GList *TextPage::makeColumns() { // no text columns = new GList(); } - unrotateChars(chars, primaryRot); - unrotateColumns(columns, primaryRot); + unrotateChars(chars, rot); + unrotateColumns(columns, rot); if (control.html) { generateUnderlinesAndLinks(columns); } @@ -1898,7 +1852,7 @@ void TextPage::writePhysLayout(void *outputStream, GList *overlappingChars; GList *columns; GBool primaryLR; - int ph, colIdx, parIdx, lineIdx, y, i; + int ph, colIdx, parIdx, lineIdx, rot, y, i; #if 0 //~debug dumpChars(chars); @@ -1911,7 +1865,7 @@ void TextPage::writePhysLayout(void *outputStream, } else { overlappingChars = NULL; } - primaryRot = rotateChars(chars); + rot = rotateChars(chars); primaryLR = checkPrimaryLR(chars); tree = splitChars(chars); #if 0 //~debug @@ -1919,15 +1873,15 @@ void TextPage::writePhysLayout(void *outputStream, #endif if (!tree) { // no text - unrotateChars(chars, primaryRot); + unrotateChars(chars, rot); return; } //~ this doesn't correctly handle the right-to-left case columns = buildColumns(tree, gTrue); delete tree; - unrotateChars(chars, primaryRot); + unrotateChars(chars, rot); if (control.html) { - rotateUnderlinesAndLinks(primaryRot); + rotateUnderlinesAndLinks(rot); generateUnderlinesAndLinks(columns); } ph = assignPhysLayoutPositions(columns); @@ -1986,7 +1940,7 @@ void TextPage::writePhysLayout(void *outputStream, if (overlappingChars) { if (overlappingChars->getLength() > 0) { - col = buildOverlappingTextColumn(overlappingChars); + TextColumn *col = buildOverlappingTextColumn(overlappingChars); (*outputFunc)(outputStream, eol, eolLen); for (parIdx = 0; parIdx < col->paragraphs->getLength(); ++parIdx) { par = (TextParagraph *)col->paragraphs->get(parIdx); @@ -2019,12 +1973,12 @@ void TextPage::writeSimpleLayout(void *outputStream, GList *superLines; GString *out; GBool primaryLR; - int x, i, j; + int rot, x, i, j; #if 0 //~debug dumpChars(chars); #endif - primaryRot = rotateChars(chars); + rot = rotateChars(chars); primaryLR = checkPrimaryLR(chars); tree = splitChars(chars); #if 0 //~debug @@ -2032,13 +1986,13 @@ void TextPage::writeSimpleLayout(void *outputStream, #endif if (!tree) { // no text - unrotateChars(chars, primaryRot); + unrotateChars(chars, rot); return; } superLines = new GList(); buildSuperLines(tree, superLines); delete tree; - unrotateChars(chars, primaryRot); + unrotateChars(chars, rot); assignSimpleLayoutPositions(superLines, uMap); for (i = 0; i < superLines->getLength(); ++i) { @@ -2082,7 +2036,6 @@ void TextPage::writeSimple2Layout(void *outputStream, int colIdx, parIdx, lineIdx; primaryLR = checkPrimaryLR(chars); - primaryRot = 0; rotateCharsToZero(chars); #if 0 //~debug dumpChars(chars); @@ -2121,9 +2074,9 @@ void TextPage::writeLinePrinter(void *outputStream, double pitch, lineSpacing, delta; double yMin0, yShift, xMin0, xShift; double y, x; - int n, i, j, k; + int rot, n, i, j, k; - primaryRot = rotateChars(chars); + rot = rotateChars(chars); chars->sort(&TextChar::cmpX); // don't call removeDuplicates here, because it expects to be // working on a secondary list that doesn't own the TextChar objects @@ -2233,7 +2186,7 @@ void TextPage::writeLinePrinter(void *outputStream, delete line; } - unrotateChars(chars, primaryRot); + unrotateChars(chars, rot); } void TextPage::writeRaw(void *outputStream, @@ -2498,7 +2451,6 @@ int TextPage::rotateChars(GList *charsA) { ch->xMax = xMax; ch->yMin = yMin; ch->yMax = yMax; - ch->base = pageWidth - ch->base; ch->rot = (ch->rot + 3) & 3; } t = pageWidth; @@ -2516,7 +2468,6 @@ int TextPage::rotateChars(GList *charsA) { ch->xMax = xMax; ch->yMin = yMin; ch->yMax = yMax; - ch->base = pageHeight - ch->base; ch->rot = (ch->rot + 2) & 3; } break; @@ -2564,7 +2515,6 @@ void TextPage::rotateCharsToZero(GList *charsA) { ch->xMax = xMax; ch->yMin = yMin; ch->yMax = yMax; - ch->base = pageWidth - ch->base; break; case 2: xMin = pageWidth - ch->xMax; @@ -2575,7 +2525,6 @@ void TextPage::rotateCharsToZero(GList *charsA) { ch->xMax = xMax; ch->yMin = yMin; ch->yMax = yMax; - ch->base = pageHeight - ch->base; break; case 3: xMin = pageHeight - ch->yMax; @@ -2705,7 +2654,6 @@ void TextPage::unrotateChars(GList *charsA, int rot) { ch->xMax = xMax; ch->yMin = yMin; ch->yMax = yMax; - ch->base = pageWidth - ch->base; ch->rot = (ch->rot + 1) & 3; } break; @@ -2720,7 +2668,6 @@ void TextPage::unrotateChars(GList *charsA, int rot) { ch->xMax = xMax; ch->yMin = yMin; ch->yMax = yMax; - ch->base = pageHeight - ch->base; ch->rot = (ch->rot + 2) & 3; } break; @@ -3273,7 +3220,7 @@ GBool TextPage::checkPrimaryLR(GList *charsA) { // by x for rot=0,2; by y for rot=1,3. void TextPage::removeDuplicates(GList *charsA, int rot) { TextChar *ch, *ch2; - double xDelta, yDelta, xDelta2, yDelta2; + double xDelta, yDelta; int i, j; if (rot & 1) { @@ -3282,10 +3229,6 @@ void TextPage::removeDuplicates(GList *charsA, int rot) { ch = (TextChar *)charsA->get(i); xDelta = dupMaxSecDelta * ch->fontSize; yDelta = dupMaxPriDelta * ch->fontSize; - yDelta2 = 0.5 * (ch->yMax - ch->yMin); - if (yDelta2 < yDelta) { - yDelta = yDelta2; - } j = i + 1; while (j < charsA->getLength()) { ch2 = (TextChar *)charsA->get(j); @@ -3298,7 +3241,6 @@ void TextPage::removeDuplicates(GList *charsA, int rot) { fabs(ch2->yMax - ch->yMax) < yDelta) { if (ch->invisible && !ch2->invisible) { charsA->del(i); - ++nRemovedDupChars; --i; break; } @@ -3306,7 +3248,6 @@ void TextPage::removeDuplicates(GList *charsA, int rot) { ch->spaceAfter = (char)gTrue; } charsA->del(j); - ++nRemovedDupChars; } else { ++j; } @@ -3318,10 +3259,6 @@ void TextPage::removeDuplicates(GList *charsA, int rot) { while (i < charsA->getLength()) { ch = (TextChar *)charsA->get(i); xDelta = dupMaxPriDelta * ch->fontSize; - xDelta2 = 0.5 * (ch->xMax - ch->xMin); - if (xDelta2 < xDelta) { - xDelta = xDelta2; - } yDelta = dupMaxSecDelta * ch->fontSize; j = i + 1; while (j < charsA->getLength()) { @@ -3335,7 +3272,6 @@ void TextPage::removeDuplicates(GList *charsA, int rot) { fabs(ch2->yMax - ch->yMax) < yDelta) { if (ch->invisible && !ch2->invisible) { charsA->del(i); - ++nRemovedDupChars; --i; break; } @@ -3343,7 +3279,6 @@ void TextPage::removeDuplicates(GList *charsA, int rot) { ch->spaceAfter = (char)gTrue; } charsA->del(j); - ++nRemovedDupChars; } else { ++j; } @@ -3624,7 +3559,7 @@ TextBlock *TextPage::splitChars(GList *charsA) { } } if (chars2->getLength() > 0) { - tree[rot] = split(chars2, rot); + tree[rot] = split(chars2, rot, gFalse); } } delete chars2; @@ -3655,11 +3590,9 @@ TextBlock *TextPage::splitChars(GList *charsA) { } // merge non-primary-rotation text into the primary-rotation tree - GBool doReorder = control.mode == textOutReadingOrder && - globalParams->getSeparateRotatedText(); for (rot = 1; rot < 4; ++rot) { if (tree[rot]) { - insertIntoTree(tree[rot], tree[0], doReorder); + insertIntoTree(tree[rot], tree[0]); tree[rot] = NULL; } } @@ -3677,7 +3610,7 @@ TextBlock *TextPage::splitChars(GList *charsA) { } // Generate a tree of TextBlocks, marked as columns, lines, and words. -TextBlock *TextPage::split(GList *charsA, int rot) { +TextBlock *TextPage::split(GList *charsA, int rot, GBool vertOnly) { TextBlock *blk; GList *chars2, *chars3; GList *splitLines; @@ -3829,13 +3762,18 @@ TextBlock *TextPage::split(GList *charsA, int rot) { doHorizSplit = doVertSplit = doLineSplit = doLargeCharSplit = gFalse; smallSplit = gFalse; if (rot & 1) { - if (control.mode == textOutSimpleLayout) { + if (vertOnly) { + if (nHorizGaps > 0 && horizGapSize > minGapSize * minFontSize) { + doHorizSplit = gTrue; + smallSplit = horizGapSize < smallSplitThreshold; + } + } else if (control.mode == textOutSimpleLayout) { if (nVertGaps > 0) { doVertSplit = gTrue; } else if (nHorizGaps > 0 && horizGapSize > minGapSize * minFontSize) { doHorizSplit = gTrue; smallSplit = horizGapSize < smallSplitThreshold; - } else if (splitLines->getLength() > 1) { + } else if (!vertOnly && splitLines->getLength() > 1) { doLineSplit = gTrue; } } else if (nHorizGaps > 0 && @@ -3848,15 +3786,19 @@ TextBlock *TextPage::split(GList *charsA, int rot) { smallSplit = horizGapSize < smallSplitThreshold; } else if (nVertGaps > 0) { doVertSplit = gTrue; - } else if (nLargeChars > 0 && - ((nLargeChars < largeCharRatio * charsA->getLength()) || - splitLines->getLength() <= 1)) { + } else if (nLargeChars > 0) { doLargeCharSplit = gTrue; } else if (splitLines->getLength() > 1) { doLineSplit = gTrue; } } else { - if (control.mode == textOutSimpleLayout) { + if (vertOnly) { + if (nVertGaps > 0 && + vertGapSize > minGapSize * minFontSize) { + doVertSplit = gTrue; + smallSplit = vertGapSize < smallSplitThreshold; + } + } else if (control.mode == textOutSimpleLayout) { if (nHorizGaps > 0) { doHorizSplit = gTrue; } else if (nVertGaps > 0 && vertGapSize > minGapSize * minFontSize) { @@ -3875,9 +3817,7 @@ TextBlock *TextPage::split(GList *charsA, int rot) { smallSplit = vertGapSize < smallSplitThreshold; } else if (nHorizGaps > 0) { doHorizSplit = gTrue; - } else if (nLargeChars > 0 && - ((nLargeChars < largeCharRatio * charsA->getLength()) || - splitLines->getLength() <= 1)) { + } else if (nLargeChars > 0) { doLargeCharSplit = gTrue; } else if (splitLines->getLength() > 1) { doLineSplit = gTrue; @@ -3907,13 +3847,13 @@ TextBlock *TextPage::split(GList *charsA, int rot) { if (vertGaps->getW(i) > vertGapSize - splitGapSlack * avgFontSize) { x1 = vertGaps->getX(i); chars2 = getChars(charsA, x0, yMin - 1, x1, yMax + 1); - blk->addChild(split(chars2, rot)); + blk->addChild(split(chars2, rot, vertOnly)); delete chars2; x0 = x1; } } chars2 = getChars(charsA, x0, yMin - 1, xMax + 1, yMax + 1); - blk->addChild(split(chars2, rot)); + blk->addChild(split(chars2, rot, vertOnly)); delete chars2; // split horizontally @@ -3934,13 +3874,13 @@ TextBlock *TextPage::split(GList *charsA, int rot) { if (horizGaps->getW(i) > horizGapSize - splitGapSlack * avgFontSize) { y1 = horizGaps->getX(i); chars2 = getChars(charsA, xMin - 1, y0, xMax + 1, y1); - blk->addChild(split(chars2, rot)); + blk->addChild(split(chars2, rot, gFalse)); delete chars2; y0 = y1; } } chars2 = getChars(charsA, xMin - 1, y0, xMax + 1, yMax + 1); - blk->addChild(split(chars2, rot)); + blk->addChild(split(chars2, rot, gFalse)); delete chars2; // split into larger and smaller chars @@ -3959,7 +3899,7 @@ TextBlock *TextPage::split(GList *charsA, int rot) { chars3->append(ch); } } - blk = split(chars3, rot); + blk = split(chars3, rot, gFalse); chars2->sort((rot & 1) ? &TextChar::cmpY : &TextChar::cmpX); insertLargeChars(chars2, blk); delete chars2; @@ -3985,21 +3925,12 @@ TextBlock *TextPage::split(GList *charsA, int rot) { for (i = 0; i < splitLine->chars->getLength(); ++i) { blk->addChild((TextChar *)splitLine->chars->get(i), gTrue); } -#if 0 //~debug - printf("line-leaf xMin=%g yMin=%g xMax=%g yMax=%g\n", - xMin, pageHeight - yMax, xMax, pageHeight - yMin); - printf(" "); - for (i = 0; i < splitLine->chars->getLength(); ++i) { - printf("%c", ((TextChar *)splitLine->chars->get(i))->c); - } - printf("\n"); -#endif } else { blk = new TextBlock((rot & 1) ? blkVertSplit : blkHorizSplit, rot); blk->smallSplit = gFalse; for (i = 0; i < splitLines->getLength(); ++i) { SplitLine *splitLine = (SplitLine *)splitLines->get(i); - blk->addChild(split(splitLine->chars, rot)); + blk->addChild(split(splitLine->chars, rot, singleLine)); } } @@ -4127,146 +4058,54 @@ void TextPage::findGaps(GList *charsA, int rot, } } - //----- find horizontal gaps + //----- partition into lines and find horizontal gaps if (rot & 1) { charsA->sort(&TextChar::cmpX); - double xxMax = 0; + SplitLine *splitLine = NULL; + double xxMin = 0, xxMax = 0; for (int i = 0; i < charsA->getLength(); ++i) { TextChar *ch = (TextChar *)charsA->get(i); - if (i == 0) { + if (i == 0 || + ch->xMin > xxMax - lineOverlapThreshold * (xxMax - xxMin)) { + if (i > 0 && ch->xMin > xxMax) { + vertGaps->addGap(0.5 * (ch->xMin + xxMax), ch->xMin - xxMax); + } + xxMin = ch->xMin; xxMax = ch->xMax; - } else if (ch->xMin <= xxMax) { + splitLine = new SplitLine(i, i, xxMin, xxMax); + splitLines->append(splitLine); + } else { + splitLine->lastCharIdx = i; if (ch->xMax > xxMax) { xxMax = ch->xMax; + splitLine->yMax = xxMax; } - } else { - vertGaps->addGap(0.5 * (ch->xMin + xxMax), ch->xMin - xxMax); - xxMax = ch->xMax; } } } else { charsA->sort(&TextChar::cmpY); - double yyMax = 0; + SplitLine *splitLine = NULL; + double yyMin = 0, yyMax = 0; for (int i = 0; i < charsA->getLength(); ++i) { TextChar *ch = (TextChar *)charsA->get(i); - if (i == 0) { - yyMax = ch->yMax; - } else if (ch->yMin <= yyMax) { - if (ch->yMax > yyMax) { - yyMax = ch->yMax; + if (i == 0 || + ch->yMin > yyMax - lineOverlapThreshold * (yyMax - yyMin)) { + if (i > 0 && ch->yMin > yyMax) { + horizGaps->addGap(0.5 * (ch->yMin + yyMax), ch->yMin - yyMax); } - } else { - horizGaps->addGap(0.5 * (ch->yMin + yyMax), ch->yMin - yyMax); + yyMin = ch->yMin; yyMax = ch->yMax; - } - } - } - - //----- split into lines - - double baseDelta = baselineRange * avgFontSize; - - if (rot & 1) { - - // split into non-overlapping chunks - int firstChar = 0; - while (firstChar < charsA->getLength()) { - TextChar *ch = (TextChar *)charsA->get(firstChar); - double xxMax = ch->xMax; - int nextChar = firstChar + 1; - while (nextChar < charsA->getLength()) { - ch = (TextChar *)charsA->get(nextChar); - if (ch->xMin > xxMax) { - break; - } - if (ch->xMax > xxMax) { - xxMax = ch->xMax; - } - ++nextChar; - } - - // split the chunk [firstChar, nextChar) into lines - charsA->sort(firstChar, nextChar - firstChar, &TextChar::cmpBase); - int i0 = firstChar; - while (i0 < nextChar) { - ch = (TextChar *)charsA->get(i0); - double baseTotal = ch->base; - double baseAvg = baseTotal; - double xxMin = ch->xMin; - xxMax = ch->xMax; - int i1 = i0 + 1; - while (i1 < nextChar) { - ch = (TextChar *)charsA->get(i1); - if (ch->base > baseAvg + baseDelta) { - break; - } - baseTotal += ch->base; - if (ch->xMin < xxMin) { - xxMin = ch->xMin; - } - if (ch->xMax > xxMax) { - xxMax = ch->xMax; - } - ++i1; - baseAvg = baseTotal / (i1 - i0); - } - splitLines->append(new SplitLine(i0, i1 - 1, xxMin, xxMax)); - i0 = i1; - } - firstChar = nextChar; - } - - } else { - - // split into non-overlapping chunks - int firstChar = 0; - while (firstChar < charsA->getLength()) { - TextChar *ch = (TextChar *)charsA->get(firstChar); - double yyMax = ch->yMax; - int nextChar = firstChar + 1; - while (nextChar < charsA->getLength()) { - ch = (TextChar *)charsA->get(nextChar); - if (ch->yMin > yyMax) { - break; - } + splitLine = new SplitLine(i, i, yyMin, yyMax); + splitLines->append(splitLine); + } else { + splitLine->lastCharIdx = i; if (ch->yMax > yyMax) { yyMax = ch->yMax; + splitLine->yMax = yyMax; } - ++nextChar; - } - - // split the chunk [firstChar, nextChar) into lines - charsA->sort(firstChar, nextChar - firstChar, &TextChar::cmpBase); - int i0 = firstChar; - while (i0 < nextChar) { - ch = (TextChar *)charsA->get(i0); - double baseTotal = ch->base; - double baseAvg = baseTotal; - double yyMin = ch->yMin; - yyMax = ch->yMax; - int i1 = i0 + 1; - while (i1 < nextChar) { - ch = (TextChar *)charsA->get(i1); - if (ch->base > baseAvg + baseDelta) { - break; - } - baseTotal += ch->base; - if (ch->yMin < yyMin) { - yyMin = ch->yMin; - } - if (ch->yMax > yyMax) { - yyMax = ch->yMax; - } - ++i1; - baseAvg = baseTotal / (i1 - i0); - } - splitLines->append(new SplitLine(i0, i1 - 1, yyMin, yyMax)); - i0 = i1; } - firstChar = nextChar; } - } } @@ -4358,19 +4197,10 @@ void TextPage::mergeSplitLines(GList *charsA, int rot, GList *splitLines) { // merge sub/superscripts into correct lines if (allSubSuper) { - idxAbove = 0; - idxBelow = 0; for (int idx = 0; idx < splitLine->chars->getLength(); ++idx) { TextChar *ch = (TextChar *)splitLine->chars->get(idx); if (maybeSub && ch->xMin < prevLine->yMax) { - while (idxAbove < prevLine->chars->getLength()) { - TextChar *ch2 = (TextChar *)prevLine->chars->get(idxAbove); - if (ch2->yMin > ch->yMin && ch2->xMin < ch->xMax && ch2->xMax > ch->xMin) { - break; - } - ++idxAbove; - } - prevLine->chars->insert(idxAbove, ch); + prevLine->chars->append(ch); if (ch->xMin < prevLine->yMin) { prevLine->yMin = ch->xMin; } @@ -4378,14 +4208,7 @@ void TextPage::mergeSplitLines(GList *charsA, int rot, GList *splitLines) { prevLine->yMax = ch->xMax; } } else { - while (idxBelow < nextLine->chars->getLength()) { - TextChar *ch2 = (TextChar *)nextLine->chars->get(idxBelow); - if (ch2->yMin > ch->yMin && ch2->xMin < ch->xMax && ch2->xMax > ch->xMin) { - break; - } - ++idxBelow; - } - nextLine->chars->insert(idxBelow, ch); + nextLine->chars->append(ch); if (ch->xMin < nextLine->yMin) { nextLine->yMin = ch->xMin; } @@ -4394,6 +4217,12 @@ void TextPage::mergeSplitLines(GList *charsA, int rot, GList *splitLines) { } } } + if (maybeSub) { + prevLine->chars->sort(&TextChar::cmpY); + } + if (maybeSuper) { + nextLine->chars->sort(&TextChar::cmpY); + } delete splitLine; splitLines->del(i); } @@ -4423,14 +4252,14 @@ void TextPage::mergeSplitLines(GList *charsA, int rot, GList *splitLines) { prevLine = (SplitLine *)splitLines->get(i-1); double minOverlap = minSubSuperscriptVertOverlap * (prevLine->yMax - prevLine->yMin); - maybeSub = prevLine->yMax - splitLine->yMin > minOverlap; + maybeSub = prevLine->yMax - splitLine->yMin > minOverlap; } GBool maybeSuper = gFalse; if (i < splitLines->getLength() - 1) { nextLine = (SplitLine *)splitLines->get(i+1); double minOverlap = minSubSuperscriptVertOverlap * (nextLine->yMax - nextLine->yMin); - maybeSuper = splitLine->yMax - nextLine->yMin > minOverlap; + maybeSuper = splitLine->yMax - nextLine->yMin > minOverlap; } if (!maybeSub && !maybeSuper) { continue; @@ -4486,19 +4315,10 @@ void TextPage::mergeSplitLines(GList *charsA, int rot, GList *splitLines) { // merge sub/superscripts into correct lines if (allSubSuper) { - idxAbove = 0; - idxBelow = 0; for (int idx = 0; idx < splitLine->chars->getLength(); ++idx) { TextChar *ch = (TextChar *)splitLine->chars->get(idx); if (maybeSub && ch->yMin < prevLine->yMax) { - while (idxAbove < prevLine->chars->getLength()) { - TextChar *ch2 = (TextChar *)prevLine->chars->get(idxAbove); - if (ch2->xMin > ch->xMin && ch2->yMin < ch->yMax && ch2->yMax > ch->yMin) { - break; - } - ++idxAbove; - } - prevLine->chars->insert(idxAbove, ch); + prevLine->chars->append(ch); if (ch->yMin < prevLine->yMin) { prevLine->yMin = ch->yMin; } @@ -4506,14 +4326,7 @@ void TextPage::mergeSplitLines(GList *charsA, int rot, GList *splitLines) { prevLine->yMax = ch->yMax; } } else { - while (idxBelow < nextLine->chars->getLength()) { - TextChar *ch2 = (TextChar *)nextLine->chars->get(idxBelow); - if (ch2->xMin > ch->xMin && ch2->yMin < ch->yMax && ch2->yMax > ch->yMin) { - break; - } - ++idxBelow; - } - nextLine->chars->insert(idxBelow, ch); + nextLine->chars->append(ch); if (ch->yMin < nextLine->yMin) { nextLine->yMin = ch->yMin; } @@ -4522,6 +4335,12 @@ void TextPage::mergeSplitLines(GList *charsA, int rot, GList *splitLines) { } } } + if (maybeSub) { + prevLine->chars->sort(&TextChar::cmpX); + } + if (maybeSuper) { + nextLine->chars->sort(&TextChar::cmpX); + } delete splitLine; splitLines->del(i); } @@ -4698,48 +4517,20 @@ void TextPage::insertLargeCharInLeaf(TextChar *ch, TextBlock *blk) { } // Merge blk (rot != 0) into primaryTree (rot == 0). -void TextPage::insertIntoTree(TextBlock *blk, TextBlock *primaryTree, - GBool doReorder) { - // if we're separating each rotation (only supported in reading - // order mode), reorder the block's children as appropriate and then - // append the block - if (doReorder) { - reorderBlocks(blk); - primaryTree->children->append(blk); - - // otherwise, insert blocks into the primary tree in the appropriate - // locations - } else { +void TextPage::insertIntoTree(TextBlock *blk, TextBlock *primaryTree) { + TextBlock *child; - // we insert a whole column at a time - so call insertIntoTree - // recursively until we get to a column (or line) - if (blk->tag == blkTagMulticolumn) { - while (blk->children->getLength()) { - TextBlock *child = (TextBlock *)blk->children->del(0); - insertIntoTree(child, primaryTree, doReorder); - } - delete blk; + // we insert a whole column at a time - so call insertIntoTree + // recursively until we get to a column (or line) - } else { - insertColumnIntoTree(blk, primaryTree); + if (blk->tag == blkTagMulticolumn) { + while (blk->children->getLength()) { + child = (TextBlock *)blk->children->del(0); + insertIntoTree(child, primaryTree); } - } -} - -// Reorder non-primary-rotation blocks as appropriate (for reading -// order mode only). -void TextPage::reorderBlocks(TextBlock *blk) { - if (blk->tag != blkTagMulticolumn) { - return; - } - for (int i = 0; i < blk->children->getLength(); ++i) { - reorderBlocks((TextBlock *)blk->children->get(i)); - } - //~ check/test these conditions - if ((blk->rot == 1 && blk->type == blkVertSplit) || - blk->rot == 2 || - (blk->rot == 3 && blk->type == blkHorizSplit)) { - blk->children->reverse(); + delete blk; + } else { + insertColumnIntoTree(blk, primaryTree); } } @@ -5304,13 +5095,11 @@ TextLine *TextPage::buildLine(GList *charsA, int rot, TextWord *word; double wordSp, lineFontSize, sp; int dir, dir2; - GBool rotated2, spaceAfter, spaceBefore; + GBool rotated, spaceAfter, spaceBefore; int i, j; wordSp = computeWordSpacingThreshold(charsA, rot); - adjustCombiningChars(charsA, rot); - words = new GList(); lineFontSize = 0; spaceBefore = gFalse; @@ -5324,7 +5113,7 @@ TextLine *TextPage::buildLine(GList *charsA, int rot, : (TextChar *)NULL, (i < charsA->getLength() - 1) ? (TextChar *)charsA->get(i+1) : (TextChar *)NULL); - rotated2 = ((TextChar *)charsA->get(i))->rotated; + rotated = ((TextChar *)charsA->get(i))->rotated; for (j = i+1; j < charsA->getLength(); ++j) { ch = (TextChar *)charsA->get(j-1); ch2 = (TextChar *)charsA->get(j); @@ -5345,7 +5134,7 @@ TextLine *TextPage::buildLine(GList *charsA, int rot, : (TextChar *)NULL); if (ch->font != ch2->font || fabs(ch->fontSize - ch2->fontSize) > 0.01 || - (control.splitRotatedWords && ch2->rotated != rotated2) || + (control.splitRotatedWords && ch2->rotated != rotated) || (dir && dir2 && dir2 != dir) || (control.mode == textOutRawOrder && ch2->charPos != ch->charPos + ch->charLen)) { @@ -5356,7 +5145,7 @@ TextLine *TextPage::buildLine(GList *charsA, int rot, } sp = wordSp - 1; } - word = new TextWord(charsA, i, j - i, rot, rotated2, dir, + word = new TextWord(charsA, i, j - i, rot, rotated, dir, (rot >= 2) ? spaceBefore : spaceAfter); spaceBefore = spaceAfter; i = j; @@ -5488,89 +5277,6 @@ double TextPage::computeWordSpacingThreshold(GList *charsA, int rot) { } } -// Move Unicode combining characters around so that they come -// immediately after the correct base characters. -//~ this currently won't work for RtL scripts -void TextPage::adjustCombiningChars(GList *charsA, int rot) { - int i = 1; - while (i < charsA->getLength()) { - TextChar *ch = (TextChar *)charsA->get(i); - - // look for a zero-width combining char - if (!(unicodeTypeCombiningMark(ch->c) && - fabs((rot & 1) ? ch->yMax - ch->yMin // width ~= zero - : ch->xMax - ch->xMin) < 0.01)) { - ++i; - continue; - } - - // look for a sequence of zero-width combining chars at the same - // position (NB: slight negative char spacing can reorder things - // so that diacritics for different base chars appear next to each - // other) - int j; - for (j = i + 1; j < charsA->getLength(); ++j) { - TextChar *ch2 = (TextChar *)charsA->get(j); - if (!(unicodeTypeCombiningMark(ch2->c) && - fabs((rot & 1) ? ch2->yMin - ch->yMax - : ch2->xMin - ch->xMax) < 0.01 * ch->fontSize && - fabs((rot & 1) ? ch->yMax - ch->yMin // width ~= zero - : ch->xMax - ch->xMin) < 0.01)) { - break; - } - } - - // identify the two previous chars - TextChar *prev1 = (i >= 2) ? (TextChar *)charsA->get(i - 2) : NULL; - TextChar *prev2 = (TextChar *)charsA->get(i - 1); - - //~ this code currently makes things worse for RtL scripts, so - //~ skip any RtL text - if (unicodeTypeR(prev2->c)) { - ++i; - continue; - } - - // if the combining chars are placed in the left 3/4 of prev2, - // assume the base char is prev1, not prev2, and reorder the chars - // accordingly - TextChar *base; - if (prev1 && - ((rot & 1) ? (ch->yMin < 0.25 * prev2->yMin + 0.75 * prev2->yMax) - : (ch->xMin < 0.25 * prev2->xMin + 0.75 * prev2->xMax))) { - for (int k = i; k < j; ++k) { - charsA->put(k - 1, charsA->get(k)); - } - charsA->put(j - 1, prev2); - --i; - --j; - base = prev1; - } else { - base = prev2; - } - - // sort the diacritics into content stream order - // (slight negative char spacing, used for kerning, will push - // zero-width diacritics out of order) - if (j - i > 1) { - charsA->sort(i, j - i, &TextChar::cmpCharPos); - } - - // set the diacritics' positions immediately to the right of the - // base char - for (int k = i; k < j; ++k) { - TextChar *ch2 = (TextChar *)charsA->get(k); - if (rot & 1) { - ch2->yMin = ch2->yMax = base->yMax; - } else { - ch2->xMin = ch2->xMax = base->xMax; - } - } - - i = j; - } -} - // Check the character's direction: returns 1 for L or Num; -1 for R; 0 // for others. int TextPage::getCharDirection(TextChar *ch) { @@ -6918,8 +6624,7 @@ void TextOutputDev::endString(GfxState *state) { void TextOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, - CharCode c, int nBytes, Unicode *u, int uLen, - GBool fill, GBool stroke, GBool makePath) { + CharCode c, int nBytes, Unicode *u, int uLen) { text->addChar(state, x, y, dx, dy, c, nBytes, u, uLen); } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/TextOutputDev.h b/Build/source/libs/xpdf/xpdf-src/xpdf/TextOutputDev.h index fc7bcb616dd..302975cd5f1 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/TextOutputDev.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/TextOutputDev.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include <stdio.h> #include "gtypes.h" #include "GfxFont.h" @@ -118,9 +122,6 @@ public: // Get the width of the 'm' character, if available. double getMWidth() { return mWidth; } - double getAscent() { return ascent; } - double getDescent() { return descent; } - Ref getFontID() { return fontID; } private: @@ -473,18 +474,10 @@ public: TextWordList *makeWordListForRect(double xMin, double yMin, double xMax, double yMax); - // Get the primary rotation of text on the page. - int getPrimaryRotation() { return primaryRot; } - // Returns true if the primary character direction is left-to-right, // false if it is right-to-left. GBool primaryDirectionIsLR(); - // Get the counter values. - int getNumVisibleChars() { return nVisibleChars; } - int getNumInvisibleChars() { return nInvisibleChars; } - int getNumRemovedDupChars() { return nRemovedDupChars; } - // Returns true if any of the fonts used on this page are likely to // be problematic when converting text to Unicode. GBool problematicForUnicode() { return problematic; } @@ -564,7 +557,7 @@ private: GList *separateOverlappingText(GList *charsA); TextColumn *buildOverlappingTextColumn(GList *overlappingChars); TextBlock *splitChars(GList *charsA); - TextBlock *split(GList *charsA, int rot); + TextBlock *split(GList *charsA, int rot, GBool vertOnly); GList *getChars(GList *charsA, double xMin, double yMin, double xMax, double yMax); void findGaps(GList *charsA, int rot, @@ -578,9 +571,7 @@ private: void insertLargeChars(GList *largeChars, TextBlock *blk); void insertLargeCharsInFirstLeaf(GList *largeChars, TextBlock *blk); void insertLargeCharInLeaf(TextChar *ch, TextBlock *blk); - void insertIntoTree(TextBlock *subtree, TextBlock *primaryTree, - GBool doReorder); - void reorderBlocks(TextBlock *blk); + void insertIntoTree(TextBlock *subtree, TextBlock *primaryTree); void insertColumnIntoTree(TextBlock *column, TextBlock *tree); void insertClippedChars(GList *clippedChars, TextBlock *tree); TextBlock *findClippedCharLeaf(TextChar *ch, TextBlock *tree); @@ -598,7 +589,6 @@ private: double xMin, double yMin, double xMax, double yMax); void getLineChars(TextBlock *blk, GList *charsA); double computeWordSpacingThreshold(GList *charsA, int rot); - void adjustCombiningChars(GList *charsA, int rot); int getCharDirection(TextChar *ch); int getCharDirection(TextChar *ch, TextChar *left, TextChar *right); int assignPhysLayoutPositions(GList *columns); @@ -650,15 +640,10 @@ private: GList *chars; // [TextChar] GList *fonts; // all font info objects used on this // page [TextFontInfo] - int primaryRot; // primary rotation GList *underlines; // [TextUnderline] GList *links; // [TextLink] - int nVisibleChars; // number of visible chars on the page - int nInvisibleChars; // number of invisible chars on the page - int nRemovedDupChars; // number of duplicate chars removed - GList *findCols; // text used by the findText**/findPoint** // functions [TextColumn] double lastFindXMin, // coordinates of the last "find" result @@ -740,8 +725,7 @@ public: virtual void drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, - CharCode c, int nBytes, Unicode *u, int uLen, - GBool fill, GBool stroke, GBool makePath); + CharCode c, int nBytes, Unicode *u, int uLen); virtual void incCharCount(int nChars); virtual void beginActualText(GfxState *state, Unicode *u, int uLen); virtual void endActualText(GfxState *state); @@ -800,11 +784,6 @@ public: // Turn extra processing for HTML conversion on or off. void enableHTMLExtras(GBool html) { control.html = html; } - // Get the counter values. - int getNumVisibleChars() { return text->nVisibleChars; } - int getNumInvisibleChars() { return text->nInvisibleChars; } - int getNumRemovedDupChars() { return text->nRemovedDupChars; } - private: void generateBOM(); diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/TextString.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/TextString.cc index 5541bc61102..8e54a1d5471 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/TextString.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/TextString.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <string.h> #include "gmem.h" #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/TextString.h b/Build/source/libs/xpdf/xpdf-src/xpdf/TextString.h index 909d3259097..c296d7d6d7a 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/TextString.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/TextString.h @@ -15,6 +15,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "CharTypes.h" class GString; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/TileCache.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/TileCache.cc index 65e60629bd2..ff002ed46fc 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/TileCache.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/TileCache.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmem.h" #include "gmempp.h" #include "GList.h" @@ -233,7 +237,7 @@ GThreadReturn TileCacheThreadPool::threadFunc(void *arg) { } void TileCacheThreadPool::worker() { - CachedTileDesc *ct = NULL; + CachedTileDesc *ct; while (1) { gLockMutex(&mutex); diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/TileCache.h b/Build/source/libs/xpdf/xpdf-src/xpdf/TileCache.h index 1c3f83cba47..bea58c4c8fc 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/TileCache.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/TileCache.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "SplashTypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/TileCompositor.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/TileCompositor.cc index eaea7fa5676..70128a4a47f 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/TileCompositor.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/TileCompositor.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <string.h> #include <math.h> #include "gmempp.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/TileCompositor.h b/Build/source/libs/xpdf/xpdf-src/xpdf/TileCompositor.h index 9efec4d0a16..aa06c9da7bd 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/TileCompositor.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/TileCompositor.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "SplashTypes.h" class GList; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/TileMap.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/TileMap.cc index fa262a28f94..d5916627082 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/TileMap.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/TileMap.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmem.h" #include "gmempp.h" #include "GList.h" @@ -899,7 +903,7 @@ void TileMap::cvtDevToUser(int pg, int xd, int yd, double *xu, double *yu) { void TileMap::getWindowPageRange(int x, int y, int w, int h, int *firstPage, int *lastPage) { - GList *tiles2; + GList *tiles; PlacedTileDesc *tile; int i; @@ -909,9 +913,9 @@ void TileMap::getWindowPageRange(int x, int y, int w, int h, } *firstPage = state->getDoc()->getNumPages(); *lastPage = 0; - tiles2 = getTileList(); - for (i = 0; i < tiles2->getLength(); ++i) { - tile = (PlacedTileDesc *)tiles2->get(i); + tiles = getTileList(); + for (i = 0; i < tiles->getLength(); ++i) { + tile = (PlacedTileDesc *)tiles->get(i); if (tile->px < x + w && tile->px + tile->tw > x && tile->py < y + h && @@ -1348,7 +1352,7 @@ void TileMap::updatePageParams() { // rotate the page boxes if (page & 1) { otherPage = page + 1; - if (otherPage > state->getDoc()->getNumPages()) { + if (otherPage >= state->getDoc()->getNumPages()) { otherPage = page; } } else { diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/TileMap.h b/Build/source/libs/xpdf/xpdf-src/xpdf/TileMap.h index 6a2dcb3e672..222877c5050 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/TileMap.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/TileMap.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" class GList; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeMap.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeMap.cc index 68e38c3a36e..833d6fc2f0c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeMap.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeMap.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <string.h> #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeMap.h b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeMap.h index d932d0e34c9..a15d628b4cc 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeMap.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeMap.h @@ -13,6 +13,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "CharTypes.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.cc index cfa28a0b79a..72dbc0e159c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdio.h> #include <string.h> #include "gmem.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.h b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.h index 679c002987f..dbf435e7dd1 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.h @@ -13,6 +13,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "CharTypes.h" struct UnicodeRemappingString; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.cc index a19bbe0d655..e6a91af2756 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.cc @@ -25,36 +25,36 @@ static UnicodeMapTableEntry typeTable[256] = { { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN...NNNNN.....##########.NNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.N....NNNNLNNNNN..##NLNNN#LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL", 'X' }, { NULL, 'L' }, { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLNNNNNNNNNNNNNNLLNNNNNNNNNNNNNNLLLLLNNNNNNNNNLNNNNNNNNNNNNNNNNN", 'X' }, - { "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMLLLLNNLLLLLLLLNLNNNNNNLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNN.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMRMRMMRMMRMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR###########", 'X' }, - { "######NNR..R.RNNMMMMMMMMMMMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRMMMMMMMMMMMMMMMMMMMMM##########.##RRRMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRMMMMMMM#NMMMMMMRRMMNMMMMRR##########RRRRRR", 'X' }, - { "RRRRRRRRRRRRRRRRRMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRMMMMMMMMMMMMMMMMMMMMMMMMMMMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRMMMMMMMMMMMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRMMMMMMMMMRRNNNNRMMMRR", 'X' }, - { "RRRRRRRRRRRRRRRRRRRRRRMMMMRMMMMMMMMMRMMMRMMMMMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRMMMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR###MMMMMMMMMMMMMMRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRMMMMMMMMMMMMMMMMMMMMMMMM#MMMMMMMMMMMMMMMMMMMMMMMMMMMMM", 'X' }, - { "MMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLMLLLLMMMMMMMMLLLLMLLLMMMMMMMLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLLLMMMMLLLLLLLLMLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLL..LLLLLLL.LLMM", 'X' }, - { "MMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLLLMMMMMMMMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLMLMMMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLLLMMMMMMMMLLLLMLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLL.LLLLLLLLMMMMMM", 'X' }, - { "MMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLMLMMMMLLLLLLLLMMMMMMMMMMLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNN.NMMMMM", 'X' }, - { "MLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLMMMLLLLMMMMMMMMMMMMMMMMMMLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLNNNNNNNLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLMMMMMMMMMMMM", 'X' }, - { "MMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLMMMMLLLLLLLLMLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLLLLMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLMMMMMMM.....LLLLLLLMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLMMMMMMMMMLLLLLLLLLLMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLMLMLMNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMLMMMMMLMMLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLMMMMMMLMMLLMMLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLMMMLLLLLLLLLLLLLLLLMMMMLLLLLLLLLLLLLMLLMMLLLLLLMLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, - { NULL, 'L' }, - { NULL, 'L' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNN", 'X' }, + { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLNNLLLLLLLLNLNNNNNNLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNN.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRNRNNRNNRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR###########", 'X' }, + { "######NNR..R.RNNNNNNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNNNNNNNNNNN##########.##RRRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNN#NNNNNNNRRNNNNNNNRR##########RRRRRR", 'X' }, + { "RRRRRRRRRRRRRRRRRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNRRNNNNRNNNRR", 'X' }, + { "RRRRRRRRRRRRRRRRRRRRRRNNNNRNNNNNNNNNRNNNRNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNNNNNNNNNNNNNNNN#NNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { "NNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNLLLLNNNNNNNNLLLLNLLLNNNNNNNLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNLLLLLLLLNLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLL..LLLLLLL.LLNN", 'X' }, + { "NNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLNLNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNLLLLNLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLL.LLLLLLLLNNNNNN", 'X' }, + { "NNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLNLNNNNLLLLLLLLNNNNNNNNNNLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNN.NNNNNN", 'X' }, + { "NLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNNNNNNNNNNNLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLNNNNNNNLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLNNNNNNNNNNNNN", 'X' }, + { "NNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLNNNNLLLLLLLLNLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLLLLNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLNNNNNNN.....LLLLLLLNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLNNNNNNNNNLLLLLLLLLLNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNLNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNLNNNNNLNNLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLNNNNNNLNNLLNNLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLNNNLLLLLLLLLLLLLLLLNNNNLLLLLLLLLLLLLNLLNNLLLLLLNLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { NULL, 'L' }, + { NULL, 'L' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNN", 'X' }, { "NLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, { NULL, 'L' }, { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLMMMMMMMLLLLLLLLMLLMMMMMMMMMMMLLLLLLL.LMLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNN", 'X' }, - { "NNNNNNNNNNNMMMNMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLLLMMLLLLLLLLLMLLLLLLMMMNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLMMLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLMMMMMMMMMLMLLMMMMMMMMLLLLLLMMMMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM", 'X' }, - { "MMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLMMMMMLMLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMLLLLLLLLLLLMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMLLMMLMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLMMLLLMLMMMLLLLLLLLLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMLMMMMMMMMMMMMMLMMMMMMMLLLLMLLLLLLMLLLMMLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM", 'X' }, + { "LLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLNNNNNNNLLLLLLLLNLLNNNNNNNNNNNLLLLLLL.LNLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { "NNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLNNLLLLLLLLLNLLLLLLNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLNNLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNNNNNNNNNLNLLNNNNNNNNLLLLLLNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { "NNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNNNNNLNLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNLLLLLLLLLNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLNNLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNNLLLNLNNNLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNLNNNNNNNNNNNNNLNNNNNNNLLLLNLLLLLLNLLLNNLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, { NULL, 'L' }, { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNNNLLLLLLLLLLLNNNLLLLLLLLLLLLNNNNLLLLLLLLLLLLLNNNLLLLLLLLLLLLLNNN", 'X' }, - { "NNNNNNNNNNNNNNLRNNNNNNNNNNNNNNNNNNNNNNNNNNLRNLR......NNNNNNNNNNNNNNN.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLRNNNNNNNN#L########..NNNL##########..NNNLLLLLLLLLLLLLL....................................MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNNNNNNNNN", 'X' }, + { "NNNNNNNNNNNNNNLRNNNNNNNNNNNNNNNNNNNNNNNNNNLRNLR......NNNNNNNNNNNNNNN.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLRNNNNNNNN#L########..NNNL##########..NNNLLLLLLLLLLLLLL...................................NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, { "NNLNNNNLNNLLLLLLLLLLNLNNNLLLLLNNNNNNLNLNLNLLLL.LLLLLLLLLLLNNLLLLNNNNNLLLLLNNNNLLNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, { "NNNNNNNNNNNNNNNNNN..NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, @@ -66,12 +66,12 @@ static UnicodeMapTableEntry typeTable[256] = { { NULL, 'N' }, { NULL, 'N' }, { NULL, 'N' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLMMMLLNNNNNNNNNNNN", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLNNNLLNNNNNNNNNNNN", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, { NULL, 'N' }, { NULL, 'N' }, - { "NNNNNLLLNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLMMMMLLNLLLLLNNLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMNNLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLL", 'X' }, + { "NNNNNLLLNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLNNNNLLNLLLLLNNLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNLLLLLLLLLLLLNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN", 'X' }, { NULL, 'L' }, @@ -188,12 +188,12 @@ static UnicodeMapTableEntry typeTable[256] = { { NULL, 'L' }, { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, { NULL, 'L' }, - { "LLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMNMMMMMMMMMMNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLNNNNNNNN", 'X' }, + { "LLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLNNNNNNNN", 'X' }, { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, - { "LLMLLLMLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLMMLNNNNMLLLLLLLLLLL..LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMLLLLLLLLLLLLLM", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLMMMMLLMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMLLMMLLMMLLLLLLLLLLLLMLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLMMMLLMMLLLLLMMLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLLLLLLMLLLLLLLLL", 'X' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLMLLLLMLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLNLLLNLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLNNLNNNNNLLLLLLLLLLL..LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLN", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLNNNNLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLNNLLNNLLLLLLLLLLLLNLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNNNLLNNLLLLLNNLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLNLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLNLLLLNLLLLLLLLLLLLLLLLLL", 'X' }, { NULL, 'L' }, { NULL, 'L' }, { NULL, 'L' }, @@ -273,10 +273,10 @@ static UnicodeMapTableEntry typeTable[256] = { { NULL, 'L' }, { NULL, 'L' }, { NULL, 'L' }, - { "LLLLLLLLLLLLLLLLLLLLLLLLRRRRRRMRRRRRRRRRR.RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLRRRRRRNRRRRRRRRRR.RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR", 'X' }, { NULL, 'R' }, - { "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNN", 'X' }, - { "MMMMMMMMMMMMMMMMNNNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.N.NN.NNNNNNNNN.NN..NNNNN..NRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNN", 'X' }, + { "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNN", 'X' }, + { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.N.NN.NNNNNNNNN.NN..NNNNN..NRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNN", 'X' }, { "NNN...NNNNN.....##########.NNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL.....NNN..NNNNNNNNNNNNNNNNNNNNNNNLL", 'X' } }; @@ -647,9 +647,9 @@ static UnicodeCaseTableVector caseTable1f = {{ 0x1fb0, 0x1fb1, 0x1f70, 0x1f71, 0x1fb3, 0x1fbd, 0x03b9, 0x1fbf, 0x1fc0, 0x1fc1, 0x1fc2, 0x1fc3, 0x1fc4, 0x1fc5, 0x1fc6, 0x1fc7, 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1fc3, 0x1fcd, 0x1fce, 0x1fcf, - 0x1fd0, 0x1fd1, 0x1fd2, 0x0390, 0x1fd4, 0x1fd5, 0x1fd6, 0x1fd7, + 0x1fd0, 0x1fd1, 0x1fd2, 0x1fd3, 0x1fd4, 0x1fd5, 0x1fd6, 0x1fd7, 0x1fd0, 0x1fd1, 0x1f76, 0x1f77, 0x1fdc, 0x1fdd, 0x1fde, 0x1fdf, - 0x1fe0, 0x1fe1, 0x1fe2, 0x03b0, 0x1fe4, 0x1fe5, 0x1fe6, 0x1fe7, + 0x1fe0, 0x1fe1, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fe5, 0x1fe6, 0x1fe7, 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, 0x1fe5, 0x1fed, 0x1fee, 0x1fef, 0x1ff0, 0x1ff1, 0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7, 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, 0x1ff3, 0x1ffd, 0x1ffe, 0x1fff @@ -728,7 +728,7 @@ static UnicodeCaseTableVector caseTable2c = {{ 0x2c40, 0x2c41, 0x2c42, 0x2c43, 0x2c44, 0x2c45, 0x2c46, 0x2c47, 0x2c48, 0x2c49, 0x2c4a, 0x2c4b, 0x2c4c, 0x2c4d, 0x2c4e, 0x2c4f, 0x2c50, 0x2c51, 0x2c52, 0x2c53, 0x2c54, 0x2c55, 0x2c56, 0x2c57, - 0x2c58, 0x2c59, 0x2c5a, 0x2c5b, 0x2c5c, 0x2c5d, 0x2c5e, 0x2c5f, + 0x2c58, 0x2c59, 0x2c5a, 0x2c5b, 0x2c5c, 0x2c5d, 0x2c5e, 0x2c2f, 0x2c30, 0x2c31, 0x2c32, 0x2c33, 0x2c34, 0x2c35, 0x2c36, 0x2c37, 0x2c38, 0x2c39, 0x2c3a, 0x2c3b, 0x2c3c, 0x2c3d, 0x2c3e, 0x2c3f, 0x2c40, 0x2c41, 0x2c42, 0x2c43, 0x2c44, 0x2c45, 0x2c46, 0x2c47, @@ -815,10 +815,10 @@ static UnicodeCaseTableVector caseTablea7 = {{ 0xa7a9, 0xa7a9, 0x0266, 0x025c, 0x0261, 0x026c, 0x026a, 0xa7af, 0x029e, 0x0287, 0x029d, 0xab53, 0xa7b5, 0xa7b5, 0xa7b7, 0xa7b7, 0xa7b9, 0xa7b9, 0xa7bb, 0xa7bb, 0xa7bd, 0xa7bd, 0xa7bf, 0xa7bf, - 0xa7c1, 0xa7c1, 0xa7c3, 0xa7c3, 0xa794, 0x0282, 0x1d8e, 0xa7c8, + 0xa7c0, 0xa7c1, 0xa7c3, 0xa7c3, 0xa794, 0x0282, 0x1d8e, 0xa7c8, 0xa7c8, 0xa7ca, 0xa7ca, 0xa7cb, 0xa7cc, 0xa7cd, 0xa7ce, 0xa7cf, - 0xa7d1, 0xa7d1, 0xa7d2, 0xa7d3, 0xa7d4, 0xa7d5, 0xa7d7, 0xa7d7, - 0xa7d9, 0xa7d9, 0xa7da, 0xa7db, 0xa7dc, 0xa7dd, 0xa7de, 0xa7df, + 0xa7d0, 0xa7d1, 0xa7d2, 0xa7d3, 0xa7d4, 0xa7d5, 0xa7d6, 0xa7d7, + 0xa7d8, 0xa7d9, 0xa7da, 0xa7db, 0xa7dc, 0xa7dd, 0xa7de, 0xa7df, 0xa7e0, 0xa7e1, 0xa7e2, 0xa7e3, 0xa7e4, 0xa7e5, 0xa7e6, 0xa7e7, 0xa7e8, 0xa7e9, 0xa7ea, 0xa7eb, 0xa7ec, 0xa7ed, 0xa7ee, 0xa7ef, 0xa7f0, 0xa7f1, 0xa7f2, 0xa7f3, 0xa7f4, 0xa7f6, 0xa7f6, 0xa7f7, @@ -858,40 +858,6 @@ static UnicodeCaseTableVector caseTableab = {{ 0xabf0, 0xabf1, 0xabf2, 0xabf3, 0xabf4, 0xabf5, 0xabf6, 0xabf7, 0xabf8, 0xabf9, 0xabfa, 0xabfb, 0xabfc, 0xabfd, 0xabfe, 0xabff }}; -static UnicodeCaseTableVector caseTablefb = {{ - 0xfb00, 0xfb01, 0xfb02, 0xfb03, 0xfb04, 0xfb06, 0xfb06, 0xfb07, - 0xfb08, 0xfb09, 0xfb0a, 0xfb0b, 0xfb0c, 0xfb0d, 0xfb0e, 0xfb0f, - 0xfb10, 0xfb11, 0xfb12, 0xfb13, 0xfb14, 0xfb15, 0xfb16, 0xfb17, - 0xfb18, 0xfb19, 0xfb1a, 0xfb1b, 0xfb1c, 0xfb1d, 0xfb1e, 0xfb1f, - 0xfb20, 0xfb21, 0xfb22, 0xfb23, 0xfb24, 0xfb25, 0xfb26, 0xfb27, - 0xfb28, 0xfb29, 0xfb2a, 0xfb2b, 0xfb2c, 0xfb2d, 0xfb2e, 0xfb2f, - 0xfb30, 0xfb31, 0xfb32, 0xfb33, 0xfb34, 0xfb35, 0xfb36, 0xfb37, - 0xfb38, 0xfb39, 0xfb3a, 0xfb3b, 0xfb3c, 0xfb3d, 0xfb3e, 0xfb3f, - 0xfb40, 0xfb41, 0xfb42, 0xfb43, 0xfb44, 0xfb45, 0xfb46, 0xfb47, - 0xfb48, 0xfb49, 0xfb4a, 0xfb4b, 0xfb4c, 0xfb4d, 0xfb4e, 0xfb4f, - 0xfb50, 0xfb51, 0xfb52, 0xfb53, 0xfb54, 0xfb55, 0xfb56, 0xfb57, - 0xfb58, 0xfb59, 0xfb5a, 0xfb5b, 0xfb5c, 0xfb5d, 0xfb5e, 0xfb5f, - 0xfb60, 0xfb61, 0xfb62, 0xfb63, 0xfb64, 0xfb65, 0xfb66, 0xfb67, - 0xfb68, 0xfb69, 0xfb6a, 0xfb6b, 0xfb6c, 0xfb6d, 0xfb6e, 0xfb6f, - 0xfb70, 0xfb71, 0xfb72, 0xfb73, 0xfb74, 0xfb75, 0xfb76, 0xfb77, - 0xfb78, 0xfb79, 0xfb7a, 0xfb7b, 0xfb7c, 0xfb7d, 0xfb7e, 0xfb7f, - 0xfb80, 0xfb81, 0xfb82, 0xfb83, 0xfb84, 0xfb85, 0xfb86, 0xfb87, - 0xfb88, 0xfb89, 0xfb8a, 0xfb8b, 0xfb8c, 0xfb8d, 0xfb8e, 0xfb8f, - 0xfb90, 0xfb91, 0xfb92, 0xfb93, 0xfb94, 0xfb95, 0xfb96, 0xfb97, - 0xfb98, 0xfb99, 0xfb9a, 0xfb9b, 0xfb9c, 0xfb9d, 0xfb9e, 0xfb9f, - 0xfba0, 0xfba1, 0xfba2, 0xfba3, 0xfba4, 0xfba5, 0xfba6, 0xfba7, - 0xfba8, 0xfba9, 0xfbaa, 0xfbab, 0xfbac, 0xfbad, 0xfbae, 0xfbaf, - 0xfbb0, 0xfbb1, 0xfbb2, 0xfbb3, 0xfbb4, 0xfbb5, 0xfbb6, 0xfbb7, - 0xfbb8, 0xfbb9, 0xfbba, 0xfbbb, 0xfbbc, 0xfbbd, 0xfbbe, 0xfbbf, - 0xfbc0, 0xfbc1, 0xfbc2, 0xfbc3, 0xfbc4, 0xfbc5, 0xfbc6, 0xfbc7, - 0xfbc8, 0xfbc9, 0xfbca, 0xfbcb, 0xfbcc, 0xfbcd, 0xfbce, 0xfbcf, - 0xfbd0, 0xfbd1, 0xfbd2, 0xfbd3, 0xfbd4, 0xfbd5, 0xfbd6, 0xfbd7, - 0xfbd8, 0xfbd9, 0xfbda, 0xfbdb, 0xfbdc, 0xfbdd, 0xfbde, 0xfbdf, - 0xfbe0, 0xfbe1, 0xfbe2, 0xfbe3, 0xfbe4, 0xfbe5, 0xfbe6, 0xfbe7, - 0xfbe8, 0xfbe9, 0xfbea, 0xfbeb, 0xfbec, 0xfbed, 0xfbee, 0xfbef, - 0xfbf0, 0xfbf1, 0xfbf2, 0xfbf3, 0xfbf4, 0xfbf5, 0xfbf6, 0xfbf7, - 0xfbf8, 0xfbf9, 0xfbfa, 0xfbfb, 0xfbfc, 0xfbfd, 0xfbfe, 0xfbff -}}; static UnicodeCaseTableVector caseTableff = {{ 0xff00, 0xff01, 0xff02, 0xff03, 0xff04, 0xff05, 0xff06, 0xff07, 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f, @@ -1178,7 +1144,7 @@ static UnicodeCaseTableVector *caseTable[256] = { NULL, NULL, NULL, - &caseTablefb, + NULL, NULL, NULL, NULL, @@ -1434,8 +1400,8 @@ static Unicode bracketTable2e[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0x80002e56, 0x2e55, 0x80002e58, - 0x2e57, 0x80002e5a, 0x2e59, 0x80002e5c, 0x2e5b, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1841,10 +1807,6 @@ GBool unicodeTypeR(Unicode c) { return getType(c) == 'R'; } -GBool unicodeTypeCombiningMark(Unicode c) { - return getType(c) == 'M'; -} - GBool unicodeTypeDigit(Unicode c) { return getType(c) == '#'; } @@ -1871,7 +1833,7 @@ GBool unicodeTypeWord(Unicode c) { char t; t = getType(c); - return t == 'L' || t == 'R' || t == '#' || t == 'M'; + return t == 'L' || t == 'R' || t == '#'; } Unicode unicodeToLower(Unicode c) { diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.h b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.h index f04361f9266..e1149fd6bc2 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.h @@ -15,8 +15,6 @@ extern GBool unicodeTypeL(Unicode c); extern GBool unicodeTypeR(Unicode c); -extern GBool unicodeTypeCombiningMark(Unicode c); - extern GBool unicodeTypeDigit(Unicode c); extern GBool unicodeTypeNumSep(Unicode c); diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/WebFont.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/WebFont.cc index 24d0896aa84..c04b52f937a 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/WebFont.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/WebFont.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "gmem.h" #include "gmempp.h" #include "GHash.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/WebFont.h b/Build/source/libs/xpdf/xpdf-src/xpdf/WebFont.h index c3c8ef1cbdd..283bdbe914d 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/WebFont.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/WebFont.h @@ -13,6 +13,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "FoFiBase.h" #include "GfxFont.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/XFAScanner.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/XFAScanner.cc index 22b2f0d02e6..8002a07a7f6 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/XFAScanner.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/XFAScanner.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include "GString.h" #include "GHash.h" #include "Object.h" diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/XFAScanner.h b/Build/source/libs/xpdf/xpdf-src/xpdf/XFAScanner.h index 22aac009048..00ee6f7fcee 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/XFAScanner.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/XFAScanner.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + class GHash; class ZxElement; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/XRef.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/XRef.cc index d3f9bcb2906..51af86db5ba 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/XRef.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/XRef.cc @@ -8,6 +8,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <stddef.h> #include <string.h> @@ -129,7 +133,7 @@ public: // Create an object stream, using object number <objStrNum>, // generation 0. - ObjectStream(XRef *xref, int objStrNumA, int recursion); + ObjectStream(XRef *xref, int objStrNumA); GBool isOk() { return ok; } @@ -151,7 +155,7 @@ private: GBool ok; }; -ObjectStream::ObjectStream(XRef *xref, int objStrNumA, int recursion) { +ObjectStream::ObjectStream(XRef *xref, int objStrNumA) { Stream *str; Lexer *lexer; Parser *parser; @@ -165,7 +169,7 @@ ObjectStream::ObjectStream(XRef *xref, int objStrNumA, int recursion) { objNums = NULL; ok = gFalse; - if (!xref->fetch(objStrNum, 0, &objStr, recursion)->isStream()) { + if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) { goto err1; } @@ -230,10 +234,11 @@ ObjectStream::ObjectStream(XRef *xref, int objStrNumA, int recursion) { lexer->skipToEOF(); delete parser; - // skip to the first object - this generally shouldn't be needed, - // because offsets[0] is normally 0, but just in case... - if (offsets[0] > 0) { - objStr.getStream()->discardChars(offsets[0]); + // skip to the first object - this shouldn't be necessary because + // the First key is supposed to be equal to offsets[0], but just in + // case... + if (first < offsets[0]) { + objStr.getStream()->discardChars(offsets[0] - first); } // parse the objects @@ -875,7 +880,6 @@ GBool XRef::constructXRef() { char *p = buf; char *end = buf; GBool startOfLine = gTrue; - GBool space = gTrue; GBool eof = gFalse; while (1) { if (end - p < 256 && !eof) { @@ -896,7 +900,6 @@ GBool XRef::constructXRef() { constructTrailerDict((GFileOffset)(bufPos + (p + 7 - buf))); p += 7; startOfLine = gFalse; - space = gFalse; } else if (startOfLine && !strncmp(p, "endstream", 9)) { if (streamEndsLen == streamEndsSize) { streamEndsSize += 64; @@ -906,23 +909,19 @@ GBool XRef::constructXRef() { streamEnds[streamEndsLen++] = (GFileOffset)(bufPos + (p - buf)); p += 9; startOfLine = gFalse; - space = gFalse; - } else if (space && *p >= '0' && *p <= '9') { + } else if (startOfLine && *p >= '0' && *p <= '9') { p = constructObjectEntry(p, (GFileOffset)(bufPos + (p - buf)), &lastObjNum); startOfLine = gFalse; - space = gFalse; } else if (p[0] == '>' && p[1] == '>') { p += 2; startOfLine = gFalse; - space = gFalse; // skip any PDF whitespace except for '\0' while (*p == '\t' || *p == '\n' || *p == '\x0c' || *p == '\r' || *p == ' ') { if (*p == '\n' || *p == '\r') { startOfLine = gTrue; } - space = gTrue; ++p; } if (!strncmp(p, "stream", 6)) { @@ -936,17 +935,12 @@ GBool XRef::constructXRef() { } p += 6; startOfLine = gFalse; - space = gFalse; } } else { if (*p == '\n' || *p == '\r') { startOfLine = gTrue; - space = gTrue; - } else if (Lexer::isSpace(*p & 0xff)) { - space = gTrue; - } else { + } else if (!Lexer::isSpace(*p & 0xff)) { startOfLine = gFalse; - space = gFalse; } ++p; } @@ -1269,7 +1263,7 @@ Object *XRef::fetch(int num, int gen, Object *obj, int recursion) { error(errSyntaxError, -1, "Invalid object stream"); goto err; } - if (!getObjectStreamObject((int)e->offset, e->gen, num, obj, recursion)) { + if (!getObjectStreamObject((int)e->offset, e->gen, num, obj)) { goto err; } break; @@ -1303,37 +1297,20 @@ Object *XRef::fetch(int num, int gen, Object *obj, int recursion) { } GBool XRef::getObjectStreamObject(int objStrNum, int objIdx, - int objNum, Object *obj, int recursion) { - // check for a cached ObjectStream + int objNum, Object *obj) { + ObjectStream *objStr; + #if MULTITHREADED gLockMutex(&objStrsMutex); #endif - ObjectStream *objStr = getObjectStreamFromCache(objStrNum); - GBool found = gFalse; - if (objStr) { - objStr->getObject(objIdx, objNum, obj); - cleanObjectStreamCache(); - found = gTrue; - } + if (!(objStr = getObjectStream(objStrNum))) { #if MULTITHREADED - gUnlockMutex(&objStrsMutex); + gUnlockMutex(&objStrsMutex); #endif - if (found) { - return gTrue; - } - - // load a new ObjectStream - objStr = new ObjectStream(this, objStrNum, recursion); - if (!objStr->isOk()) { - delete objStr; return gFalse; } - objStr->getObject(objIdx, objNum, obj); -#if MULTITHREADED - gLockMutex(&objStrsMutex); -#endif - addObjectStreamToCache(objStr); cleanObjectStreamCache(); + objStr->getObject(objIdx, objNum, obj); #if MULTITHREADED gUnlockMutex(&objStrsMutex); #endif @@ -1341,19 +1318,22 @@ GBool XRef::getObjectStreamObject(int objStrNum, int objIdx, } // NB: objStrsMutex must be locked when calling this function. -ObjectStream *XRef::getObjectStreamFromCache(int objStrNum) { +ObjectStream *XRef::getObjectStream(int objStrNum) { + ObjectStream *objStr; + int i, j; + // check the MRU entry in the cache if (objStrs[0] && objStrs[0]->getObjStrNum() == objStrNum) { - ObjectStream *objStr = objStrs[0]; + objStr = objStrs[0]; objStrLastUse[0] = objStrTime++; return objStr; } // check the rest of the cache - for (int i = 1; i < objStrCacheLength; ++i) { + for (i = 1; i < objStrCacheLength; ++i) { if (objStrs[i] && objStrs[i]->getObjStrNum() == objStrNum) { - ObjectStream *objStr = objStrs[i]; - for (int j = i; j > 0; --j) { + objStr = objStrs[i]; + for (j = i; j > 0; --j) { objStrs[j] = objStrs[j - 1]; objStrLastUse[j] = objStrLastUse[j - 1]; } @@ -1363,30 +1343,33 @@ ObjectStream *XRef::getObjectStreamFromCache(int objStrNum) { } } - return NULL; -} + // load a new ObjectStream + objStr = new ObjectStream(this, objStrNum); + if (!objStr->isOk()) { + delete objStr; + return NULL; + } -// NB: objStrsMutex must be locked when calling this function. -void XRef::addObjectStreamToCache(ObjectStream *objStr) { // add to the cache if (objStrCacheLength == objStrCacheSize) { delete objStrs[objStrCacheSize - 1]; --objStrCacheLength; } - for (int j = objStrCacheLength; j > 0; --j) { + for (j = objStrCacheLength; j > 0; --j) { objStrs[j] = objStrs[j - 1]; objStrLastUse[j] = objStrLastUse[j - 1]; } ++objStrCacheLength; objStrs[0] = objStr; objStrLastUse[0] = objStrTime++; + + return objStr; } // If the oldest (least recently used) entry in the object stream // cache is more than objStrCacheTimeout accesses old (hasn't been // used in the last objStrCacheTimeout accesses), eject it from the // cache. -// NB: objStrsMutex must be locked when calling this function. void XRef::cleanObjectStreamCache() { // NB: objStrTime and objStrLastUse[] are unsigned ints, so the // mod-2^32 arithmetic makes the subtraction work out, even if the diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/XRef.h b/Build/source/libs/xpdf/xpdf-src/xpdf/XRef.h index 662b8351c00..10e4e6a7501 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/XRef.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/XRef.h @@ -11,6 +11,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" #include "gfile.h" #include "Object.h" @@ -179,9 +183,8 @@ private: GBool constructXRefEntry(int num, int gen, GFileOffset pos, XRefEntryType type); GBool getObjectStreamObject(int objStrNum, int objIdx, - int objNum, Object *obj, int recursion); - ObjectStream *getObjectStreamFromCache(int objStrNum); - void addObjectStreamToCache(ObjectStream *objStr); + int objNum, Object *obj); + ObjectStream *getObjectStream(int objStrNum); void cleanObjectStreamCache(); GFileOffset strToFileOffset(char *s); }; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Zoox.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Zoox.cc index 2e41d990b59..9e4fb47900c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Zoox.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Zoox.cc @@ -6,6 +6,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -275,8 +279,6 @@ bool ZxDoc::parse(const char *data, Guint dataLen) { parseEnd = data + dataLen; parseSpace(); - parseBOM(); - parseSpace(); parseXMLDecl(this); parseMisc(this); parseDocTypeDecl(this); @@ -781,12 +783,6 @@ GString *ZxDoc::parseQuotedString() { return s; } -void ZxDoc::parseBOM() { - if (match("\xef\xbb\xbf")) { - parsePtr += 3; - } -} - void ZxDoc::parseSpace() { while (parsePtr < parseEnd && (*parsePtr == '\x20' || *parsePtr == '\x09' || diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Zoox.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Zoox.h index c89cd67b065..c04ca95064b 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Zoox.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Zoox.h @@ -9,6 +9,10 @@ #include <aconf.h> +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + #include "gtypes.h" class GString; @@ -106,7 +110,6 @@ private: void parsePI(ZxNode *par); GString *parseName(); GString *parseQuotedString(); - void parseBOM(); void parseSpace(); bool match(const char *s); diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/config.h b/Build/source/libs/xpdf/xpdf-src/xpdf/config.h index 6bd00d500ae..b41dd492248 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/config.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/config.h @@ -2,7 +2,7 @@ // // config.h // -// Copyright 1996-2024 Glyph & Cog, LLC +// Copyright 1996-2022 Glyph & Cog, LLC // //======================================================================== @@ -14,13 +14,13 @@ //------------------------------------------------------------------------ // xpdf version -#define xpdfVersion "4.05" -#define xpdfVersionNum 4.05 +#define xpdfVersion "4.04" +#define xpdfVersionNum 4.04 #define xpdfMajorVersion 4 -#define xpdfMinorVersion 5 +#define xpdfMinorVersion 4 #define xpdfUpdateVersion 0 #define xpdfMajorVersionStr "4" -#define xpdfMinorVersionStr "5" +#define xpdfMinorVersionStr "4" #define xpdfUpdateVersionStr "0" // supported PDF version @@ -28,11 +28,11 @@ #define supportedPDFVersionNum 2.0 // copyright notice -#define xpdfCopyright "Copyright 1996-2024 Glyph & Cog, LLC" +#define xpdfCopyright "Copyright 1996-2022 Glyph & Cog, LLC" // Windows resource file stuff -#define winxpdfVersion "WinXpdf 4.05" -#define xpdfCopyrightAmp "Copyright 1996-2024 Glyph && Cog, LLC" +#define winxpdfVersion "WinXpdf 4.04" +#define xpdfCopyrightAmp "Copyright 1996-2022 Glyph && Cog, LLC" //------------------------------------------------------------------------ // paper size diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/pdfdetach.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/pdfdetach.cc index 1b80fe474b6..581383fe730 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/pdfdetach.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/pdfdetach.cc @@ -62,10 +62,6 @@ static ArgDesc argDesc[] = { }; int main(int argc, char *argv[]) { -#if USE_EXCEPTIONS - try { -#endif - char *fileName; UnicodeMap *uMap; GString *ownerPW, *userPW; @@ -217,11 +213,4 @@ int main(int argc, char *argv[]) { gMemReport(stderr); return exitCode; - -#if USE_EXCEPTIONS - } catch (GMemException e) { - fprintf(stderr, "Out of memory\n"); - return 98; - } -#endif } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/pdffonts.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/pdffonts.cc index ad9e40d7c62..bde57557c3c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/pdffonts.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/pdffonts.cc @@ -96,10 +96,6 @@ static char *seenObjs; static int numObjects; int main(int argc, char *argv[]) { -#if USE_EXCEPTIONS - try { -#endif - char *fileName; GString *ownerPW, *userPW; GBool ok; @@ -178,21 +174,22 @@ int main(int argc, char *argv[]) { numObjects = doc->getXRef()->getNumObjects(); seenObjs = (char *)gmalloc(numObjects); memset(seenObjs, 0, numObjects); - annots = doc->getAnnots(); for (pg = firstPage; pg <= lastPage; ++pg) { page = doc->getCatalog()->getPage(pg); if ((resDict = page->getResourceDict())) { scanFonts(resDict, doc); } - int nAnnots = annots->getNumAnnots(pg); - for (i = 0; i < nAnnots; ++i) { - if (annots->getAnnot(pg, i)->getAppearance(&obj1)->isStream()) { + annots = new Annots(doc, page->getAnnots(&obj1)); + obj1.free(); + for (i = 0; i < annots->getNumAnnots(); ++i) { + if (annots->getAnnot(i)->getAppearance(&obj1)->isStream()) { obj1.streamGetDict()->lookupNF("Resources", &obj2); scanFonts(&obj2, doc); obj2.free(); } obj1.free(); } + delete annots; } if ((form = doc->getCatalog()->getForm())) { for (i = 0; i < form->getNumFields(); ++i) { @@ -225,13 +222,6 @@ int main(int argc, char *argv[]) { gMemReport(stderr); return exitCode; - -#if USE_EXCEPTIONS - } catch (GMemException e) { - fprintf(stderr, "Out of memory\n"); - return 98; - } -#endif } static void scanFonts(Object *obj, PDFDoc *doc) { diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/pdfimages.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/pdfimages.cc index 303a046932d..346346bce77 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/pdfimages.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/pdfimages.cc @@ -76,10 +76,6 @@ static ArgDesc argDesc[] = { }; int main(int argc, char *argv[]) { -#if USE_EXCEPTIONS - try { -#endif - PDFDoc *doc; char *fileName; char *imgRoot; @@ -175,11 +171,4 @@ int main(int argc, char *argv[]) { gMemReport(stderr); return exitCode; - -#if USE_EXCEPTIONS - } catch (GMemException e) { - fprintf(stderr, "Out of memory\n"); - return 98; - } -#endif } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/pdfinfo.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/pdfinfo.cc index a1fb5c2327d..88829b993c3 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/pdfinfo.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/pdfinfo.cc @@ -41,7 +41,6 @@ static void printInfoString(Object *infoDict, const char *infoKey, const char *xmpKey2, const char *text, GBool parseDate, UnicodeMap *uMap); -static void printCustomInfo(Object *infoDict, UnicodeMap *uMap); static GString *parseInfoDate(GString *s); static GString *parseXMPDate(GString *s); static void printBox(const char *text, PDFRectangle *box); @@ -51,7 +50,6 @@ static int lastPage = 0; static GBool printBoxes = gFalse; static GBool printMetadata = gFalse; static GBool rawDates = gFalse; -static GBool printCustom = gFalse; static char textEncName[128] = ""; static char ownerPassword[33] = "\001"; static char userPassword[33] = "\001"; @@ -70,8 +68,6 @@ static ArgDesc argDesc[] = { "print the document metadata (XML)"}, {"-rawdates", argFlag, &rawDates, 0, "print the undecoded date strings directly from the PDF file"}, - {"-custom", argFlag, &printCustom, 0, - "print the custom info dictionary fields"}, {"-enc", argString, textEncName, sizeof(textEncName), "output text encoding name"}, {"-opw", argString, ownerPassword, sizeof(ownerPassword), @@ -94,10 +90,6 @@ static ArgDesc argDesc[] = { }; int main(int argc, char *argv[]) { -#if USE_EXCEPTIONS - try { -#endif - PDFDoc *doc; char *fileName; GString *ownerPW, *userPW; @@ -201,9 +193,6 @@ int main(int argc, char *argv[]) { printInfoString(&info, "Producer", xmp, "pdf:Producer", NULL, "Producer: ", gFalse, uMap); printInfoString(&info, "CreationDate", xmp, "xap:CreateDate", "xmp:CreateDate", "CreationDate: ", !rawDates, uMap); printInfoString(&info, "ModDate", xmp, "xap:ModifyDate", "xmp:ModifyDate", "ModDate: ", !rawDates, uMap); - if (printCustom) { - printCustomInfo(&info, uMap); - } info.free(); if (xmp) { delete xmp; @@ -315,9 +304,6 @@ int main(int argc, char *argv[]) { // print linearization info printf("Optimized: %s\n", doc->isLinearized() ? "yes" : "no"); - // print JavaScript info - printf("JavaScript: %s\n", doc->usesJavaScript() ? "yes" : "no"); - // print PDF version printf("PDF version: %.1f\n", doc->getPDFVersion()); @@ -347,13 +333,6 @@ int main(int argc, char *argv[]) { gMemReport(stderr); return exitCode; - -#if USE_EXCEPTIONS - } catch (GMemException e) { - fprintf(stderr, "Out of memory\n"); - return 98; - } -#endif } static void printInfoString(Object *infoDict, const char *infoKey, @@ -418,7 +397,7 @@ static void printInfoString(Object *infoDict, const char *infoKey, if (!parseDate || !(value = parseXMPDate(((ZxCharData *)node2)->getData()))) { tmp = ((ZxCharData *)node2)->getData(); - i = 0; + int i = 0; value = new GString(); while (getUTF8(tmp, &i, &uu)) { n = uMap->mapUnicode(uu, buf, sizeof(buf)); @@ -435,48 +414,12 @@ static void printInfoString(Object *infoDict, const char *infoKey, if (value) { fputs(text, stdout); - fwrite(value->getCString(), 1, value->getLength(), stdout); + fwrite(value->getCString(), 1, value->getLength(), stdout); fputc('\n', stdout); delete value; } } -static void printCustomInfo(Object *infoDict, UnicodeMap *uMap) { - if (!infoDict->isDict()) { - return; - } - for (int i = 0; i < infoDict->dictGetLength(); ++i) { - char *key = infoDict->dictGetKey(i); - Object obj; - infoDict->dictGetVal(i, &obj); - if (obj.isString() && - strcmp(key, "Title") && - strcmp(key, "Subject") && - strcmp(key, "Keywords") && - strcmp(key, "Author") && - strcmp(key, "Creator") && - strcmp(key, "Producer") && - strcmp(key, "CreationDate") && - strcmp(key, "ModDate")) { - printf("%s: ", key); - int n = 14 - (int)strlen(key); - if (n > 0) { - printf("%*s", n, ""); - } - TextString *s = new TextString(obj.getString()); - Unicode *u = s->getUnicode(); - char buf[8]; - for (int j = 0; j < s->getLength(); ++j) { - n = uMap->mapUnicode(u[j], buf, sizeof(buf)); - fwrite(buf, 1, n, stdout); - } - delete s; - printf("\n"); - } - obj.free(); - } -} - static GString *parseInfoDate(GString *s) { int year, mon, day, hour, min, sec, n; struct tm tmStruct; diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftohtml.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftohtml.cc index 92d78b0e5dc..4c98afed50c 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftohtml.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftohtml.cc @@ -38,9 +38,7 @@ static GBool embedFonts = gFalse; static GBool skipInvisible = gFalse; static GBool allInvisible = gFalse; static GBool formFields = gFalse; -static GBool includeMetadata = gFalse; static GBool tableMode = gFalse; -static GBool overwrite = gFalse; static char ownerPassword[33] = "\001"; static char userPassword[33] = "\001"; static GBool verbose = gFalse; @@ -72,12 +70,8 @@ static ArgDesc argDesc[] = { "treat all text as invisible"}, {"-formfields", argFlag, &formFields, 0, "convert form fields to HTML"}, - {"-meta", argFlag, &includeMetadata, 0, - "include document metadata in the HTML output"}, {"-table", argFlag, &tableMode, 0, "use table mode for text extraction"}, - {"-overwrite", argFlag, &overwrite, 0, - "overwrite files in an existing output directory"}, {"-opw", argString, ownerPassword, sizeof(ownerPassword), "owner password (for encrypted files)"}, {"-upw", argString, userPassword, sizeof(userPassword), @@ -108,10 +102,6 @@ static int writeToFile(void *file, const char *data, int size) { } int main(int argc, char *argv[]) { -#if USE_EXCEPTIONS - try { -#endif - PDFDoc *doc; char *fileName; char *htmlDir; @@ -194,19 +184,10 @@ int main(int argc, char *argv[]) { // create HTML directory if (makeDir(htmlDir, 0755)) { - if (pathIsDir(htmlDir)) { - if (!overwrite) { - error(errIO, -1, "HTML output directory '{0:s}' already exists (use '-overwrite' to overwrite it)", - htmlDir); - exitCode = 2; - goto err1; - } - } else { - error(errIO, -1, "Couldn't create HTML output directory '{0:s}'", - htmlDir); - exitCode = 2; - goto err1; - } + error(errIO, -1, "Couldn't create HTML output directory '{0:s}'", + htmlDir); + exitCode = 2; + goto err1; } // set up the HTMLGen object @@ -223,7 +204,6 @@ int main(int argc, char *argv[]) { htmlGen->setExtractFontFiles(!noFonts); htmlGen->setEmbedFonts(embedFonts); htmlGen->setConvertFormFields(formFields); - htmlGen->setIncludeMetadata(includeMetadata); htmlGen->startDoc(doc); // convert the pages @@ -291,13 +271,6 @@ int main(int argc, char *argv[]) { gMemReport(stderr); return exitCode; - -#if USE_EXCEPTIONS - } catch (GMemException e) { - fprintf(stderr, "Out of memory\n"); - return 98; - } -#endif } static GBool createIndex(char *htmlDir) { @@ -307,12 +280,11 @@ static GBool createIndex(char *htmlDir) { htmlFileName = GString::format("{0:s}/index.html", htmlDir); html = openFile(htmlFileName->getCString(), "w"); + delete htmlFileName; if (!html) { error(errIO, -1, "Couldn't open HTML file '{0:t}'", htmlFileName); - delete htmlFileName; return gFalse; } - delete htmlFileName; fprintf(html, "<html>\n"); fprintf(html, "<body>\n"); diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftopng.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftopng.cc index e4107f59899..7f3b97b9d94 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftopng.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftopng.cc @@ -99,10 +99,6 @@ static void writePNGData(png_structp png, SplashBitmap *bitmap); static void finishPNG(png_structp *png, png_infop *pngInfo); int main(int argc, char *argv[]) { -#if USE_EXCEPTIONS - try { -#endif - PDFDoc *doc; char *fileName; char *pngRoot; @@ -300,13 +296,6 @@ int main(int argc, char *argv[]) { gMemReport(stderr); return exitCode; - -#if USE_EXCEPTIONS - } catch (GMemException e) { - fprintf(stderr, "Out of memory\n"); - return 98; - } -#endif } static void setupPNG(png_structp *png, png_infop *pngInfo, FILE *f, diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftoppm.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftoppm.cc index c4dc3494a72..28861ef948b 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftoppm.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftoppm.cc @@ -98,10 +98,6 @@ static ArgDesc argDesc[] = { }; int main(int argc, char *argv[]) { -#if USE_EXCEPTIONS - try { -#endif - PDFDoc *doc; char *fileName; char *ppmRoot; @@ -281,11 +277,4 @@ int main(int argc, char *argv[]) { gMemReport(stderr); return exitCode; - -#if USE_EXCEPTIONS - } catch (GMemException e) { - fprintf(stderr, "Out of memory\n"); - return 98; - } -#endif } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftops.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftops.cc index c6c7c4767ec..77e90fe0165 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftops.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftops.cc @@ -153,10 +153,6 @@ static ArgDesc argDesc[] = { }; int main(int argc, char *argv[]) { -#if USE_EXCEPTIONS - try { -#endif - PDFDoc *doc; char *fileName; GString *psFileName; @@ -400,11 +396,4 @@ int main(int argc, char *argv[]) { gMemReport(stderr); return exitCode; - -#if USE_EXCEPTIONS - } catch (GMemException e) { - fprintf(stderr, "Out of memory\n"); - return 98; - } -#endif } diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc index 928de607678..d8bf6df5e67 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/pdftotext.cc @@ -132,10 +132,6 @@ static ArgDesc argDesc[] = { }; int main(int argc, char *argv[]) { -#if USE_EXCEPTIONS - try { -#endif - PDFDoc *doc; char *fileName; GString *textFileName; @@ -333,11 +329,4 @@ int main(int argc, char *argv[]) { gMemReport(stderr); return exitCode; - -#if USE_EXCEPTIONS - } catch (GMemException e) { - fprintf(stderr, "Out of memory\n"); - return 98; - } -#endif } |