From b63e5fbb510209cf9aa1c179e8b2197fce86aa4c Mon Sep 17 00:00:00 2001 From: David Tardon Date: Dec 13 2016 11:29:23 +0000 Subject: fix char background color in some cases --- 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 new file mode 100644 index 0000000..035b375 --- /dev/null +++ b/0001-fix-parsing-of-text-block-bg-color-in-some-cases.patch @@ -0,0 +1,29 @@ +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 00d8cd2..5b77d59 100644 --- a/libvisio.spec +++ b/libvisio.spec @@ -2,7 +2,7 @@ Name: libvisio Version: 0.1.5 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A library for import of Microsoft Visio diagrams License: MPLv2.0 @@ -20,6 +20,8 @@ BuildRequires: pkgconfig(librevenge-0.0) BuildRequires: pkgconfig(libxml-2.0) >= 2.9.2 BuildRequires: pkgconfig(zlib) +Patch0: 0001-fix-parsing-of-text-block-bg-color-in-some-cases.patch + %description %{name} is library providing ability to interpret and import Microsoft Visio diagrams into various applications. You can find it @@ -112,6 +114,9 @@ make check %{?_smp_mflags} %{_mandir}/man1/vss2xhtml.1* %changelog +* Tue Dec 13 2016 David Tardon - 0.1.5-5 +- fix char background color in some cases + * Fri Apr 15 2016 David Tardon - 0.1.5-4 - rebuild for ICU 57.1