You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
(28) |
Jul
(15) |
Aug
(23) |
Sep
(2) |
Oct
(13) |
Nov
(26) |
Dec
(30) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(1) |
Feb
(2) |
Mar
(5) |
Apr
(4) |
May
(70) |
Jun
(32) |
Jul
(27) |
Aug
(25) |
Sep
(8) |
Oct
(16) |
Nov
(30) |
Dec
(30) |
2007 |
Jan
(17) |
Feb
(7) |
Mar
(6) |
Apr
(36) |
May
(19) |
Jun
(82) |
Jul
(99) |
Aug
(44) |
Sep
(60) |
Oct
(106) |
Nov
(47) |
Dec
(37) |
2008 |
Jan
(5) |
Feb
(5) |
Mar
(4) |
Apr
(16) |
May
(2) |
Jun
|
Jul
(20) |
Aug
(5) |
Sep
|
Oct
(95) |
Nov
(104) |
Dec
(23) |
2009 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(1) |
Jun
(46) |
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Fridrich S. <str...@us...> - 2008-12-05 15:17:50
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12730/filter Modified Files: OdgExporter.cxx OdgExporter.hxx Log Message: committing work done in the train while having wireless access Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- OdgExporter.cxx 5 Dec 2008 00:55:05 -0000 1.31 +++ OdgExporter.cxx 5 Dec 2008 15:17:45 -0000 1.32 @@ -242,11 +242,11 @@ mpHandler->endDocument(); } -void OdgExporter::setStyle(const libwpg::WPGPen& pen, const libwpg::WPGBrush& brush, const ::WPXPropertyList & propList) +void OdgExporter::setStyle(const libwpg::WPGDashArray& dashArray, const libwpg::WPGGradient& gradient, const ::WPXPropertyList & propList) { mxStyle = propList; - mxPen = pen; - mxBrush = brush; + mxDashArray = dashArray; + mxGradient = gradient; } void OdgExporter::startLayer(const ::WPXPropertyList & /* propList */) @@ -495,12 +495,12 @@ void OdgExporter::writeGraphicsStyle() { - if(!mxPen.solid && (mxPen.dashArray.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 // note that dash length is written in percentage ????????????????? - double distance = mxPen.dashArray.at(1); + double distance = mxDashArray.at(1); TagOpenElement *pDrawStrokeDashElement = new TagOpenElement("draw:stroke-dash"); pDrawStrokeDashElement->addAttribute("draw:style", "rect"); WPXString sValue; @@ -511,19 +511,19 @@ WPXString sName; // We have to find out how to do this intelligently, since the ODF is allowing only // two pairs draw:dots1 draw:dots1-length and draw:dots2 draw:dots2-length - for(unsigned i = 0; i < mxPen.dashArray.count()/2 && i < 2; i++) + for(unsigned i = 0; i < mxDashArray.count()/2 && i < 2; i++) { sName.sprintf("draw:dots%i", i+1); pDrawStrokeDashElement->addAttribute(sName.cstr(), "1"); sName.sprintf("draw:dots%i-length", i+1); - sValue = doubleToString(mxPen.dashArray.at(i*2)); sValue.append("in"); + sValue = doubleToString(mxDashArray.at(i*2)); sValue.append("in"); pDrawStrokeDashElement->addAttribute(sName.cstr(), sValue); } mGraphicsStrokeDashStyles.push_back(pDrawStrokeDashElement); mGraphicsStrokeDashStyles.push_back(new TagCloseElement("draw:stroke-dash")); } - if(mxStyle["draw:fill"] && mxStyle["draw:fill"]->getStr() == "gradient") + if(mxStyle["draw:fill"] && mxStyle["draw:fill"]->getStr() == "gradient" && mxGradient.count() >= 2) { TagOpenElement *pDrawGradientElement = new TagOpenElement("draw:gradient"); pDrawGradientElement->addAttribute("draw:style", "linear"); @@ -532,7 +532,7 @@ pDrawGradientElement->addAttribute("draw:name", sValue); // ODG angle unit is 0.1 degree - double angle = -mxBrush.gradient.angle(); + double angle = -mxGradient.angle(); while(angle < 0) angle += 360; while(angle > 360) @@ -541,8 +541,8 @@ sValue.sprintf("%i", (unsigned)(angle*10)); pDrawGradientElement->addAttribute("draw:angle", sValue); - pDrawGradientElement->addAttribute("draw:start-color", mxBrush.gradient.stopColor(0).cstr()); - pDrawGradientElement->addAttribute("draw:end-color", mxBrush.gradient.stopColor(1).cstr()); + pDrawGradientElement->addAttribute("draw:start-color", mxGradient.stopColor(0).cstr()); + pDrawGradientElement->addAttribute("draw:end-color", mxGradient.stopColor(1).cstr()); pDrawGradientElement->addAttribute("draw:start-intensity", "100%"); pDrawGradientElement->addAttribute("draw:end-intensity", "100%"); pDrawGradientElement->addAttribute("draw:border", "0%"); @@ -560,14 +560,20 @@ TagOpenElement *pStyleGraphicsPropertiesElement = new TagOpenElement("style:graphic-properties"); - if(mxPen.width > 0.0) + if(!(mxStyle["draw:stroke"] && mxStyle["draw:stroke"]->getStr() == "none") && mxStyle["svg:stroke-width"] && mxStyle["svg:stroke-width"]->getDouble() > 0.0) { - sValue = doubleToString(mxPen.width); sValue.append("in"); - pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-width", sValue); + if (mxStyle["svg:stroke-width"]) + pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-width", mxStyle["svg:stroke-width"]->getStr()); - pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-color", mxPen.foreColor.cstr()); + if (mxStyle["svg:stroke-color"]) + pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-color", mxStyle["svg:stroke-color"]->getStr()); + if (mxStyle["svg:stroke-opacity"] && mxStyle["svg:stroke-opacity"]->getDouble() != 1.0) + pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-opacity", mxStyle["svg:stroke-opacity"]->getStr()); + - if(!mxPen.solid) + 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); @@ -583,7 +589,10 @@ if(mxStyle["draw:fill"] && mxStyle["draw:fill"]->getStr() == "solid") { pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "solid"); - pStyleGraphicsPropertiesElement->addAttribute("draw:fill-color", mxBrush.foreColor.cstr()); + if (mxStyle["draw:fill-color"]) + pStyleGraphicsPropertiesElement->addAttribute("draw:fill-color", mxStyle["draw:fill-color"]->getStr()); + if (mxStyle["draw:opacity"] && mxStyle["draw:opacity"]->getDouble() != 1.0) + pStyleGraphicsPropertiesElement->addAttribute("draw:opacity", mxStyle["draw:opacity"]->getStr()); } if(mxStyle["draw:fill"] && mxStyle["draw:fill"]->getStr() == "gradient") Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.hxx,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- OdgExporter.hxx 5 Dec 2008 00:55:05 -0000 1.14 +++ OdgExporter.hxx 5 Dec 2008 15:17:45 -0000 1.15 @@ -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::WPGPen& pen, const libwpg::WPGBrush& brush, const ::WPXPropertyList &propList); + void setStyle(const libwpg::WPGDashArray& dashArray, const libwpg::WPGGradient& gradient, const ::WPXPropertyList &propList); void drawRectangle(const ::WPXPropertyList &propList); void drawEllipse(const ::WPXPropertyList &propList); @@ -72,8 +71,8 @@ DocumentHandler *mpHandler; ::WPXPropertyList mxStyle; - libwpg::WPGPen mxPen; - libwpg::WPGBrush mxBrush; + libwpg::WPGDashArray mxDashArray; + libwpg::WPGGradient mxGradient; int miGradientIndex; int miDashIndex; int miGraphicsStyleIndex; |
From: Fridrich S. <str...@us...> - 2008-12-05 00:55:10
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21358/filter Modified Files: OdgExporter.cxx OdgExporter.hxx Log Message: WPGBrush::style went, so learn to live without it Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- OdgExporter.cxx 4 Dec 2008 23:19:26 -0000 1.30 +++ OdgExporter.cxx 5 Dec 2008 00:55:05 -0000 1.31 @@ -242,8 +242,9 @@ mpHandler->endDocument(); } -void OdgExporter::setStyle(const libwpg::WPGPen& pen, const libwpg::WPGBrush& brush, const ::WPXPropertyList & /*propList*/) +void OdgExporter::setStyle(const libwpg::WPGPen& pen, const libwpg::WPGBrush& brush, const ::WPXPropertyList & propList) { + mxStyle = propList; mxPen = pen; mxBrush = brush; } @@ -522,7 +523,7 @@ mGraphicsStrokeDashStyles.push_back(new TagCloseElement("draw:stroke-dash")); } - if(mxBrush.style == "gradient") + if(mxStyle["draw:fill"] && mxStyle["draw:fill"]->getStr() == "gradient") { TagOpenElement *pDrawGradientElement = new TagOpenElement("draw:gradient"); pDrawGradientElement->addAttribute("draw:style", "linear"); @@ -576,16 +577,16 @@ else pStyleGraphicsPropertiesElement->addAttribute("draw:stroke", "none"); - if(mxBrush.style == "none") + if(mxStyle["draw:fill"] && mxStyle["draw:fill"]->getStr() == "none") pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "none"); - if(mxBrush.style == "solid") + if(mxStyle["draw:fill"] && mxStyle["draw:fill"]->getStr() == "solid") { pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "solid"); pStyleGraphicsPropertiesElement->addAttribute("draw:fill-color", mxBrush.foreColor.cstr()); } - if(mxBrush.style == "gradient") + if(mxStyle["draw:fill"] && mxStyle["draw:fill"]->getStr() == "gradient") { pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "gradient"); sValue.sprintf("Gradient_%i", miGradientIndex-1); Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.hxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- OdgExporter.hxx 28 Nov 2008 12:26:16 -0000 1.13 +++ OdgExporter.hxx 5 Dec 2008 00:55:05 -0000 1.14 @@ -71,6 +71,7 @@ DocumentHandler *mpHandler; + ::WPXPropertyList mxStyle; libwpg::WPGPen mxPen; libwpg::WPGBrush mxBrush; int miGradientIndex; |
From: Fridrich S. <str...@us...> - 2008-12-04 23:19:31
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8084/filter Modified Files: OdgExporter.cxx Log Message: adapting to the removal of WPGColor.h from libwpg's API Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- OdgExporter.cxx 3 Dec 2008 23:10:04 -0000 1.29 +++ OdgExporter.cxx 4 Dec 2008 23:19:26 -0000 1.30 @@ -522,7 +522,7 @@ mGraphicsStrokeDashStyles.push_back(new TagCloseElement("draw:stroke-dash")); } - if(mxBrush.style == libwpg::WPGBrush::Gradient) + if(mxBrush.style == "gradient") { TagOpenElement *pDrawGradientElement = new TagOpenElement("draw:gradient"); pDrawGradientElement->addAttribute("draw:style", "linear"); @@ -564,7 +564,7 @@ sValue = doubleToString(mxPen.width); sValue.append("in"); pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-width", sValue); - pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-color", mxPen.foreColor.getColorString().cstr()); + pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-color", mxPen.foreColor.cstr()); if(!mxPen.solid) { @@ -576,16 +576,16 @@ else pStyleGraphicsPropertiesElement->addAttribute("draw:stroke", "none"); - if(mxBrush.style == libwpg::WPGBrush::NoBrush) + if(mxBrush.style == "none") pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "none"); - if(mxBrush.style == libwpg::WPGBrush::Solid) + if(mxBrush.style == "solid") { pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "solid"); - pStyleGraphicsPropertiesElement->addAttribute("draw:fill-color", mxBrush.foreColor.getColorString().cstr()); + pStyleGraphicsPropertiesElement->addAttribute("draw:fill-color", mxBrush.foreColor.cstr()); } - if(mxBrush.style == libwpg::WPGBrush::Gradient) + if(mxBrush.style == "gradient") { pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "gradient"); sValue.sprintf("Gradient_%i", miGradientIndex-1); |
From: Fridrich S. <str...@us...> - 2008-12-04 23:14:15
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7018/src/lib Modified Files: WPXString.cpp WPXString.h Log Message: making the operator== const function + adding inline operators\!= Index: WPXString.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXString.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- WPXString.h 9 Nov 2007 16:02:41 -0000 1.11 +++ WPXString.h 4 Dec 2008 23:14:10 -0000 1.12 @@ -46,10 +46,12 @@ void append(const char *s); void append(const char c); void clear(); - WPXString& operator=(const WPXString &); + WPXString& operator=(const WPXString &str); WPXString& operator=(const char *s); - bool operator==(const char *); - bool operator==(const WPXString &str); + bool operator==(const char *s) const; + bool operator==(const WPXString &str) const; + inline bool operator!=(const char *s) const { return !operator==(s); } + inline bool operator!=(const WPXString &str) const { return !operator==(str); } class Iter { Index: WPXString.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXString.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- WPXString.cpp 9 Nov 2007 16:02:41 -0000 1.19 +++ WPXString.cpp 4 Dec 2008 23:14:10 -0000 1.20 @@ -210,12 +210,12 @@ return *this; } -bool WPXString::operator==(const char *str) +bool WPXString::operator==(const char *str) const { return (m_stringImpl->m_buf == str); } -bool WPXString::operator==(const WPXString &str) +bool WPXString::operator==(const WPXString &str) const { return (m_stringImpl->m_buf == str.m_stringImpl->m_buf); } |
From: Fridrich S. <str...@us...> - 2008-12-03 23:10:09
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6597/filter Modified Files: OdgExporter.cxx Log Message: don't use the WPGColor data members directly (the corresponding header will soon be removed from the public api) Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- OdgExporter.cxx 3 Dec 2008 13:00:31 -0000 1.28 +++ OdgExporter.cxx 3 Dec 2008 23:10:04 -0000 1.29 @@ -540,12 +540,8 @@ sValue.sprintf("%i", (unsigned)(angle*10)); pDrawGradientElement->addAttribute("draw:angle", sValue); - libwpg::WPGColor startColor = mxBrush.gradient.stopColor(0); - libwpg::WPGColor stopColor = mxBrush.gradient.stopColor(1); - sValue.sprintf("#%.2x%.2x%.2x", (startColor.red & 0xff), (startColor.green & 0xff), (startColor.blue & 0xff)); - pDrawGradientElement->addAttribute("draw:start-color", sValue); - sValue.sprintf("#%.2x%.2x%.2x", (stopColor.red & 0xff), (stopColor.green & 0xff), (stopColor.blue & 0xff)); - pDrawGradientElement->addAttribute("draw:end-color", sValue); + pDrawGradientElement->addAttribute("draw:start-color", mxBrush.gradient.stopColor(0).cstr()); + pDrawGradientElement->addAttribute("draw:end-color", mxBrush.gradient.stopColor(1).cstr()); pDrawGradientElement->addAttribute("draw:start-intensity", "100%"); pDrawGradientElement->addAttribute("draw:end-intensity", "100%"); pDrawGradientElement->addAttribute("draw:border", "0%"); @@ -568,9 +564,7 @@ sValue = doubleToString(mxPen.width); sValue.append("in"); pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-width", sValue); - sValue.sprintf("#%.2x%.2x%.2x", (mxPen.foreColor.red & 0xff), - (mxPen.foreColor.green & 0xff), (mxPen.foreColor.blue & 0xff)); - pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-color", sValue); + pStyleGraphicsPropertiesElement->addAttribute("svg:stroke-color", mxPen.foreColor.getColorString().cstr()); if(!mxPen.solid) { @@ -588,9 +582,7 @@ if(mxBrush.style == libwpg::WPGBrush::Solid) { pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "solid"); - sValue.sprintf("#%.2x%.2x%.2x", (mxBrush.foreColor.red & 0xff), - (mxBrush.foreColor.green & 0xff), (mxBrush.foreColor.blue & 0xff)); - pStyleGraphicsPropertiesElement->addAttribute("draw:fill-color", sValue); + pStyleGraphicsPropertiesElement->addAttribute("draw:fill-color", mxBrush.foreColor.getColorString().cstr()); } if(mxBrush.style == libwpg::WPGBrush::Gradient) |
From: Fridrich S. <str...@us...> - 2008-12-03 16:01:57
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15857/filter Modified Files: Tag: fs_experimental ListStyle.cxx PageSpan.cxx TextRunStyle.cxx WordPerfectCollector.cxx Log Message: getFloat -> getDouble Index: WordPerfectCollector.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WordPerfectCollector.cxx,v retrieving revision 1.66 retrieving revision 1.66.2.1 diff -u -d -r1.66 -r1.66.2.1 --- WordPerfectCollector.cxx 9 Nov 2008 08:57:49 -0000 1.66 +++ WordPerfectCollector.cxx 3 Dec 2008 16:01:45 -0000 1.66.2.1 @@ -509,16 +509,16 @@ float fSectionMarginLeft = 0.0f; float fSectionMarginRight = 0.0f; if (propList["fo:margin-left"]) - fSectionMarginLeft = propList["fo:margin-left"]->getFloat(); + fSectionMarginLeft = propList["fo:margin-left"]->getDouble(); if (propList["fo:margin-right"]) - fSectionMarginRight = propList["fo:margin-right"]->getFloat(); + fSectionMarginRight = propList["fo:margin-right"]->getDouble(); if (iNumColumns > 1 || fSectionMarginLeft != 0 || fSectionMarginRight != 0) { if (propList["fo:margin-bottom"]) - mfSectionSpaceAfter = propList["fo:margin-bottom"]->getFloat(); + mfSectionSpaceAfter = propList["fo:margin-bottom"]->getDouble(); else if (propList["libwpd:margin-bottom"]) - mfSectionSpaceAfter = propList["libwpd:margin-bottom"]->getFloat(); + mfSectionSpaceAfter = propList["libwpd:margin-bottom"]->getDouble(); WPXString sSectionName; sSectionName.sprintf("Section%i", mSectionStyles.size()); Index: TextRunStyle.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/TextRunStyle.cxx,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -u -d -r1.17 -r1.17.2.1 --- TextRunStyle.cxx 10 Sep 2007 14:34:43 -0000 1.17 +++ TextRunStyle.cxx 3 Dec 2008 16:01:45 -0000 1.17.2.1 @@ -80,7 +80,7 @@ propList.insert("fo:margin-top", i()->getStr()); if (strcmp(i.key(), "fo:margin-bottom") == 0) { - if (i()->getFloat() > 0.0f) + if (i()->getDouble() > 0.0f) propList.insert("fo:margin-bottom", i()->getStr()); else propList.insert("fo:margin-bottom", 0.0f); @@ -105,7 +105,7 @@ WPXPropertyListVector::Iter i(mxTabStops); for (i.rewind(); i.next();) { - if (i()["style:position"] && i()["style:position"]->getFloat() < 0) + if (i()["style:position"] && i()["style:position"]->getDouble() < 0) continue; TagOpenElement tabStopOpen("style:tab-stop"); @@ -148,7 +148,7 @@ if (mPropList["fo:font-size"]) { - if (mPropList["fo:font-size"]->getFloat() > 0.0f) + if (mPropList["fo:font-size"]->getDouble() > 0.0f) { propList.insert("style:font-size-asian", mPropList["fo:font-size"]->getStr()); propList.insert("style:font-size-complex", mPropList["fo:font-size"]->getStr()); Index: PageSpan.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/PageSpan.cxx,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -d -r1.16 -r1.16.2.1 --- PageSpan.cxx 7 Jul 2007 09:49:39 -0000 1.16 +++ PageSpan.cxx 3 Dec 2008 16:01:45 -0000 1.16.2.1 @@ -90,7 +90,7 @@ float PageSpan::getMarginLeft() const { if (mxPropList["fo:margin-left"]) - return mxPropList["fo:margin-left"]->getFloat(); + return mxPropList["fo:margin-left"]->getDouble(); return 0.0f; } @@ -98,7 +98,7 @@ float PageSpan::getMarginRight() const { if (mxPropList["fo:margin-right"]) - return mxPropList["fo:margin-right"]->getFloat(); + return mxPropList["fo:margin-right"]->getDouble(); return 0.0f; } Index: ListStyle.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/ListStyle.cxx,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -d -r1.16 -r1.16.2.1 --- ListStyle.cxx 17 Jul 2007 19:30:22 -0000 1.16 +++ ListStyle.cxx 3 Dec 2008 16:01:45 -0000 1.16.2.1 @@ -70,11 +70,11 @@ listLevelStyleOpen.write(pHandler); TagOpenElement stylePropertiesOpen("style:list-level-properties"); - if (mPropList["text:space-before"] && mPropList["text:space-before"]->getFloat() > 0.0f) + if (mPropList["text:space-before"] && mPropList["text:space-before"]->getDouble() > 0.0f) stylePropertiesOpen.addAttribute("text:space-before", mPropList["text:space-before"]->getStr()); - if (mPropList["text:min-label-width"] && mPropList["text:min-label-width"]->getFloat() > 0.0f) + if (mPropList["text:min-label-width"] && mPropList["text:min-label-width"]->getDouble() > 0.0f) stylePropertiesOpen.addAttribute("text:min-label-width", mPropList["text:min-label-width"]->getStr()); - if (mPropList["text:min-label-distance"] && mPropList["text:min-label-distance"]->getFloat() > 0.0f) + if (mPropList["text:min-label-distance"] && mPropList["text:min-label-distance"]->getDouble() > 0.0f) stylePropertiesOpen.addAttribute("text:min-label-distance", mPropList["text:min-label-distance"]->getStr()); stylePropertiesOpen.write(pHandler); @@ -117,11 +117,11 @@ listLevelStyleOpen.write(pHandler); TagOpenElement stylePropertiesOpen("style:list-level-properties"); - if (mPropList["text:space-before"] && mPropList["text:space-before"]->getFloat() > 0.0f) + if (mPropList["text:space-before"] && mPropList["text:space-before"]->getDouble() > 0.0f) stylePropertiesOpen.addAttribute("text:space-before", mPropList["text:space-before"]->getStr()); - if (mPropList["text:min-label-width"] && mPropList["text:min-label-width"]->getFloat() > 0.0f) + if (mPropList["text:min-label-width"] && mPropList["text:min-label-width"]->getDouble() > 0.0f) stylePropertiesOpen.addAttribute("text:min-label-width", mPropList["text:min-label-width"]->getStr()); - if (mPropList["text:min-label-distance"] && mPropList["text:min-label-distance"]->getFloat() > 0.0f) + if (mPropList["text:min-label-distance"] && mPropList["text:min-label-distance"]->getDouble() > 0.0f) stylePropertiesOpen.addAttribute("text:min-label-distance", mPropList["text:min-label-distance"]->getStr()); stylePropertiesOpen.addAttribute("style:font-name", "OpenSymbol"); stylePropertiesOpen.write(pHandler); |
Update of /cvsroot/libwpd/libwpd2/src/lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6324/src/lib Modified Files: WP1ContentListener.cpp WP1ContentListener.h WP1SetTabsGroup.cpp WP1StylesListener.cpp WP1StylesListener.h WP3ContentListener.cpp WP3ContentListener.h WP3DefinitionGroup.cpp WP3DefinitionGroup.h WP3IndentGroup.cpp WP3IndentGroup.h WP3Listener.h WP3PageFormatGroup.cpp WP3PageFormatGroup.h WP3StylesListener.cpp WP3StylesListener.h WP3TabGroup.cpp WP3TabGroup.h WP3WindowGroup.cpp WP3WindowGroup.h WP42ContentListener.cpp WP42ContentListener.h WP42Listener.h WP42Parser.cpp WP42StylesListener.cpp WP42StylesListener.h WP5ContentListener.cpp WP5ContentListener.h WP5FontGroup.cpp WP5FontGroup.h WP5IndentGroup.cpp WP5IndentGroup.h WP5ListFontsUsedPacket.cpp WP5ListFontsUsedPacket.h WP5Listener.h WP5PageFormatGroup.cpp WP5PageFormatGroup.h WP5Parser.cpp WP5StylesListener.cpp WP5StylesListener.h WP5TabGroup.cpp WP5TabGroup.h WP6ColumnGroup.cpp WP6ColumnGroup.h WP6ContentListener.cpp WP6ContentListener.h WP6Listener.h WP6ParagraphGroup.cpp WP6ParagraphGroup.h WP6StylesListener.cpp WP6StylesListener.h WP6TabGroup.cpp WP6TabGroup.h WPXContentListener.cpp WPXContentListener.h WPXPageSpan.cpp WPXPageSpan.h WPXProperty.cpp libwpd_internal.cpp libwpd_internal.h Log Message: all float -> double (it does not take so much more space and saves big deal of precision) Index: WP1ContentListener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP1ContentListener.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- WP1ContentListener.h 27 Oct 2008 13:06:49 -0000 1.21 +++ WP1ContentListener.h 3 Dec 2008 13:40:34 -0000 1.22 @@ -72,7 +72,7 @@ void headerFooterGroup(uint8_t headerFooterDefinition, WP1SubDocument *subDocument); void suppressPageCharacteristics(uint8_t /* suppressCode */) {} void justificationChange(uint8_t justification); - void lineSpacingChange(uint8_t spacing) { WPXContentListener::lineSpacingChange((float)((double)spacing/2.0f)); } + void lineSpacingChange(uint8_t spacing) { WPXContentListener::lineSpacingChange((double)((double)spacing/2.0)); } void flushRightOn(); void flushRightOff() {} void centerOn(); Index: WP5IndentGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5IndentGroup.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- WP5IndentGroup.cpp 22 Nov 2007 12:20:33 -0000 1.4 +++ WP5IndentGroup.cpp 3 Dec 2008 13:40:34 -0000 1.5 @@ -32,7 +32,7 @@ WP5IndentGroup::WP5IndentGroup(WPXInputStream *input, WPXEncryption *encryption, uint8_t groupID) : WP5FixedLengthGroup(groupID), m_indentType(0), - m_indentPosition(0.0f) + m_indentPosition(0.0) { _read(input, encryption); } Index: WP5IndentGroup.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5IndentGroup.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- WP5IndentGroup.h 22 Nov 2007 12:20:34 -0000 1.4 +++ WP5IndentGroup.h 3 Dec 2008 13:40:34 -0000 1.5 @@ -40,7 +40,7 @@ private: uint8_t m_indentType; - float m_indentPosition; + double m_indentPosition; }; #endif /* WP5INDENTGROUP_H */ Index: WP5ContentListener.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5ContentListener.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- WP5ContentListener.cpp 11 Nov 2008 10:23:01 -0000 1.39 +++ WP5ContentListener.cpp 3 Dec 2008 13:40:34 -0000 1.40 @@ -48,7 +48,7 @@ WPXContentListener(pageList, documentInterface), m_parseState(new WP5ContentParsingState), m_subDocuments(subDocuments), - m_defaultFontSize(12.0f), + m_defaultFontSize(12.0), m_defaultFontName("Times New Roman") { } @@ -70,10 +70,10 @@ appendUCS4(m_parseState->m_textBuffer, (uint32_t)character); } -void WP5ContentListener::insertTab(uint8_t tabType, float tabPosition) +void WP5ContentListener::insertTab(uint8_t tabType, double tabPosition) { bool tmpHasTabPositionInformation = true; - if (tabPosition >= (float)((double)0xFFFE/(double)WPX_NUM_WPUS_PER_INCH) || tabPosition == 0.0f) + if (tabPosition >= (double)((double)0xFFFE/(double)WPX_NUM_WPUS_PER_INCH) || tabPosition == 0.0) tmpHasTabPositionInformation = false; if (!isUndoOn()) @@ -165,10 +165,10 @@ } } -void WP5ContentListener::insertIndent(uint8_t indentType, float indentPosition) +void WP5ContentListener::insertIndent(uint8_t indentType, double indentPosition) { bool tmpHasIndentPositionInformation = true; - if (indentPosition >= (float)((double)0xFFFE/(double)WPX_NUM_WPUS_PER_INCH) || indentPosition == 0.0f) + if (indentPosition >= (double)((double)0xFFFE/(double)WPX_NUM_WPUS_PER_INCH) || indentPosition == 0.0) tmpHasIndentPositionInformation = false; if (!isUndoOn()) @@ -183,7 +183,7 @@ else m_ps->m_leftMarginByTabs = indentPosition - m_ps->m_pageMarginLeft - m_ps->m_sectionMarginRight - m_ps->m_leftMarginByPageMarginChange - m_ps->m_leftMarginByParagraphMarginChange; - if (m_ps->m_paragraphTextIndent != 0.0f) + if (m_ps->m_paragraphTextIndent != 0.0) m_ps->m_textIndentByTabs -= m_ps->m_paragraphTextIndent; break; @@ -194,7 +194,7 @@ m_ps->m_leftMarginByTabs = indentPosition - m_ps->m_pageMarginLeft - m_ps->m_sectionMarginLeft - m_ps->m_leftMarginByPageMarginChange - m_ps->m_leftMarginByParagraphMarginChange; m_ps->m_rightMarginByTabs = m_ps->m_leftMarginByTabs; - if (m_ps->m_paragraphTextIndent != 0.0f) + if (m_ps->m_paragraphTextIndent != 0.0) m_ps->m_textIndentByTabs -= m_ps->m_paragraphTextIndent; break; @@ -262,7 +262,7 @@ break; } // Note: WordPerfect has an offset from the left edge of the page. We translate it to the offset from the left margin - m_ps->m_tableDefinition.m_leftOffset = (float)((double)leftOffset / (double)WPX_NUM_WPUS_PER_INCH) - m_ps->m_paragraphMarginLeft; + m_ps->m_tableDefinition.m_leftOffset = (double)((double)leftOffset / (double)WPX_NUM_WPUS_PER_INCH) - m_ps->m_paragraphMarginLeft; // remove all the old column information m_ps->m_tableDefinition.m_columns.clear(); @@ -278,9 +278,9 @@ { // define the new column WPXColumnDefinition colDef; - colDef.m_width = (float)((double)width / (double)WPX_NUM_WPUS_PER_INCH); - colDef.m_leftGutter = (float)((double)width / (double)WPX_NUM_WPUS_PER_INCH); - colDef.m_rightGutter = (float)((double)width / (double)WPX_NUM_WPUS_PER_INCH); + colDef.m_width = (double)((double)width / (double)WPX_NUM_WPUS_PER_INCH); + colDef.m_leftGutter = (double)((double)width / (double)WPX_NUM_WPUS_PER_INCH); + colDef.m_rightGutter = (double)((double)width / (double)WPX_NUM_WPUS_PER_INCH); // add the new column definition to our table definition m_ps->m_tableDefinition.m_columns.push_back(colDef); @@ -322,7 +322,7 @@ if (!isUndoOn()) { _flushText(); - float rowHeightInch = (float)((double) rowHeight / (double)WPX_NUM_WPUS_PER_INCH); + double rowHeightInch = (double)((double) rowHeight / (double)WPX_NUM_WPUS_PER_INCH); _openTableRow(rowHeightInch, isMinimumHeight, isHeaderRow); } } @@ -440,20 +440,20 @@ { if (!isUndoOn()) { - float marginInch = (float)((double)margin/ (double)WPX_NUM_WPUS_PER_INCH); + double marginInch = (double)((double)margin/ (double)WPX_NUM_WPUS_PER_INCH); switch(side) { case WPX_LEFT: if (m_ps->m_numColumns > 1) { - m_ps->m_leftMarginByPageMarginChange = 0.0f; + m_ps->m_leftMarginByPageMarginChange = 0.0; m_ps->m_sectionMarginLeft = marginInch - m_ps->m_pageMarginLeft; } else { m_ps->m_leftMarginByPageMarginChange = marginInch - m_ps->m_pageMarginLeft; - m_ps->m_sectionMarginLeft = 0.0f; + m_ps->m_sectionMarginLeft = 0.0; } m_ps->m_paragraphMarginLeft = m_ps->m_leftMarginByPageMarginChange + m_ps->m_leftMarginByParagraphMarginChange @@ -462,13 +462,13 @@ case WPX_RIGHT: if (m_ps->m_numColumns > 1) { - m_ps->m_rightMarginByPageMarginChange = 0.0f; + m_ps->m_rightMarginByPageMarginChange = 0.0; m_ps->m_sectionMarginRight = marginInch - m_ps->m_pageMarginRight; } else { m_ps->m_rightMarginByPageMarginChange = marginInch - m_ps->m_pageMarginRight; - m_ps->m_sectionMarginRight = 0.0f; + m_ps->m_sectionMarginRight = 0.0; } m_ps->m_paragraphMarginRight = m_ps->m_rightMarginByPageMarginChange + m_ps->m_rightMarginByParagraphMarginChange @@ -490,7 +490,7 @@ } } -void WP5ContentListener::setFont(const WPXString &fontName, float fontSize) +void WP5ContentListener::setFont(const WPXString &fontName, double fontSize) { if (!isUndoOn()) { @@ -596,7 +596,7 @@ m_subDocuments.push_back(subDocument); } -void WP5ContentListener::setDefaultFont(const WPXString &fontName, float fontSize) +void WP5ContentListener::setDefaultFont(const WPXString &fontName, double fontSize) { m_defaultFontName = fontName; m_defaultFontSize = fontSize; @@ -656,8 +656,8 @@ WPXPropertyList propList; - propList.insert("svg:height", (float)((double)height/(double)WPX_NUM_WPUS_PER_INCH)); - propList.insert("svg:width", (float)((double)width/(double)WPX_NUM_WPUS_PER_INCH)); + propList.insert("svg:height", (double)((double)height/(double)WPX_NUM_WPUS_PER_INCH)); + propList.insert("svg:width", (double)((double)width/(double)WPX_NUM_WPUS_PER_INCH)); if ( alignment & 0x80 ) propList.insert( "style:wrap", "dynamic" ); @@ -684,7 +684,7 @@ switch ( (positionAndType & 0x1c) >> 2 ) { case 0x00: - propList.insert("svg:height", (float)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom ) ); + propList.insert("svg:height", (double)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom ) ); propList.insert("style:vertical-rel", "page-content" ); propList.insert("style:vertical-pos", "middle" ); break; @@ -694,11 +694,11 @@ else { propList.insert("style:vertical-pos", "from-top" ); - float newPosition = (float)((double)y/(double)WPX_NUM_WPUS_PER_INCH); - if (newPosition > (float)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom + double newPosition = (double)((double)y/(double)WPX_NUM_WPUS_PER_INCH); + if (newPosition > (double)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom - (double)height/(double)WPX_NUM_WPUS_PER_INCH) ) { - newPosition = (float)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom + newPosition = (double)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom - (double)height/(double)WPX_NUM_WPUS_PER_INCH); } propList.insert("svg:y", newPosition); @@ -710,12 +710,12 @@ else { propList.insert("style:vertical-pos", "from-top" ); - float newPosition = (float)((m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom - - (double)height/(double)WPX_NUM_WPUS_PER_INCH)/2.0f); - if (newPosition > (float)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom + double newPosition = (double)((m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom + - (double)height/(double)WPX_NUM_WPUS_PER_INCH)/2.0); + if (newPosition > (double)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom - (double)height/(double)WPX_NUM_WPUS_PER_INCH) ) { - newPosition = (float)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom + newPosition = (double)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom - (double)height/(double)WPX_NUM_WPUS_PER_INCH); } propList.insert("svg:y", newPosition); @@ -727,12 +727,12 @@ else { propList.insert("style:vertical-pos", "from-top" ); - float newPosition = (float)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom + double newPosition = (double)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom - (double)height/(double)WPX_NUM_WPUS_PER_INCH + (double)y/(double)WPX_NUM_WPUS_PER_INCH); - if (newPosition > (float)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom + if (newPosition > (double)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom - (double)height/(double)WPX_NUM_WPUS_PER_INCH) ) { - newPosition = (float)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom + newPosition = (double)(m_ps->m_pageFormLength - m_ps->m_pageMarginTop - m_ps->m_pageMarginBottom - (double)height/(double)WPX_NUM_WPUS_PER_INCH); } propList.insert("svg:y", newPosition); @@ -741,7 +741,7 @@ case 0x04: propList.insert("style:vertical-rel", "page" ); propList.insert("style:vertical-pos", "from-top" ); - propList.insert("svg:y", (float)((double)y/(double)WPX_NUM_WPUS_PER_INCH)); + propList.insert("svg:y", (double)((double)y/(double)WPX_NUM_WPUS_PER_INCH)); break; default: break; @@ -756,7 +756,7 @@ else { propList.insert( "style:horizontal-pos", "from-left"); - propList.insert( "svg:x", (float)((double)x/(double)WPX_NUM_WPUS_PER_INCH)); + propList.insert( "svg:x", (double)((double)x/(double)WPX_NUM_WPUS_PER_INCH)); } break; case 0x01: @@ -765,7 +765,7 @@ else { propList.insert( "style:horizontal-pos", "from-left"); - propList.insert( "svg:x", (float)(m_ps->m_pageFormWidth - m_ps->m_pageMarginLeft - m_ps->m_pageMarginRight + propList.insert( "svg:x", (double)(m_ps->m_pageFormWidth - m_ps->m_pageMarginLeft - m_ps->m_pageMarginRight - (double)width/(double)WPX_NUM_WPUS_PER_INCH + (double)x/(double)WPX_NUM_WPUS_PER_INCH)); } break; @@ -775,12 +775,12 @@ else { propList.insert( "style:horizontal-pos", "from-left"); - propList.insert( "svg:x", (float)((m_ps->m_pageFormWidth - m_ps->m_pageMarginLeft - m_ps->m_pageMarginRight - - (double)width/(double)WPX_NUM_WPUS_PER_INCH)/2.0f + (double)x/(double)WPX_NUM_WPUS_PER_INCH)); + propList.insert( "svg:x", (double)((m_ps->m_pageFormWidth - m_ps->m_pageMarginLeft - m_ps->m_pageMarginRight + - (double)width/(double)WPX_NUM_WPUS_PER_INCH)/2.0 + (double)x/(double)WPX_NUM_WPUS_PER_INCH)); } break; case 0x03: - propList.insert("svg:width", (float)(m_ps->m_pageFormWidth - m_ps->m_pageMarginLeft - m_ps->m_pageMarginRight ) ); + propList.insert("svg:width", (double)(m_ps->m_pageFormWidth - m_ps->m_pageMarginLeft - m_ps->m_pageMarginRight ) ); propList.insert("style:horizontal-rel", "page-content" ); propList.insert("style:horizontal-pos", "center" ); break; Index: WP6ContentListener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6ContentListener.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- WP6ContentListener.h 27 Oct 2008 13:06:49 -0000 1.32 +++ WP6ContentListener.h 3 Dec 2008 13:40:34 -0000 1.33 @@ -75,8 +75,8 @@ WPXString m_textAfterDisplayReference; WPXString m_textAfterNumber; - float m_paragraphMarginBottomRelative; - float m_paragraphMarginBottomAbsolute; + double m_paragraphMarginBottomRelative; + double m_paragraphMarginBottomAbsolute; int m_numRemovedParagraphBreaks; @@ -151,24 +151,24 @@ void defineTabStops(const bool isRelative, const std::vector<WPXTabStop> &tabStops, const std::vector<bool> &usePreWP9LeaderMethods); void insertCharacter(const uint16_t character); - void insertTab(const uint8_t tabType, float tabPosition); + void insertTab(const uint8_t tabType, double tabPosition); void handleLineBreak(); void insertEOL(); void insertBreak(const uint8_t breakType) { WPXContentListener::insertBreak(breakType); }; - void lineSpacingChange(const float lineSpacing) { WPXContentListener::lineSpacingChange(lineSpacing); }; + void lineSpacingChange(const double lineSpacing) { WPXContentListener::lineSpacingChange(lineSpacing); }; void justificationChange(const uint8_t justification) { WPXContentListener::justificationChange(justification); }; void characterColorChange(const uint8_t red, const uint8_t green, const uint8_t blue); void characterShadingChange(const uint8_t shading); void highlightChange(const bool isOn, const RGBSColor color); void fontChange(const uint16_t matchedFontPointSize, const uint16_t fontPID); void attributeChange(const bool isOn, const uint8_t attribute); - void spacingAfterParagraphChange(const float spacingRelative, const float spacingAbsolute); + void spacingAfterParagraphChange(const double spacingRelative, const double spacingAbsolute); void pageMarginChange(const uint8_t /* side */, const uint16_t /* margin */) {} void pageFormChange(const uint16_t /* length */, const uint16_t /* width */, const WPXFormOrientation /* orientation */) {} void marginChange(const uint8_t side, const uint16_t margin); void paragraphMarginChange(const uint8_t side, const int16_t margin); void indentFirstLineChange(const int16_t offset); - void columnChange(const WPXTextColumnType columnType, const uint8_t numColumns, const std::vector<float> &columnWidth, + void columnChange(const WPXTextColumnType columnType, const uint8_t numColumns, const std::vector<double> &columnWidth, const std::vector<bool> &isFixedWidth); void updateOutlineDefinition(const WP6OutlineLocation outlineLocation, const uint16_t outlineHash, const uint8_t *numberingMethods, const uint8_t tabBehaviourFlag); Index: WP6ColumnGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6ColumnGroup.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- WP6ColumnGroup.cpp 22 Nov 2007 12:20:38 -0000 1.25 +++ WP6ColumnGroup.cpp 3 Dec 2008 13:40:34 -0000 1.26 @@ -34,7 +34,7 @@ m_margin(0), m_colType(0), m_numColumns(0), - m_rowSpacing(0.0f), + m_rowSpacing(0.0), m_isFixedWidth(), m_columnWidth() { @@ -59,8 +59,8 @@ m_colType = readU8(input, encryption); uint32_t tmpRowSpacing = readU32(input, encryption); int16_t tmpRowSpacingIntegerPart = (int16_t)((tmpRowSpacing & 0xffff0000) >> 16); - float tmpRowSpacingFractionalPart = (float)((double)(tmpRowSpacing & 0xffff)/(double)0x10000); - m_rowSpacing = (float)tmpRowSpacingIntegerPart + tmpRowSpacingFractionalPart; + double tmpRowSpacingFractionalPart = (double)((double)(tmpRowSpacing & 0xffff)/(double)0x10000); + m_rowSpacing = (double)tmpRowSpacingIntegerPart + tmpRowSpacingFractionalPart; m_numColumns = readU8(input, encryption); uint8_t tmpDefinition; uint16_t tmpWidth; @@ -73,12 +73,12 @@ if ((tmpDefinition & 0x01) == 0x01) { m_isFixedWidth.push_back(true); - m_columnWidth.push_back((float)((double)tmpWidth/(double)WPX_NUM_WPUS_PER_INCH)); + m_columnWidth.push_back((double)((double)tmpWidth/(double)WPX_NUM_WPUS_PER_INCH)); } else { m_isFixedWidth.push_back(false); - m_columnWidth.push_back((float)((double)tmpWidth/(double)0x10000)); + m_columnWidth.push_back((double)((double)tmpWidth/(double)0x10000)); } } Index: WP3DefinitionGroup.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP3DefinitionGroup.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- WP3DefinitionGroup.h 22 Nov 2007 12:20:23 -0000 1.6 +++ WP3DefinitionGroup.h 3 Dec 2008 13:40:34 -0000 1.7 @@ -45,7 +45,7 @@ uint8_t m_colType; uint8_t m_numColumns; std::vector<bool> m_isFixedWidth; - std::vector<float> m_columnWidth; + std::vector<double> m_columnWidth; }; Index: WP42Listener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP42Listener.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- WP42Listener.h 27 Oct 2008 13:06:49 -0000 1.20 +++ WP42Listener.h 3 Dec 2008 13:40:34 -0000 1.21 @@ -40,7 +40,7 @@ virtual void startDocument() = 0; virtual void startSubDocument() = 0; virtual void insertCharacter(uint16_t character) = 0; - virtual void insertTab(uint8_t tabType, float tabPosition) = 0; + virtual void insertTab(uint8_t tabType, double tabPosition) = 0; virtual void insertBreak(uint8_t breakType) = 0; virtual void insertEOL() = 0; virtual void attributeChange(bool isOn, uint8_t attribute) = 0; Index: WP42StylesListener.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP42StylesListener.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- WP42StylesListener.cpp 27 Oct 2008 13:06:49 -0000 1.22 +++ WP42StylesListener.cpp 3 Dec 2008 13:40:34 -0000 1.23 @@ -36,8 +36,8 @@ m_currentPage(), m_nextPage(), m_subDocuments(subDocuments), - m_tempMarginLeft(1.0f), - m_tempMarginRight(1.0f), + m_tempMarginLeft(1.0), + m_tempMarginRight(1.0), m_currentPageHasContent(false), m_isSubDocument(false), m_pageListHardPageMark(m_pageList.end()) @@ -79,7 +79,7 @@ m_pageListHardPageMark--; } } - m_currentPage = WPXPageSpan(m_pageList.back(), 0.0f, 0.0f); + m_currentPage = WPXPageSpan(m_pageList.back(), 0.0, 0.0); m_currentPage.setPageSpan(1); for(std::vector<WPXHeaderFooter>::const_iterator HFiter = (m_nextPage.getHeaderFooterList()).begin(); Index: WP5FontGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5FontGroup.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- WP5FontGroup.cpp 22 Nov 2007 12:20:32 -0000 1.5 +++ WP5FontGroup.cpp 3 Dec 2008 13:40:34 -0000 1.6 @@ -58,7 +58,7 @@ if (getSize() >= 36) { input->seek(2, WPX_SEEK_CUR); - m_fontSize = (float)(readU16(input, encryption) / 50); + m_fontSize = (double)(readU16(input, encryption) / 50); } break; default: @@ -71,7 +71,7 @@ WPD_DEBUG_MSG(("WordPerfect: handling a Font group\n")); int tmpFontNameOffset; - float tmpFontSize = 12.0f; + double tmpFontSize = 12.0; WPXString tmpFontName("Times New Roman"); switch(getSubGroup()) Index: WPXProperty.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXProperty.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- WPXProperty.cpp 3 Dec 2008 12:16:00 -0000 1.18 +++ WPXProperty.cpp 3 Dec 2008 13:40:34 -0000 1.19 @@ -123,7 +123,7 @@ double WPXStringProperty::getDouble() const { - return 0.0f; + return 0.0; } WPXString WPXStringProperty::getStr() const @@ -219,7 +219,7 @@ WPXString WPXPercentProperty::getStr() const { - WPXString str = doubleToString(getDouble()*100.0f); + WPXString str = doubleToString(getDouble()*100.0); str.append("%"); return str; } Index: WP3TabGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP3TabGroup.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- WP3TabGroup.cpp 22 Nov 2007 12:20:26 -0000 1.4 +++ WP3TabGroup.cpp 3 Dec 2008 13:40:34 -0000 1.5 @@ -31,7 +31,7 @@ WP3FixedLengthGroup(groupID), m_subGroup(0), m_modeType(0), - m_position(0.0f) + m_position(0.0) { _read(input, encryption); } @@ -40,7 +40,7 @@ { m_subGroup = readU8(input, encryption); m_modeType = readU8(input, encryption); - m_position = fixedPointToFloat(readU32(input, encryption, true)) / 72.0f; + m_position = fixedPointToDouble(readU32(input, encryption, true)) / 72.0; } void WP3TabGroup::parse(WP3Listener *listener) Index: WP6TabGroup.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6TabGroup.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- WP6TabGroup.h 22 Nov 2007 12:20:46 -0000 1.17 +++ WP6TabGroup.h 3 Dec 2008 13:40:34 -0000 1.18 @@ -37,7 +37,7 @@ void parse(WP6Listener *listener); private: - float m_position; + double m_position; bool m_ignoreFunction; }; Index: WP1ContentListener.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP1ContentListener.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- WP1ContentListener.cpp 29 Oct 2008 19:58:54 -0000 1.27 +++ WP1ContentListener.cpp 3 Dec 2008 13:40:34 -0000 1.28 @@ -51,7 +51,7 @@ m_subDocuments(subDocuments) { *(m_ps->m_fontName) = "Geneva"; - m_ps->m_fontSize = 12.0f; + m_ps->m_fontSize = 12.0; } WP1ContentListener::~WP1ContentListener() @@ -215,7 +215,7 @@ { _closeSpan(); - m_ps->m_fontSize=float(pointSize); + m_ps->m_fontSize=double(pointSize); } } @@ -386,7 +386,7 @@ { if (leftMargin) { - float leftMarginInch = (float)((double)leftMargin/72.0f); + double leftMarginInch = (double)((double)leftMargin/72.0); m_ps->m_leftMarginByPageMarginChange = leftMarginInch - m_ps->m_pageMarginLeft; m_ps->m_paragraphMarginLeft = m_ps->m_leftMarginByPageMarginChange + m_ps->m_leftMarginByParagraphMarginChange @@ -395,7 +395,7 @@ } if (rightMargin) { - float rightMarginInch = (float)((double)rightMargin/72.0f); + double rightMarginInch = (double)((double)rightMargin/72.0); m_ps->m_rightMarginByPageMarginChange = rightMarginInch - m_ps->m_pageMarginRight; m_ps->m_paragraphMarginRight = m_ps->m_rightMarginByPageMarginChange + m_ps->m_rightMarginByParagraphMarginChange @@ -414,7 +414,7 @@ else { m_parseState->m_numDeferredTabs = 0; - m_ps->m_leftMarginByTabs += (float)((double)leftMarginOffset / 72.0f); + m_ps->m_leftMarginByTabs += (double)((double)leftMarginOffset / 72.0); m_ps->m_paragraphMarginLeft = m_ps->m_leftMarginByPageMarginChange + m_ps->m_leftMarginByParagraphMarginChange + m_ps->m_leftMarginByTabs; @@ -432,8 +432,8 @@ else { m_parseState->m_numDeferredTabs = 0; - m_ps->m_leftMarginByTabs += (float)((double)leftRightMarginOffset / 72.0f); - m_ps->m_rightMarginByTabs += (float)((double)leftRightMarginOffset / 72.0f); + m_ps->m_leftMarginByTabs += (double)((double)leftRightMarginOffset / 72.0); + m_ps->m_rightMarginByTabs += (double)((double)leftRightMarginOffset / 72.0); m_ps->m_paragraphMarginLeft = m_ps->m_leftMarginByPageMarginChange + m_ps->m_leftMarginByParagraphMarginChange + m_ps->m_leftMarginByTabs; @@ -453,7 +453,7 @@ { if (!m_parseState->m_numDeferredTabs) { - m_ps->m_textIndentByTabs -= (float)((double)release / 72.0f); + m_ps->m_textIndentByTabs -= (double)((double)release / 72.0); m_ps->m_paragraphTextIndent = m_ps->m_textIndentByParagraphIndentChange + m_ps->m_textIndentByTabs; } @@ -537,8 +537,8 @@ _openSpan(); WPXPropertyList propList; - propList.insert("svg:width", (float)((double)width/72.0f)); - propList.insert("svg:height", (float)((double)height/72.0f)); + propList.insert("svg:width", (double)((double)width/72.0)); + propList.insert("svg:height", (double)((double)height/72.0)); propList.insert("text:anchor-type", "as-char"); m_documentInterface->openFrame(propList); Index: WP5ContentListener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5ContentListener.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- WP5ContentListener.h 27 Oct 2008 13:06:49 -0000 1.31 +++ WP5ContentListener.h 3 Dec 2008 13:40:34 -0000 1.32 @@ -57,14 +57,14 @@ void startDocument() { WPXContentListener::startDocument(); }; void startSubDocument() { WPXContentListener::startSubDocument(); }; - void setFont(const WPXString &fontName, float fontSize); + void setFont(const WPXString &fontName, double fontSize); void setTabs(const std::vector<WPXTabStop> &tabStops, uint16_t tabOffset); void insertCharacter(uint16_t character); - void insertTab(uint8_t tabType, float tabPosition); - void insertIndent(uint8_t indentType, float indentPosition); + void insertTab(uint8_t tabType, double tabPosition); + void insertIndent(uint8_t indentType, double indentPosition); void insertEOL(); void insertBreak(uint8_t breakType) { WPXContentListener::insertBreak(breakType); }; - void lineSpacingChange(float lineSpacing) { WPXContentListener::lineSpacingChange(lineSpacing); }; + void lineSpacingChange(double lineSpacing) { WPXContentListener::lineSpacingChange(lineSpacing); }; void justificationChange(uint8_t justification) { WPXContentListener::justificationChange(justification); }; void characterColorChange(uint8_t red, uint8_t green, uint8_t blue); void attributeChange(bool isOn, uint8_t attribute); @@ -91,7 +91,7 @@ void headerFooterGroup(uint8_t headerFooterType, uint8_t occurenceBits, WP5SubDocument *subDocument); void suppressPageCharacteristics(uint8_t /* suppressCode */) {}; - void setDefaultFont(const WPXString &fontName, float fontSize); + void setDefaultFont(const WPXString &fontName, double fontSize); void boxOn(uint8_t positionAndType, uint8_t alignment, uint16_t width, uint16_t height, uint16_t x, uint16_t y); virtual void boxOff(); @@ -108,7 +108,7 @@ WP5ContentListener& operator=(const WP5ContentListener&); WP5ContentParsingState *m_parseState; std::vector<WP5SubDocument *> &m_subDocuments; - float m_defaultFontSize; + double m_defaultFontSize; WPXString m_defaultFontName; }; Index: WP3PageFormatGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP3PageFormatGroup.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- WP3PageFormatGroup.cpp 15 Apr 2008 19:48:02 -0000 1.20 +++ WP3PageFormatGroup.cpp 3 Dec 2008 13:40:34 -0000 1.21 @@ -35,7 +35,7 @@ WP3VariableLengthGroup(), m_leftMargin(0), m_rightMargin(0), - m_lineSpacing(1.0f), + m_lineSpacing(1.0), m_isRelative(false), m_tabStops(), m_topMargin(0), @@ -56,7 +56,7 @@ // this group can contain different kinds of data, thus we need to read // the contents accordingly int8_t tmpTabType = 0; - float tmpTabPosition = 0.0f; + double tmpTabPosition = 0.0; WPXTabStop tmpTabStop = WPXTabStop(); switch (getSubGroup()) @@ -75,7 +75,7 @@ { uint32_t lineSpacing = readU32(input, encryption, true); int16_t lineSpacingIntegerPart = (int16_t)((lineSpacing & 0xFFFF0000) >> 16); - float lineSpacingFractionalPart = (float)((double)(lineSpacing & 0xFFFF)/(double)0xFFFF); + double lineSpacingFractionalPart = (double)((double)(lineSpacing & 0xFFFF)/(double)0xFFFF); WPD_DEBUG_MSG(("WordPerfect: Page format group line spacing - integer part: %i fractional part: %f (original value: %i)\n", lineSpacingIntegerPart, lineSpacingFractionalPart, lineSpacing)); m_lineSpacing = lineSpacingIntegerPart + lineSpacingFractionalPart; @@ -96,7 +96,7 @@ { if (input->atEOS()) throw FileException(); - tmpTabPosition = fixedPointToFloat(readU32(input, encryption, true)) / 72.0f; + tmpTabPosition = fixedPointToDouble(readU32(input, encryption, true)) / 72.0; if (tmpTabType < 0) { Index: WP5FontGroup.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5FontGroup.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- WP5FontGroup.h 22 Nov 2007 12:20:32 -0000 1.4 +++ WP5FontGroup.h 3 Dec 2008 13:40:34 -0000 1.5 @@ -39,7 +39,7 @@ private: uint8_t m_red, m_green, m_blue; uint8_t m_fontNumber; - float m_fontSize; + double m_fontSize; }; #endif /* WP5FONTGROUP_H */ Index: WP3IndentGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP3IndentGroup.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- WP3IndentGroup.cpp 22 Nov 2007 12:20:25 -0000 1.3 +++ WP3IndentGroup.cpp 3 Dec 2008 13:40:34 -0000 1.4 @@ -30,7 +30,7 @@ WP3IndentGroup::WP3IndentGroup(WPXInputStream *input, WPXEncryption *encryption, uint8_t groupID) : WP3FixedLengthGroup(groupID), m_subGroup(0), - m_offset(0.0f) + m_offset(0.0) { _read(input, encryption); } @@ -38,7 +38,7 @@ void WP3IndentGroup::_readContents(WPXInputStream *input, WPXEncryption *encryption) { m_subGroup = readU8(input, encryption); - m_offset = fixedPointToFloat(readU32(input, encryption, true)); + m_offset = fixedPointToDouble(readU32(input, encryption, true)); } void WP3IndentGroup::parse(WP3Listener *listener) Index: WP42StylesListener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP42StylesListener.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- WP42StylesListener.h 27 Oct 2008 13:06:49 -0000 1.18 +++ WP42StylesListener.h 3 Dec 2008 13:40:34 -0000 1.19 @@ -42,7 +42,7 @@ void startDocument() {} void startSubDocument() {} void insertCharacter(uint16_t /* character */) { if (!isUndoOn()) m_currentPageHasContent = true; } - void insertTab(uint8_t /* tabType */, float /* tabPosition */) { if (!isUndoOn()) m_currentPageHasContent = true; } + void insertTab(uint8_t /* tabType */, double /* tabPosition */) { if (!isUndoOn()) m_currentPageHasContent = true; } void insertEOL() { if (!isUndoOn()) m_currentPageHasContent = true; } void insertBreak(uint8_t breakType); void attributeChange(bool /* isOn */, uint8_t /* attribute */) {} @@ -58,7 +58,7 @@ private: WPXPageSpan m_currentPage, m_nextPage; std::vector<WP42SubDocument *> &m_subDocuments; - float m_tempMarginLeft, m_tempMarginRight; + double m_tempMarginLeft, m_tempMarginRight; bool m_currentPageHasContent; bool m_isSubDocument; std::list<WPXPageSpan>::iterator m_pageListHardPageMark; Index: libwpd_internal.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/libwpd_internal.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- libwpd_internal.h 27 Oct 2008 13:06:49 -0000 1.34 +++ libwpd_internal.h 3 Dec 2008 13:40:34 -0000 1.35 @@ -97,7 +97,7 @@ const uint16_t **chars); uint16_t fixedPointToWPUs(const uint32_t fixedPointNumber); -float fixedPointToFloat(const uint32_t fixedPointNumber); +double fixedPointToDouble(const uint32_t fixedPointNumber); enum WPXFileType { WP6_DOCUMENT, WP5_DOCUMENT, WP42_DOCUMENT, OTHER }; enum WPXNumberingType { ARABIC, LOWERCASE, UPPERCASE, LOWERCASE_ROMAN, UPPERCASE_ROMAN }; @@ -183,9 +183,9 @@ struct _WPXColumnDefinition { _WPXColumnDefinition(); // initializes all values to 0 - float m_width; - float m_leftGutter; - float m_rightGutter; + double m_width; + double m_leftGutter; + double m_rightGutter; }; typedef struct _WPXColumnProperties WPXColumnProperties; @@ -199,9 +199,9 @@ typedef struct _WPXTabStop WPXTabStop; struct _WPXTabStop { - _WPXTabStop(float position, WPXTabAlignment alignment, uint16_t leaderCharacter, uint8_t leaderNumSpaces); + _WPXTabStop(double position, WPXTabAlignment alignment, uint16_t leaderCharacter, uint8_t leaderNumSpaces); _WPXTabStop(); - float m_position; + double m_position; WPXTabAlignment m_alignment; uint16_t m_leaderCharacter; uint8_t m_leaderNumSpaces; Index: WP1SetTabsGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP1SetTabsGroup.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- WP1SetTabsGroup.cpp 22 Nov 2007 12:20:20 -0000 1.11 +++ WP1SetTabsGroup.cpp 3 Dec 2008 13:40:34 -0000 1.12 @@ -45,14 +45,14 @@ // Now read the new condensed tab table int8_t tmpTabType = 0; - float tmpTabPosition = 0.0f; + double tmpTabPosition = 0.0; WPXTabStop tmpTabStop = WPXTabStop(); while (((tmpTabType = (int8_t)readU8(input, encryption)) & 0xff) != 0xff) { if (input->atEOS()) throw FileException(); - tmpTabPosition = (float)((double)readU16(input, encryption, true) / 72.0f); + tmpTabPosition = (double)((double)readU16(input, encryption, true) / 72.0); if (tmpTabType < 0) { Index: WP6ParagraphGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6ParagraphGroup.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- WP6ParagraphGroup.cpp 22 Nov 2007 12:20:43 -0000 1.37 +++ WP6ParagraphGroup.cpp 3 Dec 2008 13:40:34 -0000 1.38 @@ -87,7 +87,7 @@ { uint32_t lineSpacing = readU32(input, encryption); int16_t lineSpacingIntegerPart = (int16_t)((lineSpacing & 0xFFFF0000) >> 16); - float lineSpacingFractionalPart = (float)(lineSpacing & 0xFFFF)/(float)0xFFFF; + double lineSpacingFractionalPart = (double)(lineSpacing & 0xFFFF)/(double)0xFFFF; WPD_DEBUG_MSG(("WordPerfect: line spacing integer part: %i fractional part: %f (original value: %i)\n", lineSpacingIntegerPart, lineSpacingFractionalPart, lineSpacing)); m_lineSpacing = lineSpacingIntegerPart + lineSpacingFractionalPart; @@ -102,7 +102,7 @@ WP6ParagraphGroup_TabSetSubGroup::WP6ParagraphGroup_TabSetSubGroup(WPXInputStream *input, WPXEncryption *encryption) : m_isRelative(false), - m_tabAdjustValue(0.0f), + m_tabAdjustValue(0.0), m_usePreWP9LeaderMethods(), m_tabStops() { @@ -111,12 +111,12 @@ if (tmp_definition == 0) { m_isRelative = false; - m_tabAdjustValue = 0.0f; + m_tabAdjustValue = 0.0; } else { m_isRelative = true; - m_tabAdjustValue = (float)((double)tmp_tabAdjustValue/(double)WPX_NUM_WPUS_PER_INCH); + m_tabAdjustValue = (double)((double)tmp_tabAdjustValue/(double)WPX_NUM_WPUS_PER_INCH); } uint8_t tmp_repetitionCount = 0; WPXTabStop tmp_tabStop; @@ -191,7 +191,7 @@ { if (tmp_tabPosition != 0xFFFF) { - tmp_tabStop.m_position = (float)((double)tmp_tabPosition/(double)WPX_NUM_WPUS_PER_INCH) - + tmp_tabStop.m_position = (double)((double)tmp_tabPosition/(double)WPX_NUM_WPUS_PER_INCH) - m_tabAdjustValue; m_tabStops.push_back(tmp_tabStop); m_usePreWP9LeaderMethods.push_back(tmp_usePreWP9LeaderMethod); @@ -201,7 +201,7 @@ { for (int k=0; k<tmp_repetitionCount; k++) { - tmp_tabStop.m_position += (float)((double)tmp_tabPosition/(double)WPX_NUM_WPUS_PER_INCH); + tmp_tabStop.m_position += (double)((double)tmp_tabPosition/(double)WPX_NUM_WPUS_PER_INCH); m_tabStops.push_back(tmp_tabStop); m_usePreWP9LeaderMethods.push_back(tmp_usePreWP9LeaderMethod); } @@ -284,20 +284,20 @@ WP6ParagraphGroup_SpacingAfterParagraphSubGroup::WP6ParagraphGroup_SpacingAfterParagraphSubGroup(WPXInputStream *input, WPXEncryption *encryption, const uint16_t sizeNonDeletable) : - m_spacingAfterParagraphAbsolute(0.0f), - m_spacingAfterParagraphRelative(1.0f), + m_spacingAfterParagraphAbsolute(0.0), + m_spacingAfterParagraphRelative(1.0), m_sizeNonDeletable(sizeNonDeletable) { uint32_t spacingAfterRelative = readU32(input, encryption); int16_t spacingAfterIntegerPart = (int16_t)((spacingAfterRelative & 0xFFFF0000) >> 16); - float spacingAfterFractionalPart = (float)(spacingAfterRelative & 0xFFFF)/(float)0xFFFF; + double spacingAfterFractionalPart = (double)(spacingAfterRelative & 0xFFFF)/(double)0xFFFF; WPD_DEBUG_MSG(("WordPerfect: spacing after paragraph relative integer part: %i fractional part: %f (original value: %i)\n", spacingAfterIntegerPart, spacingAfterFractionalPart, spacingAfterRelative)); m_spacingAfterParagraphRelative = spacingAfterIntegerPart + spacingAfterFractionalPart; if (m_sizeNonDeletable == (uint16_t)0x06) // Let us use the optional information that is in WPUs { uint16_t spacingAfterAbsolute = readU16(input, encryption); - m_spacingAfterParagraphAbsolute = (float)((double)spacingAfterAbsolute / (double)WPX_NUM_WPUS_PER_INCH); + m_spacingAfterParagraphAbsolute = (double)((double)spacingAfterAbsolute / (double)WPX_NUM_WPUS_PER_INCH); WPD_DEBUG_MSG(("WordPerfect: spacing after paragraph absolute: %i\n", spacingAfterAbsolute)); } } Index: WPXPageSpan.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXPageSpan.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- WPXPageSpan.h 9 Nov 2007 16:02:41 -0000 1.25 +++ WPXPageSpan.h 3 Dec 2008 13:40:34 -0000 1.26 @@ -62,31 +62,31 @@ { public: WPXPageSpan(); - WPXPageSpan(const WPXPageSpan &page, float paragraphMarginLeft, float paragraphMarginRight); + WPXPageSpan(const WPXPageSpan &page, double paragraphMarginLeft, double paragraphMarginRight); WPXPageSpan(const WPXPageSpan &page); virtual ~WPXPageSpan(); bool getHeaderFooterSuppression(const uint8_t headerFooterType) const { if (headerFooterType <= WPX_FOOTER_B) return m_isHeaderFooterSuppressed[headerFooterType]; return false; } - float getFormLength() const { return m_formLength; } - float getFormWidth() const { return m_formWidth; } + double getFormLength() const { return m_formLength; } + double getFormWidth() const { return m_formWidth; } WPXFormOrientation getFormOrientation() const { return m_formOrientation; } - float getMarginLeft() const { return m_marginLeft; } - float getMarginRight() const { return m_marginRight; } - float getMarginTop() const { return m_marginTop; } - float getMarginBottom() const { return m_marginBottom; } + double getMarginLeft() const { return m_marginLeft; } + double getMarginRight() const { return m_marginRight; } + double getMarginTop() const { return m_marginTop; } + double getMarginBottom() const { return m_marginBottom; } int getPageSpan() const { return m_pageSpan; } const std::vector<WPXHeaderFooter> & getHeaderFooterList() const { return m_headerFooterList; } void setHeaderFooter(const WPXHeaderFooterType type, const uint8_t headerFooterType, const WPXHeaderFooterOccurence occurence, const WPXSubDocument * subDocument, WPXTableList tableList); void setHeadFooterSuppression(const uint8_t headerFooterType, const bool suppress) { m_isHeaderFooterSuppressed[headerFooterType] = suppress; } - void setFormLength(const float formLength) { m_formLength = formLength; } - void setFormWidth(const float formWidth) { m_formWidth = formWidth; } + void setFormLength(const double formLength) { m_formLength = formLength; } + void setFormWidth(const double formWidth) { m_formWidth = formWidth; } void setFormOrientation(const WPXFormOrientation formOrientation) { m_formOrientation = formOrientation; } - void setMarginLeft(const float marginLeft) { m_marginLeft = marginLeft; } - void setMarginRight(const float marginRight) { m_marginRight = marginRight; } - void setMarginTop(const float marginTop) { m_marginTop = marginTop; } - void setMarginBottom(const float marginBottom) { m_marginBottom = marginBottom; } + void setMarginLeft(const double marginLeft) { m_marginLeft = marginLeft; } + void setMarginRight(const double marginRight) { m_marginRight = marginRight; } + void setMarginTop(const double marginTop) { m_marginTop = marginTop; } + void setMarginBottom(const double marginBottom) { m_marginBottom = marginBottom; } void setPageSpan(const int pageSpan) { m_pageSpan = pageSpan; } void makeConsistent(int startingPageNumber); @@ -97,10 +97,10 @@ private: bool m_isHeaderFooterSuppressed[WPX_NUM_HEADER_FOOTER_TYPES]; - float m_formLength, m_formWidth; + double m_formLength, m_formWidth; WPXFormOrientation m_formOrientation; - float m_marginLeft, m_marginRight; - float m_marginTop, m_marginBottom; + double m_marginLeft, m_marginRight; + double m_marginTop, m_marginBottom; std::vector<WPXHeaderFooter> m_headerFooterList; int m_pageSpan; Index: libwpd_internal.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/libwpd_internal.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- libwpd_internal.cpp 8 Dec 2007 09:26:37 -0000 1.42 +++ libwpd_internal.cpp 3 Dec 2008 13:40:34 -0000 1.43 @@ -925,16 +925,16 @@ uint16_t fixedPointToWPUs(const uint32_t fixedPointNumber) { int16_t fixedPointNumberIntegerPart = (int16_t)((fixedPointNumber & 0xFFFF0000) >> 16); - float fixedPointNumberFractionalPart = (float)((double)(fixedPointNumber & 0x0000FFFF)/(double)0xFFFF); - uint16_t numberWPU = (uint16_t)rint((((float)fixedPointNumberIntegerPart + fixedPointNumberFractionalPart)*50)/3); + double fixedPointNumberFractionalPart = (double)((double)(fixedPointNumber & 0x0000FFFF)/(double)0xFFFF); + uint16_t numberWPU = (uint16_t)rint((((double)fixedPointNumberIntegerPart + fixedPointNumberFractionalPart)*50)/3); return numberWPU; } -float fixedPointToFloat(const uint32_t fixedPointNumber) +double fixedPointToDouble(const uint32_t fixedPointNumber) { int16_t fixedPointNumberIntegerPart = (int16_t)((fixedPointNumber & 0xFFFF0000) >> 16); - float fixedPointNumberFractionalPart = (float)((double)(fixedPointNumber & 0x0000FFFF)/(double)0xFFFF); - return ((float)fixedPointNumberIntegerPart + fixedPointNumberFractionalPart); + double fixedPointNumberFractionalPart = (double)((double)(fixedPointNumber & 0x0000FFFF)/(double)0xFFFF); + return ((double)fixedPointNumberIntegerPart + fixedPointNumberFractionalPart); } _RGBSColor::_RGBSColor(uint8_t r, uint8_t g, uint8_t b, uint8_t s) @@ -961,7 +961,7 @@ { } -_WPXTabStop::_WPXTabStop(float position, WPXTabAlignment alignment, uint16_t leaderCharacter, uint8_t leaderNumSpaces) +_WPXTabStop::_WPXTabStop(double position, WPXTabAlignment alignment, uint16_t leaderCharacter, uint8_t leaderNumSpaces) : m_position(position), m_alignment(alignment), m_leaderCharacter(leaderCharacter), @@ -970,7 +970,7 @@ } _WPXTabStop::_WPXTabStop() - : m_position(0.0f), + : m_position(0.0), m_alignment(LEFT), m_leaderCharacter('\0'), m_leaderNumSpaces(0) @@ -978,9 +978,9 @@ } _WPXColumnDefinition::_WPXColumnDefinition() - : m_width(0.0f), - m_leftGutter(0.0f), - m_rightGutter(0.0f) + : m_width(0.0), + m_leftGutter(0.0), + m_rightGutter(0.0) { } Index: WP5StylesListener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5StylesListener.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- WP5StylesListener.h 27 Oct 2008 13:06:49 -0000 1.31 +++ WP5StylesListener.h 3 Dec 2008 13:40:34 -0000 1.32 @@ -43,16 +43,16 @@ void startDocument() {} void startSubDocument() {} - void setFont(const WPXString& /* fontName */, float /* fontSize */) {} + void setFont(const WPXString& /* fontName */, double /* fontSize */) {} void setTabs(const std::vector<WPXTabStop>& /* tabStops */, uint16_t /* tabOffset */) {} void insertCharacter(uint16_t /* character */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; } - void insertTab(uint8_t /* tabType */, float /* tabPosition */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; } - virtual void insertIndent(uint8_t /* indentType */, float /* indentPosition */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; } + void insertTab(uint8_t /* tabType */, double /* tabPosition */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; } + virtual void insertIndent(uint8_t /* indentType */, double /* indentPosition */) { /*if (!isUndoOn())*/ m_currentPageHasContent = true; } void characterColorChange(uint8_t /* red */, uint8_t /* green */, uint8_t /* blue */) {}; void insertEOL() { /*if (!isUndoOn())*/ m_currentPageHasContent = true; } void insertBreak(uint8_t breakType); void attributeChange(bool /* isOn */, uint8_t /* attribute */) {} - void lineSpacingChange(float /* lineSpacing */) {} + void lineSpacingChange(double /* lineSpacing */) {} void justificationChange(uint8_t /* justification */) {} void pageMarginChange(uint8_t side, uint16_t margin); void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation); @@ -90,7 +90,7 @@ WPXTableList m_tableList; WPXTable *m_currentTable; - float m_tempMarginLeft, m_tempMarginRight; + double m_tempMarginLeft, m_tempMarginRight; bool m_currentPageHasContent; bool m_isSubDocument; std::vector<WP5SubDocument *> &m_subDocuments; Index: WP6ParagraphGroup.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6ParagraphGroup.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- WP6ParagraphGroup.h 22 Nov 2007 12:20:43 -0000 1.27 +++ WP6ParagraphGroup.h 3 Dec 2008 13:40:34 -0000 1.28 @@ -37,7 +37,7 @@ void parse(WP6Listener *listener, const uint8_t numPrefixIDs, uint16_t const *prefixIDs) const; private: - float m_lineSpacing; + double m_lineSpacing; }; class WP6ParagraphGroup_JustificationModeSubGroup : public WP6VariableLengthGroup_SubGroup @@ -57,8 +57,8 @@ void parse(WP6Listener *listener, const uint8_t numPrefixIDs, uint16_t const *prefixIDs) const; private: - float m_spacingAfterParagraphAbsolute; - float m_spacingAfterParagraphRelative; + double m_spacingAfterParagraphAbsolute; + double m_spacingAfterParagraphRelative; uint16_t m_sizeNonDeletable; }; @@ -71,7 +71,7 @@ private: bool m_isRelative; - float m_tabAdjustValue; + double m_tabAdjustValue; std::vector<bool> m_usePreWP9LeaderMethods; std::vector<WPXTabStop> m_tabStops; }; Index: WP5ListFontsUsedPacket.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5ListFontsUsedPacket.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- WP5ListFontsUsedPacket.cpp 22 Nov 2007 12:20:34 -0000 1.6 +++ WP5ListFontsUsedPacket.cpp 3 Dec 2008 13:40:34 -0000 1.7 @@ -46,7 +46,7 @@ int numFonts = (int)(dataSize / 86); // 86 == size of the structure describing the font WPD_DEBUG_MSG(("WP5 List Fonts Used Packet, data size: %i, number fonts: %i\n", dataSize, numFonts)); int tempFontNameOffset; - float tempFontSize; + double tempFontSize; for (int i=0; i<numFonts; i++) { input->seek(18, WPX_SEEK_CUR); @@ -54,13 +54,13 @@ if (m_packetType == WP50_LIST_FONTS_USED_PACKET) { input->seek(2, WPX_SEEK_CUR); - tempFontSize=(float)(readU16(input, encryption) / 50); + tempFontSize=(double)(readU16(input, encryption) / 50); input->seek(62, WPX_SEEK_CUR); } else { input->seek(27, WPX_SEEK_CUR); - tempFontSize=(float)(readU16(input, encryption) / 50); + tempFontSize=(double)(readU16(input, encryption) / 50); input->seek(37, WPX_SEEK_CUR); } WPD_DEBUG_MSG(("WP5 List Fonts Used Packet, font number: %i, font name offset: %i, font size, %.4f\n", i, tempFontNameOffset, tempFontSize)); @@ -76,10 +76,10 @@ return 0; } -float WP5ListFontsUsedPacket::getFontSize(const int fontNumber) const +double WP5ListFontsUsedPacket::getFontSize(const int fontNumber) const { if ((fontNumber >= 0) && ((long)fontNumber < (long)m_fontSize.size())) return m_fontSize[fontNumber]; - return 0.0f; + return 0.0; } Index: WP6StylesListener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6StylesListener.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- WP6StylesListener.h 27 Oct 2008 13:06:49 -0000 1.28 +++ WP6StylesListener.h 3 Dec 2008 13:40:34 -0000 1.29 @@ -57,7 +57,7 @@ void defineTabStops(const bool /* isRelative */, const std::vector<WPXTabStop> & /* tabStops */, const std::vector<bool> & /* usePreWP9LeaderMethods */) {} void insertCharacter(const uint16_t /* character */) { if (!isUndoOn()) m_currentPageHasContent = true; } - void insertTab(const uint8_t /* tabType */, float /* tabPosition */) { if (!isUndoOn()) m_currentPageHasContent = true; } + void insertTab(const uint8_t /* tabType */, double /* tabPosition */) { if (!isUndoOn()) m_currentPageHasContent = true; } void handleLineBreak() { if (!isUndoOn()) m_currentPageHasContent = true; } void insertEOL() { if (!isUndoOn()) m_currentPageHasContent = true; } void insertBreak(const uint8_t breakType); @@ -66,8 +66,8 @@ void highlightChange(const bool /* isOn */, const RGBSColor /* color */) {} void fontChange(const uint16_t /* matchedFontPointSize */, const uint16_t /* fontPID */) {} void attributeChange(const bool /* isOn */, const uint8_t /* attribute */) {} - void lineSpacingChange(const float /* lineSpacing */) {} - void spacingAfterParagraphChange(const float /* spacingRelative */, const float /* spacingAbsolute */) {} + void lineSpacingChange(const double /* lineSpacing */) {} + void spacingAfterParagraphChange(const double /* spacingRelative */, const double /* spacingAbsolute */) {} void justificationChange(const uint8_t /* justification */) {} void pageMarginChange(const uint8_t side, const uint16_t margin); void pageFormChange(const uint16_t length, const uint16_t width, const WPXFormOrientation orientation); @@ -75,7 +75,7 @@ void paragraphMarginChange(const uint8_t /* side */, const int16_t /* margin */) {} void indentFirstLineChange(const int16_t /* offset */) {} void columnChange(const WPXTextColumnType /* columnType */, const uint8_t /* numColumns */, - const std::vector<float> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {} + const std::vector<double> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {} void updateOutlineDefinition(const WP6OutlineLocation /* outlineLocation */, const uint16_t /* outlineHash */, const uint8_t * /* numberingMethods */, const uint8_t /* tabBehaviourFlag */) {} @@ -129,7 +129,7 @@ WPXTableList m_tableList; WPXTable * m_currentTable; - float m_tempMarginLeft, m_tempMarginRight; + double m_tempMarginLeft, m_tempMarginRight; bool m_currentPageHasContent; bool m_isTableDefined; bool m_isSubDocument; Index: WP3StylesListener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP3StylesListener.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- WP3StylesListener.h 7 Nov 2008 17:24:23 -0000 1.28 +++ WP3StylesListener.h 3 Dec 2008 13:40:34 -0000 1.29 @@ -42,11 +42,11 @@ void startSubDocument() {} void insertCharacter(uint16_t /* character */) { if (!isUndoOn()) m_currentPageHasContent = true; } void insertTab() { if (!isUndoOn()) m_currentPageHasContent = true; } - void insertTab(uint8_t /* tabType */, float /* tabPosition */) { if (!isUndoOn()) m_currentPageHasContent = true; } + void insertTab(uint8_t /* tabType */, double /* tabPosition */) { if (!isUndoOn()) m_currentPageHasContent = true; } void insertEOL() { if (!isUndoOn()) m_currentPageHasContent = true; } void insertBreak(uint8_t breakType); void attributeChange(bool /* isOn */, uint8_t /* attribute */) {} - void lineSpacingChange(float /* lineSpacing */) {} + void lineSpacingChange(double /* lineSpacing */) {} void justificationChange(uint8_t /* justification */) {} void pageMarginChange(uint8_t side, uint16_t margin); void pageFormChange(uint16_t length, uint16_t width, WPXFormOrientation orientation); @@ -54,7 +54,7 @@ void indentFirstLineChange(int16_t /* offset */) {} void setTabs(bool /* isRelative */, const std::vector<WPXTabStop> /* tabStops */) {} void columnChange(WPXTextColumnType /* columnType */, uint8_t /* numColumns */, - const std::vector<float> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {} + const std::vector<double> & /* columnWidth */, const std::vector<bool> & /* isFixedWidth */) {} void endDocument(); void endSubDocument(); @@ -80,14 +80,14 @@ void suppressPage(uint16_t suppressCode); void backTab() { if (!isUndoOn()) m_currentPageHasContent = true; } void leftIndent() {} - void leftIndent(float /* offset */) {} + void leftIndent(double /* offset */) {} void leftRightIndent() {} - void leftRightIndent(float /* offset */) {} - void insertPicture(float /* height */, float /* width */, float /* verticalOffset */, float /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */, + void leftRightIndent(double /* offset */) {} + void insertPicture(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */, uint16_t /* figureFlags */, const WPXBinaryData & /* binaryData */) {} - void insertTextBox(float /* height */, float /* width */, float /* verticalOffset */, float /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */, + void insertTextBox(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */, uint16_t /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) {} - void insertWP51Table(float /* height */, float /* width */, float /* verticalOffset */, float /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */, + void insertWP51Table(double /* height */, double /* width */, double /* verticalOffset */, double /* horizontalOffset */, uint8_t /* leftColumn */, uint8_t /* rightColumn */, uint16_t /* figureFlags */, const WP3SubDocument * /* subDocument */, const WP3SubDocument * /* caption */) {} protected: @@ -100,7 +100,7 @@ WPXTableList m_tableList; WPXTable *m_currentTable; - float m_tempMarginLeft, m_tempMarginRight; + double m_tempMarginLeft, m_tempMarginRight; bool m_currentPageHasContent; bool m_isSubDocument; std::vector<WP3SubDocument *> &m_subDocuments; Index: WP1StylesListener.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP1StylesListener.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- WP1StylesListener.cpp 27 Oct 2008 13:06:49 -0000 1.12 +++ WP1StylesListener.cpp 3 Dec 2008 13:40:34 -0000 1.13 @@ -35,8 +35,8 @@ m_currentPage(), m_nextPage(), m_subDocuments(subDocuments), - m_tempMarginLeft(1.0f), - m_tempMarginRight(1.0f), + m_tempMarginLeft(1.0), + m_tempMarginRight(1.0), m_currentPageHasContent(false), m_isSubDocument(false), m_pageListHardPageMark(m_pageList.end()) @@ -78,7 +78,7 @@ m_pageListHardPageMark--; } } - m_currentPage = WPXPageSpan(m_pageList.back(), 0.0f, 0.0f); + m_currentPage = WPXPageSpan(m_pageList.back(), 0.0, 0.0); m_currentPage.setPageSpan(1); for(std::vector<WPXHeaderFooter>::const_iterator HFiter = (m_nextPage.getHeaderFooterList()).begin(); @@ -117,11 +117,11 @@ return; // do not collect L/R margin information in sub documents std::list<WPXPageSpan>::iterator Iter; - float marginInch = 0.0f; + double marginInch = 0.0; if (leftMargin) { - marginInch = (float)((double)leftMargin / 72.0f); + marginInch = (double)((double)leftMargin / 72.0); WPD_DEBUG_MSG(("Left Margin: %ipts = %.4finch\n", leftMargin, marginInch)); if (!m_currentPageHasContent && (m_pageListHardPageMark == m_pageList.end())) m_currentPage.setMarginLeft(marginInch); @@ -139,7 +139,7 @@ if (rightMargin) { - marginInch = (float)((double)rightMargin / 72.0f); + marginInch = (double)((double)rightMargin / 72.0); WPD_DEBUG_MSG(("Right Margin: %ipts = %.4finch\n", rightMargin, marginInch)); if (!m_currentPageHasContent && (m_pageListHardPageMark == m_pageList.end())) m_currentPage.setMarginRight(marginInch); @@ -162,7 +162,7 @@ if (!isUndoOn()) { if (!topMargin) return; - float marginInch = (float)((double)topMargin / 72.0f); + double marginInch = (double)((double)topMargin / 72.0); m_currentPage.setMarginTop(marginInch); } } @@ -172,7 +172,7 @@ if (!isUndoOn()) { if (!bottomMargin) return; - float marginInch = (float)((double)bottomMargin / 72.0f); + double marginInch = (double)((double)bottomMargin / 72.0); m_currentPage.setMarginBottom(marginInch); } } Index: WP5TabGroup.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5TabGroup.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- WP5TabGroup.h ... [truncated message content] |
From: Fridrich S. <str...@us...> - 2008-12-03 13:00:38
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3728/filter Modified Files: FilterInternal.hxx OdgExporter.cxx PageSpan.cxx SectionStyle.cxx WordPerfectCollector.cxx WordPerfectCollector.hxx WriterProperties.hxx Log Message: some more float -> double changes Index: FilterInternal.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/FilterInternal.hxx,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FilterInternal.hxx 9 Oct 2006 03:53:05 -0000 1.4 +++ FilterInternal.hxx 3 Dec 2008 13:00:31 -0000 1.5 @@ -26,6 +26,6 @@ #define WRITER_DEBUG_MSG(M) #endif -const float fDefaultSideMargin = 1.0f; // inches -const float fDefaultPageWidth = 8.5f; // inches (OOo required default: we will handle this later) -const float fDefaultPageHeight = 11.0f; // inches +const double fDefaultSideMargin = 1.0; // inches +const double fDefaultPageWidth = 8.5f; // inches (OOo required default: we will handle this later) +const double fDefaultPageHeight = 11.0; // inches Index: PageSpan.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/PageSpan.cxx,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- PageSpan.cxx 3 Dec 2008 12:52:08 -0000 1.17 +++ PageSpan.cxx 3 Dec 2008 13:00:31 -0000 1.18 @@ -92,7 +92,7 @@ if (mxPropList["fo:margin-left"]) return mxPropList["fo:margin-left"]->getDouble(); - return 0.0f; + return 0.0; } double PageSpan::getMarginRight() const @@ -100,7 +100,7 @@ if (mxPropList["fo:margin-right"]) return mxPropList["fo:margin-right"]->getDouble(); - return 0.0f; + return 0.0; } void PageSpan::writePageLayout(const int iNum, DocumentHandler *pHandler) const Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- OdgExporter.cxx 3 Dec 2008 12:52:08 -0000 1.27 +++ OdgExporter.cxx 3 Dec 2008 13:00:31 -0000 1.28 @@ -40,8 +40,8 @@ miGradientIndex(1), miDashIndex(1), miGraphicsStyleIndex(1), - mfWidth(0.0f), - mfHeight(0.0f), + mfWidth(0.0), + mfHeight(0.0), mbIsFlatXML(isFlatXML) { } Index: WordPerfectCollector.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WordPerfectCollector.cxx,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- WordPerfectCollector.cxx 3 Dec 2008 12:52:08 -0000 1.67 +++ WordPerfectCollector.cxx 3 Dec 2008 13:00:31 -0000 1.68 @@ -75,7 +75,7 @@ mbUsed(false), mWriterDocumentStates(), mWriterListStates(), - mfSectionSpaceAfter(0.0f), + mfSectionSpaceAfter(0.0), miNumListStyles(0), mpCurrentContentElements(&mBodyElements), mpCurrentPageSpan(NULL), @@ -506,8 +506,8 @@ void WordPerfectCollector::openSection(const WPXPropertyList &propList, const WPXPropertyListVector &columns) { int iNumColumns = columns.count(); - float fSectionMarginLeft = 0.0f; - float fSectionMarginRight = 0.0f; + double fSectionMarginLeft = 0.0; + double fSectionMarginRight = 0.0; if (propList["fo:margin-left"]) fSectionMarginLeft = propList["fo:margin-left"]->getDouble(); if (propList["fo:margin-right"]) @@ -542,7 +542,7 @@ else mWriterDocumentStates.top().mbInFakeSection = false; - mfSectionSpaceAfter = 0.0f; + mfSectionSpaceAfter = 0.0; } void WordPerfectCollector::openParagraph(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops) Index: WordPerfectCollector.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WordPerfectCollector.hxx,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- WordPerfectCollector.hxx 29 Oct 2008 20:00:26 -0000 1.35 +++ WordPerfectCollector.hxx 3 Dec 2008 13:00:31 -0000 1.36 @@ -188,7 +188,7 @@ // section styles std::vector<SectionStyle *> mSectionStyles; - float mfSectionSpaceAfter; + double mfSectionSpaceAfter; // table styles std::vector<TableStyle *> mTableStyles; Index: SectionStyle.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/SectionStyle.cxx,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- SectionStyle.cxx 25 Jun 2007 17:14:25 -0000 1.14 +++ SectionStyle.cxx 3 Dec 2008 13:00:31 -0000 1.15 @@ -73,7 +73,7 @@ else { columnProps.insert("fo:column-count", 0); - columnProps.insert("fo:column-gap", 0.0f); + columnProps.insert("fo:column-gap", 0.0); pHandler->startElement("style:columns", columnProps); } Index: WriterProperties.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WriterProperties.hxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- WriterProperties.hxx 12 Jul 2007 21:51:11 -0000 1.3 +++ WriterProperties.hxx 3 Dec 2008 13:00:31 -0000 1.4 @@ -30,6 +30,6 @@ #define IMP_DEFAULT_SUPER_SUB_SCRIPT "58%" #define IMP_NUM_CENTIMETERES_PER_INCH 2.54f #define IMP_DEFAULT_FONT_NAME "Times New Roman" -#define IMP_DEFAULT_FONT_SIZE 12.0f +#define IMP_DEFAULT_FONT_SIZE 12.0 #define IMP_DEFAULT_FONT_PITCH "variable" #endif |
From: Fridrich S. <str...@us...> - 2008-12-03 12:52:11
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3288/filter Modified Files: ListStyle.cxx OdgExporter.cxx PageSpan.cxx PageSpan.hxx TextRunStyle.cxx WordPerfectCollector.cxx Log Message: adapting to the fact that getFloat -> getDouble in WPXProperty class Index: PageSpan.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/PageSpan.cxx,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- PageSpan.cxx 7 Jul 2007 09:49:39 -0000 1.16 +++ PageSpan.cxx 3 Dec 2008 12:52:08 -0000 1.17 @@ -87,18 +87,18 @@ return 0; // should never happen } -float PageSpan::getMarginLeft() const +double PageSpan::getMarginLeft() const { if (mxPropList["fo:margin-left"]) - return mxPropList["fo:margin-left"]->getFloat(); + return mxPropList["fo:margin-left"]->getDouble(); return 0.0f; } -float PageSpan::getMarginRight() const +double PageSpan::getMarginRight() const { if (mxPropList["fo:margin-right"]) - return mxPropList["fo:margin-right"]->getFloat(); + return mxPropList["fo:margin-right"]->getDouble(); return 0.0f; } Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- OdgExporter.cxx 28 Nov 2008 12:26:16 -0000 1.26 +++ OdgExporter.cxx 3 Dec 2008 12:52:08 -0000 1.27 @@ -122,7 +122,7 @@ configItemOpenElement.addAttribute("config:type", "int"); configItemOpenElement.write(mpHandler); if (propList["svg:width"]) - mfWidth = propList["svg:width"]->getFloat(); + mfWidth = propList["svg:width"]->getDouble(); WPXString sWidth; sWidth.sprintf("%li", (unsigned long)(2540 * mfWidth)); mpHandler->characters(sWidth); mpHandler->endElement("config:config-item"); @@ -131,7 +131,7 @@ configItemOpenElement.addAttribute("config:type", "int"); configItemOpenElement.write(mpHandler); if (propList["svg:height"]) - mfHeight = propList["svg:height"]->getFloat(); + mfHeight = propList["svg:height"]->getDouble(); WPXString sHeight; sHeight.sprintf("%li", (unsigned long)(2540 * mfHeight)); mpHandler->characters(sHeight); mpHandler->endElement("config:config-item"); @@ -268,7 +268,10 @@ 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", propList["svg:rx"]->getStr()); + if (propList["svg:rx"]) + pDrawRectElement->addAttribute("draw:corner-radius", propList["svg:rx"]->getStr()); + else + pDrawRectElement->addAttribute("draw:corner-radius", "0.0000in"); mBodyElements.push_back(pDrawRectElement); mBodyElements.push_back(new TagCloseElement("draw:rect")); } @@ -280,35 +283,35 @@ WPXString sValue; sValue.sprintf("gr%i", miGraphicsStyleIndex-1); pDrawEllipseElement->addAttribute("draw:style-name", sValue); - sValue = doubleToString(2 * propList["svg:rx"]->getFloat()); sValue.append("in"); + sValue = doubleToString(2 * propList["svg:rx"]->getDouble()); sValue.append("in"); pDrawEllipseElement->addAttribute("svg:width", sValue); - sValue = doubleToString(2 * propList["svg:ry"]->getFloat()); sValue.append("in"); + sValue = doubleToString(2 * propList["svg:ry"]->getDouble()); sValue.append("in"); pDrawEllipseElement->addAttribute("svg:height", sValue); - if (propList["libwpg:rotate"] && propList["libwpg:rotate"]->getFloat() != 0.0) + if (propList["libwpg:rotate"] && propList["libwpg:rotate"]->getDouble() != 0.0) { - double rotation = propList["libwpg:rotate"]->getFloat(); + double rotation = propList["libwpg:rotate"]->getDouble(); while(rotation < -180) rotation += 360; while(rotation > 180) rotation -= 360; double radrotation = rotation*M_PI/180.0; - 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(); + double deltax = sqrt(pow(propList["svg:rx"]->getDouble(), 2.0) + + pow(propList["svg:ry"]->getDouble(), 2.0))*cos(atan(propList["svg:ry"]->getDouble()/propList["svg:rx"]->getDouble()) + - radrotation ) - propList["svg:rx"]->getDouble(); + double deltay = sqrt(pow(propList["svg:rx"]->getDouble(), 2.0) + + pow(propList["svg:ry"]->getDouble(), 2.0))*sin(atan(propList["svg:ry"]->getDouble()/propList["svg:rx"]->getDouble()) + - radrotation ) - propList["svg:ry"]->getDouble(); sValue = "rotate("; sValue.append(doubleToString(radrotation)); sValue.append(") "); - sValue.append("translate("); sValue.append(doubleToString(propList["svg:cx"]->getFloat() - propList["svg:rx"]->getFloat() - deltax)); + sValue.append("translate("); sValue.append(doubleToString(propList["svg:cx"]->getDouble() - propList["svg:rx"]->getDouble() - deltax)); sValue.append("in, "); - sValue.append(doubleToString(propList["svg:cy"]->getFloat() - propList["svg:ry"]->getFloat() - deltay)); sValue.append("in)"); + sValue.append(doubleToString(propList["svg:cy"]->getDouble() - propList["svg:ry"]->getDouble() - deltay)); sValue.append("in)"); pDrawEllipseElement->addAttribute("svg:transform", sValue); } else { - sValue = doubleToString(propList["svg:cx"]->getFloat()-propList["svg:rx"]->getFloat()); sValue.append("in"); + sValue = doubleToString(propList["svg:cx"]->getDouble()-propList["svg:rx"]->getDouble()); sValue.append("in"); pDrawEllipseElement->addAttribute("svg:x", sValue); - sValue = doubleToString(propList["svg:cy"]->getFloat()-propList["svg:ry"]->getFloat()); sValue.append("in"); + sValue = doubleToString(propList["svg:cy"]->getDouble()-propList["svg:ry"]->getDouble()); sValue.append("in"); pDrawEllipseElement->addAttribute("svg:y", sValue); } mBodyElements.push_back(pDrawEllipseElement); @@ -378,28 +381,28 @@ // try to find the bounding box // this is simple convex hull technique, the bounding box might not be // accurate but that should be enough for this purpose - double px = path[0]["svg:x"]->getFloat(); - double py = path[0]["svg:y"]->getFloat(); - double qx = path[0]["svg:x"]->getFloat(); - double qy = path[0]["svg:y"]->getFloat(); + double px = path[0]["svg:x"]->getDouble(); + double py = path[0]["svg:y"]->getDouble(); + double qx = path[0]["svg:x"]->getDouble(); + double qy = path[0]["svg:y"]->getDouble(); for(unsigned k = 0; k < path.count(); k++) { if (!path[k]["svg:x"] || !path[k]["svg:y"]) continue; - px = (px > path[k]["svg:x"]->getFloat()) ? path[k]["svg:x"]->getFloat() : px; - py = (py > path[k]["svg:y"]->getFloat()) ? path[k]["svg:y"]->getFloat() : py; - qx = (qx < path[k]["svg:x"]->getFloat()) ? path[k]["svg:x"]->getFloat() : qx; - qy = (qy < path[k]["svg:y"]->getFloat()) ? path[k]["svg:y"]->getFloat() : qy; + px = (px > path[k]["svg:x"]->getDouble()) ? path[k]["svg:x"]->getDouble() : px; + py = (py > path[k]["svg:y"]->getDouble()) ? path[k]["svg:y"]->getDouble() : py; + qx = (qx < path[k]["svg:x"]->getDouble()) ? path[k]["svg:x"]->getDouble() : qx; + qy = (qy < path[k]["svg:y"]->getDouble()) ? path[k]["svg:y"]->getDouble() : qy; if(path[k]["libwpg:path-action"]->getStr() == "C") { - px = (px > path[k]["svg:x1"]->getFloat()) ? path[k]["svg:x1"]->getFloat() : px; - py = (py > path[k]["svg:y1"]->getFloat()) ? path[k]["svg:y1"]->getFloat() : py; - qx = (qx < path[k]["svg:x1"]->getFloat()) ? path[k]["svg:x1"]->getFloat() : qx; - qy = (qy < path[k]["svg:y1"]->getFloat()) ? path[k]["svg:y1"]->getFloat() : qy; - px = (px > path[k]["svg:x2"]->getFloat()) ? path[k]["svg:x2"]->getFloat() : px; - py = (py > path[k]["svg:y2"]->getFloat()) ? path[k]["svg:y2"]->getFloat() : py; - qx = (qx < path[k]["svg:x2"]->getFloat()) ? path[k]["svg:x2"]->getFloat() : qx; - qy = (qy < path[k]["svg:y2"]->getFloat()) ? path[k]["svg:y2"]->getFloat() : qy; + px = (px > path[k]["svg:x1"]->getDouble()) ? path[k]["svg:x1"]->getDouble() : px; + py = (py > path[k]["svg:y1"]->getDouble()) ? path[k]["svg:y1"]->getDouble() : py; + qx = (qx < path[k]["svg:x1"]->getDouble()) ? path[k]["svg:x1"]->getDouble() : qx; + qy = (qy < path[k]["svg:y1"]->getDouble()) ? path[k]["svg:y1"]->getDouble() : qy; + px = (px > path[k]["svg:x2"]->getDouble()) ? path[k]["svg:x2"]->getDouble() : px; + py = (py > path[k]["svg:y2"]->getDouble()) ? path[k]["svg:y2"]->getDouble() : py; + qx = (qx < path[k]["svg:x2"]->getDouble()) ? path[k]["svg:x2"]->getDouble() : qx; + qy = (qy < path[k]["svg:y2"]->getDouble()) ? path[k]["svg:y2"]->getDouble() : qy; } } double vw = qx - px; @@ -431,22 +434,25 @@ if (path[i]["libwpg:path-action"]->getStr() == "M") { // 2540 is 2.54*1000, 2.54 in = 1 inch - sElement.sprintf("M%i %i", (unsigned)((path[i]["svg:x"]->getFloat()-px)*2540), (unsigned)((path[i]["svg:y"]->getFloat()-py)*2540)); + sElement.sprintf("M%i %i", (unsigned)((path[i]["svg:x"]->getDouble()-px)*2540), + (unsigned)((path[i]["svg:y"]->getDouble()-py)*2540)); sValue.append(sElement); } else if (path[i]["libwpg:path-action"]->getStr() == "L") { - sElement.sprintf("L%i %i", (unsigned)((path[i]["svg:x"]->getFloat()-px)*2540), (unsigned)((path[i]["svg:y"]->getFloat()-py)*2540)); + sElement.sprintf("L%i %i", (unsigned)((path[i]["svg:x"]->getDouble()-px)*2540), + (unsigned)((path[i]["svg:y"]->getDouble()-py)*2540)); sValue.append(sElement); } else if (path[i]["libwpg:path-action"]->getStr() == "C") { - sElement.sprintf("C%i %i %i %i %i %i", (unsigned)((path[i]["svg:x1"]->getFloat()-px)*2540), - (int)((path[i]["svg:y1"]->getFloat()-py)*2540), (unsigned)((path[i]["svg:x2"]->getFloat()-px)*2540), - (int)((path[i]["svg:y2"]->getFloat()-py)*2540), (unsigned)((path[i]["svg:x"]->getFloat()-px)*2540), (unsigned)((path[i]["svg:y"]->getFloat()-py)*2540)); + sElement.sprintf("C%i %i %i %i %i %i", (unsigned)((path[i]["svg:x1"]->getDouble()-px)*2540), + (int)((path[i]["svg:y1"]->getDouble()-py)*2540), (unsigned)((path[i]["svg:x2"]->getDouble()-px)*2540), + (int)((path[i]["svg:y2"]->getDouble()-py)*2540), (unsigned)((path[i]["svg:x"]->getDouble()-px)*2540), + (unsigned)((path[i]["svg:y"]->getDouble()-py)*2540)); sValue.append(sElement); } - else if (path[i]["libwpg:path-action"]->getStr() == "Z" && i == (path.count() - 1)) + else if (path[i]["libwpg:path-action"]->getStr() == "Z" && i >= (path.count() - 1)) sValue.append(" Z"); } pDrawPathElement->addAttribute("svg:d", sValue); Index: PageSpan.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/PageSpan.hxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- PageSpan.hxx 25 Jun 2007 17:14:25 -0000 1.9 +++ PageSpan.hxx 3 Dec 2008 12:52:08 -0000 1.10 @@ -40,8 +40,8 @@ void writePageLayout(const int iNum, DocumentHandler *pHandler) const; void writeMasterPages(const int iStartingNum, const int iPageLayoutNum, const bool bLastPageSpan, DocumentHandler *pHandler) const; int getSpan() const; - float getMarginLeft() const; - float getMarginRight() const; + double getMarginLeft() const; + double getMarginRight() const; const std::vector<DocumentElement *> * getHeaderContent() const { return mpHeaderContent; } void setHeaderContent(std::vector<DocumentElement *> * pHeaderContent) { mpHeaderContent = pHeaderContent; } Index: WordPerfectCollector.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WordPerfectCollector.cxx,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- WordPerfectCollector.cxx 9 Nov 2008 08:57:49 -0000 1.66 +++ WordPerfectCollector.cxx 3 Dec 2008 12:52:08 -0000 1.67 @@ -509,16 +509,16 @@ float fSectionMarginLeft = 0.0f; float fSectionMarginRight = 0.0f; if (propList["fo:margin-left"]) - fSectionMarginLeft = propList["fo:margin-left"]->getFloat(); + fSectionMarginLeft = propList["fo:margin-left"]->getDouble(); if (propList["fo:margin-right"]) - fSectionMarginRight = propList["fo:margin-right"]->getFloat(); + fSectionMarginRight = propList["fo:margin-right"]->getDouble(); if (iNumColumns > 1 || fSectionMarginLeft != 0 || fSectionMarginRight != 0) { if (propList["fo:margin-bottom"]) - mfSectionSpaceAfter = propList["fo:margin-bottom"]->getFloat(); + mfSectionSpaceAfter = propList["fo:margin-bottom"]->getDouble(); else if (propList["libwpd:margin-bottom"]) - mfSectionSpaceAfter = propList["libwpd:margin-bottom"]->getFloat(); + mfSectionSpaceAfter = propList["libwpd:margin-bottom"]->getDouble(); WPXString sSectionName; sSectionName.sprintf("Section%i", mSectionStyles.size()); Index: TextRunStyle.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/TextRunStyle.cxx,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- TextRunStyle.cxx 10 Sep 2007 14:34:43 -0000 1.17 +++ TextRunStyle.cxx 3 Dec 2008 12:52:08 -0000 1.18 @@ -80,10 +80,10 @@ propList.insert("fo:margin-top", i()->getStr()); if (strcmp(i.key(), "fo:margin-bottom") == 0) { - if (i()->getFloat() > 0.0f) + if (i()->getDouble() > 0.0) propList.insert("fo:margin-bottom", i()->getStr()); else - propList.insert("fo:margin-bottom", 0.0f); + propList.insert("fo:margin-bottom", 0.0); } if (strcmp(i.key(), "fo:line-height") == 0) propList.insert("fo:line-height", i()->getStr()); @@ -105,7 +105,7 @@ WPXPropertyListVector::Iter i(mxTabStops); for (i.rewind(); i.next();) { - if (i()["style:position"] && i()["style:position"]->getFloat() < 0) + if (i()["style:position"] && i()["style:position"]->getDouble() < 0.0) continue; TagOpenElement tabStopOpen("style:tab-stop"); @@ -148,7 +148,7 @@ if (mPropList["fo:font-size"]) { - if (mPropList["fo:font-size"]->getFloat() > 0.0f) + if (mPropList["fo:font-size"]->getDouble() > 0.0) { propList.insert("style:font-size-asian", mPropList["fo:font-size"]->getStr()); propList.insert("style:font-size-complex", mPropList["fo:font-size"]->getStr()); Index: ListStyle.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/ListStyle.cxx,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ListStyle.cxx 17 Jul 2007 19:30:22 -0000 1.16 +++ ListStyle.cxx 3 Dec 2008 12:52:08 -0000 1.17 @@ -70,11 +70,11 @@ listLevelStyleOpen.write(pHandler); TagOpenElement stylePropertiesOpen("style:list-level-properties"); - if (mPropList["text:space-before"] && mPropList["text:space-before"]->getFloat() > 0.0f) + if (mPropList["text:space-before"] && mPropList["text:space-before"]->getDouble() > 0.0) stylePropertiesOpen.addAttribute("text:space-before", mPropList["text:space-before"]->getStr()); - if (mPropList["text:min-label-width"] && mPropList["text:min-label-width"]->getFloat() > 0.0f) + if (mPropList["text:min-label-width"] && mPropList["text:min-label-width"]->getDouble() > 0.0) stylePropertiesOpen.addAttribute("text:min-label-width", mPropList["text:min-label-width"]->getStr()); - if (mPropList["text:min-label-distance"] && mPropList["text:min-label-distance"]->getFloat() > 0.0f) + if (mPropList["text:min-label-distance"] && mPropList["text:min-label-distance"]->getDouble() > 0.0) stylePropertiesOpen.addAttribute("text:min-label-distance", mPropList["text:min-label-distance"]->getStr()); stylePropertiesOpen.write(pHandler); @@ -117,11 +117,11 @@ listLevelStyleOpen.write(pHandler); TagOpenElement stylePropertiesOpen("style:list-level-properties"); - if (mPropList["text:space-before"] && mPropList["text:space-before"]->getFloat() > 0.0f) + if (mPropList["text:space-before"] && mPropList["text:space-before"]->getDouble() > 0.0) stylePropertiesOpen.addAttribute("text:space-before", mPropList["text:space-before"]->getStr()); - if (mPropList["text:min-label-width"] && mPropList["text:min-label-width"]->getFloat() > 0.0f) + if (mPropList["text:min-label-width"] && mPropList["text:min-label-width"]->getDouble() > 0.0) stylePropertiesOpen.addAttribute("text:min-label-width", mPropList["text:min-label-width"]->getStr()); - if (mPropList["text:min-label-distance"] && mPropList["text:min-label-distance"]->getFloat() > 0.0f) + if (mPropList["text:min-label-distance"] && mPropList["text:min-label-distance"]->getDouble() > 0.0) stylePropertiesOpen.addAttribute("text:min-label-distance", mPropList["text:min-label-distance"]->getStr()); stylePropertiesOpen.addAttribute("style:font-name", "OpenSymbol"); stylePropertiesOpen.write(pHandler); |
From: Fridrich S. <str...@us...> - 2008-12-03 12:30:43
|
Update of /cvsroot/libwpd/libwpd2/src/conv/html In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2125/src/conv/html Modified Files: HtmlDocumentGenerator.cpp Log Message: some little change Index: HtmlDocumentGenerator.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/html/HtmlDocumentGenerator.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- HtmlDocumentGenerator.cpp 3 Dec 2008 12:16:00 -0000 1.5 +++ HtmlDocumentGenerator.cpp 3 Dec 2008 12:30:38 -0000 1.6 @@ -142,7 +142,7 @@ if (propList["fo:text-indent"]) *m_pOutputStream << "text-indent:" << propList["fo:text-indent"]->getStr().cstr() << ";"; - if (propList["fo:line-height"] && propList["fo:line-height"]->getDouble() != 1.0f) + if (propList["fo:line-height"] && propList["fo:line-height"]->getDouble() != 1.0) *m_pOutputStream << "line-height:" << propList["fo:line-height"]->getDouble() << ";"; *m_pOutputStream << "\">"; } |
From: Fridrich S. <str...@us...> - 2008-12-03 12:16:08
|
Update of /cvsroot/libwpd/libwpd2/src/conv/html In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv794/src/conv/html Modified Files: HtmlDocumentGenerator.cpp Log Message: use double instead of float in WPXProperty* stuff Index: HtmlDocumentGenerator.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/html/HtmlDocumentGenerator.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- HtmlDocumentGenerator.cpp 3 Dec 2008 05:28:07 -0000 1.4 +++ HtmlDocumentGenerator.cpp 3 Dec 2008 12:16:00 -0000 1.5 @@ -142,8 +142,8 @@ if (propList["fo:text-indent"]) *m_pOutputStream << "text-indent:" << propList["fo:text-indent"]->getStr().cstr() << ";"; - if (propList["fo:line-height"] && propList["fo:line-height"]->getFloat() != 1.0f) - *m_pOutputStream << "line-height:" << propList["fo:line-height"]->getFloat() << ";"; + if (propList["fo:line-height"] && propList["fo:line-height"]->getDouble() != 1.0f) + *m_pOutputStream << "line-height:" << propList["fo:line-height"]->getDouble() << ";"; *m_pOutputStream << "\">"; } } |
From: Fridrich S. <str...@us...> - 2008-12-03 12:16:05
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv794/src/lib Modified Files: WPXProperty.cpp WPXProperty.h WPXPropertyList.cpp WPXPropertyList.h Log Message: use double instead of float in WPXProperty* stuff Index: WPXPropertyList.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXPropertyList.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- WPXPropertyList.cpp 4 Jul 2007 20:39:41 -0000 1.12 +++ WPXPropertyList.cpp 3 Dec 2008 12:16:00 -0000 1.13 @@ -136,7 +136,7 @@ m_mapImpl->insert(name, WPXPropertyFactory::newStringProp(val)); } -void WPXPropertyList::insert(const char * name, const float val, const WPXUnit units) +void WPXPropertyList::insert(const char * name, const double val, const WPXUnit units) { if (units == WPX_INCH) m_mapImpl->insert(name, WPXPropertyFactory::newInchProp(val)); Index: WPXPropertyList.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXPropertyList.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- WPXPropertyList.h 4 Jul 2007 20:39:41 -0000 1.13 +++ WPXPropertyList.h 3 Dec 2008 12:16:00 -0000 1.14 @@ -45,7 +45,7 @@ void insert(const char * name, const int val); void insert(const char * name, const bool val); void insert(const char * name, const WPXString &val); - void insert(const char * name, const float val, const WPXUnit units = WPX_INCH); + void insert(const char * name, const double val, const WPXUnit units = WPX_INCH); void remove(const char * name); const WPXProperty * operator[](const char *name) const; Index: WPXProperty.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXProperty.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- WPXProperty.cpp 9 Nov 2007 16:02:41 -0000 1.17 +++ WPXProperty.cpp 3 Dec 2008 12:16:00 -0000 1.18 @@ -32,7 +32,7 @@ WPXStringProperty(const WPXString &str); WPXStringProperty(const char * str); virtual int getInt() const; - virtual float getFloat() const; + virtual double getDouble() const; virtual WPXString getStr() const; virtual WPXProperty * clone() const; @@ -45,7 +45,7 @@ public: WPXIntProperty(const int val); virtual int getInt() const; - virtual float getFloat() const; + virtual double getDouble() const; virtual WPXString getStr() const; virtual WPXProperty * clone() const; @@ -61,45 +61,45 @@ virtual WPXProperty * clone() const; }; -class WPXFloatProperty : public WPXProperty +class WPXDoubleProperty : public WPXProperty { public: - WPXFloatProperty(const float val); + WPXDoubleProperty(const double val); virtual int getInt() const; - virtual float getFloat() const; + virtual double getDouble() const; private: - float m_val; + double m_val; }; -class WPXInchProperty : public WPXFloatProperty +class WPXInchProperty : public WPXDoubleProperty { public: - WPXInchProperty(const float val); + WPXInchProperty(const double val); virtual WPXString getStr() const; virtual WPXProperty * clone() const; }; -class WPXPercentProperty : public WPXFloatProperty +class WPXPercentProperty : public WPXDoubleProperty { public: - WPXPercentProperty(const float val); + WPXPercentProperty(const double val); virtual WPXString getStr() const; virtual WPXProperty * clone() const; }; -class WPXPointProperty : public WPXFloatProperty +class WPXPointProperty : public WPXDoubleProperty { public: - WPXPointProperty(const float val); + WPXPointProperty(const double val); virtual WPXString getStr() const; virtual WPXProperty * clone() const; }; -class WPXTwipProperty : public WPXFloatProperty +class WPXTwipProperty : public WPXDoubleProperty { public: - WPXTwipProperty(const float val); + WPXTwipProperty(const double val); virtual WPXString getStr() const; virtual WPXProperty * clone() const; }; @@ -121,7 +121,7 @@ return 0; } -float WPXStringProperty::getFloat() const +double WPXStringProperty::getDouble() const { return 0.0f; } @@ -146,9 +146,9 @@ return m_val; } -float WPXIntProperty::getFloat() const +double WPXIntProperty::getDouble() const { - return (float)m_val; + return (double)m_val; } WPXString WPXIntProperty::getStr() const @@ -180,57 +180,57 @@ return new WPXBoolProperty(getInt() != 0); } -WPXFloatProperty::WPXFloatProperty(const float val) : +WPXDoubleProperty::WPXDoubleProperty(const double val) : m_val(val) { } -int WPXFloatProperty::getInt() const +int WPXDoubleProperty::getInt() const { return (int)m_val; } -float WPXFloatProperty::getFloat() const +double WPXDoubleProperty::getDouble() const { return m_val; } -WPXInchProperty::WPXInchProperty(const float val) : - WPXFloatProperty(val) +WPXInchProperty::WPXInchProperty(const double val) : + WPXDoubleProperty(val) { } WPXString WPXInchProperty::getStr() const { - WPXString str = doubleToString(getFloat()); + WPXString str = doubleToString(getDouble()); str.append("in"); return str; } WPXProperty * WPXInchProperty::clone() const { - return new WPXInchProperty(getFloat()); + return new WPXInchProperty(getDouble()); } -WPXPercentProperty::WPXPercentProperty(const float val) : - WPXFloatProperty(val) +WPXPercentProperty::WPXPercentProperty(const double val) : + WPXDoubleProperty(val) { } WPXString WPXPercentProperty::getStr() const { - WPXString str = doubleToString(getFloat()*100.0f); + WPXString str = doubleToString(getDouble()*100.0f); str.append("%"); return str; } WPXProperty * WPXPercentProperty::clone() const { - return new WPXPercentProperty(getFloat()); + return new WPXPercentProperty(getDouble()); } -WPXPointProperty::WPXPointProperty(const float val) : - WPXFloatProperty(val) +WPXPointProperty::WPXPointProperty(const double val) : + WPXDoubleProperty(val) { } @@ -243,11 +243,11 @@ WPXProperty * WPXPointProperty::clone() const { - return new WPXPointProperty(getFloat()); + return new WPXPointProperty(getDouble()); } -WPXTwipProperty::WPXTwipProperty(const float val) : - WPXFloatProperty(val) +WPXTwipProperty::WPXTwipProperty(const double val) : + WPXDoubleProperty(val) { } @@ -260,7 +260,7 @@ WPXProperty * WPXTwipProperty::clone() const { - return new WPXTwipProperty(getFloat()); + return new WPXTwipProperty(getDouble()); } WPXProperty * WPXPropertyFactory::newStringProp(const WPXString &str) @@ -283,22 +283,22 @@ return static_cast<WPXProperty *>(new WPXBoolProperty(val)); } -WPXProperty * WPXPropertyFactory::newInchProp(const float val) +WPXProperty * WPXPropertyFactory::newInchProp(const double val) { return static_cast<WPXProperty *>(new WPXInchProperty(val)); } -WPXProperty * WPXPropertyFactory::newPercentProp(const float val) +WPXProperty * WPXPropertyFactory::newPercentProp(const double val) { return static_cast<WPXProperty *>(new WPXPercentProperty(val)); } -WPXProperty * WPXPropertyFactory::newPointProp(const float val) +WPXProperty * WPXPropertyFactory::newPointProp(const double val) { return static_cast<WPXProperty *>(new WPXPointProperty(val)); } -WPXProperty * WPXPropertyFactory::newTwipProp(const float val) +WPXProperty * WPXPropertyFactory::newTwipProp(const double val) { return static_cast<WPXProperty *>(new WPXTwipProperty(val)); } Index: WPXProperty.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXProperty.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- WPXProperty.h 4 Jul 2007 20:39:41 -0000 1.13 +++ WPXProperty.h 3 Dec 2008 12:16:00 -0000 1.14 @@ -34,7 +34,7 @@ public: virtual ~WPXProperty(); virtual int getInt() const = 0; - virtual float getFloat() const = 0; + virtual double getDouble() const = 0; virtual WPXString getStr() const = 0; virtual WPXProperty * clone() const = 0; }; @@ -46,9 +46,9 @@ static WPXProperty * newStringProp(const char *str); static WPXProperty * newIntProp(const int val); static WPXProperty * newBoolProp(const bool val); - static WPXProperty * newInchProp(const float val); - static WPXProperty * newPercentProp(const float val); - static WPXProperty * newPointProp(const float val); - static WPXProperty * newTwipProp(const float val); + static WPXProperty * newInchProp(const double val); + static WPXProperty * newPercentProp(const double val); + static WPXProperty * newPointProp(const double val); + static WPXProperty * newTwipProp(const double val); }; #endif /* WPXPROPERTY_H */ |
From: Fridrich S. <str...@us...> - 2008-12-03 05:28:37
|
Update of /cvsroot/libwpd/libwpd2/src/conv/html In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14836/src/conv/html Modified Files: HtmlDocumentGenerator.cpp HtmlDocumentGenerator.h Log Message: adding an WPXPropertyListVector::operator= + making wpd2html a little bit more useful Index: HtmlDocumentGenerator.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/html/HtmlDocumentGenerator.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- HtmlDocumentGenerator.h 29 Oct 2008 19:58:54 -0000 1.4 +++ HtmlDocumentGenerator.h 3 Dec 2008 05:28:07 -0000 1.5 @@ -27,6 +27,8 @@ #ifndef HTMLLISTENERIMPL_H #define HTMLLISTENERIMPL_H +#include <ostream> +#include <sstream> #include "WPXDocumentInterface.h" class HtmlDocumentGenerator : public WPXDocumentInterface @@ -91,6 +93,10 @@ private: bool m_ignore; + std::ostream *m_pOutputStream; + std::ostringstream m_footNotesStream, m_endNotesStream, m_commentsStream, m_textBoxesStream, m_dummyStream; + unsigned m_footNotesCount, m_endNotesCount, m_commentsCount, m_textBoxesCount; + unsigned m_commentNumber, m_textBoxNumber; }; Index: HtmlDocumentGenerator.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/html/HtmlDocumentGenerator.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- HtmlDocumentGenerator.cpp 9 Nov 2007 16:02:41 -0000 1.3 +++ HtmlDocumentGenerator.cpp 3 Dec 2008 05:28:07 -0000 1.4 @@ -26,13 +26,21 @@ */ #include <stdio.h> +#include <iostream> #include "HtmlDocumentGenerator.h" // use the BELL code to represent a TAB for now #define UCS_TAB 0x0009 HtmlDocumentGenerator::HtmlDocumentGenerator() : - m_ignore(false) + m_ignore(false), + m_pOutputStream(&std::cout), + m_footNotesCount(0), + m_endNotesCount(0), + m_commentsCount(0), + m_textBoxesCount(0), + m_commentNumber(1), + m_textBoxNumber(1) { } @@ -43,38 +51,57 @@ void HtmlDocumentGenerator::setDocumentMetaData(const WPXPropertyList &propList) { if (propList["author"]) - printf("<meta name=\"author\" content=\"%s\">\n", propList["author"]->getStr().cstr()); + *m_pOutputStream << "<meta name=\"author\" content=\"" << propList["author"]->getStr().cstr() << "\">" << std::endl; if (propList["subject"]) - printf("<meta name=\"subject\" content=\"%s\">\n", propList["subject"]->getStr().cstr()); + *m_pOutputStream << "<meta name=\"subject\" content=\"" << propList["subject"]->getStr().cstr() << "\">" << std::endl; if (propList["publisher"]) - printf("<meta name=\"publisher\" content=\"%s\">\n", propList["publisher"]->getStr().cstr()); + *m_pOutputStream << "<meta name=\"publisher\" content=\"" << propList["publisher"]->getStr().cstr() << "\">" << std::endl; if (propList["keywords"]) - printf("<meta name=\"keywords\" content=\"%s\">\n", propList["keywords"]->getStr().cstr()); + *m_pOutputStream << "<meta name=\"keywords\" content=\"" << propList["keywords"]->getStr().cstr() << "\">" << std::endl; if (propList["language"]) - printf("<meta name=\"language\" content=\"%s\">\n", propList["language"]->getStr().cstr()); + *m_pOutputStream << "<meta name=\"language\" content=\"" << propList["language"]->getStr().cstr() << "\">" << std::endl; if (propList["abstract"]) - printf("<meta name=\"abstract\" content=\"%s\">\n", propList["abstract"]->getStr().cstr()); + *m_pOutputStream << "<meta name=\"abstract\" content=\"" << propList["abstract"]->getStr().cstr() << "\">" << std::endl; if (propList["descriptive-name"]) - printf("<meta name=\"descriptive-name\" content=\"%s\">\n", propList["descriptive-name"]->getStr().cstr()); + *m_pOutputStream << "<meta name=\"descriptive-name\" content=\"" << propList["descriptive-name"]->getStr().cstr() << "\">" << std::endl; if (propList["descriptive-type"]) - printf("<meta name=\"descriptive-type\" content=\"%s\">\n", propList["descriptive-type"]->getStr().cstr()); + *m_pOutputStream << "<meta name=\"descriptive-type\" content=\"" << propList["descriptive-type"]->getStr().cstr() << "\">" << std::endl; } void HtmlDocumentGenerator::startDocument() { - printf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"); - printf("<html>\n"); - printf("<head>\n"); - printf("<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" >\n"); - printf("</head>\n"); - printf("<body>\n"); + *m_pOutputStream << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">" << std::endl; + *m_pOutputStream << "<html>" << std::endl; + *m_pOutputStream << "<head>" << std::endl; + *m_pOutputStream << "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" >" << std::endl; + *m_pOutputStream << "</head>" << std::endl; + *m_pOutputStream << "<body>" << std::endl; } void HtmlDocumentGenerator::endDocument() { - printf("\n"); - printf("</body>\n"); - printf("</html>\n"); + if (m_footNotesStream.str().length()) + { + *m_pOutputStream << "<p><b>FOOTNOTES</b></p>" << std::endl; + *m_pOutputStream << m_footNotesStream.str() << std::endl; + } + if (m_endNotesStream.str().length()) + { + *m_pOutputStream << "<p><b>ENDNOTES</b></p>" << std::endl; + *m_pOutputStream << m_endNotesStream.str() << std::endl; + } + if (m_commentsStream.str().length()) + { + *m_pOutputStream << "<p><b>COMMENTS AND ANNOTATIONS</b></p>" << std::endl; + *m_pOutputStream << m_commentsStream.str() << std::endl; + } + if (m_textBoxesStream.str().length()) + { + *m_pOutputStream << "<p><b>TEXT BOXES</b></p>" << std::endl; + *m_pOutputStream << m_textBoxesStream.str() << std::endl; + } + *m_pOutputStream << "</body>" << std::endl; + *m_pOutputStream << "</html>" << std::endl; } void HtmlDocumentGenerator::openHeader(const WPXPropertyList & /* propList */) @@ -102,22 +129,22 @@ { if (!m_ignore) { - printf("<p style=\""); + *m_pOutputStream << "<p style=\""; if (propList["fo:text-align"]) { if (propList["fo:text-align"]->getStr() == WPXString("end")) // stupid OOo convention.. - printf("text-align:right;"); + *m_pOutputStream << "text-align:right;"; else - printf("text-align:%s;", propList["fo:text-align"]->getStr().cstr()); + *m_pOutputStream << "text-align:" << propList["fo:text-align"]->getStr().cstr() << ";"; } if (propList["fo:text-indent"]) - printf("text-indent:%s;", propList["fo:text-indent"]->getStr().cstr()); + *m_pOutputStream << "text-indent:" << propList["fo:text-indent"]->getStr().cstr() << ";"; if (propList["fo:line-height"] && propList["fo:line-height"]->getFloat() != 1.0f) - printf("line-height:%f;", propList["fo:line-height"]->getFloat()); - printf("\">"); + *m_pOutputStream << "line-height:" << propList["fo:line-height"]->getFloat() << ";"; + *m_pOutputStream << "\">"; } } @@ -125,7 +152,7 @@ { if (!m_ignore) { - printf("</p>\n"); + *m_pOutputStream << "</p>" << std::endl; } } @@ -134,27 +161,27 @@ if (!m_ignore) { - printf("<span style=\""); + *m_pOutputStream << "<span style=\""; if (propList["style:font-name"]) - printf("font-family: \'%s\';", propList["style:font-name"]->getStr().cstr()); + *m_pOutputStream << "font-family: \'" << propList["style:font-name"]->getStr().cstr() << "\';"; if (propList["fo:font-size"]) - printf("font-size: %s;", propList["fo:font-size"]->getStr().cstr()); + *m_pOutputStream << "font-size: " << propList["fo:font-size"]->getStr().cstr() << ";"; if (propList["fo:font-weight"]) - printf("font-weight: %s;", propList["fo:font-weight"]->getStr().cstr()); + *m_pOutputStream << "font-weight: " << propList["fo:font-weight"]->getStr().cstr() << ";"; if (propList["fo:font-style"]) - printf("font-style: %s;", propList["fo:font-style"]->getStr().cstr()); + *m_pOutputStream << "font-style: " << propList["fo:font-style"]->getStr().cstr() << ";"; if (propList["style:text-crossing-out"] && propList["style:text-crossing-out"]->getStr() == WPXString("single-line")) - printf("text-decoration:line-through;"); + *m_pOutputStream << "text-decoration:line-through;"; if (propList["style:text-underline"]) // don't know if double underline is possible - printf("text-decoration:underline;"); + *m_pOutputStream << "text-decoration:underline;"; if (propList["style:text-blinking"]) - printf("text-decoration:blink;"); + *m_pOutputStream << "text-decoration:blink;"; if (propList["fo:color"]) - printf("color:%s;", propList["fo:color"]->getStr().cstr()); + *m_pOutputStream << "color:" << propList["fo:color"]->getStr().cstr() << ";"; if (propList["style:text-background-color"]) - printf("background-color:%s;", propList["style:text-background-color"]->getStr().cstr()); + *m_pOutputStream << "background-color:" << propList["style:text-background-color"]->getStr().cstr() << ";"; - printf("\">"); + *m_pOutputStream << "\">"; } } @@ -162,7 +189,7 @@ { if (!m_ignore) { - printf("</span>\n"); + *m_pOutputStream << "</span>" << std::endl; } } @@ -170,8 +197,8 @@ { if (!m_ignore) { - - printf("%c", UCS_TAB); + // Does not have a lot of effect since tabs in html are ignorable white-space + *m_pOutputStream << "\t"; } } @@ -180,7 +207,7 @@ if (!m_ignore) { - printf("<br>\n"); + *m_pOutputStream << "<br>" << std::endl; } } @@ -190,7 +217,7 @@ { WPXString tempUTF8(text, true); - printf("%s", tempUTF8.cstr()); + *m_pOutputStream << tempUTF8.cstr(); } } @@ -198,7 +225,7 @@ { if (!m_ignore) { - printf("<ol>\n"); + *m_pOutputStream << "<ol>" << std::endl; } } @@ -206,7 +233,7 @@ { if (!m_ignore) { - printf("</ol>\n"); + *m_pOutputStream << "</ol>" << std::endl; } } @@ -214,7 +241,7 @@ { if (!m_ignore) { - printf("<ul>\n"); + *m_pOutputStream << "<ul>" << std::endl; } } @@ -222,7 +249,7 @@ { if (!m_ignore) { - printf("</ul>\n"); + *m_pOutputStream << "</ul>" << std::endl; } } @@ -231,7 +258,7 @@ { if (!m_ignore) { - printf("<li>"); + *m_pOutputStream << "<li>"; } } @@ -239,7 +266,7 @@ { if (!m_ignore) { - printf("</li>\n"); + *m_pOutputStream << "</li>" << std::endl; } } @@ -247,11 +274,19 @@ { if (!m_ignore) { - // Cheesey hack.. - if (propList["libwpd:number"]) - printf("<p>%s:</p>", propList["libwpd:number"]->getStr().cstr()); + if (!m_footNotesCount++) + { + if (propList["libwpd:number"]) + *m_pOutputStream << "<sup>(footnote: " << propList["libwpd:number"]->getStr().cstr() << ")</sup>"; + m_pOutputStream = &m_footNotesStream; + // Cheesey hack.. + if (propList["libwpd:number"]) + *m_pOutputStream << "<p>" << propList["libwpd:number"]->getStr().cstr() << ":</p>"; + else + *m_pOutputStream << "<p/>"; + } else - printf("<p/>"); + m_pOutputStream = &m_dummyStream; } } @@ -259,7 +294,11 @@ { if (!m_ignore) { - printf("<p/>\n"); + if (!(--m_footNotesCount)) + { + *m_pOutputStream << "<p/>" << std::endl; + m_pOutputStream = &std::cout; + } } } @@ -267,11 +306,19 @@ { if (!m_ignore) { - // Cheesey hack.. - if (propList["libwpd:number"]) - printf("<p>%s:</p>", propList["libwpd:number"]->getStr().cstr()); + if (!m_endNotesCount++) + { + if (propList["libwpd:number"]) + *m_pOutputStream << "<sup>(endnote: " << propList["libwpd:number"]->getStr().cstr() << ")</sup>"; + m_pOutputStream = &m_footNotesStream; + // Cheesey hack.. + if (propList["libwpd:number"]) + *m_pOutputStream << "<p>" << propList["libwpd:number"]->getStr().cstr() << ":</p>"; + else + *m_pOutputStream << "<p/>"; + } else - printf("<p/>"); + m_pOutputStream = &m_dummyStream; } } @@ -279,7 +326,11 @@ { if (!m_ignore) { - printf("<p/>\n"); + if (!(--m_endNotesCount)) + { + *m_pOutputStream << "<p/>" << std::endl; + m_pOutputStream = &std::cout; + } } } @@ -287,7 +338,15 @@ { if (!m_ignore) { - printf("<p/>"); + if (!m_commentsCount++) + { + *m_pOutputStream << "<sup>(comment: " << m_commentNumber << ")</sup>"; + m_pOutputStream = &m_commentsStream; + *m_pOutputStream << "<p>Comment " << m_commentNumber++ << ":</p>" << std::endl; + *m_pOutputStream << "<p/>"; + } + else + m_pOutputStream = &m_dummyStream; } } @@ -295,7 +354,11 @@ { if (!m_ignore) { - printf("<p/>\n"); + if (!(--m_commentsCount)) + { + *m_pOutputStream << "<p/>" << std::endl; + m_pOutputStream = &std::cout; + } } } @@ -303,7 +366,16 @@ { if (!m_ignore) { - printf("<p/>"); + if (!m_textBoxesCount) + { + *m_pOutputStream << "<sup>(text box: " << m_textBoxNumber << ")</sup>"; + m_pOutputStream = &m_commentsStream; + *m_pOutputStream << "<p>Text Box " << m_textBoxNumber++ << ":</p>" << std::endl; + m_pOutputStream = &m_textBoxesStream; + *m_pOutputStream << "<p/>"; + } + else + m_pOutputStream = &m_dummyStream; } } @@ -311,7 +383,11 @@ { if (!m_ignore) { - printf("<p/>\n"); + if (!(--m_textBoxesCount)) + { + *m_pOutputStream << "<p/>" << std::endl; + m_pOutputStream = &std::cout; + } } } @@ -319,8 +395,8 @@ { if (!m_ignore) { - printf("<table border=\"1\">\n"); - printf("<tbody>\n"); + *m_pOutputStream << "<table border=\"1\">" << std::endl; + *m_pOutputStream << "<tbody>" << std::endl; } } @@ -328,7 +404,7 @@ { if (!m_ignore) { - printf("<tr>\n"); + *m_pOutputStream << "<tr>" << std::endl; } } @@ -336,7 +412,7 @@ { if (!m_ignore) { - printf("</tr>\n"); + *m_pOutputStream << "</tr>" << std::endl; } } @@ -344,18 +420,18 @@ { if (!m_ignore) { - printf("<td style=\""); + *m_pOutputStream << "<td style=\""; if (propList["fo:background-color"]) - printf("background-color:%s;", propList["fo:background-color"]->getStr().cstr()); + *m_pOutputStream << "background-color:" << propList["fo:background-color"]->getStr().cstr() << ";"; - printf("\" "); + *m_pOutputStream << "\" "; if (propList["table:number-columns-spanned"]) - printf("colspan=\"%d\" ", propList["table:number-columns-spanned"]->getInt()); + *m_pOutputStream << "colspan=\"" << propList["table:number-columns-spanned"]->getInt() << "\" "; if (propList["table:number-rows-spanned"]) - printf("rowspan=\"%d\" ", propList["table:number-rows-spanned"]->getInt()); + *m_pOutputStream << "rowspan=\"" << propList["table:number-rows-spanned"]->getInt() << "\" "; - printf(">\n"); + *m_pOutputStream << ">" << std::endl; } } @@ -363,7 +439,7 @@ { if (!m_ignore) { - printf("</td>\n"); + *m_pOutputStream << "</td>" << std::endl; } } @@ -371,7 +447,7 @@ { if (!m_ignore) { - printf("</tbody>\n"); - printf("</table>\n"); + *m_pOutputStream << "</tbody>" << std::endl; + *m_pOutputStream << "</table>" << std::endl; } } |
From: Fridrich S. <str...@us...> - 2008-12-03 05:28:16
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14836/src/lib Modified Files: WPXPropertyListVector.cpp WPXPropertyListVector.h Log Message: adding an WPXPropertyListVector::operator= + making wpd2html a little bit more useful Index: WPXPropertyListVector.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXPropertyListVector.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- WPXPropertyListVector.cpp 25 Nov 2008 11:53:48 -0000 1.10 +++ WPXPropertyListVector.cpp 3 Dec 2008 05:28:07 -0000 1.11 @@ -111,6 +111,12 @@ const WPXPropertyList& WPXPropertyListVector::operator[](size_t index) const { return m_impl->operator[](index); +} + +const WPXPropertyListVector& WPXPropertyListVector::operator=(const WPXPropertyListVector &vec) +{ + m_impl->m_vector = vec.m_impl->m_vector; + return *this; } WPXPropertyListVector::Iter::Iter(const WPXPropertyListVector &vect) : Index: WPXPropertyListVector.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXPropertyListVector.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- WPXPropertyListVector.h 25 Nov 2008 11:53:48 -0000 1.9 +++ WPXPropertyListVector.h 3 Dec 2008 05:28:07 -0000 1.10 @@ -47,6 +47,7 @@ void append(const WPXPropertyListVector &vec); size_t count() const; const WPXPropertyList& operator[](size_t index) const; + const WPXPropertyListVector& operator=(const WPXPropertyListVector&); class Iter { @@ -68,7 +69,6 @@ private: WPXPropertyListVectorImpl *m_impl; - WPXPropertyListVector& operator=(WPXPropertyListVector&); }; #endif /* WPXPROPERTYLISTVECTOR_H */ |
From: Fridrich S. <str...@us...> - 2008-11-28 12:27:01
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28528/filter Modified Files: OdgExporter.cxx OdgExporter.hxx Log Message: adapting to the new setStyle callback Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- OdgExporter.cxx 28 Nov 2008 11:53:38 -0000 1.25 +++ OdgExporter.cxx 28 Nov 2008 12:26:16 -0000 1.26 @@ -242,13 +242,9 @@ mpHandler->endDocument(); } -void OdgExporter::setPen(const libwpg::WPGPen& pen) +void OdgExporter::setStyle(const libwpg::WPGPen& pen, const libwpg::WPGBrush& brush, const ::WPXPropertyList & /*propList*/) { mxPen = pen; -} - -void OdgExporter::setBrush(const libwpg::WPGBrush& brush) -{ mxBrush = brush; } Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.hxx,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- OdgExporter.hxx 28 Nov 2008 11:53:38 -0000 1.12 +++ OdgExporter.hxx 28 Nov 2008 12:26:16 -0000 1.13 @@ -47,9 +47,7 @@ void startEmbeddedGraphics(const ::WPXPropertyList& /*propList*/) {} void endEmbeddedGraphics() {} - void setPen(const libwpg::WPGPen& pen); - void setBrush(const libwpg::WPGBrush& brush); - void setFillRule(const ::WPXPropertyList & /*propList*/) {}; + void setStyle(const libwpg::WPGPen& pen, const libwpg::WPGBrush& brush, const ::WPXPropertyList &propList); void drawRectangle(const ::WPXPropertyList &propList); void drawEllipse(const ::WPXPropertyList &propList); |
From: Fridrich S. <str...@us...> - 2008-11-28 11:56:12
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18319/filter Modified Files: OdgExporter.cxx OdgExporter.hxx Log Message: adapting to the fact that WPGBitmap is not in public api anymore Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- OdgExporter.cxx 27 Nov 2008 21:43:28 -0000 1.24 +++ OdgExporter.cxx 28 Nov 2008 11:53:38 -0000 1.25 @@ -458,29 +458,6 @@ mBodyElements.push_back(new TagCloseElement("draw:path")); } -void OdgExporter::drawBitmap(const ::WPXPropertyList &propList, const libwpg::WPGBitmap& bitmap) -{ - TagOpenElement *pDrawFrameElement = new TagOpenElement("draw:frame"); - 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.getDIB().getBase64Data(); - mBodyElements.push_back(new CharDataElement(base64Binary.cstr())); - - mBodyElements.push_back(new TagCloseElement("office:binary-data")); - - mBodyElements.push_back(new TagCloseElement("draw:image")); - - mBodyElements.push_back(new TagCloseElement("draw:frame")); -} - void OdgExporter::drawImageObject(const ::WPXPropertyList &propList, const ::WPXBinaryData& binaryData) { if (!propList["libwpg:mime-type"] && propList["libwpg:mime-type"]->getStr().len() <= 0) Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.hxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- OdgExporter.hxx 27 Nov 2008 21:43:28 -0000 1.11 +++ OdgExporter.hxx 28 Nov 2008 11:53:38 -0000 1.12 @@ -56,7 +56,6 @@ void drawPolyline(const ::WPXPropertyListVector& vertices); void drawPolygon(const ::WPXPropertyListVector& vertices); void drawPath(const ::WPXPropertyListVector& path); - void drawBitmap(const ::WPXPropertyList &propList, const libwpg::WPGBitmap& bitmap); void drawImageObject(const ::WPXPropertyList &propList, const ::WPXBinaryData& binaryData); private: |
From: Fridrich S. <str...@us...> - 2008-11-27 22:17:39
|
Update of /cvsroot/libwpd/writerperfect/filter In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18251/filter Modified Files: OdgExporter.cxx OdgExporter.hxx Log Message: adapt to the setFillRule api change Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- OdgExporter.cxx 27 Nov 2008 16:35:08 -0000 1.23 +++ OdgExporter.cxx 27 Nov 2008 21:43:28 -0000 1.24 @@ -37,7 +37,6 @@ OdgExporter::OdgExporter(DocumentHandler *pHandler, const bool isFlatXML): mpHandler(pHandler), - mxFillRule(AlternatingFill), miGradientIndex(1), miDashIndex(1), miGraphicsStyleIndex(1), @@ -253,11 +252,6 @@ mxBrush = brush; } -void OdgExporter::setFillRule(FillRule rule) -{ - mxFillRule = rule; -} - void OdgExporter::startLayer(const ::WPXPropertyList & /* propList */) { } Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.hxx,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- OdgExporter.hxx 27 Nov 2008 16:35:08 -0000 1.10 +++ OdgExporter.hxx 27 Nov 2008 21:43:28 -0000 1.11 @@ -49,7 +49,7 @@ void setPen(const libwpg::WPGPen& pen); void setBrush(const libwpg::WPGBrush& brush); - void setFillRule(FillRule rule); + void setFillRule(const ::WPXPropertyList & /*propList*/) {}; void drawRectangle(const ::WPXPropertyList &propList); void drawEllipse(const ::WPXPropertyList &propList); @@ -76,7 +76,6 @@ libwpg::WPGPen mxPen; libwpg::WPGBrush mxBrush; - FillRule mxFillRule; int miGradientIndex; int miDashIndex; int miGraphicsStyleIndex; |
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: |
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); |
From: Fridrich S. <str...@us...> - 2008-11-26 09:34:13
|
Update of /cvsroot/libwpd/libwpd2-bindings/src/java In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23207/src/java Modified Files: test.sh.in Log Message: some more checks and trying to make the things as flawless as possible Index: test.sh.in =================================================================== RCS file: /cvsroot/libwpd/libwpd2-bindings/src/java/test.sh.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- test.sh.in 23 Nov 2008 17:15:59 -0000 1.7 +++ test.sh.in 26 Nov 2008 09:34:08 -0000 1.8 @@ -1,6 +1,6 @@ tmp=`mktemp -d` @WPD2RAW@ @top_srcdir@/src/java/examples/wp_test_document.wpd >$tmp/cpp.out -PATH="$PATH:./.libs" LD_LIBRARY_PATH="./.libs:$LD_LIBRARY_PATH" \ +PATH="$PATH:./.libs@WPD2RAW_PATH@" LD_LIBRARY_PATH="./.libs:$LD_LIBRARY_PATH" \ @JAVA@ -classpath "./wpd-@WPDBINDINGS_MAJOR_VERSION@.@WPDBINDINGS_MINOR_VERSION@.jar:./examples/" wpd2raw @top_srcdir@/src/java/examples/wp_test_document.wpd > $tmp/java.out diff -uw $tmp/cpp.out $tmp/java.out if [ $? == 0 ]; then |
From: Fridrich S. <str...@us...> - 2008-11-26 09:34:13
|
Update of /cvsroot/libwpd/libwpd2-bindings In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23207 Modified Files: configure.in Log Message: some more checks and trying to make the things as flawless as possible Index: configure.in =================================================================== RCS file: /cvsroot/libwpd/libwpd2-bindings/configure.in,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- configure.in 25 Nov 2008 21:02:19 -0000 1.21 +++ configure.in 26 Nov 2008 09:34:08 -0000 1.22 @@ -76,22 +76,22 @@ AC_PROG_JAVA AC_PROG_JAR -test x$GMCS = x && AC_PATH_PROG(GMCS, gmcs, no) -if test x$GMCS = xno; then +test x$GMCS = x && AC_PATH_PROG(GMCS, gmcs) +if test x$GMCS = x; then AC_MSG_ERROR([*** Could not find C-sharp compiler that supports generics.]) fi # The gacutil and mono can be besides gmcs PATH="$PATH:`dirname $GMCS`" -test x$GACUTIL = x && AC_PATH_PROG(GACUTIL, gacutil, no) -if test x$GACUTIL = xno; then +test x$GACUTIL = x && AC_PATH_PROG(GACUTIL, gacutil) +if test x$GACUTIL = x; then AC_MSG_WARN([Could not find gacutil. The resulting assemblies ]) AC_MSG_WARN([will not be installed in Global Assembly Cache.]) fi -test x$MONO = x && AC_PATH_PROG(MONO, mono, no) -if test x$MONO = xno; then +test x$MONO = x && AC_PATH_PROG(MONO, mono) +if test x$MONO = x; then AC_MSG_WARN([Could not find mono. The tests will possibly not run.]) fi @@ -134,8 +134,12 @@ if test x$WPD2RAW = x ; then AC_MSG_WARN([*** Could not find wpd2raw in your PATH.]) AC_MSG_WARN([*** The tests will not be built and run.]) + WPD2RAW_PATH= +else + WPD2RAW_PATH=":`dirname $WPD2RAW`" fi AC_SUBST(WPD2RAW) +AC_SUBST(WPD2RAW_PATH) AC_MSG_CHECKING([for Win32 platform in general]) case "$host" in |
From: Fridrich S. <str...@us...> - 2008-11-26 09:34:13
|
Update of /cvsroot/libwpd/libwpd2-bindings/src/csharp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23207/src/csharp Modified Files: test.sh.in Log Message: some more checks and trying to make the things as flawless as possible Index: test.sh.in =================================================================== RCS file: /cvsroot/libwpd/libwpd2-bindings/src/csharp/test.sh.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- test.sh.in 25 Nov 2008 21:02:19 -0000 1.8 +++ test.sh.in 26 Nov 2008 09:34:08 -0000 1.9 @@ -1,6 +1,6 @@ tmp=`mktemp -d` @WPD2RAW@ @top_srcdir@/src/java/examples/wp_test_document.wpd >$tmp/cpp.out -PATH="$PATH:./.libs" MONO_PATH="$MONO_PATH:./" LD_LIBRARY_PATH=./.libs @MONO@ ./examples/wpd2raw.exe @top_srcdir@/src/java/examples/wp_test_document.wpd > $tmp/csharp.out +PATH="$PATH:./.libs@WPD2RAW_PATH@" MONO_PATH="$MONO_PATH:./" LD_LIBRARY_PATH=./.libs @MONO@ ./examples/wpd2raw.exe @top_srcdir@/src/java/examples/wp_test_document.wpd > $tmp/csharp.out diff -uw $tmp/cpp.out $tmp/csharp.out if [ $? == 0 ]; then echo ok |
From: Fridrich S. <str...@us...> - 2008-11-25 21:02:30
|
Update of /cvsroot/libwpd/libwpd2-bindings/src/java In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3689/src/java Modified Files: Makefile.am Log Message: some more perfectionned checks Index: Makefile.am =================================================================== RCS file: /cvsroot/libwpd/libwpd2-bindings/src/java/Makefile.am,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Makefile.am 19 Nov 2008 13:18:20 -0000 1.22 +++ Makefile.am 25 Nov 2008 21:02:19 -0000 1.23 @@ -63,7 +63,7 @@ all: wpd-@WPDBINDINGS_MAJOR_VERSION@.@WPDBINDINGS_MINOR_VERSION@.jar wpd_java_wrap.cxx: - swig -c++ $(WPDBINDINGS_CXXFLAGS) -I./org/libwpd $(DEBUG_CXXFLAGS) -java -package org.libwpd -outdir org/libwpd \ + @SWIG@ -c++ $(WPDBINDINGS_CXXFLAGS) -I./org/libwpd $(DEBUG_CXXFLAGS) -java -package org.libwpd -outdir org/libwpd \ -o ./wpd_java_wrap.cxx -oh ./wpd_java_wrap.hxx $(top_srcdir)/src/wpd.i org/libwpd/wpd.class: org/libwpd/wpd.java |
From: Fridrich S. <str...@us...> - 2008-11-25 21:02:27
|
Update of /cvsroot/libwpd/libwpd2-bindings/src/csharp In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3689/src/csharp Modified Files: Makefile.am test.sh.in Log Message: some more perfectionned checks Index: Makefile.am =================================================================== RCS file: /cvsroot/libwpd/libwpd2-bindings/src/csharp/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile.am 19 Nov 2008 13:18:20 -0000 1.15 +++ Makefile.am 25 Nov 2008 21:02:19 -0000 1.16 @@ -86,14 +86,14 @@ install-exec-local: wpd-@WPDBINDINGS_MAJOR_VERSION@.@WPDBINDINGS_MINOR_VERSION@.dll mkdir -p $(DESTDIR)$(libexecdir)/mono/gac $(DESTDIR)$(libexecdir)/mono/libwpd - gacutil \ + @GACUTIL@ \ -i wpd-@WPDBINDINGS_MAJOR_VERSION@.@WPDBINDINGS_MINOR_VERSION@.dll \ -check_refs \ -root $(DESTDIR)$(libexecdir) \ -package libwpd uninstall-local: - gacutil \ + @GACUTIL@ \ -u wpd-@WPDBINDINGS_MAJOR_VERSION@.@WPDBINDINGS_MINOR_VERSION@,Version=@WPDBINDINGS_MAJOR_VERSION@.@WPDBINDINGS_MINOR_VERSION@.@WPDBINDINGS_MICRO_VERSION@.0 \ -root $(DESTDIR)$(libexecdir) \ -package libwpd @@ -102,7 +102,7 @@ sh test.sh wpd_sharp_wrap.cxx: - swig -c++ $(WPDBINDINGS_CXXFLAGS) $(DEBUG_CXXFLAGS) -csharp -outdir ./ -namespace org.libwpd -o ./wpd_sharp_wrap.cxx \ + @SWIG@ -c++ $(WPDBINDINGS_CXXFLAGS) $(DEBUG_CXXFLAGS) -csharp -outdir ./ -namespace org.libwpd -o ./wpd_sharp_wrap.cxx \ -oh ./wpd_sharp_wrap.hxx -dllimport libwpd-sharp-@WPDBINDINGS_MAJOR_VERSION@.@WPDBINDINGS_MINOR_VERSION@.dll \ $(top_srcdir)/src/wpd.i Index: test.sh.in =================================================================== RCS file: /cvsroot/libwpd/libwpd2-bindings/src/csharp/test.sh.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- test.sh.in 23 Nov 2008 17:15:59 -0000 1.7 +++ test.sh.in 25 Nov 2008 21:02:19 -0000 1.8 @@ -1,6 +1,6 @@ tmp=`mktemp -d` @WPD2RAW@ @top_srcdir@/src/java/examples/wp_test_document.wpd >$tmp/cpp.out -PATH="$PATH:./.libs" MONO_PATH="$MONO_PATH:./" LD_LIBRARY_PATH=./.libs mono ./examples/wpd2raw.exe @top_srcdir@/src/java/examples/wp_test_document.wpd > $tmp/csharp.out +PATH="$PATH:./.libs" MONO_PATH="$MONO_PATH:./" LD_LIBRARY_PATH=./.libs @MONO@ ./examples/wpd2raw.exe @top_srcdir@/src/java/examples/wp_test_document.wpd > $tmp/csharp.out diff -uw $tmp/cpp.out $tmp/csharp.out if [ $? == 0 ]; then echo ok |
From: Fridrich S. <str...@us...> - 2008-11-25 21:02:26
|
Update of /cvsroot/libwpd/libwpd2-bindings In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3689 Modified Files: configure.in Log Message: some more perfectionned checks Index: configure.in =================================================================== RCS file: /cvsroot/libwpd/libwpd2-bindings/configure.in,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- configure.in 23 Nov 2008 17:15:59 -0000 1.20 +++ configure.in 25 Nov 2008 21:02:19 -0000 1.21 @@ -76,11 +76,25 @@ AC_PROG_JAVA AC_PROG_JAR -AC_PATH_PROG(GMCS, gmcs, no) -if test "GMCS" = "no"; then +test x$GMCS = x && AC_PATH_PROG(GMCS, gmcs, no) +if test x$GMCS = xno; then AC_MSG_ERROR([*** Could not find C-sharp compiler that supports generics.]) fi +# The gacutil and mono can be besides gmcs +PATH="$PATH:`dirname $GMCS`" + +test x$GACUTIL = x && AC_PATH_PROG(GACUTIL, gacutil, no) +if test x$GACUTIL = xno; then + AC_MSG_WARN([Could not find gacutil. The resulting assemblies ]) + AC_MSG_WARN([will not be installed in Global Assembly Cache.]) +fi + +test x$MONO = x && AC_PATH_PROG(MONO, mono, no) +if test x$MONO = xno; then + AC_MSG_WARN([Could not find mono. The tests will possibly not run.]) +fi + AC_PROG_INSTALL AC_DISABLE_STATIC @@ -100,17 +114,18 @@ case "$host" in *-*-mingw*) native_win32=yes + AC_MSG_RESULT([$native_win32]) AC_CHECK_TOOL(WINDRES, windres) WPDJAVA_WIN32_RESOURCE=libwpd-java-win32res.lo WPDSHARP_WIN32_RESOURCE=libwpd-sharp-win32res.lo ;; *) native_win32=no + AC_MSG_RESULT([$native_win32]) WPDJAVA_WIN32_RESOURCE= WPDSHARP_WIN32_RESOURCE= ;; esac -AC_MSG_RESULT([$native_win32]) AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes) AC_SUBST(WPDJAVA_WIN32_RESOURCE) AC_SUBST(WPDSHARP_WIN32_RESOURCE) |