diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2013-04-18 21:28:17 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2013-04-18 21:28:17 +0000 |
| commit | ff4d08c8cdd344469f346cdd647ce6b694a7abfe (patch) | |
| tree | 8aecfa53b38a0fafea32fe933d5651c3f0915a02 /src | |
| parent | merge from trunk (r12272) (diff) | |
| parent | Add symbolic icons set by Jimmac & Barbara Muraus (diff) | |
| download | inkscape-ff4d08c8cdd344469f346cdd647ce6b694a7abfe.tar.gz inkscape-ff4d08c8cdd344469f346cdd647ce6b694a7abfe.zip | |
merge from trunk (r12281)
(bzr r11668.1.67)
Diffstat (limited to 'src')
| -rw-r--r-- | src/display/cairo-utils.h | 2 | ||||
| -rw-r--r-- | src/display/nr-style.cpp | 2 | ||||
| -rw-r--r-- | src/display/nr-style.h | 2 | ||||
| -rw-r--r-- | src/extension/internal/odf.cpp | 87 | ||||
| -rw-r--r-- | src/extension/internal/odf.h | 4 | ||||
| -rw-r--r-- | src/file.cpp | 4 | ||||
| -rw-r--r-- | src/livarot/ShapeSweep.cpp | 8 | ||||
| -rw-r--r-- | src/proofs | 2 | ||||
| -rw-r--r-- | src/select-context.cpp | 4 | ||||
| -rw-r--r-- | src/sp-paint-server-reference.h | 2 | ||||
| -rw-r--r-- | src/sp-pattern.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/symbols.cpp | 3 | ||||
| -rw-r--r-- | src/verbs.cpp | 2 |
13 files changed, 55 insertions, 69 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/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 ("<style:style style:name=\"%1\" style:family=\"graphic\" style:parent-style-name=\"standard\">\n", si.name); - // Glib::ustring tmpstring; - tmpstring += "<style:graphic-properties "; + tmpstring += "<style:graphic-properties"; if (si.fill == "gradient") { tmpstring += Glib::ustring::compose (" draw:fill=\"gradient\" draw:fill-gradient-name=\"%1\"", gradientNameFill); @@ -1420,19 +1419,22 @@ bool OdfOutput::processStyle(Writer &outs, SPItem *item, const Glib::ustring &id tmpstring += Glib::ustring(" draw:fill=\"") + si.fill + "\""; if(si.fill != "none") { - tmpstring += Glib::ustring::compose(" draw:fill-color=\"%1\" draw:fill-opacity=\"%2\"", si.fillColor, si.fillOpacity); + // tmpstring += Glib::ustring::compose(" draw:fill-color=\"%1\" draw:fill-opacity=\"%2\"", si.fillColor, si.fillOpacity); + tmpstring += Glib::ustring::compose(" draw:fill-color=\"%1\"", si.fillColor); } } if (si.stroke == "gradient") { - tmpstring += Glib::ustring (" draw:stroke=\"gradient\" draw:stroke-gradient-name=\"NotYetProgrammedPleaseBePatient\""); + //does not seem to be supported by Open Office.org + tmpstring += Glib::ustring::compose (" draw:stroke=\"gradient\" draw:stroke-gradient-name=\"%1\"", gradientNameStroke); } else { tmpstring += Glib::ustring(" draw:stroke=\"") + si.stroke + "\""; if (si.stroke != "none") { - tmpstring += Glib::ustring::compose (" svg:stroke-width=\"%1\" svg:stroke-color=\"%2\" svg:stroke-opacity=\"%3\" ", si.strokeWidth, si.strokeColor, si.strokeOpacity); + tmpstring += Glib::ustring::compose (" svg:stroke-width=\"%1\" svg:stroke-color=\"%2\" ", si.strokeWidth, si.strokeColor); + // tmpstring += Glib::ustring::compose (" svg:stroke-width=\"%1\" svg:stroke-color=\"%2\" draw:stroke-opacity=\"%3\" ", si.strokeWidth, si.strokeColor, si.strokeOpacity); } } tmpstring += "/>\n</style:style>\n"; @@ -1441,7 +1443,7 @@ bool OdfOutput::processStyle(Writer &outs, SPItem *item, const Glib::ustring &id return true; } -bool OdfOutput::processGradient(Writer &outs, SPItem *item, +bool OdfOutput::processGradient(SPItem *item, const Glib::ustring &id, Geom::Affine &/*tf*/, Glib::ustring& gradientName, Glib::ustring& output, bool checkFillGradient) { @@ -1494,8 +1496,11 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item, { gi.style = "radial"; SPRadialGradient *radGrad = SP_RADIALGRADIENT(gradient); - gi.cx = radGrad->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("<draw:gradient draw:name=\"%1\"", gi.name); - // "<draw:gradient id=\"%1\" draw:name=\"%2\"\n", gi.name, gi.name); output += Glib::ustring::compose(" draw:display-name=\"imported linear %1\"", gradientCount); output += " draw:style=\"linear\""; - // outs.writeUString (tmpstring); - // outs.printf(" draw:start-color=\"#%06lx\" draw:end-color=\"#%06lx\"\n", gi.stops[0].rgb, gi.stops[1].rgb); snprintf(buf, 127, " draw:start-color=\"#%06lx\" draw:end-color=\"#%06lx\"", gi.stops[0].rgb, gi.stops[1].rgb); output += buf; - output += Glib::ustring::compose(" draw:start-intensity=\"%1\" draw:end-intensity=\"%2\" draw:angle=\"0\" draw:border=\"0%%\"/>\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("<svg:radialGradient "); - outs.printf("id=\"%s\" ", gi.name.c_str()); - outs.printf("draw:name=\"%s\"\n", gi.name.c_str()); - outs.printf(" draw:display-name=\"imported radial %d\"\n", - gradientCount); - outs.printf(" svg:gradientUnits=\"objectBoundingBox\"\n"); - outs.printf(" svg:cx=\"%05.3f\" svg:cy=\"%05.3f\"\n", - gi.cx, gi.cy); - outs.printf(" svg:fx=\"%05.3f\" svg:fy=\"%05.3f\"\n", - gi.fx, gi.fy); - outs.printf(" svg:r=\"%05.3f\">\n", - gi.r); - outs.printf(" <svg:stop\n"); - outs.printf(" svg:stop-color=\"#%06lx\"\n", - gi.stops[0].rgb); - outs.printf(" svg:stop-opacity=\"%f%%\"\n", - gi.stops[0].opacity * 100.0); - outs.printf(" svg:offset=\"0\"/>\n"); - outs.printf(" <svg:stop\n"); - outs.printf(" svg:stop-color=\"#%06lx\"\n", - gi.stops[1].rgb); - outs.printf(" svg:stop-opacity=\"%f%%\"\n", - gi.stops[1].opacity * 100.0); - outs.printf(" svg:offset=\"1\"/>\n"); - outs.printf("</svg:radialGradient>\n"); - */ + output += Glib::ustring::compose("<draw:gradient draw:name=\"%1\" draw:display-name=\"imported radial %2\" ", gi.name, gradientCount); + snprintf(buf, 127, "draw:cx=\"%05.3f\" draw:cy=\"%05.3f\" ", gi.cx, gi.cy); + output += Glib::ustring("draw:style=\"radial\" ") + buf; + snprintf(buf, 127, "draw:start-color=\"#%06lx\" draw:end-color=\"#%06lx\" ", gi.stops[0].rgb, gi.stops[1].rgb); + output += buf; + snprintf(buf, 127, "draw:start-intensity=\"%f%%\" draw:end-intensity=\"%f%%\" ", gi.stops[0].opacity*100.0, gi.stops[1].opacity*100.0); + output += buf; + output += "/>\n";//draw:border=\"0%\" } else { @@ -1709,13 +1689,14 @@ bool OdfOutput::writeTree(Writer &couts, Writer &souts, Glib::ustring gradientNameStroke; Glib::ustring outputFill; Glib::ustring outputStroke; - // Glib::ustring styleString; - - processGradient(souts, item, id, tf, gradientNameFill, outputFill, 1); + + processGradient(item, id, tf, gradientNameFill, outputFill, 1); + processGradient(item, id, tf, gradientNameStroke, outputStroke, 0); souts.writeUString(outputFill); + souts.writeUString(outputStroke); //# STYLE - processStyle(souts, item, id, gradientNameFill);//, styleString); + processStyle(souts, item, id, gradientNameFill, gradientNameStroke); //# ITEM DATA @@ -1806,7 +1787,7 @@ bool OdfOutput::writeTree(Writer &couts, Writer &souts, Glib::ustring styleName = siter->second; couts.printf("draw:style-name=\"%s\" ", styleName.c_str()); } - // couts.writeUString(styleString); + // couts.writeUString(styleString); // std::map<Glib::ustring, Glib::ustring>::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("<!-- ####### 'Standard' styles ####### -->\n"); outs.writeString("<style:style style:name=\"dp1\" style:family=\"drawing-page\"/>\n"); outs.writeString("<style:style style:name=\"standard\" style:family=\"graphic\">\n"); - + ///TODO: add default document style here - + outs.writeString("</style:style>\n"); outs.writeString("<style:style style:name=\"gr1\" style:family=\"graphic\" style:parent-style-name=\"standard\">\n"); outs.writeString(" <style:graphic-properties draw:stroke=\"none\" draw:fill=\"none\"\n"); diff --git a/src/extension/internal/odf.h b/src/extension/internal/odf.h index 5fcad2630..7dfbf9786 100644 --- a/src/extension/internal/odf.h +++ b/src/extension/internal/odf.h @@ -313,9 +313,9 @@ private: bool writeStyle(ZipFile &zf); - bool processStyle(Writer &outs, SPItem *item, const Glib::ustring &id, const Glib::ustring &gradientNameFill);//, Glib::ustring &styleString); + bool processStyle(Writer &outs, SPItem *item, const Glib::ustring &id, const Glib::ustring &gradientNameFill, const Glib::ustring &gradientNameStroke); - bool processGradient(Writer &outs, SPItem *item, + bool processGradient(SPItem *item, const Glib::ustring &id, Geom::Affine &tf, Glib::ustring& gradientName, Glib::ustring& output, bool checkFillGradient = 1); bool writeStyleHeader(Writer &outs); diff --git a/src/file.cpp b/src/file.cpp index 453ddb546..5b4110253 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -157,8 +157,8 @@ Glib::ustring sp_file_default_template_uri() baseNames.push_back("default.svg"); gchar *foundTemplate = 0; - for (std::list<gchar const*>::iterator nameIt = baseNames.begin(); (nameIt != baseNames.end()) && !foundTemplate; ++nameIt) { - for (std::list<gchar *>::iterator it = sources.begin(); (it != sources.end()) && !foundTemplate; ++it) { + for (std::list<gchar *>::iterator it = sources.begin(); (it != sources.end()) && !foundTemplate; ++it) { + for (std::list<gchar const*>::iterator nameIt = baseNames.begin(); (nameIt != baseNames.end()) && !foundTemplate; ++nameIt) { gchar *dirname = *it; if ( Inkscape::IO::file_test( dirname, (GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR) ) ) { diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index 2073d1cd2..c2fd83e31 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -2741,8 +2741,9 @@ Shape::CheckAdjacencies (int lastPointNo, int lastChgtPt, Shape * /*shapeHead*/, { if (TesteAdjacency (lS, lB, getPoint(n).x, n, false) == false) - break; - lS->swsData[lB].leftRnd = n; + break; + if (getPoint(lS->swsData[lB].leftRnd).x[0] > getPoint(n).x[0] + HalfRound (1)) // LP Bug 614577 + lS->swsData[lB].leftRnd = n; } for (int n = rgtN + 1; n < lastPointNo; n++) { @@ -2768,7 +2769,8 @@ Shape::CheckAdjacencies (int lastPointNo, int lastChgtPt, Shape * /*shapeHead*/, if (TesteAdjacency (rS, rB, getPoint(n).x, n, false) == false) break; - rS->swsData[rB].leftRnd = n; + if (getPoint(rS->swsData[rB].leftRnd).x[0] > getPoint(n).x[0] + HalfRound (1)) // LP Bug 614577 + rS->swsData[rB].leftRnd = n; } for (int n = rgtN + 1; n < lastPointNo; n++) { 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/select-context.cpp b/src/select-context.cpp index 2684cbc1e..9a88bcf20 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -988,7 +988,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) } else if (MOD__CTRL) { sp_selection_rotate(selection, 90); } else if (snaps) { - sp_selection_rotate(selection, 180/snaps); + sp_selection_rotate(selection, 180.0/snaps); } ret = TRUE; break; @@ -1000,7 +1000,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) } else if (MOD__CTRL) { sp_selection_rotate(selection, -90); } else if (snaps) { - sp_selection_rotate(selection, -180/snaps); + sp_selection_rotate(selection, -180.0/snaps); } ret = TRUE; break; 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 : diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index dfc92774c..5bc3ae91b 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -148,6 +148,9 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : //iconView->set_text_column( columns->symbol_id ); iconView->set_tooltip_column( 1 ); iconView->set_pixbuf_column( columns->symbol_image ); + // Giving the iconview a small minimum size will help users understand + // What the dialog does. + iconView->set_size_request( 100, 32 ); std::vector< Gtk::TargetEntry > targets; targets.push_back(Gtk::TargetEntry( "application/x-inkscape-paste")); diff --git a/src/verbs.cpp b/src/verbs.cpp index b8e72bc9b..4777e168c 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2753,7 +2753,7 @@ Verb *Verb::_base_verbs[] = { new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."), N_("Select colors from a swatches palette"), GTK_STOCK_SELECT_COLOR), new DialogVerb(SP_VERB_DIALOG_SYMBOLS, "DialogSymbols", N_("S_ymbols..."), - N_("Select symbol from a symbols palette"), GTK_STOCK_SELECT_COLOR), + N_("Select symbol from a symbols palette"), INKSCAPE_ICON("symbols")), new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m..."), N_("Precisely control objects' transformations"), INKSCAPE_ICON("dialog-transform")), new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."), |
