aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Berres <armin.berres@basyskom.de>2010-11-16 15:32:16 +0100
committerArmin Berres <armin.berres@basyskom.de>2010-11-16 16:47:36 +0100
commitbee461dab65f16ffce217518e4b025daa28ce0d3 (patch)
treeb649b0a0669da43a9d39a606edd31ff341498abe
parent6fa40ab5e6057bbbcd74da5390651167c4d1bcd3 (diff)
Chnages: do not fail if logical values are zero
RevBy: TrustMe
-rw-r--r--src/corelib/style/mstylesheetparser.cpp9
-rw-r--r--src/corelib/style/mstylesheetselector.cpp5
2 files changed, 8 insertions, 6 deletions
diff --git a/src/corelib/style/mstylesheetparser.cpp b/src/corelib/style/mstylesheetparser.cpp
index a2b14c1d..43c43b8b 100644
--- a/src/corelib/style/mstylesheetparser.cpp
+++ b/src/corelib/style/mstylesheetparser.cpp
@@ -1058,7 +1058,7 @@ bool MStyleSheetParserPrivate::loadBinary(const QFileInfo &cssFileInfo, const QS
QList<uint> logicalTimestamps;
stream >> logicalTimestamps;
- if (logicalTimestamps != logicalValues->timestamps()) {
+ if (logicalValues && logicalTimestamps.length() > 0 && logicalTimestamps != logicalValues->timestamps()) {
// the logical values have been updated. our constants may have changed
return false;
}
@@ -1137,7 +1137,12 @@ bool MStyleSheetParserPrivate::dump(const MStyleSheetParser::StylesheetFileInfo
stream << info.filename;
stream << info.includes;
stream << info.constants;
- stream << logicalValues->timestamps();
+ if (logicalValues) {
+ stream << logicalValues->timestamps();
+ } else {
+ stream << QList<uint>();
+ }
+
// write number of selectors
stream << info.selectors.count();
diff --git a/src/corelib/style/mstylesheetselector.cpp b/src/corelib/style/mstylesheetselector.cpp
index 7f8b179e..e7ee7e27 100644
--- a/src/corelib/style/mstylesheetselector.cpp
+++ b/src/corelib/style/mstylesheetselector.cpp
@@ -41,10 +41,7 @@ void MStyleSheetSelectorPrivate::operator=(const MStyleSheetSelectorPrivate &oth
MStyleSheetAttribute *source = *iterator;
// copy of attribute
- MStyleSheetAttribute *copy = new MStyleSheetAttribute();
- copy->name = source->name;
- copy->value = source->value;
- copy->position = source->position;
+ MStyleSheetAttribute *copy = new MStyleSheetAttribute(*source);
// add copy of attribute to data list
data.insert(iterator.key(), copy);