From: Fridrich S. <str...@us...> - 2008-11-27 16:35:14
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16445/filter Modified Files: OdgExporter.cxx OdgExporter.hxx Log Message: adapt to the absence of WPGRect and to the WPGBitmap API changes Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- OdgExporter.cxx 27 Nov 2008 14:16:00 -0000 1.22 +++ OdgExporter.cxx 27 Nov 2008 16:35:08 -0000 1.23 @@ -266,24 +266,19 @@ { } -void OdgExporter::drawRectangle(const libwpg::WPGRect& rect, double rx, double /* ry */) +void OdgExporter::drawRectangle(const ::WPXPropertyList &propList) { writeGraphicsStyle(); TagOpenElement *pDrawRectElement = new TagOpenElement("draw:rect"); WPXString sValue; sValue.sprintf("gr%i", miGraphicsStyleIndex-1); pDrawRectElement->addAttribute("draw:style-name", sValue); - sValue = doubleToString(rect.x1); sValue.append("in"); - pDrawRectElement->addAttribute("svg:x", sValue); - sValue = doubleToString(rect.y1); sValue.append("in"); - pDrawRectElement->addAttribute("svg:y", sValue); - sValue = doubleToString(rect.width()); sValue.append("in"); - pDrawRectElement->addAttribute("svg:width", sValue); - sValue = doubleToString(rect.height()); sValue.append("in"); - pDrawRectElement->addAttribute("svg:height", sValue); - sValue = doubleToString(rx); sValue.append("in"); + pDrawRectElement->addAttribute("svg:x", propList["svg:x"]->getStr()); + pDrawRectElement->addAttribute("svg:y", propList["svg:y"]->getStr()); + pDrawRectElement->addAttribute("svg:width", propList["svg:width"]->getStr()); + pDrawRectElement->addAttribute("svg:height", propList["svg:height"]->getStr()); // FIXME: what to do when rx != ry ? - pDrawRectElement->addAttribute("draw:corner-radius", sValue); + pDrawRectElement->addAttribute("draw:corner-radius", propList["svg:rx"]->getStr()); mBodyElements.push_back(pDrawRectElement); mBodyElements.push_back(new TagCloseElement("draw:rect")); } @@ -469,26 +464,20 @@ mBodyElements.push_back(new TagCloseElement("draw:path")); } -void OdgExporter::drawBitmap(const libwpg::WPGBitmap& bitmap) +void OdgExporter::drawBitmap(const ::WPXPropertyList &propList, const libwpg::WPGBitmap& bitmap) { TagOpenElement *pDrawFrameElement = new TagOpenElement("draw:frame"); - WPXString sValue; - sValue = doubleToString(bitmap.rect.x1); sValue.append("in"); - pDrawFrameElement->addAttribute("svg:x", sValue); - sValue = doubleToString(bitmap.rect.y1); sValue.append("in"); - pDrawFrameElement->addAttribute("svg:y", sValue); - sValue = doubleToString(bitmap.rect.height()); sValue.append("in"); - pDrawFrameElement->addAttribute("svg:height", sValue); - sValue = doubleToString(bitmap.rect.width()); sValue.append("in"); - pDrawFrameElement->addAttribute("svg:width", sValue); + pDrawFrameElement->addAttribute("svg:x", propList["svg:x"]->getStr()); + pDrawFrameElement->addAttribute("svg:y", propList["svg:y"]->getStr()); + pDrawFrameElement->addAttribute("svg:width", propList["svg:width"]->getStr()); + pDrawFrameElement->addAttribute("svg:height", propList["svg:height"]->getStr()); mBodyElements.push_back(pDrawFrameElement); mBodyElements.push_back(new TagOpenElement("draw:image")); mBodyElements.push_back(new TagOpenElement("office:binary-data")); - ::WPXString base64Binary; - bitmap.generateBase64DIB(base64Binary); + ::WPXString base64Binary = bitmap.getDIB().getBase64Data(); mBodyElements.push_back(new CharDataElement(base64Binary.cstr())); mBodyElements.push_back(new TagCloseElement("office:binary-data")); Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.hxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- OdgExporter.hxx 27 Nov 2008 14:16:00 -0000 1.9 +++ OdgExporter.hxx 27 Nov 2008 16:35:08 -0000 1.10 @@ -51,12 +51,12 @@ void setBrush(const libwpg::WPGBrush& brush); void setFillRule(FillRule rule); - void drawRectangle(const libwpg::WPGRect& rect, double rx, double ry); + void drawRectangle(const ::WPXPropertyList &propList); void drawEllipse(const ::WPXPropertyList &propList); void drawPolyline(const ::WPXPropertyListVector& vertices); void drawPolygon(const ::WPXPropertyListVector& vertices); void drawPath(const ::WPXPropertyListVector& path); - void drawBitmap(const libwpg::WPGBitmap& bitmap); + void drawBitmap(const ::WPXPropertyList &propList, const libwpg::WPGBitmap& bitmap); void drawImageObject(const ::WPXPropertyList &propList, const ::WPXBinaryData& binaryData); private: |