aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/css.hh19
-rw-r--r--src/styleengine.cc2
2 files changed, 18 insertions, 3 deletions
diff --git a/src/css.hh b/src/css.hh
index 1ed8c39b..4ed854d1 100644
--- a/src/css.hh
+++ b/src/css.hh
@@ -304,10 +304,25 @@ class CssPropertyList : public lout::misc::SimpleVector <CssProperty> {
refCount = 0;
this->ownerOfStrings = ownerOfStrings;
};
- inline CssPropertyList(const CssPropertyList &p) :
+ inline CssPropertyList(const CssPropertyList &p, bool deep = false) :
lout::misc::SimpleVector <CssProperty> (p) {
refCount = 0;
- ownerOfStrings = false;
+ if (deep) {
+ for (int i = 0; i < size (); i++) {
+ CssProperty *p = getRef(i);
+ switch (p->type) {
+ case CSS_TYPE_STRING:
+ case CSS_TYPE_SYMBOL:
+ p->value.strVal = dStrdup (p->value.strVal);
+ break;
+ default:
+ break;
+ }
+ }
+ ownerOfStrings = true;
+ } else {
+ ownerOfStrings = false;
+ }
};
~CssPropertyList ();
diff --git a/src/styleengine.cc b/src/styleengine.cc
index d655ee88..be6e3eb1 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -153,7 +153,7 @@ void StyleEngine::inheritNonCssHints () {
Node *n = stack->getRef (stack->size () - 1);
if (pn->nonCssProperties)
- n->nonCssProperties = new CssPropertyList (*pn->nonCssProperties);
+ n->nonCssProperties = new CssPropertyList (*pn->nonCssProperties, true);
}
void StyleEngine::clearNonCssHints () {