diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2013-02-13 19:02:23 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2013-02-13 19:02:23 +0000 |
| commit | 47d871e0b2a9ed5fb58d4d02edf840a0d4b19783 (patch) | |
| tree | 4267c803d47dcc1852b51e6f9b622535e1d2d9d0 /src | |
| parent | Build. Adding unistd header (fixes compilation on Win32 with OpenSuse cross-c... (diff) | |
| download | inkscape-47d871e0b2a9ed5fb58d4d02edf840a0d4b19783.tar.gz inkscape-47d871e0b2a9ed5fb58d4d02edf840a0d4b19783.zip | |
fixing variable type in stream classes to what was intended (preparation for solving bug #1120585 )
(bzr r12123)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dom/io/bufferstream.cpp | 2 | ||||
| -rw-r--r-- | src/dom/io/bufferstream.h | 2 | ||||
| -rw-r--r-- | src/dom/io/domstream.cpp | 11 | ||||
| -rw-r--r-- | src/dom/io/domstream.h | 14 | ||||
| -rw-r--r-- | src/dom/io/stringstream.cpp | 2 | ||||
| -rw-r--r-- | src/dom/io/stringstream.h | 2 | ||||
| -rw-r--r-- | src/dom/io/uristream.cpp | 7 | ||||
| -rw-r--r-- | src/dom/io/uristream.h | 4 | ||||
| -rw-r--r-- | src/io/inkscapestream.cpp | 10 | ||||
| -rw-r--r-- | src/io/inkscapestream.h | 6 | ||||
| -rw-r--r-- | src/io/stringstream.cpp | 5 | ||||
| -rw-r--r-- | src/io/stringstream.h | 2 | ||||
| -rw-r--r-- | src/io/uristream.cpp | 15 | ||||
| -rw-r--r-- | src/io/uristream.h | 2 |
14 files changed, 36 insertions, 48 deletions
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/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: |
