src/lib/CDRParser.cpp | 46 +++++++++++++--------------------------------- 1 file changed, 13 insertions(+), 33 deletions(-)
New commits: commit bd969c36b580f5de0cc30fe1badf4f1b8361c05d Author: Fridrich Štrba <fridrich.st...@bluewin.ch> AuthorDate: Sun Feb 2 12:09:49 2020 +0100 Commit: Fridrich Štrba <fridrich.st...@bluewin.ch> CommitDate: Sun Feb 2 12:09:49 2020 +0100 Fix txsm for version 15 Change-Id: I188be62b02807f6704ce78ef2a9b1011667ed46a diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp index d58f281..40b9b68 100644 --- a/src/lib/CDRParser.cpp +++ b/src/lib/CDRParser.cpp @@ -2911,7 +2911,7 @@ void libcdr::CDRParser::readTxsm(librevenge::RVNGInputStream *input, unsigned le std::map<unsigned, CDRFillStyle>::const_iterator iter = m_fillStyles.find(fillId); if (iter != m_fillStyles.end()) style.m_fillStyle = iter->second; - if (m_version >= 1500) + if (m_version >= 1600) input->seek(48, librevenge::RVNG_SEEK_CUR); } if (fl2&0x80) // Font Outl Colour commit 496e288d9e5450ed7db8324b51a1767377f0125a Author: Fridrich Štrba <fridrich.st...@bluewin.ch> AuthorDate: Sat Feb 1 20:28:36 2020 +0100 Commit: Fridrich Štrba <fridrich.st...@bluewin.ch> CommitDate: Sun Feb 2 11:30:45 2020 +0100 improve readFild for versions 13 and up Change-Id: I9d5d2f92da990b9e46998517bdf1b750ddb00315 diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp index 6bd5dc9..d58f281 100644 --- a/src/lib/CDRParser.cpp +++ b/src/lib/CDRParser.cpp @@ -1156,6 +1156,9 @@ libcdr::CDRColor libcdr::CDRParser::readColor(librevenge::RVNGInputStream *input colorModel = readU8(input); colorValue = readU32(input); } + + CDR_DEBUG_MSG(("CDRParser::redColor --> colorModel 0x%x -- colorValue 0x%x\n", colorModel, colorValue)); + return libcdr::CDRColor(colorModel, colorValue); } @@ -1758,13 +1761,8 @@ void libcdr::CDRParser::readFild(librevenge::RVNGInputStream *input, unsigned le if (!_redirectX6Chunk(&input, length)) throw GenericException(); unsigned fillId = readU32(input); - unsigned short v13flag = 0; if (m_version >= 1300) - { - input->seek(4, librevenge::RVNG_SEEK_CUR); - v13flag = readU16(input); - input->seek(2, librevenge::RVNG_SEEK_CUR); - } + input->seek(8, librevenge::RVNG_SEEK_CUR); unsigned short fillType = readU16(input); libcdr::CDRColor color1; libcdr::CDRColor color2; @@ -1818,14 +1816,11 @@ void libcdr::CDRParser::readFild(librevenge::RVNGInputStream *input, unsigned le { libcdr::CDRGradientStop stop; stop.m_color = readColor(input); - if (m_version >= 1300) - { - if (v13flag == 0x9e || (m_version >= 1600 && v13flag == 0x96)) - input->seek(26, librevenge::RVNG_SEEK_CUR); - else - input->seek(5, librevenge::RVNG_SEEK_CUR); - } - stop.m_offset = (double)readUnsigned(input) / 100.0; + if (m_version >= 1400) + input->seek(26, librevenge::RVNG_SEEK_CUR); + else if (m_version >= 1300) + input->seek(5, librevenge::RVNG_SEEK_CUR); + stop.m_offset = (double)(readUnsigned(input) & 0xffff) / 100.0; if (m_version >= 1300) input->seek(3, librevenge::RVNG_SEEK_CUR); gradient.m_stops.push_back(stop); @@ -1867,12 +1862,7 @@ void libcdr::CDRParser::readFild(librevenge::RVNGInputStream *input, unsigned le input->seek(1, librevenge::RVNG_SEEK_CUR); color1 = readColor(input); if (m_version >= 1300) - { - if (v13flag == 0x94 || (m_version >= 1600 && v13flag == 0x8c)) - input->seek(31, librevenge::RVNG_SEEK_CUR); - else - input->seek(10, librevenge::RVNG_SEEK_CUR); - } + input->seek(31, librevenge::RVNG_SEEK_CUR); color2 = readColor(input); imageFill = libcdr::CDRImageFill(patternId, patternWidth, patternHeight, isRelative, tileOffsetX, tileOffsetY, rcpOffset, flags); } @@ -1921,12 +1911,7 @@ void libcdr::CDRParser::readFild(librevenge::RVNGInputStream *input, unsigned le case 10: // Full color { if (m_version >= 1300) - { - if (v13flag == 0x4e) - input->seek(28, librevenge::RVNG_SEEK_CUR); - else - input->seek(4, librevenge::RVNG_SEEK_CUR); - } + input->seek(28, librevenge::RVNG_SEEK_CUR); else input->seek(2, librevenge::RVNG_SEEK_CUR); unsigned patternId = readUnsigned(input); @@ -1966,12 +1951,7 @@ void libcdr::CDRParser::readFild(librevenge::RVNGInputStream *input, unsigned le if (m_version < 600) fillType = 10; if (m_version >= 1300) - { - if (v13flag == 0x18e) - input->seek(36, librevenge::RVNG_SEEK_CUR); - else - input->seek(1, librevenge::RVNG_SEEK_CUR); - } + input->seek(36, librevenge::RVNG_SEEK_CUR); else input->seek(2, librevenge::RVNG_SEEK_CUR); unsigned patternId = readU32(input); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits