summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-02-15 17:41:43 +0000
committerJabiertxo Arraiza Zenotz <jtx@jtx.marker.es>2013-02-15 17:41:43 +0000
commitf986ce1bf97a05515103c828a42ff9a77a244c02 (patch)
treed65419c34b2c3b97230d282d508384565e477109 /src
parentRemoved unused function (diff)
parentBug #561503: fix typo in earlier fix (r11133) (diff)
downloadinkscape-f986ce1bf97a05515103c828a42ff9a77a244c02.tar.gz
inkscape-f986ce1bf97a05515103c828a42ff9a77a244c02.zip
Merge to trunk
(bzr r11950.2.3)
Diffstat (limited to 'src')
-rw-r--r--src/display/canvas-grid.cpp2
-rw-r--r--src/dom/io/bufferstream.cpp2
-rw-r--r--src/dom/io/bufferstream.h2
-rw-r--r--src/dom/io/domstream.cpp11
-rw-r--r--src/dom/io/domstream.h14
-rw-r--r--src/dom/io/stringstream.cpp2
-rw-r--r--src/dom/io/stringstream.h2
-rw-r--r--src/dom/io/uristream.cpp7
-rw-r--r--src/dom/io/uristream.h4
-rw-r--r--src/extension/implementation/script.cpp9
-rw-r--r--src/extension/system.cpp35
-rw-r--r--src/io/base64stream.cpp2
-rw-r--r--src/io/base64stream.h2
-rw-r--r--src/io/gzipstream.cpp2
-rw-r--r--src/io/gzipstream.h2
-rw-r--r--src/io/inkscapestream.cpp10
-rw-r--r--src/io/inkscapestream.h6
-rw-r--r--src/io/stringstream.cpp5
-rw-r--r--src/io/stringstream.h2
-rw-r--r--src/io/uristream.cpp15
-rw-r--r--src/io/uristream.h2
-rw-r--r--src/io/xsltstream.cpp5
-rw-r--r--src/io/xsltstream.h2
23 files changed, 53 insertions, 92 deletions
diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp
index 5fd38a473..51a6dd89b 100644
--- a/src/display/canvas-grid.cpp
+++ b/src/display/canvas-grid.cpp
@@ -779,7 +779,7 @@ _wr.setUpdating (true);
_rsu_ox->setProgrammatically = false;
_rsu_oy->setProgrammatically = false;
_rsu_sx->setProgrammatically = false;
- _rsu_sx->setProgrammatically = false;
+ _rsu_sy->setProgrammatically = false;
return table;
}
diff --git a/src/dom/io/bufferstream.cpp b/src/dom/io/bufferstream.cpp
index 7baab4814..3389bd80e 100644
--- a/src/dom/io/bufferstream.cpp
+++ b/src/dom/io/bufferstream.cpp
@@ -146,7 +146,7 @@ void BufferOutputStream::flush()
/**
* Writes the specified byte to this output stream.
*/
-int BufferOutputStream::put(XMLCh ch)
+int BufferOutputStream::put(gunichar ch)
{
if (closed)
return -1;
diff --git a/src/dom/io/bufferstream.h b/src/dom/io/bufferstream.h
index 9a36b30e2..0ac06b362 100644
--- a/src/dom/io/bufferstream.h
+++ b/src/dom/io/bufferstream.h
@@ -102,7 +102,7 @@ public:
virtual void flush();
- virtual int put(XMLCh ch);
+ virtual int put(gunichar ch);
virtual std::vector<unsigned char> &getBuffer()
{ return buffer; }
diff --git a/src/dom/io/domstream.cpp b/src/dom/io/domstream.cpp
index de221f855..21d09662a 100644
--- a/src/dom/io/domstream.cpp
+++ b/src/dom/io/domstream.cpp
@@ -510,7 +510,7 @@ void BasicOutputStream::flush()
/**
* Writes the specified byte to this output stream.
*/
-int BasicOutputStream::put(XMLCh ch)
+int BasicOutputStream::put(gunichar ch)
{
if (closed)
return -1;
@@ -886,7 +886,7 @@ void BasicWriter::flush()
/**
* Writes the specified byte to this output writer.
*/
-int BasicWriter::put(XMLCh ch)
+int BasicWriter::put(gunichar ch)
{
if (destination && destination->put(ch)>=0)
return 1;
@@ -1079,7 +1079,7 @@ void OutputStreamWriter::flush()
* Overloaded to redirect the output chars from the next Writer
* in the chain to an OutputStream instead.
*/
-int OutputStreamWriter::put(XMLCh ch)
+int OutputStreamWriter::put(gunichar ch)
{
//Do we need conversions here?
int intCh = (int) ch;
@@ -1133,11 +1133,10 @@ void StdWriter::flush()
* Overloaded to redirect the output chars from the next Writer
* in the chain to an OutputStream instead.
*/
-int StdWriter::put(XMLCh ch)
+int StdWriter::put(gunichar ch)
{
//Do we need conversions here?
- int intCh = (int) ch;
- if (outputStream->put(intCh) < 0)
+ if (outputStream->put(ch) < 0)
return -1;
return 1;
}
diff --git a/src/dom/io/domstream.h b/src/dom/io/domstream.h
index 1a93e73b2..925e52bfe 100644
--- a/src/dom/io/domstream.h
+++ b/src/dom/io/domstream.h
@@ -218,7 +218,7 @@ public:
/**
* Send one byte to the destination stream.
*/
- virtual int put(XMLCh ch) = 0;
+ virtual int put(gunichar ch) = 0;
}; // class OutputStream
@@ -241,7 +241,7 @@ public:
virtual void flush();
- virtual int put(XMLCh ch);
+ virtual int put(gunichar ch);
protected:
@@ -267,7 +267,7 @@ public:
void flush()
{ }
- int put(XMLCh ch)
+ int put(gunichar ch)
{ putchar(ch); return 1; }
};
@@ -492,7 +492,7 @@ public:
virtual void flush() = 0;
- virtual int put(XMLCh ch) = 0;
+ virtual int put(gunichar ch) = 0;
/* Formatted output */
virtual Writer& printf(const DOMString &fmt, ...) = 0;
@@ -542,7 +542,7 @@ public:
virtual void flush();
- virtual int put(XMLCh ch);
+ virtual int put(gunichar ch);
@@ -635,7 +635,7 @@ public:
virtual void flush();
- virtual int put(XMLCh ch);
+ virtual int put(gunichar ch);
private:
@@ -663,7 +663,7 @@ public:
virtual void flush();
- virtual int put(XMLCh ch);
+ virtual int put(gunichar ch);
private:
diff --git a/src/dom/io/stringstream.cpp b/src/dom/io/stringstream.cpp
index c6e47045e..ca058a575 100644
--- a/src/dom/io/stringstream.cpp
+++ b/src/dom/io/stringstream.cpp
@@ -140,7 +140,7 @@ void StringOutputStream::flush()
/**
* Writes the specified byte to this output stream.
*/
-int StringOutputStream::put(XMLCh ch)
+int StringOutputStream::put(gunichar ch)
{
buffer.push_back(ch);
return 1;
diff --git a/src/dom/io/stringstream.h b/src/dom/io/stringstream.h
index f6ed89e65..9ba24fc26 100644
--- a/src/dom/io/stringstream.h
+++ b/src/dom/io/stringstream.h
@@ -100,7 +100,7 @@ public:
virtual void flush();
- virtual int put(XMLCh ch);
+ virtual int put(gunichar ch);
virtual DOMString &getString()
{ return buffer; }
diff --git a/src/dom/io/uristream.cpp b/src/dom/io/uristream.cpp
index 09b0ac361..68a14a166 100644
--- a/src/dom/io/uristream.cpp
+++ b/src/dom/io/uristream.cpp
@@ -372,7 +372,7 @@ void UriOutputStream::flush() throw(StreamException)
/**
* Writes the specified byte to this output stream.
*/
-int UriOutputStream::put(XMLCh ch) throw(StreamException)
+int UriOutputStream::put(gunichar ch) throw(StreamException)
{
if (closed)
return -1;
@@ -440,10 +440,9 @@ void UriWriter::flush() throw(StreamException)
/**
*
*/
-int UriWriter::put(XMLCh ch) throw(StreamException)
+int UriWriter::put(gunichar ch) throw(StreamException)
{
- int ich = (int)ch;
- if (outputStream->put(ich) < 0)
+ if (outputStream->put(ch) < 0)
return -1;
return 1;
}
diff --git a/src/dom/io/uristream.h b/src/dom/io/uristream.h
index 8d60468a5..2a659d030 100644
--- a/src/dom/io/uristream.h
+++ b/src/dom/io/uristream.h
@@ -143,7 +143,7 @@ public:
virtual void flush() throw(StreamException);
- virtual int put(XMLCh ch) throw(StreamException);
+ virtual int put(gunichar ch) throw(StreamException);
private:
@@ -181,7 +181,7 @@ public:
virtual void flush() throw(StreamException);
- virtual int put(XMLCh ch) throw(StreamException);
+ virtual int put(gunichar ch) throw(StreamException);
private:
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index d3aeace55..4af778e04 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -956,7 +956,14 @@ int Script::execute (const std::list<std::string> &in_command,
// assemble the rest of argv
std::copy(in_params.begin(), in_params.end(), std::back_inserter(argv));
if (!filein.empty()) {
- argv.push_back(filein);
+ if(Glib::path_is_absolute(filein))
+ argv.push_back(filein);
+ else {
+ std::vector<std::string> buildargs;
+ buildargs.push_back(Glib::get_current_dir());
+ buildargs.push_back(filein);
+ argv.push_back(Glib::build_filename(buildargs));
+ }
}
int stdout_pipe, stderr_pipe;
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index 7fb6e1591..a9ca5c456 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -21,6 +21,7 @@
#endif
#include <interface.h>
+#include <unistd.h>
#include "system.h"
#include "preferences.h"
@@ -68,34 +69,6 @@ static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementatio
*/
SPDocument *open(Extension *key, gchar const *filename)
{
- // Convert to absolute pathname to tolerate chdir().
- bool relpath = (filename[0] != '/');
-#ifdef WIN32
- relpath &= (filename[0] != '\\') && !(isalpha(filename[0]) && (filename[1] == ':'));
-#endif
-
- // Do not consider an URI as a relative path.
- if (relpath) {
- gchar const * cp = filename;
-
- while (isalpha(*cp) || isdigit(*cp) || *cp == '+' || *cp == '-' || *cp == '.')
- cp++;
-
- relpath = *cp != ':' || cp[1] != '/' || cp[2] != '/';
- }
-
- if (relpath) {
- gchar * curdir = NULL;
-#ifndef WIN32
- curdir = getcwd(NULL, 0);
-#else
- curdir = _getcwd(NULL, 0);
-#endif
-
- filename = g_build_filename(curdir, filename, NULL);
- free(curdir);
- }
-
Input *imod = NULL;
if (key == NULL) {
@@ -137,9 +110,6 @@ SPDocument *open(Extension *key, gchar const *filename)
}
if (!imod->prefs(filename)) {
- if (relpath){
- free((void *) filename);
- }
return NULL;
}
@@ -162,9 +132,6 @@ SPDocument *open(Extension *key, gchar const *filename)
imod->set_gui(true);
}
- if (relpath){
- free((void *) filename);
- }
return doc;
}
diff --git a/src/io/base64stream.cpp b/src/io/base64stream.cpp
index 667487c35..42a6ba1e4 100644
--- a/src/io/base64stream.cpp
+++ b/src/io/base64stream.cpp
@@ -290,7 +290,7 @@ void Base64OutputStream::putCh(int ch)
/**
* Writes the specified byte to this output stream.
*/
-void Base64OutputStream::put(int ch)
+void Base64OutputStream::put(gunichar ch)
{
if (closed)
{
diff --git a/src/io/base64stream.h b/src/io/base64stream.h
index 554a92fe2..836939130 100644
--- a/src/io/base64stream.h
+++ b/src/io/base64stream.h
@@ -88,7 +88,7 @@ public:
virtual void flush();
- virtual void put(int ch);
+ virtual void put(gunichar ch);
/**
* Sets the maximum line length for base64 output. If
diff --git a/src/io/gzipstream.cpp b/src/io/gzipstream.cpp
index f9e30de91..071179b48 100644
--- a/src/io/gzipstream.cpp
+++ b/src/io/gzipstream.cpp
@@ -433,7 +433,7 @@ void GzipOutputStream::flush()
/**
* Writes the specified byte to this output stream.
*/
-void GzipOutputStream::put(int ch)
+void GzipOutputStream::put(gunichar ch)
{
if (closed)
{
diff --git a/src/io/gzipstream.h b/src/io/gzipstream.h
index 89c5f64f3..5af57b4c5 100644
--- a/src/io/gzipstream.h
+++ b/src/io/gzipstream.h
@@ -98,7 +98,7 @@ public:
virtual void flush();
- virtual void put(int ch);
+ virtual void put(gunichar ch);
private:
diff --git a/src/io/inkscapestream.cpp b/src/io/inkscapestream.cpp
index 65f24cf59..3270127d6 100644
--- a/src/io/inkscapestream.cpp
+++ b/src/io/inkscapestream.cpp
@@ -125,7 +125,7 @@ void BasicOutputStream::flush()
/**
* Writes the specified byte to this output stream.
*/
-void BasicOutputStream::put(int ch)
+void BasicOutputStream::put(gunichar ch)
{
if (closed)
return;
@@ -775,9 +775,7 @@ void OutputStreamWriter::flush()
*/
void OutputStreamWriter::put(gunichar ch)
{
- //Do we need conversions here?
- int intCh = (int) ch;
- outputStream.put(intCh);
+ outputStream.put(ch);
}
//#########################################################################
@@ -827,9 +825,7 @@ void StdWriter::flush()
*/
void StdWriter::put(gunichar ch)
{
- //Do we need conversions here?
- int intCh = (int) ch;
- outputStream->put(intCh);
+ outputStream->put(ch);
}
diff --git a/src/io/inkscapestream.h b/src/io/inkscapestream.h
index 37c41552f..a9854ae6d 100644
--- a/src/io/inkscapestream.h
+++ b/src/io/inkscapestream.h
@@ -189,7 +189,7 @@ public:
/**
* Send one byte to the destination stream.
*/
- virtual void put(int ch) = 0;
+ virtual void put(gunichar ch) = 0;
}; // class OutputStream
@@ -212,7 +212,7 @@ public:
virtual void flush();
- virtual void put(int ch);
+ virtual void put(gunichar ch);
protected:
@@ -238,7 +238,7 @@ public:
void flush()
{ }
- void put(int ch)
+ void put(gunichar ch)
{ putchar(ch); }
};
diff --git a/src/io/stringstream.cpp b/src/io/stringstream.cpp
index 44d11dd04..f204a99d5 100644
--- a/src/io/stringstream.cpp
+++ b/src/io/stringstream.cpp
@@ -112,10 +112,9 @@ void StringOutputStream::flush()
/**
* Writes the specified byte to this output stream.
*/
-void StringOutputStream::put(int ch)
+void StringOutputStream::put(gunichar ch)
{
- gunichar uch = (gunichar)ch;
- buffer.push_back(uch);
+ buffer.push_back(ch);
}
diff --git a/src/io/stringstream.h b/src/io/stringstream.h
index 4a05d88a9..a78935599 100644
--- a/src/io/stringstream.h
+++ b/src/io/stringstream.h
@@ -67,7 +67,7 @@ public:
virtual void flush();
- virtual void put(int ch);
+ virtual void put(gunichar ch);
virtual Glib::ustring &getString()
{ return buffer; }
diff --git a/src/io/uristream.cpp b/src/io/uristream.cpp
index 19994bc82..8d7fd9b38 100644
--- a/src/io/uristream.cpp
+++ b/src/io/uristream.cpp
@@ -402,16 +402,14 @@ void UriOutputStream::flush() throw(StreamException)
/**
* Writes the specified byte to this output stream.
*/
-void UriOutputStream::put(int ch) throw(StreamException)
+void UriOutputStream::put(gunichar ch) throw(StreamException)
{
if (closed)
return;
unsigned char uch;
- gunichar gch;
switch (scheme) {
-
case SCHEME_FILE:
if (!outf)
return;
@@ -420,13 +418,11 @@ void UriOutputStream::put(int ch) throw(StreamException)
Glib::ustring err = "ERROR writing to file ";
throw StreamException(err);
}
- //fwrite(uch, 1, 1, outf);
- break;
+ break;
case SCHEME_DATA:
- gch = (gunichar) ch;
- data.push_back(gch);
- break;
+ data.push_back(ch);
+ break;
}//switch
@@ -474,8 +470,7 @@ void UriWriter::flush() throw(StreamException)
*/
void UriWriter::put(gunichar ch) throw(StreamException)
{
- int ich = (int)ch;
- outputStream->put(ich);
+ outputStream->put(ch);
}
diff --git a/src/io/uristream.h b/src/io/uristream.h
index 16b1b0894..e519335e8 100644
--- a/src/io/uristream.h
+++ b/src/io/uristream.h
@@ -115,7 +115,7 @@ public:
virtual void flush() throw(StreamException);
- virtual void put(int ch) throw(StreamException);
+ virtual void put(gunichar ch) throw(StreamException);
private:
diff --git a/src/io/xsltstream.cpp b/src/io/xsltstream.cpp
index 6b72627d3..1c260c0b3 100644
--- a/src/io/xsltstream.cpp
+++ b/src/io/xsltstream.cpp
@@ -230,10 +230,9 @@ void XsltOutputStream::flush() throw (StreamException)
/**
* Writes the specified byte to this output stream.
*/
-void XsltOutputStream::put(int ch) throw (StreamException)
+void XsltOutputStream::put(gunichar ch) throw (StreamException)
{
- gunichar uch = (gunichar) ch;
- outbuf.push_back(uch);
+ outbuf.push_back(ch);
}
diff --git a/src/io/xsltstream.h b/src/io/xsltstream.h
index cfe9e5124..9b8e19215 100644
--- a/src/io/xsltstream.h
+++ b/src/io/xsltstream.h
@@ -120,7 +120,7 @@ public:
virtual void flush() throw (StreamException);
- virtual void put(int ch) throw (StreamException);
+ virtual void put(gunichar ch) throw (StreamException);
private: