summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/odf.cpp
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2006-04-20 22:24:13 +0000
committerishmal <ishmal@users.sourceforge.net>2006-04-20 22:24:13 +0000
commit11f3b36ca7b076c011af29892416ae0c4a8a625e (patch)
treea18187cc1ba0117df24db3505f9f67566feb1422 /src/extension/internal/odf.cpp
parentUse dual maps to remove duplicates in style table (diff)
downloadinkscape-11f3b36ca7b076c011af29892416ae0c4a8a625e.tar.gz
inkscape-11f3b36ca7b076c011af29892416ae0c4a8a625e.zip
remove duplicate styles, add placeholders for opacities
(bzr r559)
Diffstat (limited to 'src/extension/internal/odf.cpp')
-rw-r--r--src/extension/internal/odf.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index 704d388fd..ff2946af0 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -204,6 +204,9 @@ OdfOutput::preprocess(ZipFile &zf, Inkscape::XML::Node *node)
snprintf(buf, 15, "#%02x%02x%02x", r, g, b);
si.fillColor = buf;
si.fill = "solid";
+ double opacityPercent = 100.0;
+ snprintf(buf, 15, "%.2f%%", opacityPercent);
+ si.fillOpacity = buf;
}
if (style->stroke.type == SP_PAINT_TYPE_COLOR)
{
@@ -218,6 +221,9 @@ OdfOutput::preprocess(ZipFile &zf, Inkscape::XML::Node *node)
snprintf(buf, 15, "%.2fpt", style->stroke_width.value);
si.strokeWidth = buf;
si.stroke = "solid";
+ double opacityPercent = 100.0;
+ snprintf(buf, 15, "%.2f%%", opacityPercent);
+ si.strokeOpacity = buf;
}
//Look for existing identical style;
@@ -229,7 +235,7 @@ OdfOutput::preprocess(ZipFile &zf, Inkscape::XML::Node *node)
{
//map to existing styleTable entry
std::string styleName = iter->first;
- g_message("found duplicate style:%s", styleName.c_str());
+ //g_message("found duplicate style:%s", styleName.c_str());
styleLookupTable[id] = styleName;
styleMatch = true;
break;
@@ -439,12 +445,16 @@ bool OdfOutput::writeStyle(Writer &outs)
outs.printf(" <style:graphic-properties");
outs.printf(" draw:fill=\"%s\" ", s.fill.c_str());
if (s.fill != "none")
+ {
outs.printf(" draw:fill-color=\"%s\" ", s.fillColor.c_str());
+ outs.printf(" draw:fill-opacity=\"%s\" ", s.fillOpacity.c_str());
+ }
outs.printf(" draw:stroke=\"%s\" ", s.stroke.c_str());
if (s.stroke != "none")
{
outs.printf(" svg:stroke-width=\"%s\" ", s.strokeWidth.c_str());
outs.printf(" svg:stroke-color=\"%s\" ", s.strokeColor.c_str());
+ outs.printf(" svg:stroke-opacity=\"%s\" ", s.strokeOpacity.c_str());
}
outs.printf("/>\n");
outs.printf("</style:style>\n");