summaryrefslogtreecommitdiffstats
path: root/src/extension/internal
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2017-02-23 14:39:39 +0000
committerShlomi Fish <shlomif@shlomifish.org>2017-02-23 14:39:39 +0000
commitd82d8e6de61b5a3da73af7d7003b8281720c3dc1 (patch)
tree50a151920b32f95afd0fa0c04f175322657ebb18 /src/extension/internal
parentMerged. (diff)
parentDisplay style attribute properties when object row selected. Allow their dele... (diff)
downloadinkscape-d82d8e6de61b5a3da73af7d7003b8281720c3dc1.tar.gz
inkscape-d82d8e6de61b5a3da73af7d7003b8281720c3dc1.zip
Merged.
(bzr r15369.1.19)
Diffstat (limited to 'src/extension/internal')
-rw-r--r--src/extension/internal/bitmap/imagemagick.cpp1
-rw-r--r--src/extension/internal/cdr-input.cpp8
-rw-r--r--src/extension/internal/filter/color.h2
-rw-r--r--src/extension/internal/filter/protrusions.h2
-rw-r--r--src/extension/internal/vsd-input.cpp8
-rw-r--r--src/extension/internal/wmf-inout.cpp10
-rw-r--r--src/extension/internal/wmf-print.cpp23
-rw-r--r--src/extension/internal/wpg-input.cpp7
8 files changed, 50 insertions, 11 deletions
diff --git a/src/extension/internal/bitmap/imagemagick.cpp b/src/extension/internal/bitmap/imagemagick.cpp
index 472c2db91..cc5b3d1bc 100644
--- a/src/extension/internal/bitmap/imagemagick.cpp
+++ b/src/extension/internal/bitmap/imagemagick.cpp
@@ -213,6 +213,7 @@ ImageMagick::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::Vi
dc->_nodes[i]->setAttribute("xlink:href", dc->_caches[i], true);
dc->_nodes[i]->setAttribute("sodipodi:absref", NULL, true);
+ delete blob;
}
catch (Magick::Exception &error_) {
printf("Caught exception: %s \n", error_.what());
diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp
index 0435f1396..dbe88c668 100644
--- a/src/extension/internal/cdr-input.cpp
+++ b/src/extension/internal/cdr-input.cpp
@@ -218,11 +218,13 @@ SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * u
// RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows
// therefore attempt to convert uri to the system codepage
// even if this is not possible the alternate short (8.3) file name will be used if available
- uri = g_win32_locale_filename_from_utf8(uri);
+ gchar * converted_uri = g_win32_locale_filename_from_utf8(uri);
+ RVNGFileStream input(converted_uri);
+ g_free(converted_uri);
+ #else
+ RVNGFileStream input(uri);
#endif
- RVNGFileStream input(uri);
-
if (!libcdr::CDRDocument::isSupported(&input)) {
return NULL;
}
diff --git a/src/extension/internal/filter/color.h b/src/extension/internal/filter/color.h
index a6b777d20..6324dafa9 100644
--- a/src/extension/internal/filter/color.h
+++ b/src/extension/internal/filter/color.h
@@ -1480,7 +1480,7 @@ public:
static void init (void) {
Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
- "<name>" N_("Quadritone fantasy") "</name>\n"
+ "<name>" N_("Quadritone Fantasy") "</name>\n"
"<id>org.inkscape.effect.filter.Quadritone</id>\n"
"<param name=\"dist\" _gui-text=\"" N_("Hue distribution (°)") "\" type=\"int\" appearance=\"full\" min=\"0\" max=\"360\">280</param>\n"
"<param name=\"colors\" _gui-text=\"" N_("Colors") "\" type=\"int\" appearance=\"full\" min=\"0\" max=\"360\">100</param>\n"
diff --git a/src/extension/internal/filter/protrusions.h b/src/extension/internal/filter/protrusions.h
index ad75d8896..d6fd315db 100644
--- a/src/extension/internal/filter/protrusions.h
+++ b/src/extension/internal/filter/protrusions.h
@@ -45,7 +45,7 @@ public:
static void init (void) {
Inkscape::Extension::build_from_mem(
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
- "<name>" N_("Snow crest") "</name>\n"
+ "<name>" N_("Snow Crest") "</name>\n"
"<id>org.inkscape.effect.filter.snow</id>\n"
"<param name=\"drift\" _gui-text=\"" N_("Drift Size") "\" type=\"float\" appearance=\"full\" min=\"0.0\" max=\"20.0\">3.5</param>\n"
"<effect>\n"
diff --git a/src/extension/internal/vsd-input.cpp b/src/extension/internal/vsd-input.cpp
index 78783aa2d..85698387a 100644
--- a/src/extension/internal/vsd-input.cpp
+++ b/src/extension/internal/vsd-input.cpp
@@ -220,11 +220,13 @@ SPDocument *VsdInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * u
// RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows
// therefore attempt to convert uri to the system codepage
// even if this is not possible the alternate short (8.3) file name will be used if available
- uri = g_win32_locale_filename_from_utf8(uri);
+ gchar * converted_uri = g_win32_locale_filename_from_utf8(uri);
+ RVNGFileStream input(converted_uri);
+ g_free(converted_uri);
+ #else
+ RVNGFileStream input(uri);
#endif
- RVNGFileStream input(uri);
-
if (!libvisio::VisioDocument::isSupported(&input)) {
return NULL;
}
diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp
index a79af5ec1..42ec2f2bb 100644
--- a/src/extension/internal/wmf-inout.cpp
+++ b/src/extension/internal/wmf-inout.cpp
@@ -1765,11 +1765,20 @@ std::cout << "BEFORE DRAW"
<< " test0 " << ( d->mask & U_DRAW_VISIBLE)
<< " test1 " << ( d->mask & U_DRAW_FORCE)
<< " test2 " << (wmr_mask & U_DRAW_ALTERS)
+ << " test2.5 " << ((d->mask & U_DRAW_NOFILL) != (wmr_mask & U_DRAW_NOFILL) )
<< " test3 " << (wmr_mask & U_DRAW_VISIBLE)
<< " test4 " << !(d->mask & U_DRAW_ONLYTO)
<< " test5 " << ((d->mask & U_DRAW_ONLYTO) && !(wmr_mask & U_DRAW_ONLYTO) )
<< std::endl;
*/
+ /* spurious moveto records should not affect the drawing. However, they set the NOFILL
+ bit and that messes up the logic about when to emit a path. So prune out any
+ stray moveto records. That is those which were never followed by a lineto.
+ */
+ if((d->mask & U_DRAW_NOFILL) && !(d->mask & U_DRAW_VISIBLE) &&
+ !(wmr_mask & U_DRAW_ONLYTO) && (wmr_mask & U_DRAW_VISIBLE)){
+ d->mask ^= U_DRAW_NOFILL;
+ }
if(
(wmr_mask != U_WMR_INVALID) && // next record is valid type
@@ -1777,6 +1786,7 @@ std::cout << "BEFORE DRAW"
(
(d->mask & U_DRAW_FORCE) || // This draw is forced by STROKE/FILL/STROKEANDFILL PATH
(wmr_mask & U_DRAW_ALTERS) || // Next record would alter the drawing environment in some way
+ ((d->mask & U_DRAW_NOFILL) != (wmr_mask & U_DRAW_NOFILL)) || // Fill<->!Fill requires a draw between
( (wmr_mask & U_DRAW_VISIBLE) && // Next record is visible...
(
( !(d->mask & U_DRAW_ONLYTO) ) || // Non *TO records cannot be followed by any Visible
diff --git a/src/extension/internal/wmf-print.cpp b/src/extension/internal/wmf-print.cpp
index 3d913bf1e..6dd9d895e 100644
--- a/src/extension/internal/wmf-print.cpp
+++ b/src/extension/internal/wmf-print.cpp
@@ -598,7 +598,28 @@ int PrintWmf::create_pen(SPStyle const *style, const Geom::Affine &transform)
if (!style->stroke_dasharray.values.empty()) {
if (!FixPPTDashLine) { // if this is set code elsewhere will break dots/dashes into many smaller lines.
- penstyle = U_PS_DASH;// userstyle not supported apparently, for now map all Inkscape dot/dash to just dash
+ int n_dash = style->stroke_dasharray.values.size();
+ /* options are dash, dot, dashdot and dashdotdot. Try to pick the closest one. */
+ int mark_short=INT_MAX;
+ int mark_long =0;
+ int i;
+ for (i=0;i<n_dash;i++) {
+ int mark = style->stroke_dasharray.values[i];
+ if (mark>mark_long) { mark_long = mark; }
+ if (mark<mark_short) { mark_short = mark; }
+ }
+ if(mark_long == mark_short){ // only one mark size
+ penstyle = U_PS_DOT;
+ }
+ else if (n_dash==2) {
+ penstyle = U_PS_DASH;
+ }
+ else if (n_dash==4) {
+ penstyle = U_PS_DASHDOT;
+ }
+ else {
+ penstyle = U_PS_DASHDOTDOT;
+ }
}
}
diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp
index 12457791b..299614c94 100644
--- a/src/extension/internal/wpg-input.cpp
+++ b/src/extension/internal/wpg-input.cpp
@@ -85,10 +85,13 @@ SPDocument *WpgInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * u
// RVNGFileStream uses fopen() internally which unfortunately only uses ANSI encoding on Windows
// therefore attempt to convert uri to the system codepage
// even if this is not possible the alternate short (8.3) file name will be used if available
- uri = g_win32_locale_filename_from_utf8(uri);
+ gchar * converted_uri = g_win32_locale_filename_from_utf8(uri);
+ RVNGInputStream* input = new RVNGFileStream(converted_uri);
+ g_free(converted_uri);
+ #else
+ RVNGInputStream* input = new RVNGFileStream(uri);
#endif
- RVNGInputStream* input = new RVNGFileStream(uri);
#if WITH_LIBWPG03
if (input->isStructured()) {
RVNGInputStream* olestream = input->getSubStreamByName("PerfectOffice_MAIN");