summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-02-15 18:31:38 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-02-15 18:31:38 +0000
commitc7f7afed83fc8453859ec98162537c7dc395568f (patch)
treeed0592d8973b5c0c09cfc757263a934772cb3c2a /src/extension
parentfirst steps (diff)
parentAdjust timeout for snap tool tips to 4 seconds (diff)
downloadinkscape-c7f7afed83fc8453859ec98162537c7dc395568f.tar.gz
inkscape-c7f7afed83fc8453859ec98162537c7dc395568f.zip
update to trunk
(bzr r13645.1.11)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/internal/emf-inout.cpp45
-rw-r--r--src/extension/internal/emf-print.cpp2
-rw-r--r--src/extension/internal/pdfinput/pdf-parser.cpp20
-rw-r--r--src/extension/internal/wmf-inout.cpp32
4 files changed, 48 insertions, 51 deletions
diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp
index 4b070cbaa..71b6b82f7 100644
--- a/src/extension/internal/emf-inout.cpp
+++ b/src/extension/internal/emf-inout.cpp
@@ -45,8 +45,8 @@
#include "display/drawing-item.h"
#include "clear-n_.h"
#include "svg/svg.h"
-#include "util/units.h" // even though it is included indirectly by wmf-inout.h
-#include "inkscape.h" // even though it is included indirectly by wmf-inout.h
+#include "util/units.h" // even though it is included indirectly by emf-inout.h
+#include "inkscape.h" // even though it is included indirectly by emf-inout.h
#include "emf-print.h"
#include "emf-inout.h"
@@ -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();
}
@@ -3538,7 +3547,7 @@ Emf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri )
d.tri = trinfo_release_except_FC(d.tri);
- setViewBoxIfMissing(doc);
+ // in earlier versions no viewbox was generated and a call to setViewBoxIfMissing() was needed here.
return doc;
}
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index f7b6626c4..b22dbc0e3 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -706,7 +706,7 @@ int PrintEmf::create_pen(SPStyle const *style, const Geom::Affine &transform)
n_dash = style->stroke_dasharray.values.size();
dash = new uint32_t[n_dash];
for (i = 0; i < n_dash; i++) {
- dash[i] = (uint32_t)(Inkscape::Util::Quantity::convert(1, "mm", "px") * style->stroke_dasharray.values[i]);
+ dash[i] = style->stroke_dasharray.values[i];
}
}
}
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index 812fa373f..cc0b38515 100644
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
@@ -2586,24 +2586,12 @@ void PdfParser::opShowSpaceText(Object args[], int /*numArgs*/)
}
}
-
-
-/*
- * The `POPPLER_NEW_GFXFONT' stuff is for the change to GfxFont's getNextChar() call.
- * Thanks to tsdgeos for the fix.
- * Miklos, does this look ok?
- */
-
void PdfParser::doShowText(GooString *s) {
GfxFont *font;
int wMode;
double riseX, riseY;
CharCode code;
-#ifdef POPPLER_NEW_GFXFONT
Unicode *u = NULL;
-#else
- Unicode u[8];
-#endif
double x, y, dx, dy, tdx, tdy;
double originX, originY, tOriginX, tOriginY;
double oldCTM[6], newCTM[6];
@@ -2651,11 +2639,7 @@ void PdfParser::doShowText(GooString *s) {
len = s->getLength();
while (len > 0) {
n = font->getNextChar(p, len, &code,
-#ifdef POPPLER_NEW_GFXFONT
&u, &uLen, /* TODO: This looks like a memory leak for u. */
-#else
- u, (int)(sizeof(u) / sizeof(Unicode)), &uLen,
-#endif
&dx, &dy, &originX, &originY);
dx = dx * state->getFontSize() + state->getCharSpace();
if (n == 1 && *p == ' ') {
@@ -2708,11 +2692,7 @@ void PdfParser::doShowText(GooString *s) {
len = s->getLength();
while (len > 0) {
n = font->getNextChar(p, len, &code,
-#ifdef POPPLER_NEW_GFXFONT
&u, &uLen, /* TODO: This looks like a memory leak for u. */
-#else
- u, (int)(sizeof(u) / sizeof(Unicode)), &uLen,
-#endif
&dx, &dy, &originX, &originY);
if (wMode) {
diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp
index 72c1c8bd3..8eb03131c 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(#clipWmfPath" << 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(#clipWmfPath" << 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";
}
}
@@ -3113,7 +3121,7 @@ Wmf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri )
d.tri = trinfo_release_except_FC(d.tri);
- setViewBoxIfMissing(doc);
+ // in earlier versions no viewbox was generated and a call to setViewBoxIfMissing() was needed here.
return doc;
}