From: Fridrich S. <str...@us...> - 2008-11-27 14:16:15
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3822/filter Modified Files: OdgExporter.cxx OdgExporter.hxx Log Message: adapt to the fact that WPGPoint went Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- OdgExporter.cxx 25 Nov 2008 12:03:57 -0000 1.21 +++ OdgExporter.cxx 27 Nov 2008 14:16:00 -0000 1.22 @@ -258,11 +258,11 @@ mxFillRule = rule; } -void OdgExporter::startLayer(unsigned int /* id */) +void OdgExporter::startLayer(const ::WPXPropertyList & /* propList */) { } -void OdgExporter::endLayer(unsigned int) +void OdgExporter::endLayer() { } @@ -288,35 +288,42 @@ mBodyElements.push_back(new TagCloseElement("draw:rect")); } -void OdgExporter::drawEllipse(const libwpg::WPGPoint& center, double rx, double ry, double rotation, const libwpg::WPGPoint& from, const libwpg::WPGPoint& to) +void OdgExporter::drawEllipse(const ::WPXPropertyList &propList) { writeGraphicsStyle(); TagOpenElement *pDrawEllipseElement = new TagOpenElement("draw:ellipse"); WPXString sValue; sValue.sprintf("gr%i", miGraphicsStyleIndex-1); pDrawEllipseElement->addAttribute("draw:style-name", sValue); - sValue = doubleToString(2 * rx); sValue.append("in"); + sValue = doubleToString(2 * propList["svg:rx"]->getFloat()); sValue.append("in"); pDrawEllipseElement->addAttribute("svg:width", sValue); - sValue = doubleToString(2 * ry); sValue.append("in"); + sValue = doubleToString(2 * propList["svg:ry"]->getFloat()); sValue.append("in"); pDrawEllipseElement->addAttribute("svg:height", sValue); - if (rotation != 0.0) + if (propList["libwpg:rotate"] && propList["libwpg:rotate"]->getFloat() != 0.0) { + double rotation = propList["libwpg:rotate"]->getFloat(); while(rotation < -180) rotation += 360; while(rotation > 180) rotation -= 360; double radrotation = rotation*M_PI/180.0; - double deltax = sqrt(pow(rx, 2.0) + pow(ry, 2.0))*cos(atan(ry/rx) - radrotation ) - rx; - double deltay = sqrt(pow(rx, 2.0) + pow(ry, 2.0))*sin(atan(ry/rx) - radrotation ) - ry; + double deltax = sqrt(pow(propList["svg:rx"]->getFloat(), 2.0) + + pow(propList["svg:ry"]->getFloat(), 2.0))*cos(atan(propList["svg:ry"]->getFloat()/propList["svg:rx"]->getFloat()) + - radrotation ) - propList["svg:rx"]->getFloat(); + double deltay = sqrt(pow(propList["svg:rx"]->getFloat(), 2.0) + + pow(propList["svg:ry"]->getFloat(), 2.0))*sin(atan(propList["svg:ry"]->getFloat()/propList["svg:rx"]->getFloat()) + - radrotation ) - propList["svg:ry"]->getFloat(); sValue = "rotate("; sValue.append(doubleToString(radrotation)); sValue.append(") "); - sValue.append("translate("); sValue.append(doubleToString(center.x - rx - deltax)); sValue.append("in, "); sValue.append(doubleToString(center.y - ry - deltay)); sValue.append("in)"); + sValue.append("translate("); sValue.append(doubleToString(propList["svg:cx"]->getFloat() - propList["svg:rx"]->getFloat() - deltax)); + sValue.append("in, "); + sValue.append(doubleToString(propList["svg:cy"]->getFloat() - propList["svg:ry"]->getFloat() - deltay)); sValue.append("in)"); pDrawEllipseElement->addAttribute("svg:transform", sValue); } else { - sValue = doubleToString(center.x-rx); sValue.append("in"); + sValue = doubleToString(propList["svg:cx"]->getFloat()-propList["svg:rx"]->getFloat()); sValue.append("in"); pDrawEllipseElement->addAttribute("svg:x", sValue); - sValue = doubleToString(center.y-ry); sValue.append("in"); + sValue = doubleToString(propList["svg:cy"]->getFloat()-propList["svg:ry"]->getFloat()); sValue.append("in"); pDrawEllipseElement->addAttribute("svg:y", sValue); } mBodyElements.push_back(pDrawEllipseElement); Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.hxx,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- OdgExporter.hxx 25 Nov 2008 12:03:57 -0000 1.8 +++ OdgExporter.hxx 27 Nov 2008 14:16:00 -0000 1.9 @@ -42,8 +42,8 @@ void startGraphics(const ::WPXPropertyList &propList); void endGraphics(); - void startLayer(unsigned int id); - void endLayer(unsigned int id); + void startLayer(const ::WPXPropertyList &propList); + void endLayer(); void startEmbeddedGraphics(const ::WPXPropertyList& /*propList*/) {} void endEmbeddedGraphics() {} @@ -52,7 +52,7 @@ void setFillRule(FillRule rule); void drawRectangle(const libwpg::WPGRect& rect, double rx, double ry); - void drawEllipse(const libwpg::WPGPoint& center, double rx, double ry, double rotation, const libwpg::WPGPoint& from, const libwpg::WPGPoint& to); + void drawEllipse(const ::WPXPropertyList &propList); void drawPolyline(const ::WPXPropertyListVector& vertices); void drawPolygon(const ::WPXPropertyListVector& vertices); void drawPath(const ::WPXPropertyListVector& path); |