Hello community, here is the log from the commit of package libwps for openSUSE:Factory checked in at 2015-01-05 04:42:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libwps (Old) and /work/SRC/openSUSE:Factory/.libwps.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libwps" Changes: -------- --- /work/SRC/openSUSE:Factory/libwps/libwps.changes 2014-07-27 18:47:05.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libwps.new/libwps.changes 2015-01-05 04:42:50.000000000 +0100 @@ -1,0 +2,15 @@ +Fri Jan 2 13:15:41 UTC 2015 - [email protected] + +- Version bump to 0.3.1: + - Fix parsing of floating-point numbers in specific cases. + - Fix several minor issues reported by Coverity and Clang. + - Check arguments of public functions. Passing NULL no longer causes + a crash. + - Use symbol visibility on Linux. The library only exports the public + functions now. + - Import @TERM and @CTERM functions (fdo#86241). + - Handle LICS character encoding in spreadsheets (fdo#87222). + - Fix a crash when reading a broken file, found with the help of + american-fuzzy-lop. + +------------------------------------------------------------------- Old: ---- libwps-0.3.0.tar.xz New: ---- libwps-0.3.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libwps.spec ++++++ --- /var/tmp/diff_new_pack.cE4c2Y/_old 2015-01-05 04:42:51.000000000 +0100 +++ /var/tmp/diff_new_pack.cE4c2Y/_new 2015-01-05 04:42:51.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package libwps # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: libwps -Version: 0.3.0 +Version: 0.3.1 Release: 0 Summary: Library for importing the Microsoft Works word processor and spreadsheet file formats License: LGPL-2.1+ and MPL-2.0+ ++++++ libwps-0.3.0.tar.xz -> libwps-0.3.1.tar.xz ++++++ ++++ 2590 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/ChangeLog new/libwps-0.3.1/ChangeLog --- old/libwps-0.3.0/ChangeLog 2014-05-23 18:51:46.000000000 +0200 +++ new/libwps-0.3.1/ChangeLog 2014-12-30 10:11:14.000000000 +0100 @@ -1,3 +1,103 @@ +2014-12-30 David Tardon <[email protected]> [be8d0814aa9e39705c10aee485dc304cee45ed81] + + prepare for a release of 0.3.1 + + +2014-12-25 David Tardon <[email protected]> [64b28a29dc62cc0b4812d8addf653e8e18069c6d] + + afl: avoid ouf-of-bounds access to std::vector + + +2014-12-15 osnola <[email protected]> [41dfedf3d25025fe1dc91e7a01d83a54d3259476] + + Retrieve LICS encoding flag and use it to convert characters... + + +2014-12-05 osnola <[email protected]> [54a904f5144993d8a2e88aeebe11394053ac62d6] + + Spreadsheet: implemente TERM and CTERM functions + + +2014-11-24 David Tardon <[email protected]> [a3425ec7546bb6a77b956de696dbfca77d502603] + + add compile script to .gitignore + + +2014-11-24 David Tardon <[email protected]> [b75eec532fc326f6157cb18730f1dcf43d01708f] + + only export public symbols + + +2014-11-06 Fridrich Štrba <[email protected]> [336dc4b6ce8f68ef0e8022c2808a5255a3f10216] + + Fix parallel build + + +2014-09-24 osnola <[email protected]> [3d23daeee72c08b2101f7fceea802be6cfcd797c] + + Fix another coverity's message... + + +2014-09-24 osnola <[email protected]> [066b5b5943ec24fbe16b326d68b2617036621152] + + Correct some coverity's errors... + + +2014-09-24 osnola <[email protected]> [d8e5e266abf26a4e6c1dcfe8c325785d540d4c24] + + basic merge + + +2014-09-24 Caolan McNamara <[email protected]> [aaf3b5805385b9e8a50d3b9857c42752f5581154] + + Correct a debug message... + + +2014-07-29 David Tardon <[email protected]> [9426655da9ed8d9da9a081b1e1bb533cae8f4b92] + + check arguments + + +2014-07-29 osnola <[email protected]> [c93db5901c4d29ed241a7e92960972d510866409] + + Try to make Clang/XCode analyzer happier... + + +2014-06-04 David Tardon <[email protected]> [e81b719f28608640a464149f8ce744f1c939b98d] + + coverity#1019360 missing break in switch + + +2014-06-04 David Tardon <[email protected]> [fbc1176cb2635dcaa25fb85b300cc85126e47f00] + + coverity#1165325 missing break in switch + + +2014-06-04 David Tardon <[email protected]> [cf7ae6b7ac7f75565fea330fd19025aaa4bfa136] + + coverity#1165326 missing break in switch + + +2014-06-04 David Tardon <[email protected]> [fe8f37b70fa1fbb0652c285f506ebf1cdebfa3f3] + + coverity#1165327 missing break in switch + + +2014-06-04 David Tardon <[email protected]> [86524613dbbc455844ae7029d2a5e9ebcd6072be] + + coverity#1165329 missing break in switch + + +2014-06-01 osnola <[email protected]> [6775752bef285a4ac86e02942bba8500df5ce4fc] + + Wks/wdb parser: correct the float reading in a special case... + + +2014-05-27 Fridrich Štrba <[email protected]> [ddbf72f45713a5a7d8474f3ebcd25486ebacf144] + + The library strictly speaking does not need the stream implementations + + 2014-05-23 David Tardon <[email protected]> [bb3b8941449ac6ec35aee5da6036d2310c325291] prepare for a new release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/NEWS new/libwps-0.3.1/NEWS --- old/libwps-0.3.0/NEWS 2014-05-23 18:50:15.000000000 +0200 +++ new/libwps-0.3.1/NEWS 2014-12-30 10:04:37.000000000 +0100 @@ -1,4 +1,16 @@ -CHANGES: +libwps-0.3.1 + +- Fix parsing of floating-point numbers in specific cases. +- Fix several minor issues reported by Coverity and Clang. +- Check arguments of public functions. Passing NULL no longer causes + a crash. +- Use symbol visibility on Linux. The library only exports the public + functions now. +- Import @TERM and @CTERM functions (fdo#86241). +- Handle LICS character encoding in spreadsheets (fdo#87222). +- Fix a crash when reading a broken file, found with the help of + american-fuzzy-lop. + 0.2.x -> 0.3.0 - switch to librevenge - add support for Works Spreadsheet diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/ar-lib new/libwps-0.3.1/ar-lib --- old/libwps-0.3.0/ar-lib 2014-03-29 11:28:45.000000000 +0100 +++ new/libwps-0.3.1/ar-lib 2013-05-16 08:39:53.000000000 +0200 @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2012-03-01.08; # UTC -# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Copyright (C) 2010, 2012 Free Software Foundation, Inc. # Written by Peter Rosin <[email protected]>. # # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/configure.ac new/libwps-0.3.1/configure.ac --- old/libwps-0.3.0/configure.ac 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/configure.ac 2014-12-30 09:34:31.000000000 +0100 @@ -7,7 +7,7 @@ # ==================== m4_define([libwps_version_major],[0]) m4_define([libwps_version_minor],[3]) -m4_define([libwps_version_micro],[0]) +m4_define([libwps_version_micro],[1]) m4_define([libwps_version],[libwps_version_major.libwps_version_minor.libwps_version_micro]) # ============= @@ -95,6 +95,25 @@ AC_MSG_RESULT([$platform_win32]) AM_CONDITIONAL([PLATFORM_WIN32], [test "x$platform_win32" = "xyes"]) +AS_IF([test "x$platform_win32" == "xyes"], + [], + [ + AC_MSG_CHECKING([for -fvisibility=hidden compiler flag]) + saved_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fvisibility=hidden" + AC_TRY_COMPILE([], [], + [ + AC_MSG_RESULT([yes]) + CXXFLAGS="$CXXFLAGS -DLIBWPS_VISIBILITY" + ], + [ + AC_MSG_RESULT([no]) + CXXFLAGS="$saved_CXXFLAGS" + ] + ) + ] +) + # ========================= # Platform check for darwin # ========================= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/inc/libwps/WPSDocument.h new/libwps-0.3.1/inc/libwps/WPSDocument.h --- old/libwps-0.3.0/inc/libwps/WPSDocument.h 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/inc/libwps/WPSDocument.h 2014-11-28 16:04:05.000000000 +0100 @@ -32,9 +32,13 @@ #else #define WPSLIB __declspec(dllimport) #endif +#else // !DLL_EXPORT +#ifdef LIBWPS_VISIBILITY +#define WPSLIB __attribute__((visibility("default"))) #else #define WPSLIB #endif +#endif namespace libwps diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/libwps.pc.in new/libwps-0.3.1/libwps.pc.in --- old/libwps-0.3.0/libwps.pc.in 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/libwps.pc.in 2014-06-27 12:20:19.000000000 +0200 @@ -6,7 +6,7 @@ Name: libwps-@WPS_MAJOR_VERSION@.@WPS_MINOR_VERSION@ Description: A library for reading Microsoft Works word processor documents Version: @VERSION@ -Requires: librevenge-0.0 librevenge-stream-0.0 +Requires: librevenge-0.0 Libs: -L${libdir} -lwps-@WPS_MAJOR_VERSION@.@WPS_MINOR_VERSION@ Cflags: -I${includedir}/libwps-@WPS_MAJOR_VERSION@.@WPS_MINOR_VERSION@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/m4/libtool.m4 new/libwps-0.3.1/m4/libtool.m4 --- old/libwps-0.3.0/m4/libtool.m4 2014-03-29 11:28:43.000000000 +0100 +++ new/libwps-0.3.1/m4/libtool.m4 2014-01-29 10:35:27.000000000 +0100 @@ -1326,10 +1326,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; - powerpc64le-*linux*) + powerpcle-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; - powerpc64-*linux*) + powerpc-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/missing new/libwps-0.3.1/missing --- old/libwps-0.3.0/missing 2014-03-29 11:28:45.000000000 +0100 +++ new/libwps-0.3.1/missing 2013-05-16 08:39:53.000000000 +0200 @@ -1,10 +1,11 @@ #! /bin/sh -# Common wrapper for a few potentially missing GNU programs. +# Common stub for a few missing GNU programs while installing. -scriptversion=2012-06-26.16; # UTC +scriptversion=2012-01-06.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard <[email protected]>, 1996. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,40 +26,68 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" + echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi -case $1 in +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; +msg="missing on your system" - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch] -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. Send bug reports to <[email protected]>." exit $? @@ -70,141 +99,228 @@ ;; -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac -# Run the given program, remember its exit status. -"$@"; st=$? +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; -# If it succeeded, we are done. -test $st -eq 0 && exit 0 + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st +exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/conv/wks2csv/Makefile.am new/libwps-0.3.1/src/conv/wks2csv/Makefile.am --- old/libwps-0.3.0/src/conv/wks2csv/Makefile.am 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/conv/wks2csv/Makefile.am 2014-11-28 16:04:05.000000000 +0100 @@ -26,7 +26,7 @@ if OS_WIN32 -@WKS2CSV_WIN32_RESOURCE@ : wks2csv.rc $(wks2raw_OBJECTS) +@WKS2CSV_WIN32_RESOURCE@ : wks2csv.rc $(wks2csv_OBJECTS) chmod +x $(top_srcdir)/build/win32/*compile-resource WINDRES=@WINDRES@ $(top_srcdir)/build/win32/lt-compile-resource wks2csv.rc @WKS2CSV_WIN32_RESOURCE@ endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/conv/wks2text/Makefile.am new/libwps-0.3.1/src/conv/wks2text/Makefile.am --- old/libwps-0.3.0/src/conv/wks2text/Makefile.am 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/conv/wks2text/Makefile.am 2014-11-28 16:04:05.000000000 +0100 @@ -26,7 +26,7 @@ if OS_WIN32 -@WKS2TEXT_WIN32_RESOURCE@ : wks2text.rc $(wks2raw_OBJECTS) +@WKS2TEXT_WIN32_RESOURCE@ : wks2text.rc $(wks2text_OBJECTS) chmod +x $(top_srcdir)/build/win32/*compile-resource WINDRES=@WINDRES@ $(top_srcdir)/build/win32/lt-compile-resource wks2text.rc @WKS2TEXT_WIN32_RESOURCE@ endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WKS4.cpp new/libwps-0.3.1/src/lib/WKS4.cpp --- old/libwps-0.3.0/src/lib/WKS4.cpp 2014-04-30 17:03:34.000000000 +0200 +++ new/libwps-0.3.1/src/lib/WKS4.cpp 2014-12-20 17:09:40.000000000 +0100 @@ -112,7 +112,7 @@ struct State { //! constructor - State() : m_eof(-1), m_isSpreadsheet(true), m_version(-1), m_fontsList(), m_pageSpan(), m_actPage(0), m_numPages(0), + State() : m_eof(-1), m_isSpreadsheet(true), m_version(-1), m_hasLICSCharacters(false), m_fontsList(), m_pageSpan(), m_actPage(0), m_numPages(0), m_headerString(""), m_footerString("") { } @@ -136,6 +136,8 @@ bool m_isSpreadsheet; //! the file version int m_version; + //! flag to know if the character + bool m_hasLICSCharacters; //! the fonts list std::vector<Font> m_fontsList; //! the actual document size @@ -237,6 +239,13 @@ return true; } +bool WKS4Parser::hasLICSCharacters() const +{ + if (version()<=2) + return m_state->m_hasLICSCharacters; + return false; +} + // main function to parse the document void WKS4Parser::parse(librevenge::RVNGSpreadsheetInterface *documentInterface) { @@ -574,7 +583,7 @@ } case 0x24: f.str(""); - f << "Entries(Protection)[database]:"; + f << "Entries(Protection):"; if (sz!=1) break; input->seek(pos+4, librevenge::RVNG_SEEK_SET); val=(int) libwps::readU8(input); @@ -644,19 +653,15 @@ { // always empty ? case 0x25: + f.str(""); + f << "Entries(LICS):"; if (sz) { f << "###"; - WPS_DEBUG_MSG(("WKS4Parser::readZone: find a not empty %d zone\n", id)); - break; - } - f.str(""); - switch (id) - { - default: - f << "Entries(EndA" << std::hex << id << std::dec << "):"; + WPS_DEBUG_MSG(("WKS4Parser::readZone: find a not empty LICS encoding zone\n")); break; } + m_state->m_hasLICSCharacters = true; isParsed = needWriteInAscii = true; break; // boolean @@ -1157,6 +1162,10 @@ int fSize = libwps::read16(input)/2; if (fSize >= 1 && fSize <= 50) font.m_size=double(fSize); + else + f << "###fSize=" << fSize << ","; + if (name.empty()) + f << "###noName,"; font.m_extra=f.str(); f.str(""); @@ -1164,9 +1173,6 @@ f << "font" << m_state->m_fontsList.size() << "[" << font << "]"; m_state->m_fontsList.push_back(font); - if (fSize == 0 && fSize > 50) - f << "###fSize=" << fSize; - if (name.length() <= 0) f << "###"; ascii().addPos(pos); ascii().addNote(f.str().c_str()); @@ -1188,13 +1194,18 @@ libwps_tools_win::Font::Type fontType=version()<=2 ? libwps_tools_win::Font::DOS_850 : libwps_tools_win::Font::WIN3_WEUROPE; std::string const &text=header ? m_state->m_headerString : m_state->m_footerString; + bool hasLICS=hasLICSCharacters(); for (size_t i=0; i < text.size(); ++i) { unsigned char c=(unsigned char) text[i]; if (c==0xd) m_listener->insertEOL(); - else if (c!=0xa) + else if (c==0xa) + continue; + else if (!hasLICS) m_listener->insertUnicode((uint32_t)libwps_tools_win::Font::unicode(c,fontType)); + else + m_listener->insertUnicode((uint32_t)libwps_tools_win::Font::LICSunicode(c,fontType)); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WKS4.h new/libwps-0.3.1/src/lib/WKS4.h --- old/libwps-0.3.0/src/lib/WKS4.h 2014-04-30 17:03:34.000000000 +0200 +++ new/libwps-0.3.1/src/lib/WKS4.h 2014-12-20 17:09:40.000000000 +0100 @@ -61,6 +61,8 @@ bool checkFilePosition(long pos); //! return the file version int version() const; + //! returns the true if the file has LICS characters + bool hasLICSCharacters() const; // // interface with WKS4Spreadsheet diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WKS4Spreadsheet.cpp new/libwps-0.3.1/src/lib/WKS4Spreadsheet.cpp --- old/libwps-0.3.0/src/lib/WKS4Spreadsheet.cpp 2014-04-30 17:03:34.000000000 +0200 +++ new/libwps-0.3.1/src/lib/WKS4Spreadsheet.cpp 2014-12-20 17:09:40.000000000 +0100 @@ -310,7 +310,7 @@ struct State { //! constructor - State() : m_eof(-1), m_version(-1), m_styleManager(), m_spreadsheetList(), m_spreadsheetStack() + State() : m_eof(-1), m_version(-1), m_hasLICSCharacters(-1), m_styleManager(), m_spreadsheetList(), m_spreadsheetStack() { pushNewSheet(); } @@ -357,6 +357,8 @@ long m_eof; //! the file version int m_version; + //! int to code if the file has LICS characters:-1 means unknown, 0 means no, 1 means yes + int m_hasLICSCharacters; //! the style manager StyleManager m_styleManager; @@ -388,6 +390,13 @@ return m_state->m_version; } +bool WKS4Spreadsheet::hasLICSCharacters() const +{ + if (m_state->m_hasLICSCharacters<0) + m_state->m_hasLICSCharacters=m_mainParser.hasLICSCharacters() ? 1 : 0; + return m_state->m_hasLICSCharacters==1; +} + bool WKS4Spreadsheet::checkFilePosition(long pos) { if (m_state->m_eof < 0) @@ -1523,14 +1532,25 @@ if (sz != 4) return false; float mantisse = 0; - /** first small byte is used to decide if we store 100*N or N. - Does the second small bute has also a meaning ? - It find some file where the third some bytes is set, so this one is normal... + /** (first&3)==1: is used to decide if we store 100*N or N., + (first&3)==2: indicates a basic int number (appears mainly when converting a dos file in a windows file) + (first&3)==3: Can this exist ? What does this mean: 100*a basic int ? + The other bytes seem to have classic meaning... */ int first = (int) libwps::readU8(m_input); - mantisse = float(first & 0xFE); - for (int i = 0; i < 1; i++) - mantisse = mantisse/256.f + (float) libwps::readU8(m_input); + if ((first&3)==2) + { + // so read it as a normal number + m_input->seek(-1, librevenge::RVNG_SEEK_CUR); + long val=long(libwps::readU16(m_input)>>2); + val+=long(libwps::readU16(m_input))<<14; + if (val&0x20000000) + res = double(val-0x40000000); + else + res = double(val); + return true; + } + mantisse = float(first & 0xFC)/256.f + (float) libwps::readU8(m_input); int mantExp = (int) libwps::readU8(m_input); mantisse = (mantisse/256.f + float(0x10+(mantExp & 0x0F)))/16.f; int exp = ((mantExp&0xF0)>>4)+int(libwps::readU8(m_input)<<4); @@ -1575,7 +1595,7 @@ if (first & 2) { // CHECKME... - WPS_DEBUG_MSG(("WKS4Spreadsheet::readFloat4: ARRGGGGGGGGGG find a float with first & 2 ARRGGGGGGGGGG,\n some float can be broken\n")); + WPS_DEBUG_MSG(("WKS4Spreadsheet::readFloat4: ARRGGGGGGGGGG find a float with first & 3 ARRGGGGGGGGGG,\n some float can be broken\n")); ascii().addDelimiter(pos,'#'); } return true; @@ -1653,7 +1673,7 @@ { "Choose", -1},{ "IsNa", 1},{ "IsError", 1},{ "False", 0}, { "True", 0},{ "Rand", 0},{ "Date", 3},{ "Now", 0}, - { "PMT", 3} /*BAD*/,{ "PV", 3} /*BAD*/,{ "FV", 3} /*BAD*/,{ "If", 3}, + { "PMT", 3} /*BAD*/,{ "PV", 3} /*BAD*/,{ "FV", 3} /*BAD*/,{ "IF", 3}, { "Day", 1},{ "Month", 1},{ "Year", 1},{ "Round", 2}, { "Time", 3},{ "Hour", 1},{ "Minute", 1},{ "Second", 1}, @@ -1661,7 +1681,7 @@ { "Text", 2}, { "Mid", 3}, { "", -2} /*UNKN*/,{ "", -2} /*UNKN*/, { "Find", 3},{ "", -2} /*UNKN*/,{ "", -2} /*UNKN*/,{ "", -2} /*UNKN*/, - { "Sum", -1},{ "Average", -1},{ "Count", -1},{ "Min", -1}, + { "Sum", -1},{ "Average", -1},{ "COUNT", -1},{ "Min", -1}, { "Max", -1},{ "Find", 3} /*UNKN*/,{ "NPV", 2}, { "Var", -1}, { "StDev", -1},{ "IRR", 2} /*BAD*/, { "HLookup", 3},{ "UNKN5B", 3} /*UNKN*/, { "UNKN5C", 3} /*UNKN*/,{ "UNKN5D", 3} /*UNKN*/,{ "", -2} /*UNKN*/,{ "", -2} /*UNKN*/, @@ -1672,7 +1692,7 @@ { "", -2} /*UNKN*/,{ "Trim", 1},{ "", -2} /*UNKN*/,{ "T", 1}, { "IsNonText", 1},{ "Exact", 2},{ "", -2} /*UNKN*/,{ "", 3} /*UNKN*/, - { "Rate", 3} /*BAD*/,{ "UNKN75", 3} /*Termino*/,{ "CTERM", 3} /*UNKN*/,{ "SLN", 3}, + { "Rate", 3} /*BAD*/,{ "TERM", 3}, { "CTERM", 3}, { "SLN", 3}, { "SYD", 4},{ "DDB", 4} /*UNKN*/,{ "", -2} /*UNKN*/,{ "", -2} /*UNKN*/, { "", -2} /*UNKN*/,{ "", -2} /*UNKN*/,{ "", -2} /*UNKN*/,{ "", -2} /*UNKN*/, @@ -1748,7 +1768,7 @@ { ok = false; f.str(""); - f << "###list cell short"; + f << "###list cell short(2)"; error=f.str(); break; } @@ -1809,6 +1829,80 @@ ok = false; break; } + // + // first treat the special cases + // + if (arity==3 && instr.m_type==WKSContentListener::FormulaInstruction::F_Function && instr.m_content=="TERM") + { + // @TERM(pmt,pint,fv) -> NPER(pint,-pmt,pv=0,fv) + std::vector<WKSContentListener::FormulaInstruction> pmt= + stack[size_t((int)numElt-3)]; + std::vector<WKSContentListener::FormulaInstruction> pint= + stack[size_t((int)numElt-2)]; + std::vector<WKSContentListener::FormulaInstruction> fv= + stack[size_t((int)numElt-1)]; + + stack.resize(size_t(++numElt)); + // pint + stack[size_t((int)numElt-4)]=pint; + //-pmt + std::vector<WKSContentListener::FormulaInstruction> &node=stack[size_t((int)numElt-3)]; + instr.m_type=WKSContentListener::FormulaInstruction::F_Operator; + instr.m_content="-"; + node.resize(0); + node.push_back(instr); + instr.m_content="("; + node.push_back(instr); + node.insert(node.end(), pmt.begin(), pmt.end()); + instr.m_content=")"; + node.push_back(instr); + //pv=zero + instr.m_type=WKSContentListener::FormulaInstruction::F_Long; + instr.m_longValue=0; + stack[size_t((int)numElt-2)].resize(0); + stack[size_t((int)numElt-2)].push_back(instr); + //fv + stack[size_t((int)numElt-1)]=fv; + arity=4; + instr.m_type=WKSContentListener::FormulaInstruction::F_Function; + instr.m_content="NPER"; + } + else if (arity==3 && instr.m_type==WKSContentListener::FormulaInstruction::F_Function && instr.m_content=="CTERM") + { + // @CTERM(pint,fv,pv) -> NPER(pint,pmt=0,-pv,fv) + std::vector<WKSContentListener::FormulaInstruction> pint= + stack[size_t((int)numElt-3)]; + std::vector<WKSContentListener::FormulaInstruction> fv= + stack[size_t((int)numElt-2)]; + std::vector<WKSContentListener::FormulaInstruction> pv= + stack[size_t((int)numElt-1)]; + stack.resize(size_t(++numElt)); + // pint + stack[size_t((int)numElt-4)]=pint; + // pmt=0 + instr.m_type=WKSContentListener::FormulaInstruction::F_Long; + instr.m_longValue=0; + stack[size_t((int)numElt-3)].resize(0); + stack[size_t((int)numElt-3)].push_back(instr); + // -pv + std::vector<WKSContentListener::FormulaInstruction> &node=stack[size_t((int)numElt-2)]; + instr.m_type=WKSContentListener::FormulaInstruction::F_Operator; + instr.m_content="-"; + node.resize(0); + node.push_back(instr); + instr.m_content="("; + node.push_back(instr); + node.insert(node.end(), pv.begin(), pv.end()); + instr.m_content=")"; + node.push_back(instr); + + //fv + stack[size_t((int)numElt-1)]=fv; + arity=4; + instr.m_type=WKSContentListener::FormulaInstruction::F_Function; + instr.m_content="NPER"; + } + if ((instr.m_content[0] >= 'A' && instr.m_content[0] <= 'Z') || instr.m_content[0] == '(') { if (instr.m_content[0] != '(') @@ -2100,6 +2194,7 @@ finalCell.WPSCellFormat::operator=(cellStyle); finalCell.setFont(cellStyle.m_font); WKSContentListener::CellContent content(cell.m_content); + bool hasLICS=hasLICSCharacters(); for (size_t f=0; f < content.m_formula.size(); ++f) { if (content.m_formula[f].m_type!=WKSContentListener::FormulaInstruction::F_Text) @@ -2107,8 +2202,14 @@ std::string &text=content.m_formula[f].m_content; librevenge::RVNGString finalString(""); for (size_t c=0; c < text.length(); ++c) - WPSListener::appendUnicode - ((uint32_t)libwps_tools_win::Font::unicode((unsigned char)text[c],fontType), finalString); + { + if (!hasLICS) + WPSListener::appendUnicode + ((uint32_t)libwps_tools_win::Font::unicode((unsigned char)text[c],fontType), finalString); + else + WPSListener::appendUnicode + ((uint32_t)libwps_tools_win::Font::LICSunicode((unsigned char)text[c],fontType), finalString); + } text=finalString.cstr(); } m_listener->openSheetCell(finalCell, content, propList); @@ -2135,7 +2236,10 @@ } else { - m_listener->insertUnicode((uint32_t)libwps_tools_win::Font::unicode(c,fontType)); + if (!hasLICS) + m_listener->insertUnicode((uint32_t)libwps_tools_win::Font::unicode(c,fontType)); + else + m_listener->insertUnicode((uint32_t)libwps_tools_win::Font::LICSunicode(c,fontType)); prevEOL=false; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WKS4Spreadsheet.h new/libwps-0.3.1/src/lib/WKS4Spreadsheet.h --- old/libwps-0.3.0/src/lib/WKS4Spreadsheet.h 2014-04-30 17:03:34.000000000 +0200 +++ new/libwps-0.3.1/src/lib/WKS4Spreadsheet.h 2014-12-20 17:09:40.000000000 +0100 @@ -65,6 +65,8 @@ bool checkFilePosition(long pos); //! return the file version int version() const; + //! returns the true if the file has LICS characters + bool hasLICSCharacters() const; //! send the data void sendSpreadsheet(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WPS4.cpp new/libwps-0.3.1/src/lib/WPS4.cpp --- old/libwps-0.3.0/src/lib/WPS4.cpp 2014-04-30 17:03:34.000000000 +0200 +++ new/libwps-0.3.1/src/lib/WPS4.cpp 2014-11-28 16:04:05.000000000 +0100 @@ -568,6 +568,7 @@ { case 0xda1: apCreator = 2; + // fall-through intended case 0: case 1: worksVersion = 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WPS4Graph.cpp new/libwps-0.3.1/src/lib/WPS4Graph.cpp --- old/libwps-0.3.0/src/lib/WPS4Graph.cpp 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/lib/WPS4Graph.cpp 2014-11-28 16:04:05.000000000 +0100 @@ -192,8 +192,6 @@ long endPos = entry.end(); input->seek(entry.begin(), librevenge::RVNG_SEEK_SET); - long lastPos = entry.begin(); - libwps::DebugStream f; int numFind = 0; @@ -203,6 +201,7 @@ int oleId = -1; bool replace = false; + long lastPos; while (1) { WPSPosition actPictPos; @@ -309,7 +308,7 @@ bool ok = readData && libwps::readData(input,(unsigned long)(endDataPos+1-actPos), data); if (confidence > actConfidence && data.size()) { - confidence = actConfidence; + actConfidence = confidence; pict = data; replace = true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WPS4Text.cpp new/libwps-0.3.1/src/lib/WPS4Text.cpp --- old/libwps-0.3.0/src/lib/WPS4Text.cpp 2014-04-30 17:03:34.000000000 +0200 +++ new/libwps-0.3.1/src/lib/WPS4Text.cpp 2014-12-25 10:12:55.000000000 +0100 @@ -747,7 +747,7 @@ case 0x08: // spreadsheet range case 0x0e: // picture { - if (!actFont.m_special || actFont.m_dlinkId >= int(m_state->m_dosLinkList.size())) + if (!actFont.m_special || m_state->m_dosLinkList.empty() || actFont.m_dlinkId >= int(m_state->m_dosLinkList.size())) { WPS_DEBUG_MSG(("WPS4Text::readText: send DLINK can not find id\n")); break; @@ -1564,6 +1564,7 @@ val = libwps::readU16(m_input); // always 4 if (val != 4) f << "g1=" << val << ","; } + // fall-through intended case 0x40: // spreadsheet range case 0x01: // char ? { @@ -1968,6 +1969,7 @@ break; case 0x13: // seems another way to define the left margin f << "#left,"; + // fall-through intended case 0x12: pp.m_margins[1] = arg/1440.; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WPS8.cpp new/libwps-0.3.1/src/lib/WPS8.cpp --- old/libwps-0.3.0/src/lib/WPS8.cpp 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/lib/WPS8.cpp 2014-11-28 16:04:05.000000000 +0100 @@ -1266,7 +1266,7 @@ bool parsedAll = true, color = false; - long lastPos; + long lastPos=input->tell(); // uneeded initialization but makes clang analyser happier for (int i = 0; i < numFram; i++) { lastPos = input->tell(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WPS8Table.cpp new/libwps-0.3.1/src/lib/WPS8Table.cpp --- old/libwps-0.3.0/src/lib/WPS8Table.cpp 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/lib/WPS8Table.cpp 2014-11-28 16:04:05.000000000 +0100 @@ -614,6 +614,7 @@ break; // normal case 0xFF: // also unset, diff with value = 1 ? f2 << "#f" << dt.id() << "=" << std::hex << dt.m_value << std::dec << ","; + // fall-through intended case 1: cell->setVerticalSet(false); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WPS8Text.cpp new/libwps-0.3.1/src/lib/WPS8Text.cpp --- old/libwps-0.3.0/src/lib/WPS8Text.cpp 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/lib/WPS8Text.cpp 2014-11-28 16:04:05.000000000 +0100 @@ -1649,10 +1649,9 @@ WPS8TextInternal::Token tokn; std::vector<WPS8TextInternal::Token> listToken; - long pos = input->tell(); for (size_t i = 0; i < size_t(numTokn); i++) { - pos = input->tell(); + long pos = input->tell(); if (input->tell() + 2 > endPage) return false; int sz = (int) libwps::read16(input); @@ -1730,7 +1729,7 @@ int numFollow = 0; for (int i = 0; i < numTokn; i++) { - pos = input->tell(); + long pos = input->tell(); if (input->tell() + 2 > endPage) return false; WPS8Struct::FileData data; @@ -1787,7 +1786,7 @@ if (numFollow != 0) { // read the strings header - pos = input->tell(); + long pos = input->tell(); if (pos+20 > endPage) return false; f.str(""); f << "TOKN(strings):"; @@ -1838,7 +1837,7 @@ size_t numStrings = sPtrs.size(); for (size_t i = 0; i < numStrings; i++) { - pos = sPtrs[i]; + long pos = sPtrs[i]; input->seek(pos, librevenge::RVNG_SEEK_SET); int sz = (int) libwps::read16(input); if (sz < 0 || pos+2*sz+2 > endPage) return false; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WPS8TextStyle.cpp new/libwps-0.3.1/src/lib/WPS8TextStyle.cpp --- old/libwps-0.3.0/src/lib/WPS8TextStyle.cpp 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/lib/WPS8TextStyle.cpp 2014-06-27 12:20:19.000000000 +0200 @@ -790,6 +790,7 @@ break; default: f << "#bullet/type=" << type << ","; + // fall-through intended case 2: para.m_listLevel.m_type = libwps::ARABIC; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WPSCell.cpp new/libwps-0.3.1/src/lib/WPSCell.cpp --- old/libwps-0.3.0/src/lib/WPSCell.cpp 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/lib/WPSCell.cpp 2014-06-27 12:20:19.000000000 +0200 @@ -82,6 +82,7 @@ break; case 'e': list.insert("number:style", "long"); + // fall-through intended case 'd': list.insert("librevenge:value-type", "day"); propVect.append(list); @@ -95,6 +96,7 @@ case 'H': list.insert("number:style", "long"); + // fall-through intended case 'I': list.insert("librevenge:value-type", "hours"); propVect.append(list); @@ -273,9 +275,11 @@ { case 5: // thousand propList.insert("number:grouping", true); + // fall-through intended case 0: // default if (m_subFormat==0) propList.remove("number:decimal-places"); + // fall-through intended case 1: // decimal propList.insert("librevenge:value-type", "number"); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WPSContentListener.cpp new/libwps-0.3.1/src/lib/WPSContentListener.cpp --- old/libwps-0.3.0/src/lib/WPSContentListener.cpp 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/lib/WPSContentListener.cpp 2014-06-27 12:20:19.000000000 +0200 @@ -1316,6 +1316,7 @@ { case WPSPosition::YFull: propList.insert("svg:height", double(h), unit); + // fall-through intended case WPSPosition::YTop: if (origin[1] < 0.0 || origin[1] > 0.0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/WPSDocument.cpp new/libwps-0.3.1/src/lib/WPSDocument.cpp --- old/libwps-0.3.0/src/lib/WPSDocument.cpp 2014-04-30 17:03:34.000000000 +0200 +++ new/libwps-0.3.1/src/lib/WPSDocument.cpp 2014-11-28 16:04:05.000000000 +0100 @@ -58,6 +58,10 @@ WPSLIB WPSConfidence WPSDocument::isFileFormatSupported(librevenge::RVNGInputStream *ip, WPSKind &kind) { WPS_DEBUG_MSG(("WPSDocument::isFileFormatSupported()\n")); + + if (!ip) + return WPS_CONFIDENCE_NONE; + kind=WPS_TEXT; WPSHeaderPtr header; shared_ptr<librevenge::RVNGInputStream > input(ip, WPS_shared_ptr_noop_deleter<librevenge::RVNGInputStream>()); @@ -128,6 +132,9 @@ */ WPSLIB WPSResult WPSDocument::parse(librevenge::RVNGInputStream *ip, librevenge::RVNGTextInterface *documentInterface) { + if (!ip || !documentInterface) + return WPS_UNKNOWN_ERROR; + WPSResult error = WPS_OK; WPSHeaderPtr header; @@ -196,6 +203,9 @@ */ WPSLIB WPSResult WPSDocument::parse(librevenge::RVNGInputStream *ip, librevenge::RVNGSpreadsheetInterface *documentInterface) { + if (!ip || !documentInterface) + return WPS_UNKNOWN_ERROR; + WPSResult error = WPS_OK; WPSHeaderPtr header; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/libwps_tools_win.cpp new/libwps-0.3.1/src/lib/libwps_tools_win.cpp --- old/libwps-0.3.0/src/lib/libwps_tools_win.cpp 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/lib/libwps_tools_win.cpp 2014-12-20 17:09:40.000000000 +0100 @@ -844,6 +844,23 @@ return cp1258[c - 0x80]; } +unsigned long Font::LICSunicode(unsigned char c, Type type) +{ + static unsigned char const LICS[] = + { + 0xB0, 0xEF, 0xB1, 0xF9, 0xB2, 0x9F, 0xB4, 0xB9, 0xBA, 0xBB, 0xBC, 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, + 0xC5, 0xC8, 0xC9, 0xCB, 0xCC, 0xD5, 0xC4, 0xD9, 0xDA, 0xDB, 0xDC, 0xDF, 0xF2, 0xB3, 0xFE, 0xFF, + 0xCA, 0xAD, 0xBD, 0x9C, 0xCD, 0xBE, 0xDD, 0xF5, 0xCF, 0xB8, 0xA6, 0xAE, 0xAA, 0xF0, 0xA9, 0xEE, + 0xF8, 0xF1, 0xFD, 0xFC, 0xCE, 0xE6, 0xF4, 0xFA, 0xF7, 0xFB, 0xA7, 0xAF, 0xAC, 0xAB, 0xF3, 0xA8, + 0xB7, 0xB5, 0xB6, 0xC7, 0x8E, 0x8F, 0x92, 0x80, 0xD4, 0x90, 0xD2, 0xD3, 0xDE, 0xD6, 0xD7, 0xD8, + 0xD1, 0xA5, 0xE3, 0xE0, 0xE2, 0xE5, 0x99, 0x9E, 0x9D, 0xEB, 0xE9, 0xEA, 0x9A, 0xED, 0xE7, 0xE1, + 0x85, 0xA0, 0x83, 0xC6, 0x84, 0x86, 0x91, 0x87, 0x8A, 0x82, 0x88, 0x89, 0x8D, 0xA1, 0x8C, 0x8B, + 0xD0, 0xA4, 0x95, 0xA2, 0x93, 0xE4, 0x94, 0xF6, 0x9B, 0x97, 0xA3, 0x96, 0x81, 0x98, 0xE8, 0xEC + }; + if (c < 0x80) return unicode(c,type); + return unicode(LICS[c - 0x80],type); +} + unsigned long Font::unicode(unsigned char c, Font::Type type) { switch (type) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libwps-0.3.0/src/lib/libwps_tools_win.h new/libwps-0.3.1/src/lib/libwps_tools_win.h --- old/libwps-0.3.0/src/lib/libwps_tools_win.h 2014-03-29 11:19:49.000000000 +0100 +++ new/libwps-0.3.1/src/lib/libwps_tools_win.h 2014-12-20 17:09:40.000000000 +0100 @@ -56,6 +56,8 @@ //! converts a character in unicode, knowing the character and the font type static unsigned long unicode(unsigned char c, Type type); + //! converts a LICS character in unicode, knowing the character and the font type + static unsigned long LICSunicode(unsigned char c, Type type); /*! returns the type corresponding to Windows OEM */ static Type getTypeForOEM(int oem); /*! \brief returns the type of the font using the fontName -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
