summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-11-15 21:45:55 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-11-15 21:45:55 +0000
commitec2f5449d635a301b82c84d5f1a031fef62b34af (patch)
tree70be27a769645e9733b50192121ea4e577cc49fc /src
parentUpdate to trunk (diff)
parentfix typo in rev 12797 (diff)
downloadinkscape-ec2f5449d635a301b82c84d5f1a031fef62b34af.tar.gz
inkscape-ec2f5449d635a301b82c84d5f1a031fef62b34af.zip
Update to trunk
(bzr r11950.1.200)
Diffstat (limited to 'src')
-rw-r--r--src/display/nr-filter-turbulence.cpp6
-rw-r--r--src/document.cpp5
-rw-r--r--src/libdepixelize/priv/splines-kopf2011.h2
-rw-r--r--src/libnrtype/Layout-TNG.h7
-rw-r--r--src/livarot/PathOutline.cpp2
-rw-r--r--src/main.cpp63
-rw-r--r--src/sp-offset.cpp25
-rw-r--r--src/sp-use-reference.cpp25
-rw-r--r--src/splivarot.cpp31
-rw-r--r--src/style.cpp8
10 files changed, 97 insertions, 77 deletions
diff --git a/src/display/nr-filter-turbulence.cpp b/src/display/nr-filter-turbulence.cpp
index 333074f55..e63b335d2 100644
--- a/src/display/nr-filter-turbulence.cpp
+++ b/src/display/nr-filter-turbulence.cpp
@@ -284,11 +284,15 @@ private:
static int const BSize = 0x100;
static int const BMask = 0xff;
-#if __cplusplus < 201103L
+#ifdef CPP11 // GCC 4.6.1 (currently used on Windows) does not correctly set __cplusplus in C++11 mode, so configure with -DCPP11 to make this work in C++11 mode
+ static double constexpr PerlinOffset = 4096.0;
+#else
+#if (__cplusplus < 201103L)
static double const PerlinOffset = 4096.0;
#else
static double constexpr PerlinOffset = 4096.0;
#endif
+#endif
Geom::Rect _tile;
Geom::Point _baseFreq;
diff --git a/src/document.cpp b/src/document.cpp
index 3433e42ec..e6166ee82 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -968,7 +968,10 @@ Glib::ustring SPDocument::getLanguage() const
if ( NULL == document_language || *document_language == 0 ) {
document_language = getenv ("LANG");
}
-
+ if ( NULL == document_language || *document_language == 0 ) {
+ document_language = getenv ("LANGUAGE");
+ }
+
if ( NULL != document_language ) {
const char *pos = strchr(document_language, '_');
if ( NULL != pos ) {
diff --git a/src/libdepixelize/priv/splines-kopf2011.h b/src/libdepixelize/priv/splines-kopf2011.h
index fb4f8ba1e..c586f74b7 100644
--- a/src/libdepixelize/priv/splines-kopf2011.h
+++ b/src/libdepixelize/priv/splines-kopf2011.h
@@ -137,7 +137,7 @@ Splines::Splines(const SimplifiedVoronoi<T, adjust_splines> &diagram) :
template<class T>
Splines::Splines(const HomogeneousSplines<T> &homogeneousSplines,
- bool optimize, int nthreads) :
+ bool optimize, int /*nthreads*/) :
_paths(homogeneousSplines.size()),
_width(homogeneousSplines.width()),
_height(homogeneousSplines.height())
diff --git a/src/libnrtype/Layout-TNG.h b/src/libnrtype/Layout-TNG.h
index d16c2843d..c3ccbffb5 100644
--- a/src/libnrtype/Layout-TNG.h
+++ b/src/libnrtype/Layout-TNG.h
@@ -432,16 +432,17 @@ public:
iterator getLetterAt(double x, double y) const;
inline iterator getLetterAt(Geom::Point &point) const;
- /** Returns an iterator pointing to the character in the output which
+ /* Returns an iterator pointing to the character in the output which
was created from the given input. If the character at the given byte
offset was removed (soft hyphens, for example) the next character after
it is returned. If no input was added with the given cookie, end() is
returned. If more than one input has the same cookie, the first will
be used regardless of the value of \a text_iterator. If
\a text_iterator is out of bounds, the first or last character belonging
- to the given input will be returned accordingly. */
+ to the given input will be returned accordingly.
iterator sourceToIterator(void *source_cookie, Glib::ustring::const_iterator text_iterator) const;
-
+ */
+
/** Returns an iterator pointing to the first character in the output
which was created from the given source. If \a source_cookie is invalid,
end() is returned. If more than one input has the same cookie, the
diff --git a/src/livarot/PathOutline.cpp b/src/livarot/PathOutline.cpp
index f15da4af7..211ee31e2 100644
--- a/src/livarot/PathOutline.cpp
+++ b/src/livarot/PathOutline.cpp
@@ -1183,7 +1183,7 @@ Path::OutlineJoin (Path * dest, Geom::Point pos, Geom::Point stNor, Geom::Point
const double angSi = cross (enNor,stNor);
const double angCo = dot (stNor, enNor);
- if (fabs(angSi < .0000001) && angCo > 0) { // The join is straight -> nothing to do.
+ if ((fabs(angSi) < .0000001) && angCo > 0) { // The join is straight -> nothing to do.
} else {
if ((angSi > 0 && width >= 0)
|| (angSi < 0 && width < 0)) { // This is an inside join -> join is independent of chosen JoinType.
diff --git a/src/main.cpp b/src/main.cpp
index 29bc7f7e9..c6427dc6f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -157,9 +157,8 @@ enum {
SP_ARG_EXPORT_PDF,
SP_ARG_EXPORT_PDF_VERSION,
SP_ARG_EXPORT_LATEX,
-#ifdef WIN32
SP_ARG_EXPORT_EMF,
-#endif //WIN32
+ SP_ARG_EXPORT_WMF,
SP_ARG_EXPORT_TEXT_TO_PATH,
SP_ARG_EXPORT_IGNORE_FILTERS,
SP_ARG_EXTENSIONDIR,
@@ -186,9 +185,9 @@ int sp_main_gui(int argc, char const **argv);
int sp_main_console(int argc, char const **argv);
static int sp_do_export_png(SPDocument *doc);
static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const *mime);
-#ifdef WIN32
static int do_export_emf(SPDocument* doc, gchar const* uri, char const *mime);
-#endif //WIN32
+static int do_export_wmf(SPDocument* doc, gchar const* uri, char const *mime);
+static int do_export_win_metafile_common(SPDocument* doc, gchar const* uri, char const *mime);
static void do_query_dimension (SPDocument *doc, bool extent, Geom::Dim2 const axis, const gchar *id);
static void do_query_all (SPDocument *doc);
static void do_query_all_recurse (SPObject *o);
@@ -215,9 +214,8 @@ static gchar *sp_export_eps = NULL;
static gint sp_export_ps_level = 2;
static gchar *sp_export_pdf = NULL;
static gchar *sp_export_pdf_version = NULL;
-#ifdef WIN32
static gchar *sp_export_emf = NULL;
-#endif //WIN32
+static gchar *sp_export_wmf = NULL;
static gboolean sp_export_text_to_path = FALSE;
static gboolean sp_export_ignore_filters = FALSE;
static gboolean sp_export_font = FALSE;
@@ -264,9 +262,8 @@ static void resetCommandlineGlobals() {
sp_export_ps_level = 2;
sp_export_pdf = NULL;
sp_export_pdf_version = NULL;
-#ifdef WIN32
sp_export_emf = NULL;
-#endif //WIN32
+ sp_export_wmf = NULL;
sp_export_text_to_path = FALSE;
sp_export_ignore_filters = FALSE;
sp_export_font = FALSE;
@@ -426,12 +423,15 @@ struct poptOption options[] = {
N_("Export PDF/PS/EPS without text. Besides the PDF/PS/EPS, a LaTeX file is exported, putting the text on top of the PDF/PS/EPS file. Include the result in LaTeX like: \\input{latexfile.tex}"),
NULL},
-#ifdef WIN32
{"export-emf", 'M',
POPT_ARG_STRING, &sp_export_emf, SP_ARG_EXPORT_EMF,
N_("Export document to an Enhanced Metafile (EMF) File"),
N_("FILENAME")},
-#endif //WIN32
+
+ {"export-wmf", 'm',
+ POPT_ARG_STRING, &sp_export_wmf, SP_ARG_EXPORT_WMF,
+ N_("Export document to a Windows Metafile (WMF) File"),
+ N_("FILENAME")},
{"export-text-to-path", 'T',
POPT_ARG_NONE, &sp_export_text_to_path, SP_ARG_EXPORT_TEXT_TO_PATH,
@@ -742,10 +742,10 @@ main(int argc, char **argv)
|| !strcmp(argv[i], "-A")
|| !strncmp(argv[i], "--export-pdf", 12)
|| !strncmp(argv[i], "--export-latex", 14)
-#ifdef WIN32
|| !strcmp(argv[i], "-M")
|| !strncmp(argv[i], "--export-emf", 12)
-#endif //WIN32
+ || !strcmp(argv[i], "-m")
+ || !strncmp(argv[i], "--export-wmf", 12)
|| !strcmp(argv[i], "-W")
|| !strncmp(argv[i], "--query-width", 13)
|| !strcmp(argv[i], "-H")
@@ -1190,11 +1190,12 @@ static int sp_process_file_list(GSList *fl)
if (sp_export_pdf) {
retVal |= do_export_ps_pdf(doc, sp_export_pdf, "application/pdf");
}
-#ifdef WIN32
if (sp_export_emf) {
retVal |= do_export_emf(doc, sp_export_emf, "image/x-emf");
}
-#endif //WIN32
+ if (sp_export_wmf) {
+ retVal |= do_export_wmf(doc, sp_export_wmf, "image/x-wmf");
+ }
if (sp_query_all) {
do_query_all (doc);
} else if (sp_query_width || sp_query_height) {
@@ -1788,16 +1789,15 @@ static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime)
return 0;
}
-#ifdef WIN32
/**
- * Export a document to EMF
+ * Export a document to EMF or WMF
*
* \param doc Document to export.
* \param uri URI to export to.
- * \param mime MIME type to export as (should be "image/x-emf")
+ * \param mime MIME type to export as (should be "image/x-emf" or "image/x-wmf")
*/
-static int do_export_emf(SPDocument* doc, gchar const* uri, char const* mime)
+static int do_export_win_metafile_common(SPDocument* doc, gchar const* uri, char const* mime)
{
Inkscape::Extension::DB::OutputList o;
Inkscape::Extension::db.get_output_list(o);
@@ -1822,7 +1822,32 @@ static int do_export_emf(SPDocument* doc, gchar const* uri, char const* mime)
(*i)->save(doc, uri);
return 0;
}
-#endif //WIN32
+
+/**
+ * Export a document to EMF
+ *
+ * \param doc Document to export.
+ * \param uri URI to export to.
+ * \param mime MIME type to export as (should be "image/x-emf")
+ */
+
+static int do_export_emf(SPDocument* doc, gchar const* uri, char const* mime)
+{
+ return do_export_win_metafile_common(doc, uri, mime);
+}
+
+/**
+ * Export a document to WMF
+ *
+ * \param doc Document to export.
+ * \param uri URI to export to.
+ * \param mime MIME type to export as (should be "image/x-wmf")
+ */
+
+static int do_export_wmf(SPDocument* doc, gchar const* uri, char const* mime)
+{
+ return do_export_win_metafile_common(doc, uri, mime);
+}
#ifdef WIN32
bool replaceArgs( int& argc, char**& argv )
diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp
index c5a3557a7..c6a4b730d 100644
--- a/src/sp-offset.cpp
+++ b/src/sp-offset.cpp
@@ -1133,28 +1133,21 @@ refresh_offset_source(SPOffset* offset)
return;
}
- SPItem *item = SP_ITEM (refobj);
-
- SPCurve *curve=NULL;
-
- if (!SP_IS_SHAPE (item) && !SP_IS_TEXT (item)) {
- return;
- }
+ SPItem *item = SP_ITEM (refobj);
+ SPCurve *curve = NULL;
if (SP_IS_SHAPE (item)) {
curve = SP_SHAPE (item)->getCurve ();
-
- if (curve == NULL) {
- return;
- }
}
-
- if (SP_IS_TEXT (item)) {
+ else if (SP_IS_TEXT (item)) {
curve = SP_TEXT (item)->getNormalizedBpath ();
+ }
+ else {
+ return;
+ }
- if (curve == NULL) {
- return;
- }
+ if (curve == NULL) {
+ return;
}
Path *orig = new Path;
diff --git a/src/sp-use-reference.cpp b/src/sp-use-reference.cpp
index ec03ffce6..642cfede8 100644
--- a/src/sp-use-reference.cpp
+++ b/src/sp-use-reference.cpp
@@ -215,23 +215,26 @@ void SPUsePath::refresh_source()
// [tr: The bad case: no d attribute. Must check that it's a SPShape and then take the outline.]
SPObject *refobj = sourceObject;
if ( refobj == NULL ) return;
+
SPItem *item = SP_ITEM(refobj);
-
SPCurve *curve = NULL;
- if (!SP_IS_SHAPE(item) && !SP_IS_TEXT(item)) {
- return;
- }
- if (SP_IS_SHAPE(item)) {
+
+ if (SP_IS_SHAPE(item))
+ {
curve = SP_SHAPE(item)->getCurve();
- if (curve == NULL)
- return;
}
- if (SP_IS_TEXT(item)) {
+ else if (SP_IS_TEXT(item))
+ {
curve = SP_TEXT(item)->getNormalizedBpath();
- if (curve == NULL) {
- return;
- }
}
+ else
+ {
+ return;
+ }
+
+ if (curve == NULL)
+ return;
+
originalPath = new Path;
originalPath->LoadPathVector(curve->get_pathvector(), item->transform, true);
curve->unref();
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index 7bf556aa1..e5006884c 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -1585,22 +1585,18 @@ void sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool
desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Selected object is <b>not a path</b>, cannot inset/outset."));
return;
}
- if (SP_IS_SHAPE(item))
+ else if (SP_IS_SHAPE(item))
{
curve = SP_SHAPE(item)->getCurve();
- if (curve == NULL) {
- return;
- }
}
- if (SP_IS_TEXT(item))
+ else // Item must be SP_TEXT
{
curve = SP_TEXT(item)->getNormalizedBpath();
- if (curve == NULL) {
- return;
- }
}
-
- g_assert(curve != NULL);
+
+ if (curve == NULL) {
+ return;
+ }
Geom::Affine const transform(item->transform);
@@ -1779,24 +1775,19 @@ sp_selected_path_do_offset(SPDesktop *desktop, bool expand, double prefOffset)
items = items->next) {
SPItem *item = SP_ITEM(items->data);
+ SPCurve *curve = NULL;
if (!SP_IS_SHAPE(item) && !SP_IS_TEXT(item))
continue;
-
- SPCurve *curve = NULL;
- if (SP_IS_SHAPE(item)) {
+ else if (SP_IS_SHAPE(item)) {
curve = SP_SHAPE(item)->getCurve();
- if (curve == NULL)
- continue;
}
- if (SP_IS_TEXT(item)) {
+ else { // Item must be SP_TEXT
curve = SP_TEXT(item)->getNormalizedBpath();
- if (curve == NULL)
- continue;
}
- // We've now checked that there is a curve for this item
- g_assert(curve != NULL);
+ if (curve == NULL)
+ continue;
Geom::Affine const transform(item->transform);
diff --git a/src/style.cpp b/src/style.cpp
index c581fde7b..fc0c97c15 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -823,10 +823,10 @@ sp_style_read(SPStyle *style, SPObject *object, Inkscape::XML::Node *repr)
SPS_READ_PENUM_IF_UNSET(&style->clip_rule, repr, "clip-rule", enum_clip_rule, true);
/* color_rendering, image_rendering, shape_rendering, text_rendering */
- SPS_READ_PENUM_IF_UNSET(&style->color_rendering, repr, "color_rendering", enum_color_rendering, true);
- SPS_READ_PENUM_IF_UNSET(&style->image_rendering, repr, "image_rendering", enum_image_rendering, true);
- SPS_READ_PENUM_IF_UNSET(&style->shape_rendering, repr, "shape_rendering", enum_shape_rendering, true);
- SPS_READ_PENUM_IF_UNSET(&style->text_rendering, repr, "text_rendering", enum_text_rendering, true);
+ SPS_READ_PENUM_IF_UNSET(&style->color_rendering, repr, "color-rendering", enum_color_rendering, true);
+ SPS_READ_PENUM_IF_UNSET(&style->image_rendering, repr, "image-rendering", enum_image_rendering, true);
+ SPS_READ_PENUM_IF_UNSET(&style->shape_rendering, repr, "shape-rendering", enum_shape_rendering, true);
+ SPS_READ_PENUM_IF_UNSET(&style->text_rendering, repr, "text-rendering", enum_text_rendering, true);
/* 3. Merge from parent */
if (object) {