diff options
author | ALONSO Laurent <laurent.alonso@inria.fr> | 2019-04-04 10:54:36 +0200 |
---|---|---|
committer | ALONSO Laurent <laurent.alonso@inria.fr> | 2019-04-04 10:54:36 +0200 |
commit | 921877e614d03820fbd51d7a6c5689cde72304c9 (patch) | |
tree | 064da5702237c2e0a73346f4e3fb77f002cafc28 /src | |
parent | 1f490e3ba099f2435fe5c28372c4a9f4aed992e4 (diff) |
.iwa[all]: convert correctly the stroke type...
Change-Id: Ife97292cbe7bd0993bd420626f621b9202fd4c6f
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/IWAParser.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/lib/IWAParser.cpp b/src/lib/IWAParser.cpp index 8616a04..b275a0c 100644 --- a/src/lib/IWAParser.cpp +++ b/src/lib/IWAParser.cpp @@ -395,9 +395,20 @@ void IWAParser::readStroke(const IWAMessage &msg, IWORKStroke &stroke) stroke.m_pattern.m_type = IWORK_STROKE_TYPE_SOLID; if (msg.message(6).uint32(1)) { - const optional<IWORKStrokeType> &strokeType = convert<IWORKStrokeType>(get(msg.message(6).uint32(1))); - if (strokeType) - stroke.m_pattern.m_type = get(strokeType); + switch(get(msg.message(6).uint32(1))) { + default : + ETONYEK_DEBUG_MSG(("IWAParser::readStroke: unknown stroke value: %u", get(msg.message(6).uint32(1)))); + ETONYEK_FALLTHROUGH; + case 1: + stroke.m_pattern.m_type = IWORK_STROKE_TYPE_SOLID; + break; + case 0: + stroke.m_pattern.m_type = IWORK_STROKE_TYPE_DASHED; + break; + case 2: + stroke.m_pattern.m_type = IWORK_STROKE_TYPE_NONE; + break; + } } unsigned remaining = 0; if (msg.message(6).uint32(3)) |