From 59d4ee5796253c9f4ab9e4cc58692fc70747a936 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 21 Oct 2017 17:06:46 +0200 Subject: [PATCH] new upstream release 0.1.6 --- .gitignore | 1 + ...it-bmps-with-color-palette-correctly.patch | 104 ------------------ ...of-text-block-bg-color-in-some-cases.patch | 29 ----- libvisio.spec | 15 +-- sources | 2 +- 5 files changed, 8 insertions(+), 143 deletions(-) delete mode 100644 0001-emit-bmps-with-color-palette-correctly.patch delete mode 100644 0001-fix-parsing-of-text-block-bg-color-in-some-cases.patch diff --git a/.gitignore b/.gitignore index 2891127..dae0d03 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /libvisio-0.1.3.tar.xz /libvisio-0.1.4.tar.xz /libvisio-0.1.5.tar.xz +/libvisio-0.1.6.tar.xz diff --git a/0001-emit-bmps-with-color-palette-correctly.patch b/0001-emit-bmps-with-color-palette-correctly.patch deleted file mode 100644 index c24a5b8..0000000 --- a/0001-emit-bmps-with-color-palette-correctly.patch +++ /dev/null @@ -1,104 +0,0 @@ -From a4ab4fdafc33088429a6c6bcdcf3c072b3a834a9 Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Mon, 12 Dec 2016 15:23:55 +0100 -Subject: [PATCH 2/2] emit bmps with color palette correctly - -Change-Id: I731ab9629fdc08c54b43cdcb21a81633bd89f569 ---- - src/lib/VSDContentCollector.cpp | 52 +++++++++++++++++++++++++++++++++++++---- - src/lib/libvisio_utils.h | 2 ++ - 2 files changed, 50 insertions(+), 4 deletions(-) - -diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp -index c20e626..229120f 100644 ---- a/src/lib/VSDContentCollector.cpp -+++ b/src/lib/VSDContentCollector.cpp -@@ -7,6 +7,7 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -+#include - #include // for memcpy - #include - #include -@@ -33,6 +34,48 @@ static unsigned bitmapId = 0; - - #define SURROGATE_VALUE(h,l) (((h) - 0xd800) * 0x400 + (l) - 0xdc00 + 0x10000) - -+namespace -+{ -+ -+unsigned computeBMPDataOffset(librevenge::RVNGInputStream *const input, const unsigned long maxLength) -+{ -+ assert(input); -+ -+ using namespace libvisio; -+ -+ // determine header size -+ unsigned headerSize = readU32(input); -+ if (headerSize > maxLength) -+ headerSize = 40; // assume v.3 bitmap header size -+ unsigned off = headerSize; -+ -+ // determine palette size -+ input->seek(10, librevenge::RVNG_SEEK_CUR); -+ unsigned bpp = readU16(input); -+ // sanitize bpp -+ if (bpp > 32) -+ bpp = 32; -+ const unsigned allowedBpp[] = {1, 4, 8, 16, 24, 32}; -+ size_t bppIdx = 0; -+ while (bppIdx < VSD_NUM_ELEMENTS(allowedBpp) && bpp < allowedBpp[bppIdx]) -+ ++bppIdx; -+ if (bpp < allowedBpp[bppIdx]) -+ bpp = allowedBpp[bppIdx]; -+ input->seek(16, librevenge::RVNG_SEEK_CUR); -+ unsigned paletteColors = readU32(input); -+ if (bpp < 16 && paletteColors == 0) -+ paletteColors = 1 << bpp; -+ assert(maxLength >= off); -+ if (paletteColors > 0 && (paletteColors < (maxLength - off) / 4)) -+ off += 4 * paletteColors; -+ -+ off += 14; // file header size -+ -+ return off; -+} -+ -+} // anonymous namespace -+ - libvisio::VSDContentCollector::VSDContentCollector( - librevenge::RVNGDrawingInterface *painter, - std::vector > &groupXFormsSequence, -@@ -1359,10 +1402,11 @@ void libvisio::VSDContentCollector::_handleForeignData(const librevenge::RVNGBin - m_currentForeignData.append((unsigned char)0x00); - m_currentForeignData.append((unsigned char)0x00); - -- m_currentForeignData.append((unsigned char)0x36); -- m_currentForeignData.append((unsigned char)0x00); -- m_currentForeignData.append((unsigned char)0x00); -- m_currentForeignData.append((unsigned char)0x00); -+ const unsigned dataOff = computeBMPDataOffset(binaryData.getDataStream(), binaryData.size()); -+ m_currentForeignData.append((unsigned char)(dataOff & 0xff)); -+ m_currentForeignData.append((unsigned char)((dataOff >> 8) & 0xff)); -+ m_currentForeignData.append((unsigned char)((dataOff >> 16) & 0xff)); -+ m_currentForeignData.append((unsigned char)((dataOff >> 24) & 0xff)); - } - m_currentForeignData.append(binaryData); - -diff --git a/src/lib/libvisio_utils.h b/src/lib/libvisio_utils.h -index c6c3a03..2a4880e 100644 ---- a/src/lib/libvisio_utils.h -+++ b/src/lib/libvisio_utils.h -@@ -70,6 +70,8 @@ typedef unsigned __int64 uint64_t; - #define VSD_DEBUG(M) - #endif - -+#define VSD_NUM_ELEMENTS(array) (sizeof(array)/sizeof((array)[0])) -+ - namespace libvisio - { - --- -2.9.3 - diff --git a/0001-fix-parsing-of-text-block-bg-color-in-some-cases.patch b/0001-fix-parsing-of-text-block-bg-color-in-some-cases.patch deleted file mode 100644 index 035b375..0000000 --- a/0001-fix-parsing-of-text-block-bg-color-in-some-cases.patch +++ /dev/null @@ -1,29 +0,0 @@ -From f28739d5bcdace1b6aa4671e5c5483d941ca8c6e Mon Sep 17 00:00:00 2001 -From: David Tardon -Date: Tue, 29 Nov 2016 15:05:20 +0100 -Subject: [PATCH 1/2] fix parsing of text block bg color in some cases - -It appears that if the color index is 0xff, no color should be set. - -Change-Id: I0dcea16ed5d61292d84e82904b863c1ccafd9d7a ---- - src/lib/VSDParser.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp -index e82a678..8fc73d1 100644 ---- a/src/lib/VSDParser.cpp -+++ b/src/lib/VSDParser.cpp -@@ -877,7 +877,8 @@ void libvisio::VSDParser::readTextBlock(librevenge::RVNGInputStream *input) - input->seek(1, librevenge::RVNG_SEEK_CUR); - double bottomMargin = readDouble(input); - unsigned char verticalAlign = readU8(input); -- bool isBgFilled = (!!readU8(input)); -+ const unsigned char bgColourIdx = readU8(input); -+ const bool isBgFilled = bgColourIdx != 0 && bgColourIdx != 0xff; - Colour c; - c.r = readU8(input); - c.g = readU8(input); --- -2.9.3 - diff --git a/libvisio.spec b/libvisio.spec index e9163ad..c72f819 100644 --- a/libvisio.spec +++ b/libvisio.spec @@ -1,8 +1,8 @@ %global apiversion 0.1 Name: libvisio -Version: 0.1.5 -Release: 10%{?dist} +Version: 0.1.6 +Release: 1%{?dist} Summary: A library for import of Microsoft Visio diagrams License: MPLv2.0 @@ -15,13 +15,9 @@ BuildRequires: gperf BuildRequires: help2man BuildRequires: perl-interpreter BuildRequires: pkgconfig(cppunit) -BuildRequires: pkgconfig(icu-i18n) +BuildRequires: pkgconfig(icu-uc) BuildRequires: pkgconfig(librevenge-0.0) BuildRequires: pkgconfig(libxml-2.0) -BuildRequires: pkgconfig(zlib) - -Patch0: 0001-fix-parsing-of-text-block-bg-color-in-some-cases.patch -Patch1: 0001-emit-bmps-with-color-palette-correctly.patch %description %{name} is library providing ability to interpret and import @@ -81,8 +77,6 @@ install -m 0644 vsd2*.1 vss2*.1 %{buildroot}/%{_mandir}/man1 %check export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -# Workaround time formatting problem in the test -export TZ='CET' make check %{?_smp_mflags} %files @@ -115,6 +109,9 @@ make check %{?_smp_mflags} %{_mandir}/man1/vss2xhtml.1* %changelog +* Sat Oct 21 2017 David Tardon - 0.1.6-1 +- new upstream release + * Thu Aug 03 2017 Fedora Release Engineering - 0.1.5-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild diff --git a/sources b/sources index 723f7ba..183992f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -691522167fe3b0c94becfe5d957883be libvisio-0.1.5.tar.xz +SHA512 (libvisio-0.1.6.tar.xz) = 58cee8cfe4205b2cad2f11dbe17882e57ebf0d10500116ca9d8d120e138f8eb0c65a5fea3bd7d2746bf8140377ee9deb34258597e028f9fdc8d21f270606cce1