summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormathog <>2015-02-09 20:58:45 +0000
committermathog <>2015-02-09 20:58:45 +0000
commit3f2f43974a62918269b0d464a8f15b8be7d8069a (patch)
tree8d27bcfbc5bcf5aa08a43ae5f994fdba5d573361 /src
parentfix for bug 1405292 (diff)
downloadinkscape-3f2f43974a62918269b0d464a8f15b8be7d8069a.tar.gz
inkscape-3f2f43974a62918269b0d464a8f15b8be7d8069a.zip
fix for bug 1419926
(bzr r13914)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/emf-inout.cpp39
-rw-r--r--src/extension/internal/wmf-inout.cpp30
2 files changed, 43 insertions, 26 deletions
diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp
index 1af9f229c..71b6b82f7 100644
--- a/src/extension/internal/emf-inout.cpp
+++ b/src/extension/internal/emf-inout.cpp
@@ -1515,6 +1515,9 @@ void Emf::common_image_extraction(PEMF_CALLBACK_DATA d, void *pEmr,
int dibparams = U_BI_UNKNOWN; // type of image not yet determined
tmp_image << "\n\t <image\n";
+ if (d->dc[d->level].clip_id){
+ tmp_image << "\tclip-path=\"url(#clipEmfPath" << d->dc[d->level].clip_id << ")\"\n";
+ }
tmp_image << " y=\"" << dy << "\"\n x=\"" << dx <<"\"\n ";
MEMPNG mempng; // PNG in memory comes back in this
@@ -1727,21 +1730,23 @@ std::cout << "BEFORE DRAW"
)
){
// std::cout << "PATH DRAW at TOP path" << *(d->path) << std::endl;
- d->outsvg += " <path "; // this is the ONLY place <path should be used!!! One exception, gradientfill.
- if(d->drawtype){ // explicit draw type EMR record
- output_style(d, d->drawtype);
- }
- else if(d->mask & U_DRAW_CLOSED){ // implicit draw type
- output_style(d, U_EMR_STROKEANDFILLPATH);
- }
- else {
- output_style(d, U_EMR_STROKEPATH);
+ if(!(d->path.empty())){
+ d->outsvg += " <path "; // this is the ONLY place <path should be used!!! One exception, gradientfill.
+ if(d->drawtype){ // explicit draw type EMR record
+ output_style(d, d->drawtype);
+ }
+ else if(d->mask & U_DRAW_CLOSED){ // implicit draw type
+ output_style(d, U_EMR_STROKEANDFILLPATH);
+ }
+ else {
+ output_style(d, U_EMR_STROKEPATH);
+ }
+ d->outsvg += "\n\t";
+ d->outsvg += "\n\td=\""; // this is the ONLY place d=" should be used!!!! One exception, gradientfill.
+ d->outsvg += d->path;
+ d->outsvg += " \" /> \n";
+ d->path = "";
}
- d->outsvg += "\n\t";
- d->outsvg += "\n\td=\""; // this is the ONLY place d=" should be used!!!! One exception, gradientfill.
- d->outsvg += d->path;
- d->outsvg += " \" /> \n";
- d->path = "";
// reset the flags
d->mask = 0;
d->drawtype = 0;
@@ -3418,7 +3423,11 @@ std::cout << "BEFORE DRAW"
tmp_rectangle << "\n\tz\"";
tmp_rectangle << "\n\tstyle=\"stroke:none;fill:url(#";
tmp_rectangle << d->gradients.strings[fill_idx];
- tmp_rectangle << ");\"\n/>\n";
+ tmp_rectangle << ");\"\n";
+ if (d->dc[d->level].clip_id){
+ tmp_rectangle << "\tclip-path=\"url(#clipEmfPath" << d->dc[d->level].clip_id << ")\"\n";
+ }
+ tmp_rectangle << "/>\n";
}
d->outsvg += tmp_rectangle.str().c_str();
}
diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp
index 2b0e00084..bffe06695 100644
--- a/src/extension/internal/wmf-inout.cpp
+++ b/src/extension/internal/wmf-inout.cpp
@@ -1308,6 +1308,9 @@ void Wmf::common_dib_to_image(PWMF_CALLBACK_DATA d, const char *dib,
int dibparams = U_BI_UNKNOWN; // type of image not yet determined
tmp_image << "\n\t <image\n";
+ if (d->dc[d->level].clip_id){
+ tmp_image << "\tclip-path=\"url(#clipEmfPath" << d->dc[d->level].clip_id << ")\"\n";
+ }
tmp_image << " y=\"" << dy << "\"\n x=\"" << dx <<"\"\n ";
MEMPNG mempng; // PNG in memory comes back in this
@@ -1405,6 +1408,9 @@ void Wmf::common_bm16_to_image(PWMF_CALLBACK_DATA d, U_BITMAP16 Bm16, const char
SVGOStringStream tmp_image;
tmp_image << "\n\t <image\n";
+ if (d->dc[d->level].clip_id){
+ tmp_image << "\tclip-path=\"url(#clipEmfPath" << d->dc[d->level].clip_id << ")\"\n";
+ }
tmp_image << " y=\"" << dy << "\"\n x=\"" << dx <<"\"\n ";
MEMPNG mempng; // PNG in memory comes back in this
@@ -1752,13 +1758,15 @@ std::cout << "BEFORE DRAW"
)
){
// std::cout << "PATH DRAW at TOP <<+++++++++++++++++++++++++++++++++++++" << std::endl;
- d->outsvg += " <path "; // this is the ONLY place <path should be used!!!!
- output_style(d);
- d->outsvg += "\n\t";
- d->outsvg += "\n\td=\""; // this is the ONLY place d=" should be used!!!!
- d->outsvg += d->path;
- d->outsvg += " \" /> \n";
- d->path = ""; //reset the path
+ if(!(d->path.empty())){
+ d->outsvg += " <path "; // this is the ONLY place <path should be used!!!!
+ output_style(d);
+ d->outsvg += "\n\t";
+ d->outsvg += "\n\td=\""; // this is the ONLY place d=" should be used!!!!
+ d->outsvg += d->path;
+ d->outsvg += " \" /> \n";
+ d->path = ""; //reset the path
+ }
// reset the flags
d->mask = 0;
d->drawtype = 0;
@@ -2600,9 +2608,9 @@ std::cout << "BEFORE DRAW"
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();
+ 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;
@@ -2610,7 +2618,7 @@ std::cout << "BEFORE DRAW"
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";
+ d->outsvg += "\n</g>\n";
}
}