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

Fridrich Å trba fridrich.strba at bluewin.ch
Thu Nov 14 05:26:44 PST 2013


 src/lib/CDRContentCollector.cpp  |    4 ++--
 src/lib/CDROutputElementList.cpp |   15 +++++++--------
 src/lib/CDROutputElementList.h   |    2 +-
 src/lib/CMXParser.cpp            |   12 ++++++------
 4 files changed, 16 insertions(+), 17 deletions(-)

New commits:
commit 77f866cd44b3c024ee64fe050d7ae6f55a5a8784
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu Nov 14 14:26:20 2013 +0100

    Adapt to API change in librevenge
    
    Change-Id: I70254919ee04d9111ef12552c113b3cc0064ab01

diff --git a/src/lib/CDRContentCollector.cpp b/src/lib/CDRContentCollector.cpp
index b83cffa..4dd59ee 100644
--- a/src/lib/CDRContentCollector.cpp
+++ b/src/lib/CDRContentCollector.cpp
@@ -357,8 +357,8 @@ void libcdr::CDRContentCollector::_flushCurrentPath()
       propList.insert("librevenge:rotate", rotate * 180 / M_PI, librevenge::RVNG_GENERIC);
 
     propList.insert("librevenge:mime-type", "image/bmp");
-
-    outputElement.addGraphicObject(propList, m_currentImage.getImage());
+    propList.insert("office:binary-data", m_currentImage.getImage());
+    outputElement.addGraphicObject(propList);
   }
   if (m_currentText && !m_currentText->empty())
   {
diff --git a/src/lib/CDROutputElementList.cpp b/src/lib/CDROutputElementList.cpp
index c34224f..9773ef2 100644
--- a/src/lib/CDROutputElementList.cpp
+++ b/src/lib/CDROutputElementList.cpp
@@ -76,16 +76,15 @@ private:
 class CDRGraphicObjectOutputElement : public CDROutputElement
 {
 public:
-  CDRGraphicObjectOutputElement(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGBinaryData &binaryData);
+  CDRGraphicObjectOutputElement(const librevenge::RVNGPropertyList &propList);
   virtual ~CDRGraphicObjectOutputElement() {}
   virtual void draw(librevenge::RVNGDrawingInterface *painter);
   virtual CDROutputElement *clone()
   {
-    return new CDRGraphicObjectOutputElement(m_propList, m_binaryData);
+    return new CDRGraphicObjectOutputElement(m_propList);
   }
 private:
   librevenge::RVNGPropertyList m_propList;
-  librevenge::RVNGBinaryData m_binaryData;
 };
 
 
@@ -237,13 +236,13 @@ void libcdr::CDRPathOutputElement::draw(librevenge::RVNGDrawingInterface *painte
 }
 
 
-libcdr::CDRGraphicObjectOutputElement::CDRGraphicObjectOutputElement(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGBinaryData &binaryData) :
-  m_propList(propList), m_binaryData(binaryData) {}
+libcdr::CDRGraphicObjectOutputElement::CDRGraphicObjectOutputElement(const librevenge::RVNGPropertyList &propList) :
+  m_propList(propList) {}
 
 void libcdr::CDRGraphicObjectOutputElement::draw(librevenge::RVNGDrawingInterface *painter)
 {
   if (painter)
-    painter->drawGraphicObject(m_propList, m_binaryData);
+    painter->drawGraphicObject(m_propList);
 }
 
 
@@ -380,9 +379,9 @@ void libcdr::CDROutputElementList::addPath(const librevenge::RVNGPropertyListVec
   m_elements.push_back(new CDRPathOutputElement(propListVec));
 }
 
-void libcdr::CDROutputElementList::addGraphicObject(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGBinaryData &binaryData)
+void libcdr::CDROutputElementList::addGraphicObject(const librevenge::RVNGPropertyList &propList)
 {
-  m_elements.push_back(new CDRGraphicObjectOutputElement(propList, binaryData));
+  m_elements.push_back(new CDRGraphicObjectOutputElement(propList));
 }
 
 void libcdr::CDROutputElementList::addStartTextObject(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGPropertyListVector &propListVec)
diff --git a/src/lib/CDROutputElementList.h b/src/lib/CDROutputElementList.h
index 9c77e9e..1289aa0 100644
--- a/src/lib/CDROutputElementList.h
+++ b/src/lib/CDROutputElementList.h
@@ -51,7 +51,7 @@ public:
   void draw(librevenge::RVNGDrawingInterface *painter) const;
   void addStyle(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGPropertyListVector &propListVec);
   void addPath(const librevenge::RVNGPropertyListVector &propListVec);
-  void addGraphicObject(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGBinaryData &binaryData);
+  void addGraphicObject(const librevenge::RVNGPropertyList &propList);
   void addStartTextObject(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGPropertyListVector &propListVec);
   void addOpenParagraph(const librevenge::RVNGPropertyList &propList, const librevenge::RVNGPropertyListVector &propListVec);
   void addOpenSpan(const librevenge::RVNGPropertyList &propList);
diff --git a/src/lib/CMXParser.cpp b/src/lib/CMXParser.cpp
index 7ae9c9f..1c0d65f 100644
--- a/src/lib/CMXParser.cpp
+++ b/src/lib/CMXParser.cpp
@@ -209,18 +209,18 @@ void libcdr::CMXParser::readCMXHeader(librevenge::RVNGInputStream *input)
 void libcdr::CMXParser::readDisp(librevenge::RVNGInputStream *input, unsigned length)
 {
   librevenge::RVNGBinaryData previewImage;
-  previewImage.append(0x42);
-  previewImage.append(0x4d);
+  previewImage.append((unsigned char)0x42);
+  previewImage.append((unsigned char)0x4d);
 
   previewImage.append((unsigned char)((length+8) & 0x000000ff));
   previewImage.append((unsigned char)(((length+8) & 0x0000ff00) >> 8));
   previewImage.append((unsigned char)(((length+8) & 0x00ff0000) >> 16));
   previewImage.append((unsigned char)(((length+8) & 0xff000000) >> 24));
 
-  previewImage.append(0x00);
-  previewImage.append(0x00);
-  previewImage.append(0x00);
-  previewImage.append(0x00);
+  previewImage.append((unsigned char)0x00);
+  previewImage.append((unsigned char)0x00);
+  previewImage.append((unsigned char)0x00);
+  previewImage.append((unsigned char)0x00);
 
   long startPosition = input->tell();
   input->seek(0x18, librevenge::RVNG_SEEK_CUR);


More information about the Libreoffice-commits mailing list