diff --git a/download.lst b/download.lst index 1f09a9bff75e..5f920e390ccf 100644 --- a/download.lst +++ b/download.lst @@ -607,8 +607,8 @@ TWAIN_DSM_TARBALL := twaindsm_2.4.1.orig.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts -VISIO_SHA256SUM := 8faf8df870cb27b09a787a1959d6c646faa44d0d8ab151883df408b7166bea4c -VISIO_TARBALL := libvisio-0.1.7.tar.xz +VISIO_SHA256SUM := b4098ffbf4dcb9e71213fa0acddbd928f27bed30db2d80234813b15d53d0405b +VISIO_TARBALL := libvisio-0.1.8.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/libvisio/UnpackedTarball_libvisio.mk b/external/libvisio/UnpackedTarball_libvisio.mk index b5f530fb2763..b4a3d912ef63 100644 --- a/external/libvisio/UnpackedTarball_libvisio.mk +++ b/external/libvisio/UnpackedTarball_libvisio.mk @@ -15,9 +15,4 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libvisio,0)) $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libvisio)) -$(eval $(call gb_UnpackedTarball_add_patches,libvisio, \ - external/libvisio/ubsan.patch \ - external/libvisio/solid-fill-style.patch \ -)) - # vim: set noet sw=4 ts=4: diff --git a/external/libvisio/solid-fill-style.patch b/external/libvisio/solid-fill-style.patch deleted file mode 100644 index 53dc6a405e71..000000000000 --- a/external/libvisio/solid-fill-style.patch +++ /dev/null @@ -1,198 +0,0 @@ ---- src/lib/VSDStyles.h -+++ src/lib/VSDStyles.h -@@ -179,14 +177,13 @@ struct VSDFillStyle - ASSIGN_OPTIONAL(style.qsFillMatrix, qsFillMatrix); - if (theme) - { -- if (!!style.qsFillColour && style.qsFillColour.get() >= 0) -- ASSIGN_OPTIONAL(theme->getThemeColour(style.qsFillColour.get()), fgColour); -- -- if (!!style.qsFillColour && style.qsFillColour.get() >= 0) -- ASSIGN_OPTIONAL(theme->getThemeColour(style.qsFillColour.get()), bgColour); -- -- if (!!style.qsShadowColour && style.qsShadowColour.get() >= 0) -- ASSIGN_OPTIONAL(theme->getThemeColour(style.qsShadowColour.get()), shadowFgColour); -+ // Quick Style Colour 100 is special. It is the default, -+ // and it is not saved explicitely in the VSDX file. -+ ASSIGN_OPTIONAL(theme->getThemeColour(style.qsFillColour.value_or(100)), fgColour); -+ ASSIGN_OPTIONAL(theme->getThemeColour(style.qsFillColour.value_or(100)), bgColour); -+ ASSIGN_OPTIONAL(theme->getThemeColour(style.qsShadowColour.value_or(100)), shadowFgColour); -+ if (!!style.qsFillMatrix && style.qsFillMatrix.get() >= 0) -+ ASSIGN_OPTIONAL(theme->getFillStyleColour(style.qsFillMatrix.get()), fgColour); - } - ASSIGN_OPTIONAL(style.fgColour, fgColour); - ASSIGN_OPTIONAL(style.bgColour, bgColour); ---- src/lib/VSDXTheme.cpp -+++ src/lib/VSDXTheme.cpp -@@ -63,7 +63,8 @@ libvisio::VSDXFontScheme::VSDXFontScheme() - - libvisio::VSDXTheme::VSDXTheme() - : m_clrScheme(), -- m_fontScheme() -+ m_fontScheme(), -+ m_fillStyleLst(std::vector>(6)) - { - } - -@@ -102,6 +103,9 @@ bool libvisio::VSDXTheme::parse(librevenge::RVNGInputStream *input) - case XML_A_FONTSCHEME: - readFontScheme(reader.get()); - break; -+ case XML_A_FMTSCHEME: -+ readFmtScheme(reader.get()); -+ break; - default: - break; - } -@@ -320,7 +324,7 @@ void libvisio::VSDXTheme::readClrScheme(xmlTextReaderPtr reader) - while ((XML_A_CLRSCHEME != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret); - } - --void libvisio::VSDXTheme::readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr) -+bool libvisio::VSDXTheme::readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr) - { - int ret = 1; - int tokenId = XML_TOKEN_INVALID; -@@ -350,7 +354,11 @@ void libvisio::VSDXTheme::readThemeColour(xmlTextReaderPtr reader, int idToken, - while ((idToken != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret); - - if (colour) -+ { - clr = *colour; -+ return true; -+ } -+ return false; - } - - void libvisio::VSDXTheme::readVariationClrSchemeLst(xmlTextReaderPtr reader) -@@ -491,4 +499,96 @@ boost::optional libvisio::VSDXTheme::getThemeColour(unsigned v - return boost::optional(); - } - -+void libvisio::VSDXTheme::readFmtScheme(xmlTextReaderPtr reader) -+{ -+ VSD_DEBUG_MSG(("VSDXTheme::readFmtScheme\n")); -+ int ret = 1; -+ int tokenId = XML_TOKEN_INVALID; -+ int tokenType = -1; -+ do -+ { -+ ret = xmlTextReaderRead(reader); -+ tokenId = getElementToken(reader); -+ if (XML_TOKEN_INVALID == tokenId) -+ { -+ VSD_DEBUG_MSG(("VSDXTheme::readFmtScheme: unknown token %s\n", xmlTextReaderConstName(reader))); -+ } -+ tokenType = xmlTextReaderNodeType(reader); -+ switch (tokenId) -+ { -+ case XML_A_FILLSTYLELST: -+ { -+ readFillStyleLst(reader); -+ break; -+ } -+ default: -+ // Other style lists not implemented -+ break; -+ } -+ } while ((XML_A_FMTSCHEME != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret); -+} -+ -+void libvisio::VSDXTheme::skipUnimplemented(xmlTextReaderPtr reader, int idToken) -+{ -+ int ret = 1; -+ int tokenId = XML_TOKEN_INVALID; -+ int tokenType = -1; -+ do -+ { -+ ret = xmlTextReaderRead(reader); -+ tokenId = getElementToken(reader); -+ if (XML_TOKEN_INVALID == tokenId) -+ { -+ VSD_DEBUG_MSG(("VSDXTheme::skipUnimplemented: unknown token %s\n", xmlTextReaderConstName(reader))); -+ } -+ tokenType = xmlTextReaderNodeType(reader); -+ } while ((idToken != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret); -+} -+ -+void libvisio::VSDXTheme::readFillStyleLst(xmlTextReaderPtr reader) -+{ -+ VSD_DEBUG_MSG(("VSDXTheme::readFillStyleLst\n")); -+ int ret = xmlTextReaderRead(reader); -+ int tokenId = getElementToken(reader); -+ if (XML_TOKEN_INVALID == tokenId) -+ { -+ VSD_DEBUG_MSG(("VSDXTheme::readFillStyleLst: unknown token %s\n", xmlTextReaderConstName(reader))); -+ } -+ int tokenType = xmlTextReaderNodeType(reader); -+ int i = 0; -+ while ((XML_A_FILLSTYLELST != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret) -+ { -+ switch (tokenId) -+ { -+ case XML_A_SOLIDFILL: -+ { -+ Colour colour; -+ if (readThemeColour(reader, tokenId, colour)) -+ { -+ m_fillStyleLst[i] = colour; -+ } -+ break; -+ } -+ default: -+ // Skip unimplemented fill type -+ skipUnimplemented(reader, tokenId); -+ break; -+ } -+ ret = xmlTextReaderRead(reader); -+ tokenId = getElementToken(reader); -+ if (XML_TOKEN_INVALID == tokenId) -+ { -+ VSD_DEBUG_MSG(("VSDXTheme::readFillStyleLst: unknown token %s\n", xmlTextReaderConstName(reader))); -+ } -+ tokenType = xmlTextReaderNodeType(reader); -+ } -+} -+ -+boost::optional libvisio::VSDXTheme::getFillStyleColour(unsigned value) const -+{ -+ if (value == 0 || value > m_fillStyleLst.size()) -+ return boost::optional(); -+ return m_fillStyleLst[value - 1]; -+} -+ - /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ ---- src/lib/VSDXTheme.h -+++ src/lib/VSDXTheme.h -@@ -80,6 +80,7 @@ public: - ~VSDXTheme(); - bool parse(librevenge::RVNGInputStream *input); - boost::optional getThemeColour(unsigned value, unsigned variationIndex = 0) const; -+ boost::optional getFillStyleColour(unsigned value) const; - - private: - VSDXTheme(const VSDXTheme &); -@@ -89,18 +90,22 @@ private: - boost::optional readSysClr(xmlTextReaderPtr reader); - - void readClrScheme(xmlTextReaderPtr reader); -- void readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr); -+ bool readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr); - void readVariationClrSchemeLst(xmlTextReaderPtr reader); - void readVariationClrScheme(xmlTextReaderPtr reader, VSDXVariationClrScheme &varClrSch); - void readFontScheme(xmlTextReaderPtr reader); - void readFont(xmlTextReaderPtr reader, int idToken, VSDXFont &font); - bool readTypeFace(xmlTextReaderPtr reader, librevenge::RVNGString &typeFace); - bool readTypeFace(xmlTextReaderPtr reader, int &script, librevenge::RVNGString &typeFace); -+ void readFmtScheme(xmlTextReaderPtr reader); -+ void readFillStyleLst(xmlTextReaderPtr reader); - - int getElementToken(xmlTextReaderPtr reader); -+ void skipUnimplemented(xmlTextReaderPtr reader, int idToken); - - VSDXClrScheme m_clrScheme; - VSDXFontScheme m_fontScheme; -+ std::vector> m_fillStyleLst; - }; - - } // namespace libvisio diff --git a/external/libvisio/ubsan.patch b/external/libvisio/ubsan.patch deleted file mode 100644 index c9ffbd98f4b6..000000000000 --- a/external/libvisio/ubsan.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/lib/VSDContentCollector.cpp -+++ src/lib/VSDContentCollector.cpp -@@ -3220,7 +3220,7 @@ - } - if (U_SUCCESS(status) && conv) - { -- const auto *src = (const char *)&characters[0]; -+ const auto *src = (const char *)characters.data(); - const char *srcLimit = (const char *)src + characters.size(); - while (src < srcLimit) - {