summaryrefslogtreecommitdiffstats
path: root/src/style-internal.cpp
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-08-08 15:04:56 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-08-08 15:04:56 +0000
commitca8023872ae0d9f7b99688502b9bdba232ec5627 (patch)
tree73092b0aa6ea3e697da66d1d6316d3a2d78a4f3e /src/style-internal.cpp
parentUpdate to experimental r13440 (diff)
parentSmall tweak to bbox calculation (diff)
downloadinkscape-ca8023872ae0d9f7b99688502b9bdba232ec5627.tar.gz
inkscape-ca8023872ae0d9f7b99688502b9bdba232ec5627.zip
Update to experimental r13464
(bzr r13341.5.14)
Diffstat (limited to 'src/style-internal.cpp')
-rw-r--r--src/style-internal.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index c686a1807..2212f8fff 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -270,18 +270,18 @@ SPILength::read( gchar const *str ) {
} else if (!strcmp(e, "em")) {
/* EM square */
unit = SP_CSS_UNIT_EM;
- if( style && &style->font_size ) {
+ if( style ) {
computed = value * style->font_size.computed;
} else {
- computed = value * style->font_size.font_size_default;
+ computed = value * SPIFontSize::font_size_default;
}
} else if (!strcmp(e, "ex")) {
/* ex square */
unit = SP_CSS_UNIT_EX;
- if( style && &style->font_size ) {
+ if( style ) {
computed = value * style->font_size.computed * 0.5; // FIXME
} else {
- computed = value * style->font_size.font_size_default * 0.5;
+ computed = value * SPIFontSize::font_size_default * 0.5;
}
} else if (!strcmp(e, "%")) {
/* Percentage */
@@ -1390,13 +1390,13 @@ SPIFilter::read( gchar const *str ) {
}
}
-const Glib::ustring
-SPIFilter::write( guint const flags, SPIBase const *const base) const {
-
+const Glib::ustring SPIFilter::write( guint const flags, SPIBase const *const /*base*/) const
+{
// TODO: fix base
//SPILength const *const my_base = dynamic_cast<const SPILength*>(base);
if ( (flags & SP_STYLE_FLAG_ALWAYS) ||
- ((flags & SP_STYLE_FLAG_IFSET) && this->set))
+ ((flags & SP_STYLE_FLAG_IFSET) && this->set) ||
+ ((flags & SP_STYLE_FLAG_IFDIFF) && this->set))
{
if (this->inherit) {
return (name + ":inherit;");
@@ -1440,7 +1440,7 @@ SPIFilter::cascade( const SPIBase* const parent ) {
void
SPIFilter::merge( const SPIBase* const parent ) {
if( const SPIFilter* p = dynamic_cast<const SPIFilter*>(parent) ) {
- // The "correct" thing to due is to combine the filter primitives.
+ // The "correct" thing to do is to combine the filter primitives.
// The next best thing is to keep any filter on this object. If there
// is no filter on this object, then use any filter on the parent.
if( (!set || inherit) && p->href && p->href->getObject() ) { // is the getObject() needed?
@@ -1453,9 +1453,11 @@ SPIFilter::merge( const SPIBase* const parent ) {
}
} else {
// If we don't have an href, create it
- if( &style->document ) { // FIXME
+ if( style->document ) { // FIXME
href = new SPFilterReference(style->document);
//href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_filter_ref_changed), style));
+ } else if (style->object) {
+ href = new SPFilterReference(style->object);
}
}
if( href ) {
@@ -1921,9 +1923,8 @@ SPIFont::read( gchar const *str ) {
}
}
-const Glib::ustring
-SPIFont::write( guint const flags, SPIBase const *const base) const {
-
+const Glib::ustring SPIFont::write( guint const /*flags*/, SPIBase const *const /*base*/) const
+{
// At the moment, do nothing. We could add a preference to write out
// 'font' shorthand rather than longhand properties.