diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-12-11 15:56:43 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-12-11 15:56:43 +0100 |
commit | b3ad8caf742e3ae44f36d4145608236d40d69cd5 (patch) | |
tree | 402ea643042541cd47ad0f157cf675d3bb14d811 | |
parent | 257e1896942a7028f1d0669ac6d4f61f294cb14d (diff) |
Trying to support initially Text Fields
-rw-r--r-- | src/lib/VSD5Parser.cpp | 16 | ||||
-rw-r--r-- | src/lib/VSD5Parser.h | 1 | ||||
-rw-r--r-- | src/lib/VSD6Parser.cpp | 7 | ||||
-rw-r--r-- | src/lib/VSD6Parser.h | 4 | ||||
-rw-r--r-- | src/lib/VSDParser.cpp | 6 |
5 files changed, 25 insertions, 9 deletions
diff --git a/src/lib/VSD5Parser.cpp b/src/lib/VSD5Parser.cpp index c8a28dc..55351b1 100644 --- a/src/lib/VSD5Parser.cpp +++ b/src/lib/VSD5Parser.cpp @@ -406,6 +406,22 @@ void libvisio::VSD5Parser::readTextBlock(WPXInputStream *input) verticalAlign, isBgFilled, c, 0.0, (unsigned char)0)); } +void libvisio::VSD5Parser::readTextField(WPXInputStream *input) +{ + input->seek(3, WPX_SEEK_CUR); + if (0xe8 == readU8(input)) + { + int nameId = readS16(input); + m_shape.m_fields.addTextField(m_header.id, m_header.level, nameId, 0xffff); + } + else + { + double numericValue = readDouble(input); + m_shape.m_fields.addNumericField(m_header.id, m_header.level, 0xffff, numericValue, 0xffff); + } +} + + unsigned libvisio::VSD5Parser::getUInt(WPXInputStream *input) { int value = readS16(input); diff --git a/src/lib/VSD5Parser.h b/src/lib/VSD5Parser.h index 9cf39c2..ceb73d6 100644 --- a/src/lib/VSD5Parser.h +++ b/src/lib/VSD5Parser.h @@ -63,6 +63,7 @@ protected: virtual void readFillAndShadow(WPXInputStream *input); virtual void readTextBlock(WPXInputStream *input); virtual void readCharIX(WPXInputStream *input); + virtual void readTextField(WPXInputStream *input); virtual void readShape(WPXInputStream *input); virtual void readPage(WPXInputStream *input); diff --git a/src/lib/VSD6Parser.cpp b/src/lib/VSD6Parser.cpp index 0a4f83e..335872c 100644 --- a/src/lib/VSD6Parser.cpp +++ b/src/lib/VSD6Parser.cpp @@ -269,16 +269,16 @@ void libvisio::VSD6Parser::readTextField(WPXInputStream *input) unsigned char tmpCode = readU8(input); if (tmpCode == 0xe8) { - int nameId = (int)readU32(input); + int nameId = readS32(input); input->seek(6, WPX_SEEK_CUR); - int formatStringId = (int)readU32(input); + int formatStringId = readS32(input); m_shape.m_fields.addTextField(m_header.id, m_header.level, nameId, formatStringId); } else { double numericValue = readDouble(input); input->seek(2, WPX_SEEK_CUR); - int formatStringId = (int)readU32(input); + int formatStringId = readS32(input); unsigned blockIdx = 0; unsigned length = 0; @@ -331,5 +331,4 @@ void libvisio::VSD6Parser::readTextField(WPXInputStream *input) } } - /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ diff --git a/src/lib/VSD6Parser.h b/src/lib/VSD6Parser.h index 219894f..6550324 100644 --- a/src/lib/VSD6Parser.h +++ b/src/lib/VSD6Parser.h @@ -53,8 +53,8 @@ private: virtual void readCharIX(WPXInputStream *input); virtual void readParaIX(WPXInputStream *input); virtual void readFillAndShadow(WPXInputStream *input); - void readName(WPXInputStream *input); - void readTextField(WPXInputStream *input); + virtual void readName(WPXInputStream *input); + virtual void readTextField(WPXInputStream *input); VSD6Parser(); VSD6Parser(const VSDParser &); diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp index d56674a..e649c56 100644 --- a/src/lib/VSDParser.cpp +++ b/src/lib/VSDParser.cpp @@ -1730,16 +1730,16 @@ void libvisio::VSDParser::readTextField(WPXInputStream *input) unsigned char tmpCode = readU8(input); if (tmpCode == 0xe8) { - int nameId = (int)readU32(input); + int nameId = readS32(input); input->seek(6, WPX_SEEK_CUR); - int formatStringId = (int)readU32(input); + int formatStringId = readS32(input); m_shape.m_fields.addTextField(m_header.id, m_header.level, nameId, formatStringId); } else { double numericValue = readDouble(input); input->seek(2, WPX_SEEK_CUR); - int formatStringId = (int)readU32(input); + int formatStringId = readS32(input); unsigned blockIdx = 0; unsigned length = 0; |