From c47b3f61af4322717ec44c983eebda8eea6f4623 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 3 Dec 2018 13:03:17 +0100 Subject: Use a QMultiMap for the weighted rules and get rid of one usage of insertMulti() Change-Id: I26a61dcdd4d778590145c38ae7f39d77ad39a51f Reviewed-by: Simon Hausmann --- src/gui/text/qcssparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui/text/qcssparser.cpp') diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 91fa40eddf..dc7e128bcd 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -2008,7 +2008,7 @@ bool StyleSelector::basicSelectorMatches(const BasicSelector &sel, NodePtr node) } void StyleSelector::matchRule(NodePtr node, const StyleRule &rule, StyleSheetOrigin origin, - int depth, QMap *weightedRules) + int depth, QMultiMap *weightedRules) { for (int j = 0; j < rule.selectors.count(); ++j) { const Selector& selector = rule.selectors.at(j); @@ -2022,7 +2022,7 @@ void StyleSelector::matchRule(NodePtr node, const StyleRule &rule, StyleSheetOri newRule.selectors[0] = selector; } //We might have rules with the same weight if they came from a rule with several selectors - weightedRules->insertMulti(weight, newRule); + weightedRules->insert(weight, newRule); } } } @@ -2035,7 +2035,7 @@ QVector StyleSelector::styleRulesForNode(NodePtr node) if (styleSheets.isEmpty()) return rules; - QMap weightedRules; // (spec, rule) that will be sorted below + QMultiMap weightedRules; // (spec, rule) that will be sorted below //prune using indexed stylesheet for (int sheetIdx = 0; sheetIdx < styleSheets.count(); ++sheetIdx) { -- cgit v1.2.3