fix char background color in some cases

f41
David Tardon 8 years ago
parent a0abf23508
commit b63e5fbb51

@ -0,0 +1,29 @@
From f28739d5bcdace1b6aa4671e5c5483d941ca8c6e Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
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

@ -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 <dtardon@redhat.com> - 0.1.5-5
- fix char background color in some cases
* Fri Apr 15 2016 David Tardon <dtardon@redhat.com> - 0.1.5-4
- rebuild for ICU 57.1

Loading…
Cancel
Save