? all-diffs ? svg/stringstream.cpp Index: style-test.cpp =================================================================== RCS file: /cvsroot/inkscape/inkscape/src/style-test.cpp,v retrieving revision 1.14 diff -d -u -p -r1.14 style-test.cpp --- style-test.cpp 4 Jul 2005 02:57:55 -0000 1.14 +++ style-test.cpp 13 Jul 2005 09:04:55 -0000 @@ -391,7 +391,7 @@ test_style() // initial value "depends on user agent" {"display", "inline", "inline", enum_val, display_vals, true}, {"fill", "#000000", "black", paint_val, NULL, true}, - {"fill-opacity", "1.0000000", "1", opacity_val, NULL, true}, + {"fill-opacity", "1", "1", opacity_val, NULL, true}, {"fill-rule", "nonzero", "nonzero", enum_val, fill_rule_vals, true}, {"font-family", "Bitstream Vera Sans", "Bitstream Vera Sans", font_family_val, NULL, true}, // initial value depends on user agent @@ -406,7 +406,7 @@ test_style() {"marker-end", "none", "none", uri_or_enum_val, none_val, true}, {"marker-mid", "none", "none", uri_or_enum_val, none_val, true}, {"marker-start", "none", "none", uri_or_enum_val, none_val, true}, - {"opacity", "1.0000000", "1", opacity_val, NULL, true}, + {"opacity", "1", "1", opacity_val, NULL, true}, {"stroke", "none", "none", paint_val, NULL, true}, {"stroke-dasharray", "none", "none", enum_val, none_val, true}, // TODO: http://www.w3.org/TR/SVG11/painting.html#StrokeDasharrayProperty @@ -416,9 +416,9 @@ test_style() // delaying fixing it. It should be changed to SPILength. {"stroke-linecap", "butt", "butt", enum_val, linecap_vals, true}, {"stroke-linejoin", "miter", "miter", enum_val, linejoin_vals, true}, - {"stroke-miterlimit", "4.0000000", "4", miterlimit_val, NULL, true}, - {"stroke-opacity", "1.0000000", "1", opacity_val, NULL, true}, - {"stroke-width", "1.0000000", "1", length_val, NULL, true}, + {"stroke-miterlimit", "4", "4", miterlimit_val, NULL, true}, + {"stroke-opacity", "1", "1", opacity_val, NULL, true}, + {"stroke-width", "1", "1", length_val, NULL, true}, {"text-anchor", "start", "start", enum_val, text_anchor_vals, true}, {"visibility", "visible", "visible", enum_val, visibility_vals, true}, {"writing-mode", "lr-tb", "lr-tb", enum_val, writing_mode_vals, true} @@ -430,7 +430,7 @@ test_style() "font-variant:normal;" "font-weight:normal;" "font-stretch:normal;" - "text-indent:0.0000000;" + "text-indent:0;" "text-align:start;" "text-decoration:none;" "line-height:normal;" @@ -441,23 +441,23 @@ test_style() "block-progression:tb;" "writing-mode:lr-tb;" "text-anchor:start;" - "opacity:1.0000000;" + "opacity:1;" "color:#000000;" "fill:#000000;" - "fill-opacity:1.0000000;" + "fill-opacity:1;" "fill-rule:nonzero;" "stroke:none;" - "stroke-width:1.0000000;" + "stroke-width:1;" "stroke-linecap:butt;" "stroke-linejoin:miter;" "marker:none;" "marker-start:none;" "marker-mid:none;" "marker-end:none;" - "stroke-miterlimit:4.0000000;" + "stroke-miterlimit:4;" "stroke-dasharray:none;" "stroke-dashoffset:0;" - "stroke-opacity:1.0000000;" + "stroke-opacity:1;" "visibility:visible;" "display:inline;" "overflow:visible;" @@ -545,7 +545,7 @@ test_style() /* End of invalid style string examples. */ -#if 0 /* fails because of dashoffset:0 vs dashoffset:0.00000000 */ +#if 1 /* previously failed because of dashoffset:0 vs dashoffset:0.00000000 */ UTEST_TEST("sp_style_merge_from_style_string(default): ifset") { gchar *ifset_str = merge_then_write_string(str0_all_exp, SP_STYLE_FLAG_IFSET); UTEST_ASSERT(streq(ifset_str, str0_all_exp)); Index: svg/Makefile_insert =================================================================== RCS file: /cvsroot/inkscape/inkscape/src/svg/Makefile_insert,v retrieving revision 1.3 diff -d -u -p -r1.3 Makefile_insert --- svg/Makefile_insert 31 Oct 2004 11:19:20 -0000 1.3 +++ svg/Makefile_insert 13 Jul 2005 09:04:55 -0000 @@ -14,13 +14,12 @@ svg/clean: rm -f svg/libspsvg.a $(svg_libspsvg_a_OBJECTS) svg_libspsvg_a_SOURCES = \ - svg/ftos.cpp \ - svg/ftos.h \ svg/gnome-canvas-bpath-util.cpp \ svg/gnome-canvas-bpath-util.h \ svg/itos.cpp \ svg/round.cpp \ svg/stringstream.h \ + svg/stringstream.cpp \ svg/svg-affine.cpp \ svg/svg-color.cpp \ svg/svg-length.cpp \ Index: svg/stringstream.h =================================================================== RCS file: /cvsroot/inkscape/inkscape/src/svg/stringstream.h,v retrieving revision 1.4 diff -d -u -p -r1.4 stringstream.h --- svg/stringstream.h 16 May 2004 09:22:21 -0000 1.4 +++ svg/stringstream.h 13 Jul 2005 09:04:55 -0000 @@ -3,31 +3,80 @@ #include #include -#include "svg/ftos.h" namespace Inkscape { - class SVGOStringStream : public std::ostringstream { - public: - SVGOStringStream() { - this->imbue(std::locale::classic()); - this->setf(std::ios::showpoint); - this->precision(8); - } +typedef std::ios_base &(*std_oct_type)(std::ios_base &); - gchar const *gcharp() const { - return reinterpret_cast(str().c_str()); - } +class SVGOStringStream { +private: + std::ostringstream ostr; - }; +public: + SVGOStringStream() { + /* This is probably unnecessary now that we provide our own + * operator<< for float and double. */ + ostr.imbue(std::locale::classic()); + ostr.setf(std::ios::showpoint); + ostr.precision(8); + } -} +#define INK_STR_OP(_t) \ + SVGOStringStream &operator<<(_t arg) { \ + ostr << arg; \ + return *this; \ + } + + INK_STR_OP(char) + INK_STR_OP(signed char) + INK_STR_OP(unsigned char) + INK_STR_OP(short) + INK_STR_OP(unsigned short) + INK_STR_OP(int) + INK_STR_OP(unsigned int) + INK_STR_OP(long) + INK_STR_OP(unsigned long) + INK_STR_OP(char const *) + INK_STR_OP(signed char const *) + INK_STR_OP(unsigned char const *) + INK_STR_OP(std::string const &) + INK_STR_OP(std_oct_type) + +#undef INK_STR_OP + + gchar const *gcharp() const { + return reinterpret_cast(ostr.str().c_str()); + } + + std::string str() const { + return ostr.str(); + } + + std::streamsize precision() const { + return ostr.precision(); + } + + std::streamsize precision(std::streamsize p) { + return ostr.precision(p); + } +}; -#ifdef BRYCE_FLOATS -Inkscape::SVGOStringStream &operator<<(Inkscape::SVGOStringStream &os, double d) -{ - return os << ftos(d, 'g', -1, -1, 0); } -#endif + +Inkscape::SVGOStringStream &operator<<(Inkscape::SVGOStringStream &os, float d); + +Inkscape::SVGOStringStream &operator<<(Inkscape::SVGOStringStream &os, double d); + #endif + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : Index: xml/Makefile_insert =================================================================== RCS file: /cvsroot/inkscape/inkscape/src/xml/Makefile_insert,v retrieving revision 1.31 diff -d -u -p -r1.31 Makefile_insert --- xml/Makefile_insert 26 Jun 2005 20:54:09 -0000 1.31 +++ xml/Makefile_insert 13 Jul 2005 09:04:56 -0000 @@ -77,7 +77,7 @@ xml_test_xml_LDADD = \ xml_repr_action_test_SOURCES = xml/repr-action-test.cpp -xml_repr_action_test_LDADD = xml/libspxml.a util/libinkutil.a libinkpost.a debug/libinkdebug.a $(INKSCAPE_LIBS) +xml_repr_action_test_LDADD = xml/libspxml.a svg/libspsvg.a util/libinkutil.a libinkpost.a debug/libinkdebug.a $(INKSCAPE_LIBS) xml_quote_test_SOURCES = xml/quote-test.cpp xml_quote_test_LDADD = $(INKSCAPE_LIBS)