Commit 9b777d1b authored by Volker Krause's avatar Volker Krause
Browse files

Delay considering the U_HEAD issuing time as context time

It's certainly better than nothing, but it doesn't contain a timezone,
while the enclosing PDF document can.

This is inspired by similar handling for the pkpass relevant date field.
parent 95e26ee7
...@@ -35,11 +35,18 @@ ExtractorDocumentNode Uic9183DocumentProcessor::createNodeFromData(const QByteAr ...@@ -35,11 +35,18 @@ ExtractorDocumentNode Uic9183DocumentProcessor::createNodeFromData(const QByteAr
ExtractorDocumentNode node; ExtractorDocumentNode node;
node.setContent(p); node.setContent(p);
return node;
}
void Uic9183DocumentProcessor::expandNode(ExtractorDocumentNode &node, [[maybe_unused]] const ExtractorEngine *engine) const
{
// only use the U_HEAD issuing time as context if we have nothing better
// while that is usually correct it cannot contain a time zone, unlike the (often) enclosing PDF document´
if (!node.contextDateTime().isValid()) {
const auto p = node.content<Uic9183Parser>();
const auto u_head = p.findBlock<Uic9183Head>(); const auto u_head = p.findBlock<Uic9183Head>();
node.setContextDateTime(u_head.issuingDateTime()); node.setContextDateTime(u_head.issuingDateTime());
}
return node;
} }
void Uic9183DocumentProcessor::preExtract(ExtractorDocumentNode &node, [[maybe_unused]] const ExtractorEngine *engine) const void Uic9183DocumentProcessor::preExtract(ExtractorDocumentNode &node, [[maybe_unused]] const ExtractorEngine *engine) const
......
...@@ -17,6 +17,7 @@ class Uic9183DocumentProcessor : public ExtractorDocumentProcessor ...@@ -17,6 +17,7 @@ class Uic9183DocumentProcessor : public ExtractorDocumentProcessor
public: public:
bool canHandleData(const QByteArray &encodedData, QStringView fileName) const override; bool canHandleData(const QByteArray &encodedData, QStringView fileName) const override;
ExtractorDocumentNode createNodeFromData(const QByteArray &encodedData) const override; ExtractorDocumentNode createNodeFromData(const QByteArray &encodedData) const override;
void expandNode(ExtractorDocumentNode &node, const ExtractorEngine *engine) const override;
void preExtract(ExtractorDocumentNode &node, const ExtractorEngine *engine) const override; void preExtract(ExtractorDocumentNode &node, const ExtractorEngine *engine) const override;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment