diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-08-08 17:27:51 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-08-08 17:27:51 +0000 |
| commit | 60d3113d1f022a3de7cf04c7979d4751b3fe21f6 (patch) | |
| tree | ca33e2a9a1af6b5911598fa1c6a1d77087b71dd2 /src/color.cpp | |
| parent | Minor cleanups (diff) | |
| parent | Add a constrained snap method that takes multiple constraints. This reduces t... (diff) | |
| download | inkscape-60d3113d1f022a3de7cf04c7979d4751b3fe21f6.tar.gz inkscape-60d3113d1f022a3de7cf04c7979d4751b3fe21f6.zip | |
merge from trunk
(bzr r9508.1.52)
Diffstat (limited to 'src/color.cpp')
| -rw-r--r-- | src/color.cpp | 54 |
1 files changed, 4 insertions, 50 deletions
diff --git a/src/color.cpp b/src/color.cpp index 07c15ff15..ae1bfa05d 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -17,7 +17,6 @@ #include <math.h> #include "color.h" #include "svg/svg-icc-color.h" -#include "svg/svg-device-color.h" #include "svg/svg-color.h" #include "svg/css-ostringstream.h" @@ -30,8 +29,7 @@ static bool profileMatches( SVGICCColor const* first, SVGICCColor const* second #define PROFILE_EPSILON 0.00000001 SPColor::SPColor() : - icc(0), - device(0) + icc(0) { v.c[0] = 0; v.c[1] = 0; @@ -39,22 +37,19 @@ SPColor::SPColor() : } SPColor::SPColor( SPColor const& other ) : - icc(0), - device(0) + icc(0) { *this = other; } SPColor::SPColor( float r, float g, float b ) : - icc(0), - device(0) + icc(0) { set( r, g, b ); } SPColor::SPColor( guint32 value ) : - icc(0), - device(0) + icc(0) { set( value ); } @@ -62,16 +57,13 @@ SPColor::SPColor( guint32 value ) : SPColor::~SPColor() { delete icc; - delete device; icc = 0; - device = 0; } SPColor& SPColor::operator= (SPColor const& other) { SVGICCColor* tmp_icc = other.icc ? new SVGICCColor(*other.icc) : 0; - SVGDeviceColor* tmp_device = other.device ? new SVGDeviceColor(*other.device) : 0; v.c[0] = other.v.c[0]; v.c[1] = other.v.c[1]; @@ -81,11 +73,6 @@ SPColor& SPColor::operator= (SPColor const& other) } icc = tmp_icc; - if ( device ) { - delete device; - } - device = tmp_device; - return *this; } @@ -100,7 +87,6 @@ bool SPColor::operator == (SPColor const& other) const && (v.c[2] != other.v.c[2]); match &= profileMatches( icc, other.icc ); -//TODO?: match &= devicecolorMatches( device, other.device ); return match; } @@ -219,38 +205,6 @@ std::string SPColor::toString() const css << ')'; } - if ( device && device->type != DEVICE_COLOR_INVALID) { - if ( !css.str().empty() ) { - css << " "; - } - - switch(device->type){ - case DEVICE_GRAY: - css << "device-gray("; - break; - case DEVICE_RGB: - css << "device-rgb("; - break; - case DEVICE_CMYK: - css << "device-cmyk("; - break; - case DEVICE_NCHANNEL: - css << "device-nchannel("; - break; - case DEVICE_COLOR_INVALID: - //should not be reached - break; - } - - for (vector<double>::const_iterator i(device->colors.begin()), - iEnd(device->colors.end()); - i != iEnd; ++i) { - if (i!=device->colors.begin()) css << ", "; - css << *i; - } - css << ')'; - } - return css.str(); } |
