44
, filter(new Filter())
46
, isSelection( false )
47
, onUpdateKeepStyles( false )
48
, onUpdateKeepSize( true )
49
, hasPersistentData( true )
51
, containsHeader( true )
52
, displayFilterButtons( false )
44
, filter(new Filter())
47
, onUpdateKeepStyles(false)
48
, onUpdateKeepSize(true)
49
, hasPersistentData(true)
51
, containsHeader(true)
52
, displayFilterButtons(false)
57
56
Private(const Private& other)
59
, source(/*other.source ? new DatabaseSource(*other.source) : */0)
60
, sort(/*other.sort ? new Sort(*other.sort) : */0)
61
, filter(other.filter ? new Filter(*other.filter) : 0)
62
, subtotalRules(/*other.subtotalRules ? new SubtotalRules(*other.subtotalRules) : */0)
64
, isSelection(other.isSelection)
65
, onUpdateKeepStyles(other.onUpdateKeepStyles)
66
, onUpdateKeepSize(other.onUpdateKeepSize)
67
, hasPersistentData(other.hasPersistentData)
68
, orientation(other.orientation)
69
, containsHeader(other.containsHeader)
70
, displayFilterButtons(other.displayFilterButtons)
71
, targetRangeAddress(other.targetRangeAddress)
72
, refreshDelay(other.refreshDelay)
58
, source(/*other.source ? new DatabaseSource(*other.source) : */0)
59
, sort(/*other.sort ? new Sort(*other.sort) : */0)
60
, filter(other.filter ? new Filter(*other.filter) : 0)
61
, subtotalRules(/*other.subtotalRules ? new SubtotalRules(*other.subtotalRules) : */0)
63
, isSelection(other.isSelection)
64
, onUpdateKeepStyles(other.onUpdateKeepStyles)
65
, onUpdateKeepSize(other.onUpdateKeepSize)
66
, hasPersistentData(other.hasPersistentData)
67
, orientation(other.orientation)
68
, containsHeader(other.containsHeader)
69
, displayFilterButtons(other.displayFilterButtons)
70
, targetRangeAddress(other.targetRangeAddress)
71
, refreshDelay(other.refreshDelay) {
197
194
if (element.hasAttributeNS(KoXmlNS::table, "name"))
198
195
d->name = element.attributeNS(KoXmlNS::table, "name", QString());
199
if (element.hasAttributeNS(KoXmlNS::table, "is-selection"))
196
if (element.hasAttributeNS(KoXmlNS::table, "is-selection")) {
201
197
if (element.attributeNS(KoXmlNS::table, "is-selection", "false") == "true")
202
198
d->isSelection = true;
204
200
d->isSelection = false;
206
if (element.hasAttributeNS(KoXmlNS::table, "on-update-keep-styles"))
202
if (element.hasAttributeNS(KoXmlNS::table, "on-update-keep-styles")) {
208
203
if (element.attributeNS(KoXmlNS::table, "on-update-keep-styles", "false") == "true")
209
204
d->onUpdateKeepStyles = true;
211
206
d->onUpdateKeepStyles = false;
213
if (element.hasAttributeNS(KoXmlNS::table, "on-update-keep-size"))
208
if (element.hasAttributeNS(KoXmlNS::table, "on-update-keep-size")) {
215
209
if (element.attributeNS(KoXmlNS::table, "on-update-keep-size", "true") == "false")
216
210
d->onUpdateKeepSize = false;
218
212
d->onUpdateKeepSize = true;
220
if (element.hasAttributeNS(KoXmlNS::table, "has-persistent-data"))
214
if (element.hasAttributeNS(KoXmlNS::table, "has-persistent-data")) {
222
215
if (element.attributeNS(KoXmlNS::table, "has-persistent-data", "true") == "false")
223
216
d->hasPersistentData = false;
225
218
d->hasPersistentData = true;
227
if (element.hasAttributeNS(KoXmlNS::table, "orientation"))
220
if (element.hasAttributeNS(KoXmlNS::table, "orientation")) {
229
221
if (element.attributeNS(KoXmlNS::table, "orientation", "row") == "column")
230
222
d->orientation = Private::Column;
232
224
d->orientation = Private::Row;
234
if (element.hasAttributeNS(KoXmlNS::table, "contains-header"))
226
if (element.hasAttributeNS(KoXmlNS::table, "contains-header")) {
236
227
if (element.attributeNS(KoXmlNS::table, "contains-header", "true") == "false")
237
228
d->containsHeader = false;
239
230
d->containsHeader = true;
241
if (element.hasAttributeNS(KoXmlNS::table, "display-filter-buttons"))
232
if (element.hasAttributeNS(KoXmlNS::table, "display-filter-buttons")) {
243
233
if (element.attributeNS(KoXmlNS::table, "display-filter-buttons", "false") == "true")
244
234
d->displayFilterButtons = true;
246
236
d->displayFilterButtons = false;
248
if (element.hasAttributeNS(KoXmlNS::table, "target-range-address"))
238
if (element.hasAttributeNS(KoXmlNS::table, "target-range-address")) {
250
239
const QString address = element.attributeNS(KoXmlNS::table, "target-range-address", QString());
251
240
// only absolute addresses allowed; no fallback sheet needed
252
241
d->targetRangeAddress = Region(Region::loadOdf(address), map);
253
242
if (!d->targetRangeAddress.isValid())
256
if (element.hasAttributeNS(KoXmlNS::table, "refresh-delay"))
245
if (element.hasAttributeNS(KoXmlNS::table, "refresh-delay")) {
259
247
d->refreshDelay = element.attributeNS(KoXmlNS::table, "refresh-delay", QString()).toInt(&ok);
260
248
if (!ok || d->refreshDelay < 0)
263
251
KoXmlElement child;
264
forEachElement(child, element)
252
forEachElement(child, element) {
266
253
if (child.namespaceURI() != KoXmlNS::table)
268
if (child.localName() == "database-source-sql")
272
else if (child.localName() == "database-source-table")
276
else if (child.localName() == "database-source-query")
280
else if (child.localName() == "sort")
284
else if (child.localName() == "filter")
255
if (child.localName() == "database-source-sql") {
257
} else if (child.localName() == "database-source-table") {
259
} else if (child.localName() == "database-source-query") {
261
} else if (child.localName() == "sort") {
263
} else if (child.localName() == "filter") {
286
264
d->filter = new Filter();
287
if (!d->filter->loadOdf(child, map))
265
if (!d->filter->loadOdf(child, map)) {
289
266
delete d->filter;
294
else if (child.localName() == "subtotal-rules")
270
} else if (child.localName() == "subtotal-rules") {