diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-04-10 16:14:53 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-04-10 16:14:53 +0000 |
| commit | bfefb35c670cb412318efb87caa5bf89182beac0 (patch) | |
| tree | 6019d0e538fa98440821aef51362398bd67aa482 /src/svg | |
| parent | Removed old SPObject factory. (diff) | |
| download | inkscape-bfefb35c670cb412318efb87caa5bf89182beac0.tar.gz inkscape-bfefb35c670cb412318efb87caa5bf89182beac0.zip | |
Removed unused (ancient!) code.
(bzr r11608.1.92)
Diffstat (limited to 'src/svg')
| -rw-r--r-- | src/svg/Makefile_insert | 2 | ||||
| -rw-r--r-- | src/svg/itos.cpp | 81 | ||||
| -rw-r--r-- | src/svg/round.cpp | 48 |
3 files changed, 0 insertions, 131 deletions
diff --git a/src/svg/Makefile_insert b/src/svg/Makefile_insert index 265210a45..cf9bf3fbb 100644 --- a/src/svg/Makefile_insert +++ b/src/svg/Makefile_insert @@ -3,10 +3,8 @@ ink_common_sources += \ svg/css-ostringstream.h \ svg/css-ostringstream.cpp \ - svg/itos.cpp \ svg/path-string.h \ svg/path-string.cpp \ - svg/round.cpp \ svg/stringstream.h \ svg/stringstream.cpp \ svg/strip-trailing-zeros.h \ diff --git a/src/svg/itos.cpp b/src/svg/itos.cpp deleted file mode 100644 index 78726d068..000000000 --- a/src/svg/itos.cpp +++ /dev/null @@ -1,81 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// ftoa.cpp -// -// Copyright (c) 1996-2003 Bryce W. Harrington [bryce at osdl dot org] -// -//----------------------------------------------------------------------- -// License: This code may be used by anyone for any purpose -// so long as the copyright notices and this license -// statement remains attached. -//----------------------------------------------------------------------- -// -// This routine converts an integer into a string -// -///////////////////////////////////////////////////////////////////////// - -// Standard include files -#include <algorithm> -#include <string> // for string -#include <cstring> - -#include "../io/ftos.h" /* own include */ /* note - why in different dirs? */ - -using std::string; - -string itos(int n) -{ - int sign; - string s; - - if ((sign = n) < 0) // record sign - n = -n; // make n positive - do { // generate digits in reverse order - s += (char(n % 10) + '0'); // get next digit - } while ((n/=10) > 0); // delete it - - if (sign < 0) - s += '-'; - - reverse(s.begin(), s.end()); // This is what the code should look like - // if the string class is compatible with - // the standard C++ string class -#ifdef DUMB_OS_LIKE_WINDOWS - // In Windows, we'll use this hack... - for (int i=0, j=s.GetLength()-1; i<j; i++, j--) - { - char c = s[i]; -// s[i] = s[j]; -// s[j] = c; - s.SetAt(i, s[j]); - s.SetAt(j, c); - } -#endif - - return s; -} - -string ultos(unsigned long n) -{ - string s; - - do { // generate digits in reverse order - s += (char(n % 10) + '0'); // get next digit - } while ((n/=10) > 0); // delete it - - reverse(s.begin(), s.end()); // This is what the code should look like - // if the string class is compatible with - // the standard C++ string class -#ifdef DUMB_OS_LIKE_WINDOWS - // In Windows, we'll use this hack... - for (int i=0, j=s.GetLength()-1; i<j; i++, j--) - { - char c = s[i]; -// s[i] = s[j]; -// s[j] = c; - s.SetAt(i, s[j]); - s.SetAt(j, c); - } -#endif - - return s; -} diff --git a/src/svg/round.cpp b/src/svg/round.cpp deleted file mode 100644 index 0a4ca9d05..000000000 --- a/src/svg/round.cpp +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// ftos.cc -// -// Copyright (c) 1996-2003 Bryce W. Harrington [bryce at osdl dot org] -// -//----------------------------------------------------------------------- -// License: This code may be used by anyone for any purpose -// so long as the copyright notices and this license -// statement remains attached. -//----------------------------------------------------------------------- -// This routine rounds a double using the "rounding rule", as expressed -// in _Advanced Engineering Mathematics_ by Erwin Kreyszig, 6th ed., -// John Wiley & Sons, Inc., 1988, page 945. -// -// Discard the (k+1)th and all subsequent decimals. -// (a) If the number thus discarded is less than half a unit in the -// kth place, leave the kth decimal unchanged ("rounding down") -// (b) If it is greater than half a unit in the kth place, add one -// to the kth decimal ("rounding up") -// (c) If it is exactly half a unit, round off to the nearest *even* -// decimal. -// Example: Rounding off 3.45 and 3.55 by one decimal gives 3.4 and -// 3.6, respectively. -// Rule (c) is to ensure that in discarding exactly half a decimal, -// rounding up and rounding down happens about equally often, -// on the average. -/////////////////////////////////////////////////////////////////////// -#include <math.h> -#include "../io/ftos.h" /* own include */ /* note - why in different dirs? */ - -double rround(double x) -{ - double xlow = floor(x); - if (x - xlow != 0.5000) - return floor(x + 0.5000); - else if ( floor(x/2.0) == xlow/2.0) - return xlow; - else - return xlow++; -} - -// This version allows rounding to a specific digit -double rround(double x, int k) -{ - if (k==0) return rround(x); - else return rround(x*pow(10,k)) / pow(10,k); -} - |
