diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-01-12 21:57:47 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-01-12 21:57:47 +0100 |
commit | 92234fa05419829744aca6a991413f55da4548e7 (patch) | |
tree | 021d4dd96ebd4e92288c964a0b21dd16e27cd637 /src | |
parent | 8897847aa556384d0a0d7bbaccd9241e0f4470d1 (diff) |
String -> ConstString
Diffstat (limited to 'src')
-rw-r--r-- | src/css.cc | 14 | ||||
-rw-r--r-- | src/css.hh | 4 |
2 files changed, 11 insertions, 7 deletions
@@ -200,10 +200,10 @@ void CssStyleSheet::addRule (CssRule *rule) { CssSimpleSelector *top = rule->selector->top (); lout::misc::SimpleVector <CssRule*> *ruleList = NULL; lout::object::Pointer *ruleListP; - lout::object::String *string; + lout::object::ConstString *string; if (top->id) { - string = new lout::object::String (top->id); + string = new lout::object::ConstString (top->id); ruleListP = idTable->get (string); if (ruleListP == NULL) { ruleList = new lout::misc::SimpleVector <CssRule*> (1); @@ -213,7 +213,7 @@ void CssStyleSheet::addRule (CssRule *rule) { ruleList = (lout::misc::SimpleVector <CssRule*>*) ruleListP->getValue (); } } else if (top->klass) { - string = new lout::object::String (top->klass); + string = new lout::object::ConstString (top->klass); ruleListP = classTable->get (string); if (ruleListP == NULL) { ruleList = new lout::misc::SimpleVector <CssRule*> (1); @@ -245,13 +245,17 @@ void CssStyleSheet::apply (CssPropertyList *props, Doctree *docTree) { const DoctreeNode *top = docTree->top (); if (top->id) { - ruleListP = idTable->get (new lout::object::String (top->id)); + lout::object::String idString (top->id); + + ruleListP = idTable->get (&idString); if (ruleListP) ruleList[3] = (lout::misc::SimpleVector <CssRule*>*) ruleListP->getValue (); } if (top->klass) { - ruleListP = classTable->get (new lout::object::String (top->klass)); + lout::object::String classString (top->klass); + + ruleListP = classTable->get (&classString); if (ruleListP) ruleList[2] = (lout::misc::SimpleVector <CssRule*>*) ruleListP->getValue (); } @@ -273,9 +273,9 @@ class CssRule { */ class CssStyleSheet { private: - class RuleMap : public lout::container::typed::HashTable <lout::object::String, lout::object::Pointer > { + class RuleMap : public lout::container::typed::HashTable <lout::object::ConstString, lout::object::Pointer > { public: - RuleMap () : lout::container::typed::HashTable <lout::object::String, lout::object::Pointer > (true, true, 256) { + RuleMap () : lout::container::typed::HashTable <lout::object::ConstString, lout::object::Pointer > (true, true, 256) { }; }; |