diff options
author | ALONSO Laurent <laurent.alonso@inria.fr> | 2019-04-03 14:29:10 +0200 |
---|---|---|
committer | ALONSO Laurent <laurent.alonso@inria.fr> | 2019-04-03 14:29:10 +0200 |
commit | edb6cbdd5981b3e77e98d70a913f4847c63134fa (patch) | |
tree | 0b0fce3379cfe522facd094e68bc5813b153bb6c | |
parent | 8b5c77bbbce760eaea7aa7dc19b69fceeb32ad67 (diff) |
iwa[pages]: retrieve headers/footers even if the document is empty.
Change-Id: If141c01a3a0737ced5ba4bbf9902985cf4c09e9a
-rw-r--r-- | src/lib/IWAParser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/IWAParser.cpp b/src/lib/IWAParser.cpp index d83fb34..8616a04 100644 --- a/src/lib/IWAParser.cpp +++ b/src/lib/IWAParser.cpp @@ -586,10 +586,12 @@ bool IWAParser::parseText(const unsigned id, const std::function<void(unsigned, } std::multimap<unsigned, std::function<void(unsigned, bool &)> > attachments; const IWAStringField &text = get(msg).string(3); - if (text) + if (text || (openPageFunction && get(msg).message(17))) { - IWAText textParser(get(text), m_langManager); - const size_t length = get(text).size(); + // special case, when the document is empty and openPageFunction is + // defined, we still need to retrieve the headers/footers + IWAText textParser(get_optional_value_or(text," "), m_langManager); + const size_t length = text ? get(text).size() : 1; if (get(msg).message(5)) { |