=== modified file 'src/extension/internal/wmf-inout.cpp' --- src/extension/internal/wmf-inout.cpp 2014-07-22 19:16:13 +0000 +++ src/extension/internal/wmf-inout.cpp 2014-07-28 16:46:01 +0000 @@ -670,7 +670,7 @@ 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 @@ // 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 @@ 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 @@ (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);