summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-07-11 15:31:28 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-07-11 15:31:28 +0200
commit3c9d42d1fbfe6dc6c74360faec48c09e8449506f (patch)
tree83e93c6051e3ce200994b038a25006f32ea6ee41 /src
parentd8233fabcd83281e50d6a09f24aa60b60a451fb2 (diff)
cleanups
Diffstat (limited to 'src')
-rw-r--r--src/css.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/css.cc b/src/css.cc
index 2846fe5b..04bd8414 100644
--- a/src/css.cc
+++ b/src/css.cc
@@ -367,8 +367,9 @@ void CssStyleSheet::addRule (CssRule *rule) {
*/
void CssStyleSheet::apply (CssPropertyList *props,
Doctree *docTree, const DoctreeNode *node) {
- RuleList *ruleList[32];
- int numLists = 0, index[32] = {0};
+ static const int maxLists = 32;
+ RuleList *ruleList[maxLists];
+ int numLists = 0, index[maxLists] = {0};
if (node->id) {
lout::object::ConstString idString (node->id);
@@ -380,8 +381,8 @@ void CssStyleSheet::apply (CssPropertyList *props,
if (node->klass) {
for (int i = 0; i < node->klass->size (); i++) {
- if (i >= 16) {
- MSG_WARN("Maximum number of classes per node exceeded.\n");
+ if (i >= maxLists - 4) {
+ MSG_WARN("Maximum number of classes per element exceeded.\n");
break;
}