[Libreoffice-commits] libcdr.git: src/lib

Fridrich Štrba fridrich.strba at bluewin.ch
Sat Jul 2 17:34:27 UTC 2016


 src/lib/CMXParser.cpp |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/lib/CMXParser.h   |    1 
 2 files changed, 56 insertions(+)

New commits:
commit 6c1e337b20f11b86e5356cc4b43ad0f715e77326
Author: Fridrich Štrba <fridrich.strba at bluewin.ch>
Date:   Sat Jul 2 19:34:03 2016 +0200

    rotl reader
    
    Change-Id: I545b82951cb7af6338be16d134ed821deb24320e

diff --git a/src/lib/CMXParser.cpp b/src/lib/CMXParser.cpp
index 3ac725b..2d8459c 100644
--- a/src/lib/CMXParser.cpp
+++ b/src/lib/CMXParser.cpp
@@ -133,6 +133,9 @@ void libcdr::CMXParser::readRecord(unsigned fourCC, unsigned &length, librevenge
   case CDR_FOURCC_rott:
     readRott(input);
     break;
+  case CDR_FOURCC_rotl:
+    readRotl(input);
+    break;
   case CDR_FOURCC_rpen:
     readRpen(input);
     break;
@@ -1237,6 +1240,58 @@ void libcdr::CMXParser::readRott(librevenge::RVNGInputStream *input)
   }
 }
 
+void libcdr::CMXParser::readRotl(librevenge::RVNGInputStream *input)
+{
+  unsigned numRecords = readU16(input, m_bigEndian);
+  CDR_DEBUG_MSG(("CMXParser::readRotl - numRecords %i\n", numRecords));
+  for (unsigned j = 1; j < numRecords+1; ++j)
+  {
+    CMXOutline outline;
+    if (m_precision == libcdr::PRECISION_32BIT)
+    {
+      unsigned char tagId = 0;
+      do
+      {
+        long offset = input->tell();
+        tagId = readU8(input, m_bigEndian);
+        if (tagId == CMX_Tag_EndTag)
+          break;
+        unsigned short tagLength = readU16(input, m_bigEndian);
+        switch (tagId)
+        {
+        case CMX_Tag_DescrSection_Outline:
+        {
+          outline.m_lineStyle = readU16(input, m_bigEndian);
+          outline.m_screen = readU16(input, m_bigEndian);
+          outline.m_color = readU16(input, m_bigEndian);
+          outline.m_arrowHeads = readU16(input, m_bigEndian);
+          outline.m_pen = readU16(input, m_bigEndian);
+          outline.m_dotDash = readU16(input, m_bigEndian);
+          break;
+        }
+        default:
+          break;
+        }
+        input->seek(offset+tagLength, librevenge::RVNG_SEEK_SET);
+      }
+      while (tagId != CMX_Tag_EndTag);
+    }
+    else if (m_precision == libcdr::PRECISION_16BIT)
+    {
+      outline.m_lineStyle = readU16(input, m_bigEndian);
+      outline.m_screen = readU16(input, m_bigEndian);
+      outline.m_color = readU16(input, m_bigEndian);
+      outline.m_arrowHeads = readU16(input, m_bigEndian);
+      outline.m_pen = readU16(input, m_bigEndian);
+      outline.m_dotDash = readU16(input, m_bigEndian);
+      break;
+    }
+    else
+      return;
+    m_parserState.m_outlines[j] = outline;
+  }
+}
+
 void libcdr::CMXParser::readRpen(librevenge::RVNGInputStream *input)
 {
   unsigned numRecords = readU16(input, m_bigEndian);
diff --git a/src/lib/CMXParser.h b/src/lib/CMXParser.h
index 48bc4e4..c858798 100644
--- a/src/lib/CMXParser.h
+++ b/src/lib/CMXParser.h
@@ -84,6 +84,7 @@ private:
   void readCcmm(librevenge::RVNGInputStream *input, long &recordEnd);
   void readPage(librevenge::RVNGInputStream *input, unsigned length);
   void readRclr(librevenge::RVNGInputStream *input);
+  void readRotl(librevenge::RVNGInputStream *input);
   void readRott(librevenge::RVNGInputStream *input);
   void readRdot(librevenge::RVNGInputStream *input);
   void readRpen(librevenge::RVNGInputStream *input);


More information about the Libreoffice-commits mailing list