diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-10-06 00:18:46 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-10-06 00:18:46 +0000 |
| commit | 7d38f876e8a4c5ab60261f61452fa2bf8baf13f3 (patch) | |
| tree | 8d93f93ef7634ca78637b55edb9de4401669b2bb /src | |
| parent | Add missing file to CMakeLists (diff) | |
| parent | Remove unused functions. (diff) | |
| download | inkscape-7d38f876e8a4c5ab60261f61452fa2bf8baf13f3.tar.gz inkscape-7d38f876e8a4c5ab60261f61452fa2bf8baf13f3.zip | |
Update to trunk r13580
(bzr r13341.1.255)
Diffstat (limited to 'src')
42 files changed, 338 insertions, 87 deletions
diff --git a/src/color-profile.cpp b/src/color-profile.cpp index aa0750c00..28550b75d 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -19,6 +19,7 @@ #include <gtk/gtk.h> #endif // DEBUG_LCMS +#include <unistd.h> #include <cstring> #include <string> #include <io/sys.h> @@ -910,7 +911,7 @@ Glib::ustring getNameFromProfile(cmsHPROFILE profile) if ( name && !g_utf8_validate(name, -1, NULL) ) { name = _("(invalid UTF-8 string)"); } - nameStr = (name) ? name : _("None"); + nameStr = (name) ? name : C_("Profile name", "None"); #elif HAVE_LIBLCMS2 cmsUInt32Number byteLen = cmsGetProfileInfo(profile, cmsInfoDescription, "en", "US", NULL, 0); if (byteLen > 0) { diff --git a/src/document-undo.cpp b/src/document-undo.cpp index 0519b6874..15d5d2c70 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -242,7 +242,7 @@ gboolean Inkscape::DocumentUndo::undo(SPDocument *doc) Inkscape::Event *log=(Inkscape::Event *)doc->priv->undo->data; doc->priv->undo = g_slist_remove (doc->priv->undo, log); sp_repr_undo_log (log->event); - doc->_updateDocument(); + //doc->_updateDocument(); doc->priv->redo = g_slist_prepend (doc->priv->redo, log); doc->setModifiedSinceSave(); diff --git a/src/document.cpp b/src/document.cpp index bb1954916..b50fc9575 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -229,7 +229,6 @@ SPDocument::~SPDocument() { // This is at the end of the destructor, because preceding code adds new orphans to the queue collectOrphans(); - //delete this->_whiteboard_session_manager; } sigc::connection SPDocument::connectDestroy(sigc::signal<void>::slot_type slot) diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 06e35ff3e..6a22eb585 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -112,8 +112,13 @@ Extension::Extension (Inkscape::XML::Node * in_repr, Implementation::Implementat _deps.push_back(new Dependency(child_repr)); } /* dependency */ if (!strcmp(chname, "script")) { - _deps.push_back(new Dependency(child_repr->firstChild())); - } /* check command as a dependency (see LP #505920) */ + for (Inkscape::XML::Node *child = child_repr->firstChild(); child != NULL ; child = child->next()) { + if (child->type() == Inkscape::XML::ELEMENT_NODE) { + _deps.push_back(new Dependency(child)); + break; + } /* skip non-element nodes (see LP #1372200) */ + } + } /* check command as a dependency (see LP #505920) */ if (!strcmp(chname, "options")) { silent = !strcmp( child_repr->attribute("silent"), "true" ); } diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp index 9a5a78a34..4b070cbaa 100644 --- a/src/extension/internal/emf-inout.cpp +++ b/src/extension/internal/emf-inout.cpp @@ -63,6 +63,7 @@ namespace Internal { static uint32_t ICMmode = 0; // not used yet, but code to read it from EMF implemented static uint32_t BLTmode = 0; +float faraway = 10000000; // used in "exclude" clips, hopefully well outside any real drawing! Emf::Emf (void) // The null constructor { @@ -1040,13 +1041,30 @@ Emf::pix_to_abs_size(PEMF_CALLBACK_DATA d, double px) return ppx; } -/* returns "x,y" (without the quotes) in inkscape coordinates for a pair of EMF x,y coordinates +/* snaps coordinate pairs made up of values near +/-faraway, +/-faraway to exactly faraway. + This eliminates coordinate drift on repeated clipping cycles which use exclude. + It should not affect internals of normal drawings because the value of faraway is so large. +*/ +void +Emf::snap_to_faraway_pair(double *x, double *y) +{ + if((abs(abs(*x) - faraway)/faraway <= 1e-4) && (abs(abs(*y) - faraway)/faraway <= 1e-4)){ + *x = (*x > 0 ? faraway : -faraway); + *y = (*y > 0 ? faraway : -faraway); + } +} + +/* returns "x,y" (without the quotes) in inkscape coordinates for a pair of EMF x,y coordinates. + Since exclude clip can go through here, it calls snap_to_faraway_pair for numerical stability. */ std::string Emf::pix_to_xy(PEMF_CALLBACK_DATA d, double x, double y){ std::stringstream cxform; - cxform << pix_to_x_point(d,x,y); + double tx = pix_to_x_point(d,x,y); + double ty = pix_to_y_point(d,x,y); + snap_to_faraway_pair(&tx,&ty); + cxform << tx; cxform << ","; - cxform << pix_to_y_point(d,x,y); + cxform << ty; return(cxform.str()); } @@ -2221,7 +2239,6 @@ std::cout << "BEFORE DRAW" U_RECTL rc = pEmr->rclClip; SVGOStringStream tmp_path; - float faraway = 10000000; // hopefully well outside any real drawing! //outer rect, clockwise tmp_path << "M " << faraway << "," << faraway << " "; tmp_path << "L " << faraway << "," << -faraway << " "; @@ -3466,6 +3483,8 @@ Emf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) return NULL; } + d.dc[0].font_name = strdup("Arial"); // Default font, set only on lowest level, it copies up from there EMF spec says device can pick whatever it wants + // set up the size default for patterns in defs. This might not be referenced if there are no patterns defined in the drawing. d.defs += "\n"; @@ -3513,7 +3532,7 @@ Emf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) d.dc[0].style.stroke_dasharray.values.clear(); - for(int i=0; i<=d.level;i++){ + for(int i=0; i<=EMF_MAX_DC; i++){ if(d.dc[i].font_name)free(d.dc[i].font_name); } diff --git a/src/extension/internal/emf-inout.h b/src/extension/internal/emf-inout.h index 302d5c474..c64299093 100644 --- a/src/extension/internal/emf-inout.h +++ b/src/extension/internal/emf-inout.h @@ -65,7 +65,7 @@ typedef struct emf_device_context { textAlign(0) // worldTransform, cur { - font_name = strdup("Arial"); // Default font, EMF spec says device can pick whatever it wants + font_name = NULL; sizeWnd = sizel_set( 0.0, 0.0 ); sizeView = sizel_set( 0.0, 0.0 ); winorg = point32_set( 0.0, 0.0 ); @@ -218,6 +218,7 @@ protected: static double pix_to_x_point(PEMF_CALLBACK_DATA d, double px, double py); static double pix_to_y_point(PEMF_CALLBACK_DATA d, double px, double py); static double pix_to_abs_size(PEMF_CALLBACK_DATA d, double px); + static void snap_to_faraway_pair(double *x, double *y); static std::string pix_to_xy(PEMF_CALLBACK_DATA d, double x, double y); static void select_pen(PEMF_CALLBACK_DATA d, int index); static void select_extpen(PEMF_CALLBACK_DATA d, int index); diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp index e054829b5..0f43fbca1 100644 --- a/src/extension/internal/emf-print.cpp +++ b/src/extension/internal/emf-print.cpp @@ -55,6 +55,7 @@ #include "sp-radial-gradient.h" #include "sp-linear-gradient.h" #include "display/cairo-utils.h" +#include "sp-shape.h" #include "splivarot.h" // pieces for union on shapes #include "2geom/svg-path-parser.h" // to get from SVG text to Geom::Path @@ -143,6 +144,7 @@ unsigned int PrintEmf::begin(Inkscape::Extension::Print *mod, SPDocument *doc) // width and height in px _width = doc->getWidth().value("px"); _height = doc->getHeight().value("px"); + _doc_unit_scale = Inkscape::Util::Quantity::convert(1, (doc->getDefaultUnit()), "px"); // initialize a few global variables hbrush = hbrushOld = hpen = 0; @@ -298,6 +300,7 @@ unsigned int PrintEmf::begin(Inkscape::Extension::Print *mod, SPDocument *doc) unsigned int PrintEmf::finish(Inkscape::Extension::Print * /*mod*/) { + do_clip_if_present(NULL); // Terminate any open clip. char *rec; if (!et) { return 0; @@ -969,19 +972,145 @@ U_TRIVERTEX PrintEmf::make_trivertex(Geom::Point Pt, U_COLORREF uc){ return(tv); } +/* Examine clip. If there is a (new) one then apply it. If there is one and it is the + same as the preceding one, leave the preceding one active. If style is NULL + terminate the current clip, if any, and return. +*/ +void PrintEmf::do_clip_if_present(SPStyle const *style){ + char *rec; + static SPClipPath *scpActive = NULL; + if(!style){ + if(scpActive){ // clear the existing clip + rec = U_EMRRESTOREDC_set(-1); + if (!rec || emf_append((PU_ENHMETARECORD)rec, et, U_REC_FREE)) { + g_error("Fatal programming error in PrintEmf::fill at U_EMRRESTOREDC_set"); + } + scpActive=NULL; + } + } else { + /* The current implementation converts only one level of clipping. If there were more + clips further up the stack they should be combined with the pathvector using "and". Since this + comes up rarely, and would involve a lot of searching (all the way up the stack for every + draw operation), it has not yet been implemented. + + Note, to debug this section of code use print statements on sp_svg_write_path(combined_pathvector). + */ + /* find the first clip_ref at object or up the stack. There may not be one. */ + SPClipPath *scp = NULL; + SPItem *item = SP_ITEM(style->object); + while(1) { + scp = (item->clip_ref ? item->clip_ref->getObject() : NULL); + if(scp)break; + item = SP_ITEM(item->parent); + if(!item || SP_IS_ROOT(item))break; // this will never be a clipping path + } + + if(scp != scpActive){ // change or remove the clipping + if(scpActive){ // clear the existing clip + rec = U_EMRRESTOREDC_set(-1); + if (!rec || emf_append((PU_ENHMETARECORD)rec, et, U_REC_FREE)) { + g_error("Fatal programming error in PrintEmf::fill at U_EMRRESTOREDC_set"); + } + scpActive = NULL; + } + + if (scp) { // set the new clip + /* because of units and who knows what other transforms that might be applied above we + need the full transform all the way to the root. + */ + Geom::Affine tf = item->transform; + SPItem *scan_item = item; + while(1) { + scan_item = SP_ITEM(scan_item->parent); + if(!scan_item)break; + tf *= scan_item->transform; + } + tf *= Geom::Scale(_doc_unit_scale);; // Transform must be in PIXELS, no matter what the document unit is. + + /* find the clipping path */ + Geom::PathVector combined_pathvector; + Geom::Affine tfc; // clipping transform, generally not the same as item transform + for(item = SP_ITEM(scp->firstChild()); item; item=SP_ITEM(item->getNext())){ + if (SP_IS_GROUP(item)) { // not implemented + // return sp_group_render(item); + combined_pathvector = merge_PathVector_with_group(combined_pathvector, item, tfc); + } else if (SP_IS_SHAPE(item)) { + combined_pathvector = merge_PathVector_with_shape(combined_pathvector, item, tfc); + } else { // not implemented + } + } + + if (!combined_pathvector.empty()) { // if clipping path isn't empty, define EMF clipping record + scpActive = scp; // remember for next time + // the sole purpose of this SAVEDC is to let us clear the clipping region later. + rec = U_EMRSAVEDC_set(); + if (!rec || emf_append((PU_ENHMETARECORD)rec, et, U_REC_FREE)) { + g_error("Fatal programming error in PrintEmf::image at U_EMRSAVEDC_set"); + } + (void) draw_pathv_to_EMF(combined_pathvector, tf); + rec = U_EMRSELECTCLIPPATH_set(U_RGN_OR); + if (!rec || emf_append((PU_ENHMETARECORD)rec, et, U_REC_FREE)) { + g_error("Fatal programming error in PrintEmf::do_clip_if_present at U_EMRSELECTCLIPPATH_set"); + } + } + else { + scpActive = NULL; // no valid path available to draw, so no DC was saved, so no signal to restore + } + } // change or remove clipping + } // scp exists + } // style exists +} + +Geom::PathVector PrintEmf::merge_PathVector_with_group(Geom::PathVector const &combined_pathvector, SPItem const *item, const Geom::Affine &transform) +{ + Geom::PathVector new_combined_pathvector; + if(!SP_IS_GROUP(item))return(new_combined_pathvector); // sanity test, only a group should be passed in, return empty if something else happens + + new_combined_pathvector = combined_pathvector; + SPGroup *group = SP_GROUP(item); + Geom::Affine tfc = item->transform * transform; + for(SPItem *item = SP_ITEM(group->firstChild()); item; item=SP_ITEM(item->getNext())){ + if (SP_IS_GROUP(item)) { + new_combined_pathvector = merge_PathVector_with_group(new_combined_pathvector, item, tfc); // could be endlessly recursive on a badly formed SVG + } else if (SP_IS_SHAPE(item)) { + new_combined_pathvector = merge_PathVector_with_shape(new_combined_pathvector, item, tfc); + } else { // not implemented + } + } + return new_combined_pathvector; +} + +Geom::PathVector PrintEmf::merge_PathVector_with_shape(Geom::PathVector const &combined_pathvector, SPItem const *item, const Geom::Affine &transform) +{ + Geom::PathVector new_combined_pathvector; + if(!SP_IS_SHAPE(item))return(new_combined_pathvector); // sanity test, only a shape should be passed in, return empty if something else happens + + Geom::Affine tfc = item->transform * transform; + SPShape *shape = SP_SHAPE(item); + if (shape->_curve) { + Geom::PathVector const & new_vect = shape->_curve->get_pathvector(); + if(combined_pathvector.empty()){ + new_combined_pathvector = new_vect * tfc; + } + else { + new_combined_pathvector = sp_pathvector_boolop(new_vect * tfc, combined_pathvector, bool_op_union , (FillRule) fill_oddEven, (FillRule) fill_oddEven); + } + } + return new_combined_pathvector; +} + unsigned int PrintEmf::fill( Inkscape::Extension::Print * /*mod*/, Geom::PathVector const &pathv, Geom::Affine const & /*transform*/, SPStyle const *style, Geom::OptRect const &/*pbox*/, Geom::OptRect const &/*dbox*/, Geom::OptRect const &/*bbox*/) { + char *rec; using Geom::X; using Geom::Y; - - //SPItem *item = SP_ITEM(style->object); - //SPClipPath *scp = (item->clip_ref ? item->clip_ref->getObject() : NULL); - Geom::Affine tf = m_tr_stack.top(); + do_clip_if_present(style); // If clipping is needed set it up + use_fill = true; use_stroke = false; @@ -1095,7 +1224,6 @@ unsigned int PrintEmf::fill( } } else if (gv.mode == DRAW_LINEAR_GRADIENT) { if(is_Rect){ - char *rec; int gMode; Geom::Point ul, ur, lr; Geom::Point outUL, outLR; // UL,LR corners of a stop rectangle, in OUTPUT coordinates @@ -1284,6 +1412,7 @@ unsigned int PrintEmf::stroke( char *rec = NULL; Geom::Affine tf = m_tr_stack.top(); + do_clip_if_present(style); // If clipping is needed set it up use_stroke = true; // use_fill was set in ::fill, if it is needed @@ -1568,12 +1697,14 @@ unsigned int PrintEmf::image( unsigned int h, /** height of bitmap */ unsigned int rs, /** row stride (normally w*4) */ Geom::Affine const &tf_rect, /** affine transform only used for defining location and size of rect, for all other tranforms, use the one from m_tr_stack */ - SPStyle const * /*style*/) /** provides indirect link to image object */ + SPStyle const *style) /** provides indirect link to image object */ { double x1, y1, dw, dh; char *rec = NULL; Geom::Affine tf = m_tr_stack.top(); + do_clip_if_present(style); // If clipping is needed set it up + rec = U_EMRSETSTRETCHBLTMODE_set(U_COLORONCOLOR); if (!rec || emf_append((PU_ENHMETARECORD)rec, et, U_REC_FREE)) { g_error("Fatal programming error in PrintEmf::image at EMRHEADER"); @@ -1658,28 +1789,14 @@ unsigned int PrintEmf::image( return 0; } -// may also be called with a simple_shape or an empty path, whereupon it just returns without doing anything -unsigned int PrintEmf::print_pathv(Geom::PathVector const &pathv, const Geom::Affine &transform) -{ - Geom::Affine tf = transform; - char *rec = NULL; - - simple_shape = print_simple_shape(pathv, tf); - if (simple_shape || pathv.empty()) { - if (use_fill) { - destroy_brush(); // these must be cleared even if nothing is drawn or hbrush,hpen fill up - } - if (use_stroke) { - destroy_pen(); - } - return TRUE; - } +unsigned int PrintEmf::draw_pathv_to_EMF(Geom::PathVector const &pathv, const Geom::Affine &transform) { + char *rec; /* inkscape to EMF scaling is done below, but NOT the rotation/translation transform, that is handled by the EMF MODIFYWORLDTRANSFORM record */ - - Geom::PathVector pv = pathv_to_linear_and_cubic_beziers(pathv * tf); + + Geom::PathVector pv = pathv_to_linear_and_cubic_beziers(pathv * transform); rec = U_EMRBEGINPATH_set(); if (!rec || emf_append((PU_ENHMETARECORD)rec, et, U_REC_FREE)) { @@ -1781,6 +1898,27 @@ unsigned int PrintEmf::print_pathv(Geom::PathVector const &pathv, const Geom::Af if (!rec || emf_append((PU_ENHMETARECORD)rec, et, U_REC_FREE)) { g_error("Fatal programming error in PrintEmf::print_pathv at U_EMRENDPATH_set"); } + return(0); +} + +// may also be called with a simple_shape or an empty path, whereupon it just returns without doing anything +unsigned int PrintEmf::print_pathv(Geom::PathVector const &pathv, const Geom::Affine &transform) +{ + Geom::Affine tf = transform; + char *rec = NULL; + + simple_shape = print_simple_shape(pathv, tf); + if (simple_shape || pathv.empty()) { + if (use_fill) { + destroy_brush(); // these must be cleared even if nothing is drawn or hbrush,hpen fill up + } + if (use_stroke) { + destroy_pen(); + } + return TRUE; + } + + (void) draw_pathv_to_EMF(pathv, tf); // explicit FILL/STROKE commands are needed for each sub section of the path if (use_fill && !use_stroke) { @@ -1819,6 +1957,7 @@ unsigned int PrintEmf::text(Inkscape::Extension::Print * /*mod*/, char const *te return 0; } + do_clip_if_present(style); // If clipping is needed set it up char *rec = NULL; int ccount, newfont; int fix90n = 0; diff --git a/src/extension/internal/emf-print.h b/src/extension/internal/emf-print.h index 9a1251b38..5bad48de5 100644 --- a/src/extension/internal/emf-print.h +++ b/src/extension/internal/emf-print.h @@ -69,6 +69,10 @@ public: protected: static void smuggle_adxkyrtl_out(const char *string, uint32_t **adx, double *ky, int *rtl, int *ndx, float scale); + void do_clip_if_present(SPStyle const *style); + Geom::PathVector merge_PathVector_with_group(Geom::PathVector const &combined_pathvector, SPItem const *item, const Geom::Affine &transform); + Geom::PathVector merge_PathVector_with_shape(Geom::PathVector const &combined_pathvector, SPItem const *item, const Geom::Affine &transform); + unsigned int draw_pathv_to_EMF(Geom::PathVector const &pathv, const Geom::Affine &transform); Geom::Path pathv_to_simple_polygon(Geom::PathVector const &pathv, int *vertices); Geom::Path pathv_to_rect(Geom::PathVector const &pathv, bool *is_rect, double *angle); Geom::Point get_pathrect_corner(Geom::Path pathRect, double angle, int corner); diff --git a/src/extension/internal/image-resolution.cpp b/src/extension/internal/image-resolution.cpp index f092b21ef..e96fd6437 100644 --- a/src/extension/internal/image-resolution.cpp +++ b/src/extension/internal/image-resolution.cpp @@ -354,8 +354,15 @@ void ImageResolution::readmagick(char const *fn) { return; } + std::string const type = image.magick(); x_ = image.xResolution(); y_ = image.yResolution(); + +// TODO: find out why the hell the following convertion is necessary + if (type == "BMP") { + x_ = Inkscape::Util::Quantity::convert(x_, "in", "cm"); + y_ = Inkscape::Util::Quantity::convert(y_, "in", "cm"); + } if (x_ != 0 && y_ != 0) { ok_ = true; diff --git a/src/extension/internal/metafile-inout.cpp b/src/extension/internal/metafile-inout.cpp index 534b33a30..824934b3e 100644 --- a/src/extension/internal/metafile-inout.cpp +++ b/src/extension/internal/metafile-inout.cpp @@ -222,7 +222,7 @@ void Metafile::setViewBoxIfMissing(SPDocument *doc) { prefs->setBool("/options/transform/pattern", true); prefs->setBool("/options/transform/gradient", true); - doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, dh)); + doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, dh), true); Inkscape::UI::ShapeEditor::blockSetItem(false); // restore options diff --git a/src/extension/internal/metafile-print.h b/src/extension/internal/metafile-print.h index a21f9de58..d184b72b7 100644 --- a/src/extension/internal/metafile-print.h +++ b/src/extension/internal/metafile-print.h @@ -69,6 +69,8 @@ protected: double _width; double _height; + double _doc_unit_scale; // to pixels, regardless of the document units + U_RECTL rc; uint32_t htextalignment; diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp index c03e7efe0..72c1c8bd3 100644 --- a/src/extension/internal/wmf-inout.cpp +++ b/src/extension/internal/wmf-inout.cpp @@ -3063,6 +3063,8 @@ Wmf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) return NULL; } + d.dc[0].font_name = strdup("Arial"); // Default font, set only on lowest level, it copies up from there WMF spec says device can pick whatever it wants + // set up the size default for patterns in defs. This might not be referenced if there are no patterns defined in the drawing. d.defs += "\n"; @@ -3105,7 +3107,7 @@ Wmf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) d.dc[0].style.stroke_dasharray.values.clear(); - for(int i=0; i<=d.level;i++){ + for(int i=0; i<=WMF_MAX_DC; i++){ if(d.dc[i].font_name)free(d.dc[i].font_name); } diff --git a/src/extension/internal/wmf-inout.h b/src/extension/internal/wmf-inout.h index 27ec14358..5a0a760dd 100644 --- a/src/extension/internal/wmf-inout.h +++ b/src/extension/internal/wmf-inout.h @@ -65,7 +65,7 @@ typedef struct wmf_device_context { textAlign(0) // worldTransform, cur { - font_name = strdup("Arial"); // Default font, WMF spec says device can pick whatever it wants + font_name = NULL; sizeWnd = point16_set( 0.0, 0.0 ); sizeView = point16_set( 0.0, 0.0 ); winorg = point16_set( 0.0, 0.0 ); diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp index af31f32b6..0ea15a5cd 100644 --- a/src/extension/prefdialog.cpp +++ b/src/extension/prefdialog.cpp @@ -90,6 +90,10 @@ PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * co if (_effect != NULL && !_effect->no_live_preview) { if (_param_preview == NULL) { XML::Document * doc = sp_repr_read_mem(live_param_xml, strlen(live_param_xml), NULL); + if (doc == NULL) { + std::cout << "Error encountered loading live parameter XML !!!" << std::endl; + return; + } _param_preview = Parameter::make(doc->root(), _effect); } diff --git a/src/extension/system.cpp b/src/extension/system.cpp index d02d801dc..5225f11ee 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -556,7 +556,7 @@ build_from_file(gchar const *filename) } /** - * \return The module created + * \return The module created, or NULL if buffer is invalid * \brief This function creates a module from a buffer holding an * XML description. * \param buffer The buffer holding the XML description of the module. @@ -568,6 +568,7 @@ Extension * build_from_mem(gchar const *buffer, Implementation::Implementation *in_imp) { Inkscape::XML::Document *doc = sp_repr_read_mem(buffer, strlen(buffer), INKSCAPE_EXTENSION_URI); + g_return_val_if_fail(doc != NULL, NULL); Extension *ext = build_from_reprdoc(doc, in_imp); Inkscape::GC::release(doc); return ext; diff --git a/src/filter-enums.cpp b/src/filter-enums.cpp index 037c66922..ae11aa64f 100644 --- a/src/filter-enums.cpp +++ b/src/filter-enums.cpp @@ -119,7 +119,7 @@ const EnumDataConverter<Inkscape::Filters::FilterComponentTransferType> Componen const EnumData<Inkscape::Filters::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeData[Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_ENDTYPE] = { {Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_DUPLICATE, _("Duplicate"), "duplicate"}, {Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_WRAP, _("Wrap"), "wrap"}, - {Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_NONE, _("None"), "none"} + {Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_NONE, C_("Convolve matrix, edge mode", "None"), "none"} }; const EnumDataConverter<Inkscape::Filters::FilterConvolveMatrixEdgeMode> ConvolveMatrixEdgeModeConverter(ConvolveMatrixEdgeModeData, Inkscape::Filters::CONVOLVEMATRIX_EDGEMODE_ENDTYPE); diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 8ac87dadd..36a802e5f 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -911,7 +911,7 @@ bool inkscape_load_menus( InkscapeApplication * inkscape ) inkscape->menus = sp_repr_read_mem(menus_skeleton, MENUS_SKELETON_SIZE, NULL); } - return (inkscape->menus != 0); + return (inkscape->menus != NULL); } diff --git a/src/live_effects/lpe-powerstroke-interpolators.h b/src/live_effects/lpe-powerstroke-interpolators.h index 3cde0b4b3..e3ab37e27 100644 --- a/src/live_effects/lpe-powerstroke-interpolators.h +++ b/src/live_effects/lpe-powerstroke-interpolators.h @@ -206,7 +206,6 @@ private: SpiroInterpolator& operator=(const SpiroInterpolator&); }; - // Quick mockup for testing the behavior for powerstroke controlpoint interpolation class CentripetalCatmullRomInterpolator : public Interpolator { public: diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp index b1951d978..58d733b53 100644 --- a/src/live_effects/lpe-powerstroke.cpp +++ b/src/live_effects/lpe-powerstroke.cpp @@ -226,10 +226,10 @@ enum LineJoinType { static const Util::EnumData<unsigned> LineJoinTypeData[] = { {LINEJOIN_BEVEL, N_("Beveled"), "bevel"}, {LINEJOIN_ROUND, N_("Rounded"), "round"}, - {LINEJOIN_EXTRP_MITER, N_("Extrapolated"), "extrapolated"}, +// {LINEJOIN_EXTRP_MITER, N_("Extrapolated"), "extrapolated"}, // disabled because doesn't work well + {LINEJOIN_EXTRP_MITER_ARC, N_("Extrapolated arc"), "extrp_arc"}, {LINEJOIN_MITER, N_("Miter"), "miter"}, {LINEJOIN_SPIRO, N_("Spiro"), "spiro"}, - {LINEJOIN_EXTRP_MITER_ARC, N_("Extrapolated arc"), "extrp_arc"}, }; static const Util::EnumDataConverter<unsigned> LineJoinTypeConverter(LineJoinTypeData, sizeof(LineJoinTypeData)/sizeof(*LineJoinTypeData)); @@ -482,8 +482,9 @@ static Geom::Path path_from_piecewise_fix_cusps( Geom::Piecewise<Geom::D2<Geom:: break; } case LINEJOIN_EXTRP_MITER_ARC: { - Geom::Circle circle1 = Geom::touching_circle(reverse(B[prev_i]),0.); - Geom::Circle circle2 = Geom::touching_circle(B[i],0.); + // Extrapolate using the curvature at the end of the path segments to join + Geom::Circle circle1 = Geom::touching_circle(reverse(B[prev_i]), 0.0); + Geom::Circle circle2 = Geom::touching_circle(B[i], 0.0); Geom::Point points[2]; int solutions = circle_circle_intersection(circle1, circle2, points[0], points[1]); if (solutions == 2) { diff --git a/src/live_effects/lpe-ruler.cpp b/src/live_effects/lpe-ruler.cpp index 788ab593a..fd611c78d 100644 --- a/src/live_effects/lpe-ruler.cpp +++ b/src/live_effects/lpe-ruler.cpp @@ -29,7 +29,7 @@ static const Util::EnumData<MarkDirType> MarkDirData[] = { static const Util::EnumDataConverter<MarkDirType> MarkDirTypeConverter(MarkDirData, sizeof(MarkDirData)/sizeof(*MarkDirData)); static const Util::EnumData<BorderMarkType> BorderMarkData[] = { - {BORDERMARK_NONE , N_("None"), "none"}, + {BORDERMARK_NONE , NC_("Border mark", "None"), "none"}, {BORDERMARK_START , N_("Start"), "start"}, {BORDERMARK_END , N_("End"), "end"}, {BORDERMARK_BOTH , N_("Both"), "both"}, diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 74d99918a..2a14d4208 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -143,7 +143,7 @@ gchar * PathParam::param_getSVGValue() const { if (href) { - return href; + return g_strdup(href); } else { gchar * svgd = sp_svg_write_path( _pathvector ); return svgd; diff --git a/src/live_effects/parameter/text.cpp b/src/live_effects/parameter/text.cpp index fcb2fc9fc..956a001ad 100644 --- a/src/live_effects/parameter/text.cpp +++ b/src/live_effects/parameter/text.cpp @@ -85,7 +85,7 @@ TextParam::param_readSVGValue(const gchar * strvalue) gchar * TextParam::param_getSVGValue() const { - return (gchar *) value.c_str(); + return g_strdup(value.c_str()); } Gtk::Widget * diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 0f7aa6368..9ff6df3bf 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -677,7 +677,7 @@ void Inkscape::ObjectSnapper::_snapPathsConstrained(IntermSnapResults &isr, (*p_inters) = dt->doc2dt(*p_inters); // Construct a snapped point Geom::Coord dist = Geom::L2(p.getPoint() - *p_inters); - SnappedPoint s = SnappedPoint(*p_inters, p.getSourceType(), p.getSourceNum(), k->target_type, dist, getSnapperTolerance(), getSnapperAlwaysSnap(), true, k->target_bbox);; + SnappedPoint s = SnappedPoint(*p_inters, p.getSourceType(), p.getSourceNum(), k->target_type, dist, getSnapperTolerance(), getSnapperAlwaysSnap(), true, false, k->target_bbox); // Store the snapped point if (dist <= tolerance) { // If the intersection is within snapping range, then we might snap to it isr.points.push_back(s); diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index b27d591b3..77fa78967 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -762,7 +762,7 @@ void sp_selection_group(Inkscape::Selection *selection, SPDesktop *desktop) sp_selection_group_impl(p, group, xml_doc, doc); DocumentUndo::done(doc, SP_VERB_SELECTION_GROUP, - _("Group")); + C_("Verb", "Group")); selection->set(group); Inkscape::GC::release(group); diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp index 7de65ccc3..72fe86daf 100644 --- a/src/sp-flowtext.cpp +++ b/src/sp-flowtext.cpp @@ -673,6 +673,21 @@ Geom::Affine SPFlowtext::set_transform (Geom::Affine const &xform) return xform; } + SPObject *region = NULL; + for ( SPObject *o = this->firstChild() ; o ; o = o->getNext() ) { + if (SP_IS_FLOWREGION(o)) { + region = o; + break; + } + } + if (region) { + if (SP_IS_RECT(region->firstChild())) { + SPRect *rect = SP_RECT(region->firstChild()); + rect->set_i2d_affine(xform * rect->i2dt_affine()); + rect->doWriteTransform(rect->getRepr(), rect->transform, NULL, true); + } + } + Geom::Affine ret(xform); ret[0] /= ex; ret[1] /= ex; @@ -693,7 +708,7 @@ Geom::Affine SPFlowtext::set_transform (Geom::Affine const &xform) this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_LAYOUT_MODIFIED_FLAG); - return ret; + return Geom::Affine(); } /* diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 79604446a..b2af3842e 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -656,14 +656,61 @@ void SPGroup::translateChildItems(Geom::Translate const &tr) } } -// Recursively scale child items around a point -void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p) +// Recursively (or not) scale child items around a point +void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p, bool noRecurse) { if ( hasChildren() ) { for (SPObject *o = firstChild() ; o ; o = o->getNext() ) { if ( SP_IS_ITEM(o) ) { if (SP_IS_GROUP(o) && !SP_IS_BOX3D(o)) { - SP_GROUP(o)->scaleChildItemsRec(sc, p); + /* Using recursion breaks clipping because transforms are applied + in coordinates for draws but nothing in defs is changed + instead change the transform on the entire group, and the transform + is applied after any references to clipping paths. However NOT using + recursion apparently breaks as of r13544 other parts of Inkscape + involved with showing/modifying units. So offer both for use + in different contexts. + */ + if(noRecurse) { + // used for EMF import + SPItem *item = SP_ITEM(o); + Geom::Translate const s(p); + Geom::Affine final = s.inverse() * sc * s; + Geom::Affine tAff = item->i2dt_affine() * final; + item->set_i2d_affine(tAff); + tAff = item->transform; + // Eliminate common rounding error affecting EMF/WMF input. + // When the rounding error persists it converts the simple + // transform=scale() to transform=matrix(). + if(std::abs(tAff[4]) < 1.0e-5 && std::abs(tAff[5]) < 1.0e-5){ + tAff[4] = 0.0; + tAff[5] = 0.0; + } + item->doWriteTransform(item->getRepr(), tAff, NULL, true); + } else { + // used for other import + SPItem *item = NULL; + if (SP_ITEM(o)->clip_ref->getObject()) { + item = SP_ITEM(SP_ITEM(o)->clip_ref->getObject()->firstChild()); + } + if (item != NULL) { + Geom::Affine tdoc2dt = Geom::Scale(1, -1) * Geom::Translate(p); // re-create doc2dt() + Geom::Affine ti2doc = SP_ITEM(o)->i2doc_affine(); + item->set_i2d_affine(ti2doc * sc * ti2doc.inverse() * tdoc2dt); + item->doWriteTransform(item->getRepr(), item->transform, NULL, true); + } + item = NULL; + if (SP_ITEM(o)->mask_ref->getObject()) { + item = SP_ITEM(SP_ITEM(o)->mask_ref->getObject()->firstChild()); + } + if (item != NULL) { + Geom::Affine tdoc2dt = Geom::Scale(1, -1) * Geom::Translate(p); // re-create doc2dt() + Geom::Affine ti2doc = SP_ITEM(o)->i2doc_affine(); + item->set_i2d_affine(ti2doc * sc * ti2doc.inverse() * tdoc2dt); + item->doWriteTransform(item->getRepr(), item->transform, NULL, true); + } + SP_GROUP(o)->scaleChildItemsRec(sc, p, false); + } } else { SPItem *item = SP_ITEM(o); Geom::OptRect bbox = item->desktopVisualBounds(); @@ -690,7 +737,7 @@ void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p) if (SP_IS_PERSP3D(item)) { persp3d_apply_affine_transformation(SP_PERSP3D(item), final); - } else if ((SP_IS_TEXT_TEXTPATH(item) || SP_IS_FLOWTEXT(item)) && !item->transform.isIdentity()) { + } else if (SP_IS_TEXT_TEXTPATH(item) && !item->transform.isIdentity()) { // Save and reset current transform Geom::Affine tmp(item->transform); item->transform = Geom::Affine(); diff --git a/src/sp-item-group.h b/src/sp-item-group.h index 97423630d..15bb58f22 100644 --- a/src/sp-item-group.h +++ b/src/sp-item-group.h @@ -61,7 +61,7 @@ public: LayerMode layerDisplayMode(unsigned int display_key) const; void setLayerDisplayMode(unsigned int display_key, LayerMode mode); void translateChildItems(Geom::Translate const &tr); - void scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p); + void scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p, bool noRecurse); int getItemCount() const; virtual void _showChildren (Inkscape::Drawing &drawing, Inkscape::DrawingItem *ai, unsigned int key, unsigned int flags); diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 10dc1a32c..c5b4b1667 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -44,6 +44,7 @@ #include "sp-rect.h" #include "sp-use.h" #include "sp-text.h" +#include "sp-textpath.h" #include "sp-item-rm-unsatisfied-cns.h" #include "sp-pattern.h" #include "sp-paint-server.h" @@ -1447,10 +1448,11 @@ void SPItem::doWriteTransform(Inkscape::XML::Node *repr, Geom::Affine const &tra // onSetTransform cannot be pure due to the fact that not all visible Items are transformable. if ( // run the object's set_transform (i.e. embed transform) only if: - !preserve && // user did not chose to preserve all transforms + SP_IS_TEXT_TEXTPATH(this) || + (!preserve && // user did not chose to preserve all transforms (!clip_ref || !clip_ref->getObject()) && // the object does not have a clippath (!mask_ref || !mask_ref->getObject()) && // the object does not have a mask - !(!transform.isTranslation() && style && style->getFilter()) // the object does not have a filter, or the transform is translation (which is supposed to not affect filters) + !(!transform.isTranslation() && style && style->getFilter())) // the object does not have a filter, or the transform is translation (which is supposed to not affect filters) ) { transform_attr = this->set_transform(transform); diff --git a/src/sp-text.cpp b/src/sp-text.cpp index 21d6a42f7..93d81e47b 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -356,6 +356,7 @@ const char* SPText::displayName() const { } gchar* SPText::description() const { + SPStyle *style = this->style; char *n = xml_quote_strdup( style->font_family.value ); @@ -371,9 +372,8 @@ gchar* SPText::description() const { } char *ret = ( SP_IS_TEXT_TEXTPATH(this) - ? g_strdup_printf(_("on path%s (%s, %s)"), trunc, n, xs->str) - : g_strdup_printf(_("%s (%s, %s)"), trunc, n, xs->str) ); - g_free(n); + ? g_strdup_printf(_("on path%s (%s, %s)"), trunc, n, xs->str) + : g_strdup_printf(_("%s (%s, %s)"), trunc, n, xs->str) ); return ret; } diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index ad6dfbac6..e5c605889 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -96,7 +96,6 @@ set(ui_SRC dialog/print.cpp dialog/symbols.cpp dialog/xml-tree.cpp - # dialog/session-player.cpp dialog/spellcheck.cpp dialog/svg-fonts-dialog.cpp dialog/swatches.cpp @@ -108,9 +107,6 @@ set(ui_SRC dialog/pixelartdialog.cpp dialog/transformation.cpp dialog/undo-history.cpp - # dialog/whiteboard-connect.cpp - # dialog/whiteboard-sharewithchat.cpp - # dialog/whiteboard-sharewithuser.cpp widget/anchor-selector.cpp widget/button.cpp diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 071ac037f..dc8a0fee2 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -1747,7 +1747,8 @@ void DocumentProperties::onDocUnitChange() doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(-viewscale*doc->getRoot()->viewBox.min()[Geom::X] + (doc->getWidth().value("px") - viewscale*doc->getRoot()->viewBox.width())/2, viewscale*doc->getRoot()->viewBox.min()[Geom::Y] + - (doc->getHeight().value("px") + viewscale*doc->getRoot()->viewBox.height())/2)); + (doc->getHeight().value("px") + viewscale*doc->getRoot()->viewBox.height())/2), + false); ShapeEditor::blockSetItem(false); } prefs->setBool("/options/transform/stroke", transform_stroke); diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index c2367c2a2..bd44846a3 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -546,7 +546,7 @@ public: _matrix(SP_ATTR_VALUES, _("This matrix determines a linear transform on color space. Each line affects one of the color components. Each column determines how much of each color component from the input is passed to the output. The last column does not depend on input colors, so can be used to adjust a constant component value.")), _saturation("", 0, 0, 1, 0.1, 0.01, 2, SP_ATTR_VALUES), _angle("", 0, 0, 360, 0.1, 0.01, 1, SP_ATTR_VALUES), - _label(_("None"), Gtk::ALIGN_START), + _label(C_("Label", "None"), Gtk::ALIGN_START), _use_stored(false), _saturation_store(0), _angle_store(0) diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 5d065dc60..c2da12058 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -19,6 +19,7 @@ #include "inkscape-preferences.h" #include <glibmm/i18n.h> +#include <glibmm/markup.h> #include <glibmm/miscutils.h> #include <gtkmm/main.h> #include <gtkmm/frame.h> @@ -330,7 +331,7 @@ void InkscapePreferences::initPageTools() _page_selector.add_line( true, "", _t_sel_trans_outl, "", _("Show only a box outline of the objects when moving or transforming")); _page_selector.add_group_header( _("Per-object selection cue")); - _t_sel_cue_none.init ( _("None"), "/options/selcue/value", Inkscape::SelCue::NONE, false, 0); + _t_sel_cue_none.init ( C_("Selection cue", "None"), "/options/selcue/value", Inkscape::SelCue::NONE, false, 0); _page_selector.add_line( true, "", _t_sel_cue_none, "", _("No per-object selection indication")); _t_sel_cue_mark.init ( _("Mark"), "/options/selcue/value", Inkscape::SelCue::MARK, true, &_t_sel_cue_none); @@ -525,11 +526,11 @@ void InkscapePreferences::initPageUI() _("Mongolian (mn)"), _("Nepali (ne)"), _("Norwegian Bokmål (nb)"), _("Norwegian Nynorsk (nn)"), _("Panjabi (pa)"), _("Polish (pl)"), _("Portuguese (pt)"), _("Portuguese/Brazil (pt_BR)"), _("Romanian (ro)"), _("Russian (ru)"), _("Serbian (sr)"), _("Serbian in Latin script (sr@latin)"), _("Slovak (sk)"), _("Slovenian (sl)"), _("Spanish (es)"), _("Spanish/Mexico (es_MX)"), - _("Swedish (sv)"),_("Telugu (te_IN)"), _("Thai (th)"), _("Turkish (tr)"), _("Ukrainian (uk)"), _("Vietnamese (vi)")}; + _("Swedish (sv)"),_("Telugu (te)"), _("Thai (th)"), _("Turkish (tr)"), _("Ukrainian (uk)"), _("Vietnamese (vi)")}; Glib::ustring langValues[] = {"", "sq", "am", "ar", "hy", "az", "eu", "be", "bg", "bn", "bn_BD", "br", "ca", "ca@valencia", "zh_CN", "zh_TW", "hr", "cs", "da", "nl", "dz", "de", "el", "en", "en_AU", "en_CA", "en_GB", "en_US@piglatin", "eo", "et", "fa", "fi", "fr", "ga", "gl", "he", "hu", "id", "it", "ja", "km", "rw", "ko", "lt", "lv", "mk", "mn", "ne", "nb", "nn", "pa", - "pl", "pt", "pt_BR", "ro", "ru", "sr", "sr@latin", "sk", "sl", "es", "es_MX", "sv", "te_IN", "th", "tr", "uk", "vi" }; + "pl", "pt", "pt_BR", "ro", "ru", "sr", "sr@latin", "sk", "sl", "es", "es_MX", "sv", "te", "th", "tr", "uk", "vi" }; { // sorting languages according to translated name @@ -641,7 +642,7 @@ void InkscapePreferences::initPageUI() _win_save_viewport.init ( _("Save and restore documents viewport"), "/options/savedocviewport/value", true); _win_zoom_resize.init ( _("Zoom when window is resized"), "/options/stickyzoom/value", false); _win_show_close.init ( _("Show close button on dialogs"), "/dialogs/showclose", false); - _win_ontop_none.init ( _("None"), "/options/transientpolicy/value", 0, false, 0); + _win_ontop_none.init ( C_("Dialog on top", "None"), "/options/transientpolicy/value", 0, false, 0); _win_ontop_normal.init ( _("Normal"), "/options/transientpolicy/value", 1, true, &_win_ontop_none); _win_ontop_agressive.init ( _("Aggressive"), "/options/transientpolicy/value", 2, false, &_win_ontop_none); @@ -1259,7 +1260,7 @@ void InkscapePreferences::initPageBehavior() _page_steps.add_line( false, "", _steps_compass, "", _("When on, angles are displayed with 0 at north, 0 to 360 range, positive clockwise; otherwise with 0 at east, -180 to 180 range, positive counterclockwise")); int const num_items = 17; - Glib::ustring labels[num_items] = {"90", "60", "45", "36", "30", "22.5", "18", "15", "12", "10", "7.5", "6", "3", "2", "1", "0.5", _("None")}; + Glib::ustring labels[num_items] = {"90", "60", "45", "36", "30", "22.5", "18", "15", "12", "10", "7.5", "6", "3", "2", "1", "0.5", C_("Rotation angle", "None")}; int values[num_items] = {2, 3, 4, 5, 6, 8, 10, 12, 15, 18, 24, 30, 60, 90, 180, 360, 0}; _steps_rot_snap.set_size_request(_sb_width); _steps_rot_snap.init("/options/rotationsnapsperpi/value", labels, values, num_items, 12); @@ -1835,7 +1836,7 @@ void InkscapePreferences::initPageSpellcheck() AspellDictInfoEnumeration *dels = aspell_dict_info_list_elements(dlist); - languages.push_back(Glib::ustring(_("None"))); + languages.push_back(Glib::ustring(C_("Spellchecker language", "None"))); langValues.push_back(Glib::ustring("")); const AspellDictInfo *entry; @@ -2054,7 +2055,8 @@ void InkscapePreferences::on_pagelist_selection_changed() if (!_init) { prefs->setInt("/dialogs/preferences/page", row[_page_list_columns._col_id]); } - _page_title.set_markup("<span size='large'><b>" + row[_page_list_columns._col_name] + "</b></span>"); + Glib::ustring col_name_escaped = Glib::Markup::escape_text( row[_page_list_columns._col_name] ); + _page_title.set_markup("<span size='large'><b>" + col_name_escaped + "</b></span>"); _page_frame.add(*_current_page); _current_page->show(); while (Gtk::Main::events_pending()) diff --git a/src/ui/dialog/input.cpp b/src/ui/dialog/input.cpp index 4be6716a5..8343cd6fe 100644 --- a/src/ui/dialog/input.cpp +++ b/src/ui/dialog/input.cpp @@ -1622,7 +1622,7 @@ void InputDialogImpl::ConfPanel::setAxis(gint count) if (barNum < count) { row[axisColumns.value] = Glib::ustring::format(barNum+1); } else { - row[axisColumns.value] = _("None"); + row[axisColumns.value] = C_("Input device axe", "None"); } } diff --git a/src/ui/dialog/pixelartdialog.cpp b/src/ui/dialog/pixelartdialog.cpp index 2d25f54d7..5113f172a 100644 --- a/src/ui/dialog/pixelartdialog.cpp +++ b/src/ui/dialog/pixelartdialog.cpp @@ -385,8 +385,8 @@ void PixelArtDialogImpl::vectorize() if ( input.pixbuf->get_width() > 256 || input.pixbuf->get_height() > 256 ) { - char *msg = _("Image looks too big. Process may take a while and is" - " wise to save your document before continue." + char *msg = _("Image looks too big. Process may take a while and it is" + " wise to save your document before continuing." "\n\nContinue the procedure (without saving)?"); Gtk::MessageDialog dialog(msg, false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK_CANCEL, true); diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index a0a163286..d3adb6307 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -180,7 +180,11 @@ SelectedStyle::SelectedStyle(bool /*layout*/) _na[i].show_all(); __na[i] = (_("Nothing selected")); - _none[i].set_markup (C_("Fill and stroke", "<i>None</i>")); + if (i == SS_FILL) { + _none[i].set_markup (C_("Fill", "<i>None</i>")); + } else { + _none[i].set_markup (C_("Stroke", "<i>None</i>")); + } sp_set_font_size_smaller (GTK_WIDGET(_none[i].gobj())); _none[i].show_all(); __none[i] = (i == SS_FILL)? (C_("Fill and stroke", "No fill")) : (C_("Fill and stroke", "No stroke")); diff --git a/src/verbs.cpp b/src/verbs.cpp index 580883646..b4743751e 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1435,7 +1435,7 @@ void LayerVerb::perform(SPAction *action, void *data) dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer.")); } else { dt->toggleLayerSolo( dt->currentLayer() ); - DocumentUndo::maybeDone(sp_desktop_document(dt), "layer:solo", SP_VERB_LAYER_SOLO, _("Toggle layer solo")); + DocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_SOLO, _("Toggle layer solo")); } break; } @@ -1459,7 +1459,7 @@ void LayerVerb::perform(SPAction *action, void *data) dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer.")); } else { dt->toggleLockOtherLayers( dt->currentLayer() ); - DocumentUndo::maybeDone(sp_desktop_document(dt), "layer:lockothers", SP_VERB_LAYER_LOCK_OTHERS, _("Lock other layers")); + DocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_LOCK_OTHERS, _("Lock other layers")); } break; } @@ -2429,7 +2429,7 @@ void LockAndHideVerb::perform(SPAction *action, void *data) Verb *Verb::_base_verbs[] = { // Header new Verb(SP_VERB_INVALID, NULL, NULL, NULL, NULL, NULL), - new Verb(SP_VERB_NONE, "None", N_("None"), N_("Does nothing"), NULL, NULL), + new Verb(SP_VERB_NONE, "None", NC_("Verb", "None"), N_("Does nothing"), NULL, NULL), // File new FileVerb(SP_VERB_FILE_NEW, "FileNew", N_("Default"), N_("Create new document from the default template"), diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp index 3e358e522..b6378b251 100644 --- a/src/widgets/gradient-toolbar.cpp +++ b/src/widgets/gradient-toolbar.cpp @@ -1109,7 +1109,7 @@ void sp_gradient_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GtkTreeIter iter; gtk_list_store_append( model, &iter ); - gtk_list_store_set( model, &iter, 0, _("None"), 1, SP_GRADIENT_SPREAD_PAD, -1 ); + gtk_list_store_set( model, &iter, 0, C_("Gradient repeat type", "None"), 1, SP_GRADIENT_SPREAD_PAD, -1 ); gtk_list_store_append( model, &iter ); gtk_list_store_set( model, &iter, 0, _("Reflected"), 1, SP_GRADIENT_SPREAD_REFLECT, -1 ); diff --git a/src/widgets/node-toolbar.cpp b/src/widgets/node-toolbar.cpp index 49f9732e5..467325d08 100644 --- a/src/widgets/node-toolbar.cpp +++ b/src/widgets/node-toolbar.cpp @@ -270,7 +270,7 @@ static void sp_node_path_value_changed(GtkAdjustment *adj, GObject *tbl, Geom::D } // quit if run by the attr_changed listener - if (g_object_get_data( tbl, "freeze" )) { + if (g_object_get_data( tbl, "freeze" ) || tracker->isUpdating()) { return; } diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index f44229fec..1214a378a 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -157,7 +157,7 @@ static void freehand_change_shape(EgeSelectOneAction* act, GObject *dataKludge) static GList * freehand_shape_dropdown_items_list() { GList *glist = NULL; - glist = g_list_append (glist, _("None")); + glist = g_list_append (glist, const_cast<gchar *>(C_("Freehand shape", "None"))); glist = g_list_append (glist, _("Triangle in")); glist = g_list_append (glist, _("Triangle out")); glist = g_list_append (glist, _("Ellipse")); diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index 64090b7cf..e1ce01eaf 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -97,7 +97,7 @@ static void sp_rtb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const * } // quit if run by the attr_changed listener - if (g_object_get_data( tbl, "freeze" )) { + if (g_object_get_data( tbl, "freeze" ) || tracker->isUpdating()) { return; } diff --git a/src/widgets/stroke-marker-selector.cpp b/src/widgets/stroke-marker-selector.cpp index e80e01c22..23da54e94 100644 --- a/src/widgets/stroke-marker-selector.cpp +++ b/src/widgets/stroke-marker-selector.cpp @@ -385,7 +385,7 @@ void MarkerComboBox::add_markers (GSList *marker_list, SPDocument *source, gbool if (history) { // add "None" Gtk::TreeModel::Row row = *(marker_store->prepend()); - row[marker_columns.label] = _("None"); + row[marker_columns.label] = C_("Marker", "None"); row[marker_columns.stock] = false; row[marker_columns.marker] = g_strdup("None"); row[marker_columns.image] = NULL; |
