index 8645205f2e388fe50df1425eeeeb980a33e6d4a5..58d19be325fa79740dee78654349ec22e983febf 100644 (file)
* Authors:
* Bob Jamison
*
- * Copyright (C) 2006 Bob Jamison
+ * Copyright (C) 2006, 2007 Bob Jamison
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
/**
* Get the value of a node/attribute pair
*/
-static Glib::ustring getAttribute( Inkscape::XML::Node *node, char *attrName)
+static Glib::ustring getAttribute( Inkscape::XML::Node *node, char const *attrName)
{
Glib::ustring val;
- char *valstr = (char *)node->attribute(attrName);
+ char const *valstr = node->attribute(attrName);
if (valstr)
- val = (const char *)valstr;
+ val = valstr;
return val;
}
{
Glib::ustring ext;
- unsigned int pos = fname.rfind('.');
+ std::string::size_type pos = fname.rfind('.');
if (pos == fname.npos)
{
ext = "";
else if (ext == ".jpg")
outs.printf("image/jpeg");
outs.printf("\" manifest:full-path=\"");
- outs.printf((char *)newName.c_str());
+ outs.printf(newName.c_str());
outs.printf("\"/>\n");
}
outs.printf("</manifest:manifest>\n");
StyleInfo si;
//## FILL
- if (style->fill.type == SP_PAINT_TYPE_COLOR)
+ if (style->fill.isColor())
{
- guint32 fillCol =
- sp_color_get_rgba32_ualpha(&style->fill.value.color, 0);
+ guint32 fillCol = style->fill.value.color.toRGBA32( 0 );
char buf[16];
int r = (fillCol >> 24) & 0xff;
int g = (fillCol >> 16) & 0xff;
}
//## STROKE
- if (style->stroke.type == SP_PAINT_TYPE_COLOR)
+ if (style->stroke.isColor())
{
- guint32 strokeCol =
- sp_color_get_rgba32_ualpha(&style->stroke.value.color, 0);
+ guint32 strokeCol = style->stroke.value.color.toRGBA32( 0 );
char buf[16];
int r = (strokeCol >> 24) & 0xff;
int g = (strokeCol >> 16) & 0xff;
bool OdfOutput::processGradient(Writer &outs, SPItem *item,
const Glib::ustring &id, NR::Matrix &tf)
{
+ if (!item)
+ return false;
+
SPStyle *style = item->style;
+ if (!style)
+ return false;
+
+ if (!style->fill.isPaintserver())
+ return false;
+
//## Gradient. Look in writeStyle() below to see what info
// we need to read into GradientInfo.
if (!SP_IS_GRADIENT(SP_STYLE_FILL_SERVER(style)))