summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2014-08-04 15:29:44 +0000
committer~suv <suv-sf@users.sourceforge.net>2014-08-04 15:29:44 +0000
commitb70edbea3adc1d80307ac2efaf01181a504191e3 (patch)
treea376cbf2f7dd28073ab89b15a897a135fdcbe0f6 /src/extension
parentupdate to trunk (r13472) (diff)
parentExporting. Fix for bug #1350897 (XAML export formats numbers in the top-level... (diff)
downloadinkscape-b70edbea3adc1d80307ac2efaf01181a504191e3.tar.gz
inkscape-b70edbea3adc1d80307ac2efaf01181a504191e3.zip
update to trunk (r13488)
(bzr r13398.1.6)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/internal/wmf-inout.cpp22
1 files changed, 19 insertions, 3 deletions
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 << "\n<clipPath";
tmp_clippath << "\n\tclipPathUnits=\"userSpaceOnUse\" ";
- tmp_clippath << "\n\tid=\"clipEmfPath" << d->dc[d->level].clip_id << "\"";
+ tmp_clippath << "\n\tid=\"clipWmfPath" << d->dc[d->level].clip_id << "\"";
tmp_clippath << " >";
tmp_clippath << "\n\t<path d=\"";
tmp_clippath << combined;
@@ -895,7 +895,7 @@ Wmf::output_style(PWMF_CALLBACK_DATA d)
}
tmp_style << "\" ";
if (d->dc[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 << "\n<g\n\tclip-path=\"url(#clipWmfPath" << d->dc[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</g>\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 << "\n<g\n\tclip-path=\"url(#clipWmfPath" << d->dc[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</g>\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);