diff options
author | ALONSO Laurent <laurent.alonso@inria.fr> | 2019-04-07 09:49:16 +0200 |
---|---|---|
committer | ALONSO Laurent <laurent.alonso@inria.fr> | 2019-04-07 09:49:16 +0200 |
commit | 7ad7c4db5b22e8486b99f4b036963b1cf1d2f935 (patch) | |
tree | 8c74824def85a42c37e00c802b0c440411fcfed3 | |
parent | 697313f5bb3b8d619d9bb1f8b0ee0fc844e2058e (diff) |
pages[iwa]: try to retrieve some page's background, to be improved.
Change-Id: If6c82351b8792a055b24b4234a751ca78c6aec97
-rw-r--r-- | src/lib/IWAParser.cpp | 11 | ||||
-rw-r--r-- | src/lib/PAGCollector.cpp | 13 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/lib/IWAParser.cpp b/src/lib/IWAParser.cpp index 00193c3..e7be74c 100644 --- a/src/lib/IWAParser.cpp +++ b/src/lib/IWAParser.cpp @@ -2179,12 +2179,15 @@ void IWAParser::parsePageMaster(unsigned id, PageMaster &pageMaster) if (!hideHeaderOnFirstPage) props.put<property::FirstPageMaster>(pMaster); } - pageMaster.m_style = std::make_shared<IWORKStyle>(props, none, none); - auto dataRef=readRef(get(msg),29); - if (dataRef) + // readRef(get(msg),30); type 10016, field 1 a bool, [field 2] a ref to type 3047 + const IWAMessageField &background = get(msg).message(30); + if (background) { - // useme: type 10016, field 1 a bool, [field 2] a ref to type 3047 + IWORKFill fill; + if (readFill(get(background), fill)) + props.put<property::Fill>(fill); } + pageMaster.m_style = std::make_shared<IWORKStyle>(props, none, none); } void IWAParser::parseHeaderAndFooter(unsigned id, IWORKPageMaster &hf) diff --git a/src/lib/PAGCollector.cpp b/src/lib/PAGCollector.cpp index 4cbea2b..2cede83 100644 --- a/src/lib/PAGCollector.cpp +++ b/src/lib/PAGCollector.cpp @@ -414,8 +414,19 @@ void PAGCollector::flushPageSpan(const bool writeEmpty) props.insert("fo:margin-top", get(page.m_marginTop), librevenge::RVNG_POINT); //TODO set also the header/footer height here } - IWORKOutputElements text; + if (m_currentSectionStyle && m_currentSectionStyle->has<property::Fill>()) + { + librevenge::RVNGPropertyList fillProps; + writeFill(m_currentSectionStyle->get<property::Fill>(), fillProps); + if (fillProps["draw:fill-color"] && fillProps["draw:fill"] && fillProps["draw:fill"]->getStr()=="solid") + props.insert("fo:background-color", fillProps["draw:fill-color"]->clone()); + else + { + ETONYEK_DEBUG_MSG(("PAGCollector::flushPageSpan: unimplemented background\n")); + } + } + IWORKOutputElements text; if (bool(m_currentText)) { m_currentText->draw(text); |