From bc3ea81d78687c9383e899ddcd81422392a6ecee Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sun, 23 Oct 2016 20:08:52 +0200 Subject: [PATCH] fix build of bundled libzmf with boost < 1.56 Change-Id: I024d77b563d492bbb56155afb6313d37ca6a4c0b --- ...001-allow-build-with-boost-1.56-part-II.patch.1 | 190 +++++++++++++++++++++ .../0001-allow-build-with-boost-1.56.patch.1 | 131 ++++++++++++++ external/libzmf/UnpackedTarball_libzmf.mk | 2 + 3 files changed, 323 insertions(+) create mode 100644 external/libzmf/0001-allow-build-with-boost-1.56-part-II.patch.1 create mode 100644 external/libzmf/0001-allow-build-with-boost-1.56.patch.1 diff --git a/external/libzmf/0001-allow-build-with-boost-1.56-part-II.patch.1 b/external/libzmf/0001-allow-build-with-boost-1.56-part-II.patch.1 new file mode 100644 index 0000000..d70fd97 --- /dev/null +++ b/external/libzmf/0001-allow-build-with-boost-1.56-part-II.patch.1 @@ -0,0 +1,190 @@ +From 11b8d5b0c8c0461ac638aba6bc6e59e7ec5d815c Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Sun, 23 Oct 2016 19:58:35 +0200 +Subject: [PATCH] allow build with boost < 1.56, part II + +Change-Id: I4421847b1aa7bbb006a32dd85567b96125df6b6b +--- + src/lib/ZMF4Parser.cpp | 42 +++++++++++++++++++++--------------------- + 1 file changed, 21 insertions(+), 21 deletions(-) + +diff --git a/src/lib/ZMF4Parser.cpp b/src/lib/ZMF4Parser.cpp +index e23c2e5..f3f3f5d 100644 +--- a/src/lib/ZMF4Parser.cpp ++++ b/src/lib/ZMF4Parser.cpp +@@ -269,7 +269,7 @@ boost::optional ZMF4Parser::getImageByRefId(uint32_t id) + ArrowPtr ZMF4Parser::getArrowByRefId(uint32_t id) + { + auto arrow = getByRefId(id, m_arrows); +- return arrow ? arrow.value() : ArrowPtr(); ++ return get_optional_value_or(arrow, ArrowPtr()); + } + + Style ZMF4Parser::readStyle() +@@ -684,13 +684,13 @@ void ZMF4Parser::readFill() + + Color color = readColor(); + +- m_fills[m_currentObjectHeader.id.value()] = color; ++ m_fills[get(m_currentObjectHeader.id)] = color; + } + else if (type >= 2 && type <= 7) + { + Gradient gradient = readGradient(type); + +- m_fills[m_currentObjectHeader.id.value()] = gradient; ++ m_fills[get(m_currentObjectHeader.id)] = gradient; + } + else if (type == 8) + { +@@ -723,13 +723,13 @@ void ZMF4Parser::readFill() + + if (!image) + { +- ZMF_DEBUG_MSG(("image not found for bitmap fill ID0x%x\n", m_currentObjectHeader.id.value())); ++ ZMF_DEBUG_MSG(("image not found for bitmap fill ID0x%x\n", get(m_currentObjectHeader.id))); + return; + } + +- imageFill.image = image.value(); ++ imageFill.image = get(image); + +- m_fills[m_currentObjectHeader.id.value()] = imageFill; ++ m_fills[get(m_currentObjectHeader.id)] = imageFill; + } + else + { +@@ -756,7 +756,7 @@ void ZMF4Parser::readTransparency() + Transparency transparency; + transparency.color = readColor(); + +- m_transparencies[m_currentObjectHeader.id.value()] = transparency; ++ m_transparencies[get(m_currentObjectHeader.id)] = transparency; + } + } + +@@ -874,7 +874,7 @@ void ZMF4Parser::readPen() + } + } + +- m_pens[m_currentObjectHeader.id.value()] = pen; ++ m_pens[get(m_currentObjectHeader.id)] = pen; + } + + void ZMF4Parser::readShadow() +@@ -926,7 +926,7 @@ void ZMF4Parser::readShadow() + break; + } + +- m_shadows[m_currentObjectHeader.id.value()] = shadow; ++ m_shadows[get(m_currentObjectHeader.id)] = shadow; + } + + void ZMF4Parser::readArrow() +@@ -947,7 +947,7 @@ void ZMF4Parser::readArrow() + + arrow->curves = readCurveComponents(std::bind(&ZMF4Parser::readUnscaledPoint, this)); + +- m_arrows[m_currentObjectHeader.id.value()] = arrow; ++ m_arrows[get(m_currentObjectHeader.id)] = arrow; + } + + void ZMF4Parser::readBitmap() +@@ -975,11 +975,11 @@ void ZMF4Parser::readBitmap() + + if (image.data.empty()) + { +- ZMF_DEBUG_MSG(("Failed to parse bitmap, ID 0x%x\n", m_currentObjectHeader.id.value())); ++ ZMF_DEBUG_MSG(("Failed to parse bitmap, ID 0x%x\n", get(m_currentObjectHeader.id))); + } + else + { +- m_images[m_currentObjectHeader.id.value()] = image; ++ m_images[get(m_currentObjectHeader.id)] = image; + } + + seek(m_input, m_currentObjectHeader.nextObjectOffset + header.size()); +@@ -1012,7 +1012,7 @@ void ZMF4Parser::readImage() + { + m_collector.setStyle(readStyle()); + +- m_collector.collectImage(image.value().data, bbox.topLeft(), bbox.width(), bbox.height(), ++ m_collector.collectImage(get(image).data, bbox.topLeft(), bbox.width(), bbox.height(), + bbox.rotation(), bbox.mirrorHorizontal(), bbox.mirrorVertical()); + } + } +@@ -1046,7 +1046,7 @@ void ZMF4Parser::readFont() + font.fill = style.fill; + font.outline = style.pen; + +- m_fonts[m_currentObjectHeader.id.value()] = font; ++ m_fonts[get(m_currentObjectHeader.id)] = font; + } + + void ZMF4Parser::readParagraphStyle() +@@ -1098,7 +1098,7 @@ void ZMF4Parser::readParagraphStyle() + { + auto font = getFontByRefId(ref.id); + if (font) +- parStyle.font = font.value(); ++ parStyle.font = get(font); + } + break; + default: +@@ -1107,7 +1107,7 @@ void ZMF4Parser::readParagraphStyle() + } + } + +- m_paragraphStyles[m_currentObjectHeader.id.value()] = parStyle; ++ m_paragraphStyles[get(m_currentObjectHeader.id)] = parStyle; + } + + void ZMF4Parser::readText() +@@ -1140,7 +1140,7 @@ void ZMF4Parser::readText() + uint32_t styleId = readU32(m_input); + auto style = getParagraphStyleByRefId(styleId); + if (style) +- paragraph.style = style.value(); ++ paragraph.style = get(style); + + skip(m_input, 4); + } +@@ -1161,7 +1161,7 @@ void ZMF4Parser::readText() + uint32_t fontId = readU32(m_input); + auto font = getFontByRefId(fontId); + if (font) +- span.font = font.value(); ++ span.font = get(font); + else + { + span.font = paragraph.style.font; +@@ -1180,7 +1180,7 @@ void ZMF4Parser::readText() + } + } + +- m_texts[m_currentObjectHeader.id.value()] = text; ++ m_texts[get(m_currentObjectHeader.id)] = text; + } + + void ZMF4Parser::readTextFrame() +@@ -1216,7 +1216,7 @@ void ZMF4Parser::readTextFrame() + + if (text) + { +- m_collector.collectTextObject(text.value(), bbox.topLeft(), bbox.width(), bbox.height(), alignment, bbox.rotation()); ++ m_collector.collectTextObject(get(text), bbox.topLeft(), bbox.width(), bbox.height(), alignment, bbox.rotation()); + } + } + +@@ -1350,7 +1350,7 @@ void ZMF4Parser::readTable() + auto text = getTextByRefId(textId); + if (text) + { +- cell.text = text.value(); ++ cell.text = get(text); + } + + uint32_t rightPenRefId = readU32(m_input); +-- +2.9.3 + diff --git a/external/libzmf/0001-allow-build-with-boost-1.56.patch.1 b/external/libzmf/0001-allow-build-with-boost-1.56.patch.1 new file mode 100644 index 0000000..0873381 --- /dev/null +++ b/external/libzmf/0001-allow-build-with-boost-1.56.patch.1 @@ -0,0 +1,131 @@ +From 16d921505a56745f671525310ebb4b3c58b35afe Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Sun, 23 Oct 2016 19:46:18 +0200 +Subject: [PATCH] allow build with boost < 1.56 + +Change-Id: I81a110fc19e1540980a265c773bd840c47643d86 +--- + src/lib/ZMFCollector.cpp | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/src/lib/ZMFCollector.cpp b/src/lib/ZMFCollector.cpp +index 18377ff..0b2608f 100644 +--- a/src/lib/ZMFCollector.cpp ++++ b/src/lib/ZMFCollector.cpp +@@ -218,7 +218,7 @@ public: + + if (m_transparency) + { +- m_propList.insert("draw:opacity", m_transparency.value().opacity(), librevenge::RVNG_PERCENT); ++ m_propList.insert("draw:opacity", get(m_transparency).opacity(), librevenge::RVNG_PERCENT); + } + } + +@@ -251,7 +251,7 @@ public: + librevenge::RVNGPropertyList grad; + grad.insert("svg:offset", stop.offset, librevenge::RVNG_PERCENT); + grad.insert("svg:stop-color", stop.color.toString()); +- grad.insert("svg:stop-opacity", m_transparency ? m_transparency.value().opacity() : 1.0, librevenge::RVNG_PERCENT); ++ grad.insert("svg:stop-opacity", m_transparency ? get(m_transparency).opacity() : 1.0, librevenge::RVNG_PERCENT); + gradientVector.append(grad); + } + +@@ -294,7 +294,7 @@ public: + + if (m_transparency) + { +- m_propList.insert("draw:opacity", m_transparency.value().opacity(), librevenge::RVNG_PERCENT); ++ m_propList.insert("draw:opacity", get(m_transparency).opacity(), librevenge::RVNG_PERCENT); + } + } + +@@ -667,9 +667,9 @@ void ZMFCollector::collectText(const Text &text) + spanPropList.insert("fo:font-style", span.font.isItalic ? "italic" : "normal"); + spanPropList.insert("style:text-outline", static_cast(span.font.outline)); + +- if (span.font.fill && span.font.fill.value().type() == typeid(Color)) ++ if (span.font.fill && get(span.font.fill).type() == typeid(Color)) + { +- auto color = boost::get(span.font.fill.value()); ++ auto color = boost::get(get(span.font.fill)); + spanPropList.insert("fo:color", color.toString()); + } + +@@ -759,9 +759,9 @@ void ZMFCollector::collectTable(const Table &table) + { + librevenge::RVNGPropertyList cellPropList; + +- if (cell.fill && cell.fill.value().type() == typeid(Color)) ++ if (cell.fill && get(cell.fill).type() == typeid(Color)) + { +- auto backgroundColor = boost::get(cell.fill.value()); ++ auto backgroundColor = boost::get(get(cell.fill)); + cellPropList.insert("fo:background-color", backgroundColor.toString()); + } + +@@ -769,19 +769,19 @@ void ZMFCollector::collectTable(const Table &table) + + if (cell.leftBorder) + { +- writeBorder(cellPropList, "fo:border-left", cell.leftBorder.value()); ++ writeBorder(cellPropList, "fo:border-left", get(cell.leftBorder)); + } + if (cell.rightBorder) + { +- writeBorder(cellPropList, "fo:border-right", cell.rightBorder.value()); ++ writeBorder(cellPropList, "fo:border-right", get(cell.rightBorder)); + } + if (cell.topBorder) + { +- writeBorder(cellPropList, "fo:border-top", cell.topBorder.value()); ++ writeBorder(cellPropList, "fo:border-top", get(cell.topBorder)); + } + if (cell.bottomBorder) + { +- writeBorder(cellPropList, "fo:border-bottom", cell.bottomBorder.value()); ++ writeBorder(cellPropList, "fo:border-bottom", get(cell.bottomBorder)); + } + + m_painter->openTableCell(cellPropList); +@@ -806,7 +806,7 @@ void ZMFCollector::collectImage(const librevenge::RVNGBinaryData &image, const P + + if (m_style.transparency) + { +- propList.insert("draw:opacity", m_style.transparency.value().opacity(), librevenge::RVNG_PERCENT); ++ propList.insert("draw:opacity", get(m_style.transparency).opacity(), librevenge::RVNG_PERCENT); + } + + m_painter->setStyle(propList); +@@ -847,17 +847,17 @@ void ZMFCollector::writeStyle(librevenge::RVNGPropertyList &propList, const Styl + + if (style.pen) + { +- writePen(propList, style.pen.value()); ++ writePen(propList, get(style.pen)); + } + + if (style.fill && !noFill) + { +- writeFill(propList, style.fill.value()); ++ writeFill(propList, get(style.fill)); + } + + if (style.shadow) + { +- writeShadow(propList, style.shadow.value()); ++ writeShadow(propList, get(style.shadow)); + } + } + +@@ -920,7 +920,7 @@ void ZMFCollector::writePen(librevenge::RVNGPropertyList &propList, const Pen &p + + if (m_style.transparency) + { +- propList.insert("svg:stroke-opacity", m_style.transparency.value().opacity(), librevenge::RVNG_PERCENT); ++ propList.insert("svg:stroke-opacity", get(m_style.transparency).opacity(), librevenge::RVNG_PERCENT); + } + + if (pen.startArrow) +-- +2.9.3 + diff --git a/external/libzmf/UnpackedTarball_libzmf.mk b/external/libzmf/UnpackedTarball_libzmf.mk index c917633..782aeb8 100644 --- a/external/libzmf/UnpackedTarball_libzmf.mk +++ b/external/libzmf/UnpackedTarball_libzmf.mk @@ -23,6 +23,8 @@ endif $(eval $(call gb_UnpackedTarball_add_patches,libzmf, \ external/libzmf/0001-add-missing-include.patch.1 \ + external/libzmf/0001-allow-build-with-boost-1.56.patch.1 \ + external/libzmf/0001-allow-build-with-boost-1.56-part-II.patch.1 \ )) # vim: set noet sw=4 ts=4: -- 2.9.3