From: Fridrich S. <str...@us...> - 2009-09-07 15:17:04
|
Update of /cvsroot/libwpg/perfectspot/src/odg In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15132/src/odg Modified Files: OdgExporter.cxx OdgExporter.hxx Log Message: adapting perfectspot to the status of the libwpg code Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpg/perfectspot/src/odg/OdgExporter.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- OdgExporter.cxx 5 Dec 2008 15:18:24 -0000 1.11 +++ OdgExporter.cxx 7 Sep 2009 15:16:52 -0000 1.12 @@ -242,10 +242,9 @@ mpHandler->endDocument(); } -void OdgExporter::setStyle(const libwpg::WPGDashArray& pen, const libwpg::WPGGradient& gradient, const ::WPXPropertyList & propList) +void OdgExporter::setStyle(const ::WPXPropertyListVector& gradient, const ::WPXPropertyList & propList) { mxStyle = propList; - mxDashArray = pen; mxGradient = gradient; } @@ -495,7 +494,7 @@ void OdgExporter::writeGraphicsStyle() { - if(!(mxStyle["libwpg:stroke-solid"] && mxStyle["libwpg:stroke-solid"]->getInt()) && (mxDashArray.count() >=2 ) ) + if(!mxStyle["libwpg:stroke-solid"]->getInt() && (mxDashArray.count() >=2 ) ) { // ODG only supports dashes with the same length of spaces inbetween // here we take the first space and assume everything else the same @@ -532,7 +531,7 @@ pDrawGradientElement->addAttribute("draw:name", sValue); // ODG angle unit is 0.1 degree - double angle = -mxGradient.angle(); + double angle = mxStyle["draw:angle"] ? -mxStyle["draw:angle"]->getDouble() : 0.0; while(angle < 0) angle += 360; while(angle > 360) @@ -541,8 +540,8 @@ sValue.sprintf("%i", (unsigned)(angle*10)); pDrawGradientElement->addAttribute("draw:angle", sValue); - pDrawGradientElement->addAttribute("draw:start-color", mxGradient.stopColor(0).cstr()); - pDrawGradientElement->addAttribute("draw:end-color", mxGradient.stopColor(1).cstr()); + pDrawGradientElement->addAttribute("draw:start-color", mxGradient[0]["svg:stop-color"]->getStr().cstr()); + pDrawGradientElement->addAttribute("draw:end-color", mxGradient[1]["svg:stop-color"]->getStr().cstr()); pDrawGradientElement->addAttribute("draw:start-intensity", "100%"); pDrawGradientElement->addAttribute("draw:end-intensity", "100%"); pDrawGradientElement->addAttribute("draw:border", "0%"); @@ -562,7 +561,8 @@ if(!(mxStyle["draw:stroke"] && mxStyle["draw:stroke"]->getStr() == "none") && mxStyle["svg:stroke-width"] && mxStyle["svg:stroke-width"]->getDouble() > 0.0) { - pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-width", mxStyle["svg:stroke-width"]->getStr()); + if (mxStyle["svg:stroke-width"]) + pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-width", mxStyle["svg:stroke-width"]->getStr()); if (mxStyle["svg:stroke-color"]) pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-color", mxStyle["svg:stroke-color"]->getStr()); @@ -570,7 +570,9 @@ pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-opacity", mxStyle["svg:stroke-opacity"]->getStr()); - if(!mxStyle["libwpg:stroke-solid"] || !mxStyle["libwpg:stroke-solid"]->getInt()) + if(mxStyle["libwpg:stroke-solid"] && mxStyle["libwpg:stroke-solid"]->getInt()) + pStyleGraphicsPropertiesElement->addAttribute("draw:stroke", "solid"); + else { pStyleGraphicsPropertiesElement->addAttribute("draw:stroke", "dash"); sValue.sprintf("Dash_%i", miDashIndex-1); Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpg/perfectspot/src/odg/OdgExporter.hxx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- OdgExporter.hxx 5 Dec 2008 15:18:24 -0000 1.7 +++ OdgExporter.hxx 7 Sep 2009 15:16:52 -0000 1.8 @@ -22,7 +22,6 @@ /* "This product is not manufactured, approved, or supported by * Corel Corporation or Corel Corporation Limited." */ - #ifndef __ODGEXPORTER_HXX__ #define __ODGEXPORTER_HXX__ @@ -47,7 +46,7 @@ void startEmbeddedGraphics(const ::WPXPropertyList& /*propList*/) {} void endEmbeddedGraphics() {} - void setStyle(const libwpg::WPGDashArray& dashArray, const libwpg::WPGGradient& gradient, const ::WPXPropertyList &propList); + void setStyle(const ::WPXPropertyListVector& gradient, const ::WPXPropertyList &propList); void drawRectangle(const ::WPXPropertyList &propList); void drawEllipse(const ::WPXPropertyList &propList); @@ -73,7 +72,7 @@ ::WPXPropertyList mxStyle; libwpg::WPGDashArray mxDashArray; - libwpg::WPGGradient mxGradient; + ::WPXPropertyListVector mxGradient; int miGradientIndex; int miDashIndex; int miGraphicsStyleIndex; |