From d2f51524a231765aefad3d0bc3fea6c0bf3d570a Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 11 Apr 2013 10:58:39 +0100 Subject: Fix some broken Vim modelines (bzr r12275) --- src/display/cairo-utils.h | 2 +- src/display/nr-style.cpp | 2 +- src/display/nr-style.h | 2 +- src/proofs | 2 +- src/sp-paint-server-reference.h | 2 +- src/sp-pattern.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/display/cairo-utils.h b/src/display/cairo-utils.h index 2596cd969..016f72d00 100644 --- a/src/display/cairo-utils.h +++ b/src/display/cairo-utils.h @@ -203,4 +203,4 @@ inline guint AssembleARGB32(guint32 a, guint32 r, guint32 g, guint32 b) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/display/nr-style.cpp b/src/display/nr-style.cpp index ba2340074..26d70ad15 100644 --- a/src/display/nr-style.cpp +++ b/src/display/nr-style.cpp @@ -220,4 +220,4 @@ void NRStyle::update() fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/display/nr-style.h b/src/display/nr-style.h index 80547c43e..cd0bd208f 100644 --- a/src/display/nr-style.h +++ b/src/display/nr-style.h @@ -81,4 +81,4 @@ struct NRStyle { fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/proofs b/src/proofs index a3a22733f..05f27daea 100644 --- a/src/proofs +++ b/src/proofs @@ -329,4 +329,4 @@ style.cpp caller: preceded by explicit test for NULL: # mode:indented-text # fill-column:99 # End: -# vim: filetype=text:tabstop=8:encoding=utf-8:textwidth=99 : +# vim: filetype=text:tabstop=8:fileencoding=utf-8:textwidth=99 : diff --git a/src/sp-paint-server-reference.h b/src/sp-paint-server-reference.h index 90d8979f8..5561af1a3 100644 --- a/src/sp-paint-server-reference.h +++ b/src/sp-paint-server-reference.h @@ -40,4 +40,4 @@ protected: fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp index 754a75e87..23cd3d32e 100644 --- a/src/sp-pattern.cpp +++ b/src/sp-pattern.cpp @@ -731,4 +731,4 @@ sp_pattern_create_pattern(SPPaintServer *ps, fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3 From 17ff038eda24f39c002be1f5cab46f7729b561da Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Fri, 12 Apr 2013 23:27:16 +0200 Subject: odg export: some work on gradients (bzr r12276) --- src/extension/internal/odf.cpp | 87 +++++++++++++++++------------------------- src/extension/internal/odf.h | 4 +- 2 files changed, 36 insertions(+), 55 deletions(-) diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index 9fc6ecfdb..70798099d 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -1315,7 +1315,7 @@ writePath(Writer &outs, Geom::PathVector const &pathv, return nrPoints; } -bool OdfOutput::processStyle(Writer &outs, SPItem *item, const Glib::ustring &id, const Glib::ustring &gradientNameFill)//, Glib::ustring &styleString) +bool OdfOutput::processStyle(Writer &outs, SPItem *item, const Glib::ustring &id, const Glib::ustring &gradientNameFill, const Glib::ustring &gradientNameStroke) { if (!item) { @@ -1409,8 +1409,7 @@ bool OdfOutput::processStyle(Writer &outs, SPItem *item, const Glib::ustring &id styleLookupTable[id] = styleName; Glib::ustring tmpstring = Glib::ustring::compose ("\n", si.name); - // Glib::ustring tmpstring; - tmpstring += "cx.computed * 100.0;//ODG cx is percentages - gi.cy = radGrad->cy.computed * 100.0; + SPRadialGradient tmpGrad = *radGrad; + tmpGrad.cx.unit= SVGLength::PERCENT; + tmpGrad.cy.unit= SVGLength::PERCENT; + gi.cx = tmpGrad.cx.computed;// * 100.0;//ODG cx is percentages + gi.cy = tmpGrad.cy.computed;// * 100.0; } else { @@ -1511,7 +1516,6 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item, if (gi.equals(*iter)) { //map to existing gradientTable entry - // Glib::ustring gradientName = iter->name; gradientName = iter->name; gradientLookupTable[id] = gradientName; gradientMatch = true; @@ -1525,7 +1529,6 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item, } // No match, let us write a new entry - // Glib::ustring gradientName = Glib::ustring::compose("gradient%1", gradientTable.size()); gradientName = Glib::ustring::compose("gradient%1", gradientTable.size()); gi.name = gradientName; gradientTable.push_back(gi); @@ -1552,16 +1555,12 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item, return false; } output += Glib::ustring::compose("\n", - gi.stops[0].opacity * 100.0, gi.stops[1].opacity * 100.0); - // outs.writeUString (tmpstring); + output += Glib::ustring::compose(" draw:start-intensity=\"%1\" draw:end-intensity=\"%2\" draw:angle=\"0\"/>\n", + gi.stops[0].opacity * 100.0, gi.stops[1].opacity * 100.0);// draw:border=\"0%%\" } else if (gi.style == "radial") { @@ -1582,33 +1581,14 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item, g_warning("Need at least 2 stops for a radial gradient"); return false; } - /* - outs.printf("\n", - gi.r); - outs.printf(" \n"); - outs.printf(" \n"); - outs.printf("\n"); - */ + output += Glib::ustring::compose("second; couts.printf("draw:style-name=\"%s\" ", styleName.c_str()); } - // couts.writeUString(styleString); + // couts.writeUString(styleString); // std::map::iterator giter; // giter = gradientLookupTable.find(id); @@ -1821,10 +1802,10 @@ bool OdfOutput::writeTree(Writer &couts, Writer &souts, bbox_x, bbox_y); couts.printf("svg:width=\"%.3fcm\" svg:height=\"%.3fcm\" ", bbox_width, bbox_height); - couts.printf("svg:viewBox=\"0.0 0.0 %.3f %.3f\"\n", + couts.printf("svg:viewBox=\"0.0 0.0 %.3f %.3f\"", bbox_width * 1000.0, bbox_height * 1000.0); - couts.printf(" svg:d=\""); + couts.printf(" svg:d=\""); int nrPoints = writePath(couts, curve->get_pathvector(), tf, bbox_x, bbox_y); couts.writeString("\""); @@ -1915,9 +1896,9 @@ bool OdfOutput::writeStyleFooter(Writer &outs) outs.writeString("\n"); outs.writeString("\n"); outs.writeString("\n"); - + ///TODO: add default document style here - + outs.writeString("\n"); outs.writeString("\n"); outs.writeString("