Code

Partial C++-ification of SPGradient
[inkscape.git] / src / sp-paint-server.cpp
index 258323a93d36399baffacada5af08aae80125106..5858f9a0e5c476106c234b06588837efb07322fc 100644 (file)
@@ -160,12 +160,7 @@ bool SPPaintServer::isSwatch() const
     bool swatch = false;
     if (SP_IS_GRADIENT(this)) {
         SPGradient *grad = SP_GRADIENT(this);
-        if ( SP_GRADIENT_HAS_STOPS(grad) ) {
-            gchar const * attr = repr->attribute("osb:paint");
-            if (attr && !strcmp(attr, "solid")) {
-                swatch = true;
-            }
-        }
+        swatch = grad->hasStops() && repr->attribute("osb:paint");
     }
     return swatch;
 }
@@ -175,7 +170,7 @@ bool SPPaintServer::isSolid() const
     bool solid = false;
     if (SP_IS_GRADIENT(this)) {
         SPGradient *grad = SP_GRADIENT(this);
-        if ( SP_GRADIENT_HAS_STOPS(grad) && (grad->getStopCount() == 0) ) {
+        if ( grad->hasStops() && (grad->getStopCount() == 0) ) {
             gchar const * attr = repr->attribute("osb:paint");
             if (attr && !strcmp(attr, "solid")) {
                 solid = true;