From cea97264b15dcb4b25a52673c9405fa5733d9f6e Mon Sep 17 00:00:00 2001 From: mathog <> Date: Mon, 28 Jul 2014 09:49:26 -0700 Subject: Fix for bug 1340683 for WMF input (bzr r13473) --- src/extension/internal/wmf-inout.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp index beb6190d3..5ccad678a 100644 --- a/src/extension/internal/wmf-inout.cpp +++ b/src/extension/internal/wmf-inout.cpp @@ -670,7 +670,7 @@ void Wmf::add_clips(PWMF_CALLBACK_DATA d, const char *clippath, unsigned int log SVGOStringStream tmp_clippath; tmp_clippath << "\ndc[d->level].clip_id << "\""; + tmp_clippath << "\n\tid=\"clipWmfPath" << d->dc[d->level].clip_id << "\""; tmp_clippath << " >"; tmp_clippath << "\n\tdc[d->level].clip_id) - tmp_style << "\n\tclip-path=\"url(#clipEmfPath" << d->dc[d->level].clip_id << ")\" "; + tmp_style << "\n\tclip-path=\"url(#clipWmfPath" << d->dc[d->level].clip_id << ")\" "; d->outsvg += tmp_style.str().c_str(); } @@ -1688,11 +1688,19 @@ int Wmf::myMetaFileProc(const char *contents, unsigned int length, PWMF_CALLBACK // next record is valid type and forces pending text to be drawn immediately if ((d->dc[d->level].dirty & DIRTY_TEXT) || ((wmr_mask != U_WMR_INVALID) && (wmr_mask & U_DRAW_TEXT) && d->tri->dirty)){ TR_layout_analyze(d->tri); + if (d->dc[d->level].clip_id){ + SVGOStringStream tmp_clip; + tmp_clip << "\ndc[d->level].clip_id << ")\"\n>"; + d->outsvg += tmp_clip.str().c_str(); + } TR_layout_2_svg(d->tri); SVGOStringStream ts; ts << d->tri->out; d->outsvg += ts.str().c_str(); d->tri = trinfo_clear(d->tri); + if (d->dc[d->level].clip_id){ + d->outsvg += "\n\n"; + } } if(d->dc[d->level].dirty){ //Apply the delayed background changes, clear the flag d->dc[d->level].bkMode = tbkMode; @@ -2590,11 +2598,19 @@ std::cout << "BEFORE DRAW" status = trinfo_load_textrec(d->tri, &tsp, tsp.ori,TR_EMFBOT); // ori is actually escapement if(status==-1){ // change of escapement, emit what we have and reset TR_layout_analyze(d->tri); + if (d->dc[d->level].clip_id){ + SVGOStringStream tmp_clip; + tmp_clip << "\ndc[d->level].clip_id << ")\"\n>"; + d->outsvg += tmp_clip.str().c_str(); + } TR_layout_2_svg(d->tri); ts << d->tri->out; d->outsvg += ts.str().c_str(); d->tri = trinfo_clear(d->tri); (void) trinfo_load_textrec(d->tri, &tsp, tsp.ori,TR_EMFBOT); // ignore return status, it must work + if (d->dc[d->level].clip_id){ + d->outsvg += "\n\n"; + } } g_free(escaped_text); @@ -3071,7 +3087,7 @@ Wmf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) (void) myMetaFileProc(contents,length, &d); free(contents); -// std::cout << "SVG Output: " << std::endl << *(d.outsvg) << std::endl; +// std::cout << "SVG Output: " << std::endl << d.outsvg << std::endl; SPDocument *doc = SPDocument::createNewDocFromMem(d.outsvg.c_str(), strlen(d.outsvg.c_str()), TRUE); -- cgit v1.2.3 From f29837e4e28f859bd83c8002453e4dd8b82ef08f Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Mon, 28 Jul 2014 15:08:20 -0400 Subject: Fix placement news and calls to destructor. Fixes crash regressions #1348891, #1344217, #1333445, and stubborn Windows bug #956225 (possibly more). Fixed bugs: - https://launchpad.net/bugs/1348891 - https://launchpad.net/bugs/1344217 - https://launchpad.net/bugs/1333445 - https://launchpad.net/bugs/956225 (bzr r13474) --- src/sp-offset.cpp | 5 ----- src/style.cpp | 11 ----------- 2 files changed, 16 deletions(-) (limited to 'src') diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp index c6a4b730d..3aa1e4eb6 100644 --- a/src/sp-offset.cpp +++ b/src/sp-offset.cpp @@ -107,11 +107,6 @@ SPOffset::SPOffset() : SPShape() { this->sourceRepr = NULL; this->sourceObject = NULL; - new (&this->_modified_connection) sigc::connection(); - new (&this->_delete_connection) sigc::connection(); - new (&this->_changed_connection) sigc::connection(); - new (&this->_transformed_connection) sigc::connection(); - // set up the uri reference this->sourceRef = new SPUseReference(this); this->_changed_connection = this->sourceRef->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_offset_href_changed), this)); diff --git a/src/style.cpp b/src/style.cpp index c6a98e7f4..222155a0c 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -227,11 +227,6 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) : document = document_in; } - new (&release_connection) sigc::connection(); - new (&filter_modified_connection) sigc::connection(); - new (&fill_ps_modified_connection) sigc::connection(); - new (&stroke_ps_modified_connection) sigc::connection(); - // 'font' shorthand requires access to included properties. font.setStylePointer( this ); @@ -431,7 +426,6 @@ SPStyle::~SPStyle() { // Remove connections release_connection.disconnect(); - release_connection.~connection(); // The following shoud be moved into SPIPaint and SPIFilter if (fill.value.href) { @@ -446,12 +440,7 @@ SPStyle::~SPStyle() { filter_modified_connection.disconnect(); } - filter_modified_connection.~connection(); - fill_ps_modified_connection.~connection(); - stroke_ps_modified_connection.~connection(); - _properties.clear(); - //_propmap.clear(); // std::cout << "SPStyle::~SPstyle(): Exit\n" << std::endl; } -- cgit v1.2.3 From 653be18705548ae8ab5a0358ecf77feca1b22e54 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 28 Jul 2014 21:34:56 +0200 Subject: noop: remove commented-out code that is dangerous and should not come back (bzr r13475) --- src/sp-flowregion.cpp | 3 --- src/sp-gradient.cpp | 2 -- src/sp-item-group.cpp | 2 -- src/sp-item.cpp | 4 ---- src/sp-string.cpp | 1 - src/sp-text.cpp | 5 ----- src/sp-tref.cpp | 7 ------- src/sp-tspan.cpp | 2 -- 8 files changed, 26 deletions(-) (limited to 'src') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index e8e5c3d95..32d3b0f60 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -42,15 +42,12 @@ static void GetDest(SPObject* child,Shape **computed); SPFlowregion::SPFlowregion() : SPItem() { - //new (&this->computed) std::vector; } SPFlowregion::~SPFlowregion() { for (std::vector::iterator it = this->computed.begin() ; it != this->computed.end() ; ++it) { delete *it; } - - //this->computed.~vector(); } void SPFlowregion::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp index 1479acd69..70c54451a 100644 --- a/src/sp-gradient.cpp +++ b/src/sp-gradient.cpp @@ -262,8 +262,6 @@ SPGradient::SPGradient() : SPPaintServer(), units(), this->vector.built = false; this->vector.stops.clear(); - - //new (&this->modified_connection) sigc::connection(); } SPGradient::~SPGradient() { diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 7af4e3320..657aca692 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -70,11 +70,9 @@ namespace { SPGroup::SPGroup() : SPLPEItem() { this->_layer_mode = SPGroup::GROUP; - //new (&this->_display_modes) std::map(); } SPGroup::~SPGroup() { - //this->_display_modes.~map(); } void SPGroup::build(SPDocument *document, Inkscape::XML::Node *repr) { diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 0cdff6546..a3f1a5d64 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -118,10 +118,6 @@ SPItem::SPItem() : SPObject() { mask_ref->changedSignal().connect(sigc::bind(sigc::ptr_fun(mask_ref_changed), this)); avoidRef = new SPAvoidRef(this); - - //new (&constraints) std::vector(); - - //new (&_transformed_signal) sigc::signal(); } SPItem::~SPItem() { diff --git a/src/sp-string.cpp b/src/sp-string.cpp index 08755a5fc..e9dfc168b 100644 --- a/src/sp-string.cpp +++ b/src/sp-string.cpp @@ -47,7 +47,6 @@ namespace { #####################################################*/ SPString::SPString() : SPObject() { - //new (&this->string) Glib::ustring(); } SPString::~SPString() { diff --git a/src/sp-text.cpp b/src/sp-text.cpp index 9a7f0b7a0..ccc5adf59 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -70,8 +70,6 @@ namespace { # SPTEXT #####################################################*/ SPText::SPText() : SPItem() { - //new (&this->layout) Inkscape::Text::Layout; - //new (&this->attributes) TextTagAttributes; } SPText::~SPText() { @@ -90,9 +88,6 @@ void SPText::build(SPDocument *doc, Inkscape::XML::Node *repr) { } void SPText::release() { - //this->attributes.~TextTagAttributes(); - //this->layout.~Layout(); - SPItem::release(); } diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index edbb9faa7..0f6eb106f 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -64,12 +64,8 @@ static void sp_tref_delete_self(SPObject *deleted, SPTRef *self); SPTRef::SPTRef() : SPItem() { this->stringChild = NULL; - //new (&this->attributes) TextTagAttributes; - this->href = NULL; this->uriOriginalRef = new SPTRefReference(this); - //new (&this->_delete_connection) sigc::connection(); - //new (&this->_changed_connection) sigc::connection(); this->_changed_connection = this->uriOriginalRef->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_tref_href_changed), this)); @@ -77,9 +73,6 @@ SPTRef::SPTRef() : SPItem() { SPTRef::~SPTRef() { delete this->uriOriginalRef; - - //this->_delete_connection.~connection(); - //this->_changed_connection.~connection(); } void SPTRef::build(SPDocument *document, Inkscape::XML::Node *repr) { diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp index 8c4105777..58a4da75c 100644 --- a/src/sp-tspan.cpp +++ b/src/sp-tspan.cpp @@ -227,8 +227,6 @@ const char* SPTSpan::displayName() const { void refresh_textpath_source(SPTextPath* offset); SPTextPath::SPTextPath() : SPItem() { - //new (&this->attributes) TextTagAttributes; - this->startOffset._set = false; this->originalPath = NULL; this->isUpdating=false; -- cgit v1.2.3 From 5a7378908bff31485572833da4db1185eac5ae55 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 28 Jul 2014 21:36:45 +0200 Subject: noop: remove commented-out code that is dangerous and should not come back (bzr r13476) --- src/sp-flowtext.cpp | 2 -- src/sp-tspan.cpp | 3 --- 2 files changed, 5 deletions(-) (limited to 'src') diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp index 59832a2b4..7de65ccc3 100644 --- a/src/sp-flowtext.cpp +++ b/src/sp-flowtext.cpp @@ -46,11 +46,9 @@ namespace { SPFlowtext::SPFlowtext() : SPItem() { this->par_indent = 0; - //new (&this->layout) Inkscape::Text::Layout(); } SPFlowtext::~SPFlowtext() { - //this->layout.~Layout(); } void SPFlowtext::child_added(Inkscape::XML::Node* child, Inkscape::XML::Node* ref) { diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp index 58a4da75c..c3f7689e7 100644 --- a/src/sp-tspan.cpp +++ b/src/sp-tspan.cpp @@ -63,7 +63,6 @@ namespace { #####################################################*/ SPTSpan::SPTSpan() : SPItem() { this->role = SP_TSPAN_ROLE_UNSPECIFIED; - //new (&this->attributes) TextTagAttributes; } SPTSpan::~SPTSpan() { @@ -81,8 +80,6 @@ void SPTSpan::build(SPDocument *doc, Inkscape::XML::Node *repr) { } void SPTSpan::release() { - //this->attributes.~TextTagAttributes(); - SPItem::release(); } -- cgit v1.2.3 From 9fb31e5a547d84fd087fc74ffeae6950e9441326 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 28 Jul 2014 21:42:08 +0200 Subject: related to lp:inkscape r13474, remove unnecessary/broken placement news (bzr r13477) --- src/sp-shape.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index 61d35e6ff..de9103dee 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -57,8 +57,6 @@ static void sp_shape_update_marker_view (SPShape *shape, Inkscape::DrawingItem * SPShape::SPShape() : SPLPEItem() { for ( int i = 0 ; i < SP_MARKER_LOC_QTY ; i++ ) { - new (&this->_release_connect[i]) sigc::connection(); - new (&this->_modified_connect[i]) sigc::connection(); this->_marker[i] = NULL; } -- cgit v1.2.3