summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2016-04-18 20:50:00 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2016-04-18 20:50:00 +0200
commit21027b7349a17cc18f74b28e9f1b32358e47135f (patch)
treea46e996bc7c899392b49ec68ef694241edc3d4a6
parente30e70afdc4a12f2f9ec9e039b82f623447c34cf (diff)
Some reading of shape ids of shapes that a connector connects
Change-Id: I0492fea6ad37a590580ec2c2a05ef2e990f9efa1
-rw-r--r--src/lib/VSD6Parser.cpp35
-rw-r--r--src/lib/VSDParser.cpp40
2 files changed, 72 insertions, 3 deletions
diff --git a/src/lib/VSD6Parser.cpp b/src/lib/VSD6Parser.cpp
index 8f2bb0b..34cde71 100644
--- a/src/lib/VSD6Parser.cpp
+++ b/src/lib/VSD6Parser.cpp
@@ -401,11 +401,46 @@ void libvisio::VSD6Parser::readTextField(librevenge::RVNGInputStream *input)
void libvisio::VSD6Parser::readMisc(librevenge::RVNGInputStream *input)
{
+ unsigned long initialPosition = input->tell();
unsigned char flags = readU8(input);
if (flags & 0x20)
m_shape.m_misc.m_hideText = true;
else
m_shape.m_misc.m_hideText = false;
+
+ input->seek(initialPosition+23, librevenge::RVNG_SEEK_SET);
+ while (!input->isEnd() && (unsigned long) input->tell() < (unsigned long)(initialPosition+m_header.dataLength+m_header.trailer))
+ {
+ unsigned long inputPos = input->tell();
+ unsigned length = readU32(input);
+ if (!length)
+ break;
+ unsigned blockType = readU8(input);
+ input->seek(1, librevenge::RVNG_SEEK_CUR);
+ if (blockType == 2)
+ {
+ if (0x74 == readU8(input))
+ {
+ if (0x6000004e == readU32(input))
+ {
+ unsigned shapeId = readU32(input);
+ if (0x7a == readU8(input))
+ {
+ if (0x40000073 == readU32(input))
+ {
+ if (!m_shape.m_xform1d)
+ m_shape.m_xform1d = new XForm1D();
+ if (m_shape.m_xform1d->beginId == MINUS_ONE)
+ m_shape.m_xform1d->beginId = shapeId;
+ else if (m_shape.m_xform1d->endId == MINUS_ONE)
+ m_shape.m_xform1d->endId = shapeId;
+ }
+ }
+ }
+ }
+ }
+ input->seek(inputPos + length, librevenge::RVNG_SEEK_SET);
+ }
}
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp
index 22b356e..26b1d9c 100644
--- a/src/lib/VSDParser.cpp
+++ b/src/lib/VSDParser.cpp
@@ -1119,9 +1119,8 @@ void libvisio::VSDParser::readXFormData(librevenge::RVNGInputStream *input)
void libvisio::VSDParser::readXForm1D(librevenge::RVNGInputStream *input)
{
- if (m_shape.m_xform1d)
- delete m_shape.m_xform1d;
- m_shape.m_xform1d = new XForm1D();
+ if (!m_shape.m_xform1d)
+ m_shape.m_xform1d = new XForm1D();
input->seek(1, librevenge::RVNG_SEEK_CUR);
m_shape.m_xform1d->beginX = readDouble(input);
input->seek(1, librevenge::RVNG_SEEK_CUR);
@@ -2155,11 +2154,46 @@ void libvisio::VSDParser::readTextField(librevenge::RVNGInputStream *input)
void libvisio::VSDParser::readMisc(librevenge::RVNGInputStream *input)
{
+ unsigned long initialPosition = input->tell();
unsigned char flags = readU8(input);
if (flags & 0x20)
m_shape.m_misc.m_hideText = true;
else
m_shape.m_misc.m_hideText = false;
+
+ input->seek(initialPosition+45, librevenge::RVNG_SEEK_SET);
+ while (!input->isEnd() && (unsigned long) input->tell() < (unsigned long)(initialPosition+m_header.dataLength+m_header.trailer))
+ {
+ unsigned long inputPos = input->tell();
+ unsigned length = readU32(input);
+ if (!length)
+ break;
+ unsigned blockType = readU8(input);
+ input->seek(1, librevenge::RVNG_SEEK_CUR);
+ if (blockType == 2)
+ {
+ if (0x74 == readU8(input))
+ {
+ if (0x6000004e == readU32(input))
+ {
+ unsigned shapeId = readU32(input);
+ if (0x7a == readU8(input))
+ {
+ if (0x40000073 == readU32(input))
+ {
+ if (!m_shape.m_xform1d)
+ m_shape.m_xform1d = new XForm1D();
+ if (m_shape.m_xform1d->beginId == MINUS_ONE)
+ m_shape.m_xform1d->beginId = shapeId;
+ else if (m_shape.m_xform1d->endId == MINUS_ONE)
+ m_shape.m_xform1d->endId = shapeId;
+ }
+ }
+ }
+ }
+ }
+ input->seek(inputPos + length, librevenge::RVNG_SEEK_SET);
+ }
}
libvisio::Colour libvisio::VSDParser::_colourFromIndex(unsigned idx)