1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_SOURCE_FILTER_XML_XMLIMPRT_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_XML_XMLIMPRT_HXX
23 #include <rsc/rscsfx.hxx>
24 #include <xmloff/xmlictxt.hxx>
25 #include <xmloff/xmlimp.hxx>
26 #include <xmloff/xmltkmap.hxx>
27 #include <xmloff/xmlaustp.hxx>
28 #include <xmloff/xmlstyle.hxx>
29 #include <com/sun/star/frame/XModel.hpp>
30 #include <com/sun/star/util/DateTime.hpp>
31 #include "xmlsubti.hxx"
33 #include <formula/grammar.hxx>
34 #include "compiler.hxx"
36 #include "xmlstyle.hxx"
37 #include <com/sun/star/sheet/ValidationAlertStyle.hpp>
38 #include <com/sun/star/sheet/ValidationType.hpp>
39 #include <com/sun/star/sheet/ConditionOperator.hpp>
40 #include <com/sun/star/table/CellAddress.hpp>
41 #include <com/sun/star/beans/XPropertySet.hpp>
42 #include <com/sun/star/util/XNumberFormatTypes.hpp>
43 #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
45 #include <unordered_map>
47 #include <boost/ptr_container/ptr_list.hpp>
48 #include <boost/ptr_container/ptr_map.hpp>
49 #include <boost/noncopyable.hpp>
50 #include <boost/scoped_ptr.hpp>
52 class ScMyStyleNumberFormats
;
53 class XMLNumberFormatAttributesExportHelper
;
54 class ScEditEngineDefaulter
;
55 class ScDocumentImport
;
56 class ScMyImpDetectiveOpArray
;
60 struct ImportPostProcessData
;
61 struct PivotTableSources
;
67 XML_TOK_DOC_FONTDECLS
,
69 XML_TOK_DOC_AUTOSTYLES
,
70 XML_TOK_DOC_MASTERSTYLES
,
75 XML_TOK_OFFICE_END
=XML_TOK_UNKNOWN
78 enum ScXMLStylesTokens
83 enum ScXMLStylesAttrTokens
85 XML_TOK_STYLES_STYLE_NAME
,
86 XML_TOK_STYLES_STYLE_FAMILY
,
87 XML_TOK_STYLES_STYLE_PARENT_STYLE_NAME
92 XML_TOK_STYLE_PROPERTIES
97 XML_TOK_BODY_TRACKED_CHANGES
,
98 XML_TOK_BODY_CALCULATION_SETTINGS
,
99 XML_TOK_BODY_CONTENT_VALIDATIONS
,
100 XML_TOK_BODY_LABEL_RANGES
,
102 XML_TOK_BODY_NAMED_EXPRESSIONS
,
103 XML_TOK_BODY_DATABASE_RANGES
,
104 XML_TOK_BODY_DATABASE_RANGE
,
105 XML_TOK_BODY_DATA_PILOT_TABLES
,
106 XML_TOK_BODY_CONSOLIDATION
,
107 XML_TOK_BODY_DDE_LINKS
,
108 XML_TOK_BODY_DATA_STREAM_SOURCE
111 enum ScXMLContentValidationsElemTokens
113 XML_TOK_CONTENT_VALIDATION
116 enum ScXMLContentValidationElemTokens
118 XML_TOK_CONTENT_VALIDATION_ELEM_HELP_MESSAGE
,
119 XML_TOK_CONTENT_VALIDATION_ELEM_ERROR_MESSAGE
,
120 XML_TOK_CONTENT_VALIDATION_ELEM_ERROR_MACRO
,
121 XML_TOK_CONTENT_VALIDATION_ELEM_EVENT_LISTENERS
124 enum ScXMLContentValidationAttrTokens
126 XML_TOK_CONTENT_VALIDATION_NAME
,
127 XML_TOK_CONTENT_VALIDATION_CONDITION
,
128 XML_TOK_CONTENT_VALIDATION_BASE_CELL_ADDRESS
,
129 XML_TOK_CONTENT_VALIDATION_ALLOW_EMPTY_CELL
,
130 XML_TOK_CONTENT_VALIDATION_DISPLAY_LIST
133 enum ScXMLContentValidationMessageElemTokens
138 enum ScXMLContentValidationHelpMessageAttrTokens
140 XML_TOK_HELP_MESSAGE_ATTR_TITLE
,
141 XML_TOK_HELP_MESSAGE_ATTR_DISPLAY
144 enum ScXMLContentValidationErrorMessageAttrTokens
146 XML_TOK_ERROR_MESSAGE_ATTR_TITLE
,
147 XML_TOK_ERROR_MESSAGE_ATTR_DISPLAY
,
148 XML_TOK_ERROR_MESSAGE_ATTR_MESSAGE_TYPE
151 enum ScXMLContentValidationErrorMacroAttrTokens
153 XML_TOK_ERROR_MACRO_ATTR_NAME
,
154 XML_TOK_ERROR_MACRO_ATTR_EXECUTE
157 enum ScXMLCondFormatsTokens
159 XML_TOK_CONDFORMATS_CONDFORMAT
162 enum ScXMLCondFormatTokens
164 XML_TOK_CONDFORMAT_COLORSCALE
,
165 XML_TOK_CONDFORMAT_DATABAR
,
166 XML_TOK_CONDFORMAT_CONDITION
,
167 XML_TOK_CONDFORMAT_ICONSET
,
168 XML_TOK_CONDFORMAT_DATE
171 enum ScXMLCondFormatAttrTokens
173 XML_TOK_CONDFORMAT_TARGET_RANGE
176 enum ScXMLCondDateAttrTokens
178 XML_TOK_COND_DATE_VALUE
,
179 XML_TOK_COND_DATE_STYLE
182 enum ScXMLConditionAttrTokens
184 XML_TOK_CONDITION_VALUE
,
185 XML_TOK_CONDITION_APPLY_STYLE_NAME
,
186 XML_TOK_CONDITION_BASE_CELL_ADDRESS
189 enum ScXMLColorScaleFormatTokens
191 XML_TOK_COLORSCALE_COLORSCALEENTRY
194 enum ScXMLColorScaleEntryAttrTokens
196 XML_TOK_COLORSCALEENTRY_TYPE
,
197 XML_TOK_COLORSCALEENTRY_VALUE
,
198 XML_TOK_COLORSCALEENTRY_COLOR
201 enum ScXMLFormattingFormatTokens
203 XML_TOK_DATABAR_DATABARENTRY
,
204 XML_TOK_FORMATTING_ENTRY
207 enum ScXMLDataBarAttrTokens
209 XML_TOK_DATABAR_POSITIVE_COLOR
,
210 XML_TOK_DATABAR_NEGATIVE_COLOR
,
211 XML_TOK_DATABAR_GRADIENT
,
212 XML_TOK_DATABAR_AXISPOSITION
,
213 XML_TOK_DATABAR_SHOWVALUE
,
214 XML_TOK_DATABAR_AXISCOLOR
,
215 XML_TOK_DATABAR_MINLENGTH
,
216 XML_TOK_DATABAR_MAXLENGTH
219 enum ScXMLDataBarEntryAttrTokens
221 XML_TOK_DATABARENTRY_TYPE
,
222 XML_TOK_DATABARENTRY_VALUE
225 enum ScXMLIconSetAttrTokens
227 XML_TOK_ICONSET_TYPE
,
228 XML_TOK_ICONSET_SHOWVALUE
231 enum ScXMLLabelRangesElemTokens
233 XML_TOK_LABEL_RANGE_ELEM
236 enum ScXMLLabelRangeAttrTokens
238 XML_TOK_LABEL_RANGE_ATTR_LABEL_RANGE
,
239 XML_TOK_LABEL_RANGE_ATTR_DATA_RANGE
,
240 XML_TOK_LABEL_RANGE_ATTR_ORIENTATION
243 enum ScXMLTableTokens
245 XML_TOK_TABLE_NAMED_EXPRESSIONS
,
246 XML_TOK_TABLE_COL_GROUP
,
247 XML_TOK_TABLE_HEADER_COLS
,
250 XML_TOK_TABLE_ROW_GROUP
,
251 XML_TOK_TABLE_HEADER_ROWS
,
252 XML_TOK_TABLE_PROTECTION
,
253 XML_TOK_TABLE_PROTECTION_EXT
,
256 XML_TOK_TABLE_SOURCE
,
257 XML_TOK_TABLE_SCENARIO
,
258 XML_TOK_TABLE_SHAPES
,
260 XML_TOK_TABLE_EVENT_LISTENERS
,
261 XML_TOK_TABLE_EVENT_LISTENERS_EXT
,
262 XML_TOK_TABLE_CONDFORMATS
265 enum ScXMLTokenProtectionTokens
267 XML_TOK_TABLE_SELECT_PROTECTED_CELLS
,
268 XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS
,
269 XML_TOK_TABLE_SELECT_PROTECTED_CELLS_EXT
,
270 XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS_EXT
273 enum ScXMLTableRowsTokens
275 XML_TOK_TABLE_ROWS_ROW_GROUP
,
276 XML_TOK_TABLE_ROWS_HEADER_ROWS
,
277 XML_TOK_TABLE_ROWS_ROWS
,
278 XML_TOK_TABLE_ROWS_ROW
281 enum ScXMLTableColsTokens
283 XML_TOK_TABLE_COLS_COL_GROUP
,
284 XML_TOK_TABLE_COLS_HEADER_COLS
,
285 XML_TOK_TABLE_COLS_COLS
,
286 XML_TOK_TABLE_COLS_COL
289 enum ScXMLTableAttrTokens
292 XML_TOK_TABLE_STYLE_NAME
,
293 XML_TOK_TABLE_PROTECTED
,
294 XML_TOK_TABLE_PRINT_RANGES
,
295 XML_TOK_TABLE_PASSWORD
,
296 XML_TOK_TABLE_PASSHASH
,
297 XML_TOK_TABLE_PASSHASH_2
,
301 enum ScXMLTableScenarioAttrTokens
303 XML_TOK_TABLE_SCENARIO_ATTR_DISPLAY_BORDER
,
304 XML_TOK_TABLE_SCENARIO_ATTR_BORDER_COLOR
,
305 XML_TOK_TABLE_SCENARIO_ATTR_COPY_BACK
,
306 XML_TOK_TABLE_SCENARIO_ATTR_COPY_STYLES
,
307 XML_TOK_TABLE_SCENARIO_ATTR_COPY_FORMULAS
,
308 XML_TOK_TABLE_SCENARIO_ATTR_IS_ACTIVE
,
309 XML_TOK_TABLE_SCENARIO_ATTR_SCENARIO_RANGES
,
310 XML_TOK_TABLE_SCENARIO_ATTR_COMMENT
,
311 XML_TOK_TABLE_SCENARIO_ATTR_PROTECTED
314 enum ScXMLTableColAttrTokens
316 XML_TOK_TABLE_COL_ATTR_STYLE_NAME
,
317 XML_TOK_TABLE_COL_ATTR_REPEATED
,
318 XML_TOK_TABLE_COL_ATTR_VISIBILITY
,
319 XML_TOK_TABLE_COL_ATTR_DEFAULT_CELL_STYLE_NAME
322 enum ScXMLTableRowTokens
324 XML_TOK_TABLE_ROW_CELL
,
325 XML_TOK_TABLE_ROW_COVERED_CELL
328 enum ScXMLTableRowAttrTokens
330 XML_TOK_TABLE_ROW_ATTR_STYLE_NAME
,
331 XML_TOK_TABLE_ROW_ATTR_VISIBILITY
,
332 XML_TOK_TABLE_ROW_ATTR_REPEATED
,
333 XML_TOK_TABLE_ROW_ATTR_DEFAULT_CELL_STYLE_NAME
334 // XML_TOK_TABLE_ROW_ATTR_USE_OPTIMAL_HEIGHT
337 enum ScXMLTableRowCellTokens
339 XML_TOK_TABLE_ROW_CELL_P
,
340 XML_TOK_TABLE_ROW_CELL_TABLE
,
341 XML_TOK_TABLE_ROW_CELL_ANNOTATION
,
342 XML_TOK_TABLE_ROW_CELL_DETECTIVE
,
343 XML_TOK_TABLE_ROW_CELL_CELL_RANGE_SOURCE
346 enum ScXMLTableRowCellAttrTokens
348 XML_TOK_TABLE_ROW_CELL_ATTR_STYLE_NAME
,
349 XML_TOK_TABLE_ROW_CELL_ATTR_CONTENT_VALIDATION_NAME
,
350 XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_ROWS
,
351 XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_COLS
,
352 XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_MATRIX_COLS
,
353 XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_MATRIX_ROWS
,
354 XML_TOK_TABLE_ROW_CELL_ATTR_REPEATED
,
355 XML_TOK_TABLE_ROW_CELL_ATTR_VALUE_TYPE
,
356 XML_TOK_TABLE_ROW_CELL_ATTR_NEW_VALUE_TYPE
,
357 XML_TOK_TABLE_ROW_CELL_ATTR_VALUE
,
358 XML_TOK_TABLE_ROW_CELL_ATTR_DATE_VALUE
,
359 XML_TOK_TABLE_ROW_CELL_ATTR_TIME_VALUE
,
360 XML_TOK_TABLE_ROW_CELL_ATTR_STRING_VALUE
,
361 XML_TOK_TABLE_ROW_CELL_ATTR_BOOLEAN_VALUE
,
362 XML_TOK_TABLE_ROW_CELL_ATTR_FORMULA
,
363 XML_TOK_TABLE_ROW_CELL_ATTR_CURRENCY
366 enum ScXMLAnnotationAttrTokens
368 XML_TOK_TABLE_ANNOTATION_ATTR_AUTHOR
,
369 XML_TOK_TABLE_ANNOTATION_ATTR_CREATE_DATE
,
370 XML_TOK_TABLE_ANNOTATION_ATTR_CREATE_DATE_STRING
,
371 XML_TOK_TABLE_ANNOTATION_ATTR_DISPLAY
,
372 XML_TOK_TABLE_ANNOTATION_ATTR_X
,
373 XML_TOK_TABLE_ANNOTATION_ATTR_Y
376 enum ScXMLDetectiveElemTokens
378 XML_TOK_DETECTIVE_ELEM_HIGHLIGHTED
,
379 XML_TOK_DETECTIVE_ELEM_OPERATION
382 enum ScXMLDetectiveHighlightedAttrTokens
384 XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_CELL_RANGE
,
385 XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_DIRECTION
,
386 XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_CONTAINS_ERROR
,
387 XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_MARKED_INVALID
390 enum ScXMLDetectiveOperationAttrTokens
392 XML_TOK_DETECTIVE_OPERATION_ATTR_NAME
,
393 XML_TOK_DETECTIVE_OPERATION_ATTR_INDEX
396 enum ScXMLCellRangeSourceAttrTokens
398 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_NAME
,
399 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_HREF
,
400 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_FILTER_NAME
,
401 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_FILTER_OPTIONS
,
402 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_LAST_COLUMN
,
403 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_LAST_ROW
,
404 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_REFRESH_DELAY
407 enum ScXMLNamedExpressionsTokens
409 XML_TOK_NAMED_EXPRESSIONS_NAMED_RANGE
,
410 XML_TOK_NAMED_EXPRESSIONS_NAMED_EXPRESSION
413 enum ScXMLNamedRangeAttrTokens
415 XML_TOK_NAMED_RANGE_ATTR_NAME
,
416 XML_TOK_NAMED_RANGE_ATTR_CELL_RANGE_ADDRESS
,
417 XML_TOK_NAMED_RANGE_ATTR_BASE_CELL_ADDRESS
,
418 XML_TOK_NAMED_RANGE_ATTR_RANGE_USABLE_AS
421 enum ScXMLNamedExpressionAttrTokens
423 XML_TOK_NAMED_EXPRESSION_ATTR_NAME
,
424 XML_TOK_NAMED_EXPRESSION_ATTR_BASE_CELL_ADDRESS
,
425 XML_TOK_NAMED_EXPRESSION_ATTR_EXPRESSION
428 enum ScXMLDatabaseRangesTokens
430 XML_TOK_DATABASE_RANGE
433 enum ScXMLDatabaseRangeTokens
435 XML_TOK_DATABASE_RANGE_SOURCE_SQL
,
436 XML_TOK_DATABASE_RANGE_SOURCE_TABLE
,
437 XML_TOK_DATABASE_RANGE_SOURCE_QUERY
,
440 XML_TOK_DATABASE_RANGE_SUBTOTAL_RULES
443 enum ScXMLDatabaseRangeAttrTokens
445 XML_TOK_DATABASE_RANGE_ATTR_NAME
,
446 XML_TOK_DATABASE_RANGE_ATTR_IS_SELECTION
,
447 XML_TOK_DATABASE_RANGE_ATTR_ON_UPDATE_KEEP_STYLES
,
448 XML_TOK_DATABASE_RANGE_ATTR_ON_UPDATE_KEEP_SIZE
,
449 XML_TOK_DATABASE_RANGE_ATTR_HAS_PERSISTENT_DATA
,
450 XML_TOK_DATABASE_RANGE_ATTR_ORIENTATION
,
451 XML_TOK_DATABASE_RANGE_ATTR_CONTAINS_HEADER
,
452 XML_TOK_DATABASE_RANGE_ATTR_DISPLAY_FILTER_BUTTONS
,
453 XML_TOK_DATABASE_RANGE_ATTR_TARGET_RANGE_ADDRESS
,
454 XML_TOK_DATABASE_RANGE_ATTR_REFRESH_DELAY
457 enum ScXMLDatabaseRangeSourceSQLAttrTokens
459 XML_TOK_SOURCE_SQL_ATTR_DATABASE_NAME
,
460 XML_TOK_SOURCE_SQL_ATTR_HREF
,
461 XML_TOK_SOURCE_SQL_ATTR_CONNECTION_RESOURCE
,
462 XML_TOK_SOURCE_SQL_ATTR_SQL_STATEMENT
,
463 XML_TOK_SOURCE_SQL_ATTR_PARSE_SQL_STATEMENT
466 enum ScXMLDatabaseRangeSourceTableAttrTokens
468 XML_TOK_SOURCE_TABLE_ATTR_DATABASE_NAME
,
469 XML_TOK_SOURCE_TABLE_ATTR_HREF
,
470 XML_TOK_SOURCE_TABLE_ATTR_CONNECTION_RESOURCE
,
471 XML_TOK_SOURCE_TABLE_ATTR_TABLE_NAME
474 enum ScXMLDatabaseRangeSourceQueryAttrTokens
476 XML_TOK_SOURCE_QUERY_ATTR_DATABASE_NAME
,
477 XML_TOK_SOURCE_QUERY_ATTR_HREF
,
478 XML_TOK_SOURCE_QUERY_ATTR_CONNECTION_RESOURCE
,
479 XML_TOK_SOURCE_QUERY_ATTR_QUERY_NAME
482 enum ScXMLFilterTokens
486 XML_TOK_FILTER_CONDITION
489 enum ScXMLFilterAttrTokens
491 XML_TOK_FILTER_ATTR_TARGET_RANGE_ADDRESS
,
492 XML_TOK_FILTER_ATTR_CONDITION_SOURCE_RANGE_ADDRESS
,
493 XML_TOK_FILTER_ATTR_CONDITION_SOURCE
,
494 XML_TOK_FILTER_ATTR_DISPLAY_DUPLICATES
497 enum ScXMLFilterConditionElemTokens
499 XML_TOK_CONDITION_FILTER_SET_ITEM
502 enum ScXMLFilterConditionAttrTokens
504 XML_TOK_CONDITION_ATTR_FIELD_NUMBER
,
505 XML_TOK_CONDITION_ATTR_CASE_SENSITIVE
,
506 XML_TOK_CONDITION_ATTR_DATA_TYPE
,
507 XML_TOK_CONDITION_ATTR_VALUE
,
508 XML_TOK_CONDITION_ATTR_OPERATOR
511 enum ScXMLFilterSetItemAttrTokens
513 XML_TOK_FILTER_SET_ITEM_ATTR_VALUE
521 enum ScXMLSortAttrTokens
523 XML_TOK_SORT_ATTR_BIND_STYLES_TO_CONTENT
,
524 XML_TOK_SORT_ATTR_TARGET_RANGE_ADDRESS
,
525 XML_TOK_SORT_ATTR_CASE_SENSITIVE
,
526 XML_TOK_SORT_ATTR_RFC_LANGUAGE_TAG
,
527 XML_TOK_SORT_ATTR_LANGUAGE
,
528 XML_TOK_SORT_ATTR_SCRIPT
,
529 XML_TOK_SORT_ATTR_COUNTRY
,
530 XML_TOK_SORT_ATTR_ALGORITHM
533 enum ScXMLSortSortByAttrTokens
535 XML_TOK_SORT_BY_ATTR_FIELD_NUMBER
,
536 XML_TOK_SORT_BY_ATTR_DATA_TYPE
,
537 XML_TOK_SORT_BY_ATTR_ORDER
540 enum ScXMLDatabaseRangeSubTotalRulesTokens
542 XML_TOK_SUBTOTAL_RULES_SORT_GROUPS
,
543 XML_TOK_SUBTOTAL_RULES_SUBTOTAL_RULE
546 enum ScXMLDatabaseRangeSubTotalRulesAttrTokens
548 XML_TOK_SUBTOTAL_RULES_ATTR_BIND_STYLES_TO_CONTENT
,
549 XML_TOK_SUBTOTAL_RULES_ATTR_CASE_SENSITIVE
,
550 XML_TOK_SUBTOTAL_RULES_ATTR_PAGE_BREAKS_ON_GROUP_CHANGE
553 enum ScXMLSubTotalRulesSortGroupsAttrTokens
555 XML_TOK_SORT_GROUPS_ATTR_DATA_TYPE
,
556 XML_TOK_SORT_GROUPS_ATTR_ORDER
559 enum ScXMLSubTotalRulesSubTotalRuleTokens
561 XML_TOK_SUBTOTAL_RULE_SUBTOTAL_FIELD
564 enum ScXMLSubTotalRulesSubTotalRuleAttrTokens
566 XML_TOK_SUBTOTAL_RULE_ATTR_GROUP_BY_FIELD_NUMBER
569 enum ScXMLSubTotalRuleSubTotalField
571 XML_TOK_SUBTOTAL_FIELD_ATTR_FIELD_NUMBER
,
572 XML_TOK_SUBTOTAL_FIELD_ATTR_FUNCTION
575 enum ScXMLDataPilotTablesElemTokens
577 XML_TOK_DATA_PILOT_TABLE
580 enum ScXMLDataPilotTableAttrTokens
582 XML_TOK_DATA_PILOT_TABLE_ATTR_NAME
,
583 XML_TOK_DATA_PILOT_TABLE_ATTR_APPLICATION_DATA
,
584 XML_TOK_DATA_PILOT_TABLE_ATTR_GRAND_TOTAL
,
585 XML_TOK_DATA_PILOT_TABLE_ATTR_IGNORE_EMPTY_ROWS
,
586 XML_TOK_DATA_PILOT_TABLE_ATTR_IDENTIFY_CATEGORIES
,
587 XML_TOK_DATA_PILOT_TABLE_ATTR_TARGET_RANGE_ADDRESS
,
588 XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS
,
589 XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON
,
590 XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN
,
591 XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT
594 enum ScXMLDataPilotTableElemTokens
596 XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL
,
597 XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE
,
598 XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL
,
599 XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL_EXT
,
600 XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_QUERY
,
601 XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SERVICE
,
602 XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE
,
603 XML_TOK_DATA_PILOT_TABLE_ELEM_DATA_PILOT_FIELD
606 enum ScXMLDataPilotTableSourceServiceAttrTokens
608 XML_TOK_SOURCE_SERVICE_ATTR_NAME
,
609 XML_TOK_SOURCE_SERVICE_ATTR_SOURCE_NAME
,
610 XML_TOK_SOURCE_SERVICE_ATTR_OBJECT_NAME
,
611 XML_TOK_SOURCE_SERVICE_ATTR_USER_NAME
,
612 XML_TOK_SOURCE_SERVICE_ATTR_PASSWORD
615 enum ScXMLDataPilotGrandTotalAttrTokens
617 XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY
,
618 XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION
,
619 XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME
,
620 XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME_EXT
623 enum ScXMLDataPilotTableSourceCellRangeElemTokens
625 XML_TOK_SOURCE_CELL_RANGE_ELEM_FILTER
628 enum ScXMLDataPilotTableSourceCellRangeAttrTokens
630 XML_TOK_SOURCE_CELL_RANGE_ATTR_CELL_RANGE_ADDRESS
,
631 XML_TOK_SOURCE_CELL_RANGE_ATTR_NAME
634 enum ScXMLDataPilotFieldAttrTokens
636 XML_TOK_DATA_PILOT_FIELD_ATTR_SOURCE_FIELD_NAME
,
637 XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME
,
638 XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME_EXT
,
639 XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD
,
640 XML_TOK_DATA_PILOT_FIELD_ATTR_FUNCTION
,
641 XML_TOK_DATA_PILOT_FIELD_ATTR_ORIENTATION
,
642 XML_TOK_DATA_PILOT_FIELD_ATTR_SELECTED_PAGE
,
643 XML_TOK_DATA_PILOT_FIELD_ATTR_IGNORE_SELECTED_PAGE
,
644 XML_TOK_DATA_PILOT_FIELD_ATTR_USED_HIERARCHY
647 enum ScXMLDataPilotFieldElemTokens
649 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_LEVEL
,
650 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_REFERENCE
,
651 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_GROUPS
654 enum ScXMLDataPilotLevelAttrTokens
656 XML_TOK_DATA_PILOT_LEVEL_ATTR_SHOW_EMPTY
,
657 XML_TOK_DATA_PILOT_LEVEL_ATTR_REPEAT_ITEM_LABELS
660 enum ScXMLDataPilotLevelElemTokens
662 XML_TOK_DATA_PILOT_LEVEL_ELEM_DATA_PILOT_SUBTOTALS
,
663 XML_TOK_DATA_PILOT_LEVEL_ELEM_DATA_PILOT_MEMBERS
,
664 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_DISPLAY_INFO
,
665 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_SORT_INFO
,
666 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_LAYOUT_INFO
669 enum ScXMLDataPilotSubTotalsElemTokens
671 XML_TOK_DATA_PILOT_SUBTOTALS_ELEM_DATA_PILOT_SUBTOTAL
674 enum ScXMLDataPilotSubTotalAttrTokens
676 XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION
,
677 XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME
,
678 XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME_EXT
681 enum ScXMLDataPilotMembersElemTokens
683 XML_TOK_DATA_PILOT_MEMBERS_ELEM_DATA_PILOT_MEMBER
686 enum ScXMLDataPilotMemberAttrTokens
688 XML_TOK_DATA_PILOT_MEMBER_ATTR_NAME
,
689 XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME
,
690 XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME_EXT
,
691 XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY
,
692 XML_TOK_DATA_PILOT_MEMBER_ATTR_SHOW_DETAILS
695 enum ScXMLConsolidationAttrTokens
697 XML_TOK_CONSOLIDATION_ATTR_FUNCTION
,
698 XML_TOK_CONSOLIDATION_ATTR_SOURCE_RANGES
,
699 XML_TOK_CONSOLIDATION_ATTR_TARGET_ADDRESS
,
700 XML_TOK_CONSOLIDATION_ATTR_USE_LABEL
,
701 XML_TOK_CONSOLIDATION_ATTR_LINK_TO_SOURCE
705 * Tokens for elements that come under <text:p>
707 enum ScXMLCellTextParaElemTokens
710 XML_TOK_CELL_TEXT_SPAN
,
711 XML_TOK_CELL_TEXT_SHEET_NAME
,
712 XML_TOK_CELL_TEXT_DATE
,
713 XML_TOK_CELL_TEXT_TITLE
,
714 XML_TOK_CELL_TEXT_URL
718 * Tokens for elements that come under <text:span>
720 enum ScXMLCellTextSpanElemTokens
722 XML_TOK_CELL_TEXT_SPAN_ELEM_SHEET_NAME
,
723 XML_TOK_CELL_TEXT_SPAN_ELEM_DATE
,
724 XML_TOK_CELL_TEXT_SPAN_ELEM_TITLE
,
725 XML_TOK_CELL_TEXT_SPAN_ELEM_URL
,
726 XML_TOK_CELL_TEXT_SPAN_ELEM_S
730 * Tokens for attributes for <text:span>
732 enum ScXMLCellTextSpanAttrTokens
734 XML_TOK_CELL_TEXT_SPAN_ATTR_STYLE_NAME
737 enum ScXMLCellTextURLAttrTokens
739 XML_TOK_CELL_TEXT_URL_ATTR_UREF
,
740 XML_TOK_CELL_TEXT_URL_ATTR_TYPE
,
744 * Tokens for attributes for <text:s>
746 enum ScXMLCellTextSAttrTokens
748 XML_TOK_CELL_TEXT_S_ATTR_C
752 * Attribute tokens for <calcext:data-stream-source>.
754 enum ScXMLDataStreamAttrTokens
756 XML_TOK_DATA_STREAM_ATTR_URL
,
757 XML_TOK_DATA_STREAM_ATTR_RANGE
,
758 XML_TOK_DATA_STREAM_ATTR_EMPTY_LINE_REFRESH
,
759 XML_TOK_DATA_STREAM_ATTR_INSERTION_POSITION
763 class XMLShapeImportHelper
;
764 class ScXMLChangeTrackingImportHelper
;
765 class SolarMutexGuard
;
767 struct tScMyCellRange
770 sal_Int32 StartColumn
, EndColumn
;
771 sal_Int32 StartRow
, EndRow
;
774 struct ScMyNamedExpression
778 OUString sContentNmsp
;
779 OUString sBaseCellAddress
;
781 formula::FormulaGrammar::Grammar eGrammar
;
785 typedef ::boost::ptr_list
<ScMyNamedExpression
> ScMyNamedExpressions
;
787 struct ScMyLabelRange
789 OUString sLabelRangeStr
;
790 OUString sDataRangeStr
;
791 bool bColumnOrientation
;
794 typedef std::list
<const ScMyLabelRange
*> ScMyLabelRanges
;
796 struct ScMyImportValidation
799 OUString sImputTitle
;
800 OUString sImputMessage
;
801 OUString sErrorTitle
;
802 OUString sErrorMessage
;
805 OUString sFormulaNmsp1
;
806 OUString sFormulaNmsp2
;
807 OUString sBaseCellAddress
; // string is used directly
808 com::sun::star::sheet::ValidationAlertStyle aAlertStyle
;
809 com::sun::star::sheet::ValidationType aValidationType
;
810 com::sun::star::sheet::ConditionOperator aOperator
;
811 formula::FormulaGrammar::Grammar eGrammar1
;
812 formula::FormulaGrammar::Grammar eGrammar2
;
814 bool bShowErrorMessage
;
815 bool bShowImputMessage
;
819 typedef std::vector
<ScMyImportValidation
> ScMyImportValidations
;
820 typedef std::list
<SvXMLImportContext
*> ScMyViewContextList
;
821 class ScMyStylesImportHelper
;
822 class ScXMLEditAttributeMap
;
824 class ScXMLImport
: public SvXMLImport
, boost::noncopyable
826 typedef std::unordered_map
< OUString
, sal_Int16
, OUStringHash
> CellTypeMap
;
827 typedef ::boost::ptr_map
<SCTAB
, ScMyNamedExpressions
> SheetNamedExpMap
;
829 CellTypeMap aCellTypeMap
;
832 boost::scoped_ptr
<ScDocumentImport
> mpDocImport
;
833 boost::scoped_ptr
<ScCompiler
> mpComp
; // For error-checking of cached string cell values.
834 boost::scoped_ptr
<ScEditEngineDefaulter
> mpEditEngine
;
835 boost::scoped_ptr
<sc::PivotTableSources
> mpPivotSources
;
837 mutable boost::scoped_ptr
<ScXMLEditAttributeMap
> mpEditAttrMap
;
838 ScXMLChangeTrackingImportHelper
* pChangeTrackingImportHelper
;
839 ScMyViewContextList aViewContextList
;
840 ScMyStylesImportHelper
* pStylesImportHelper
;
841 OUString sNumberFormat
;
844 OUString sStandardFormat
;
847 rtl::Reference
< XMLPropertyHandlerFactory
> xScPropHdlFactory
;
848 rtl::Reference
< XMLPropertySetMapper
> xCellStylesPropertySetMapper
;
849 rtl::Reference
< XMLPropertySetMapper
> xColumnStylesPropertySetMapper
;
850 rtl::Reference
< XMLPropertySetMapper
> xRowStylesPropertySetMapper
;
851 rtl::Reference
< XMLPropertySetMapper
> xTableStylesPropertySetMapper
;
853 SvXMLTokenMap
*pDocElemTokenMap
;
854 SvXMLTokenMap
*pStylesElemTokenMap
;
855 SvXMLTokenMap
*pStylesAttrTokenMap
;
856 SvXMLTokenMap
*pStyleElemTokenMap
;
857 SvXMLTokenMap
*pBodyElemTokenMap
;
858 SvXMLTokenMap
*pContentValidationsElemTokenMap
;
859 SvXMLTokenMap
*pContentValidationElemTokenMap
;
860 SvXMLTokenMap
*pContentValidationAttrTokenMap
;
861 SvXMLTokenMap
*pContentValidationMessageElemTokenMap
;
862 SvXMLTokenMap
*pContentValidationHelpMessageAttrTokenMap
;
863 SvXMLTokenMap
*pContentValidationErrorMessageAttrTokenMap
;
864 SvXMLTokenMap
*pContentValidationErrorMacroAttrTokenMap
;
865 SvXMLTokenMap
*pCondFormatsTokenMap
;
866 SvXMLTokenMap
*pCondFormatTokenMap
;
867 SvXMLTokenMap
*pCondFormatAttrMap
;
868 SvXMLTokenMap
*pCondDateAttrMap
;
869 SvXMLTokenMap
*pConditionAttrMap
;
870 SvXMLTokenMap
*pColorScaleTokenMap
;
871 SvXMLTokenMap
*pColorScaleEntryAttrTokenMap
;
872 SvXMLTokenMap
*pDataBarTokenMap
;
873 SvXMLTokenMap
*pDataBarAttrMap
;
874 SvXMLTokenMap
*pFormattingEntryAttrMap
;
875 SvXMLTokenMap
*pIconSetAttrMap
;
876 SvXMLTokenMap
*pLabelRangesElemTokenMap
;
877 SvXMLTokenMap
*pLabelRangeAttrTokenMap
;
878 SvXMLTokenMap
*pTableElemTokenMap
;
879 SvXMLTokenMap
*pTableProtectionElemTokenMap
;
880 SvXMLTokenMap
*pTableRowsElemTokenMap
;
881 SvXMLTokenMap
*pTableColsElemTokenMap
;
882 SvXMLTokenMap
*pTableScenarioAttrTokenMap
;
883 SvXMLTokenMap
*pTableAttrTokenMap
;
884 SvXMLTokenMap
*pTableColAttrTokenMap
;
885 SvXMLTokenMap
*pTableRowElemTokenMap
;
886 SvXMLTokenMap
*pTableRowAttrTokenMap
;
887 SvXMLTokenMap
*pTableRowCellElemTokenMap
;
888 SvXMLTokenMap
*pTableRowCellAttrTokenMap
;
889 SvXMLTokenMap
*pTableAnnotationAttrTokenMap
;
890 SvXMLTokenMap
*pDetectiveElemTokenMap
;
891 SvXMLTokenMap
*pDetectiveHighlightedAttrTokenMap
;
892 SvXMLTokenMap
*pDetectiveOperationAttrTokenMap
;
893 SvXMLTokenMap
*pTableCellRangeSourceAttrTokenMap
;
894 SvXMLTokenMap
*pNamedExpressionsElemTokenMap
;
895 SvXMLTokenMap
*pNamedRangeAttrTokenMap
;
896 SvXMLTokenMap
*pNamedExpressionAttrTokenMap
;
897 SvXMLTokenMap
*pDatabaseRangesElemTokenMap
;
898 SvXMLTokenMap
*pDatabaseRangeElemTokenMap
;
899 SvXMLTokenMap
*pDatabaseRangeAttrTokenMap
;
900 SvXMLTokenMap
*pDatabaseRangeSourceSQLAttrTokenMap
;
901 SvXMLTokenMap
*pDatabaseRangeSourceTableAttrTokenMap
;
902 SvXMLTokenMap
*pDatabaseRangeSourceQueryAttrTokenMap
;
903 SvXMLTokenMap
*pFilterElemTokenMap
;
904 SvXMLTokenMap
*pFilterAttrTokenMap
;
905 SvXMLTokenMap
*pFilterConditionElemTokenMap
;
906 SvXMLTokenMap
*pFilterConditionAttrTokenMap
;
907 SvXMLTokenMap
*pFilterSetItemAttrTokenMap
;
908 SvXMLTokenMap
*pSortElemTokenMap
;
909 SvXMLTokenMap
*pSortAttrTokenMap
;
910 SvXMLTokenMap
*pSortSortByAttrTokenMap
;
911 SvXMLTokenMap
*pDatabaseRangeSubTotalRulesElemTokenMap
;
912 SvXMLTokenMap
*pDatabaseRangeSubTotalRulesAttrTokenMap
;
913 SvXMLTokenMap
*pSubTotalRulesSortGroupsAttrTokenMap
;
914 SvXMLTokenMap
*pSubTotalRulesSubTotalRuleElemTokenMap
;
915 SvXMLTokenMap
*pSubTotalRulesSubTotalRuleAttrTokenMap
;
916 SvXMLTokenMap
*pSubTotalRuleSubTotalFieldAttrTokenMap
;
917 SvXMLTokenMap
*pDataPilotTablesElemTokenMap
;
918 SvXMLTokenMap
*pDataPilotTableAttrTokenMap
;
919 SvXMLTokenMap
*pDataPilotTableElemTokenMap
;
920 SvXMLTokenMap
*pDataPilotTableSourceServiceAttrTokenMap
;
921 SvXMLTokenMap
*pDataPilotGrandTotalAttrTokenMap
;
922 SvXMLTokenMap
*pDataPilotTableSourceCellRangeElemTokenMap
;
923 SvXMLTokenMap
*pDataPilotTableSourceCellRangeAttrTokenMap
;
924 SvXMLTokenMap
*pDataPilotFieldAttrTokenMap
;
925 SvXMLTokenMap
*pDataPilotFieldElemTokenMap
;
926 SvXMLTokenMap
*pDataPilotLevelAttrTokenMap
;
927 SvXMLTokenMap
*pDataPilotLevelElemTokenMap
;
928 SvXMLTokenMap
*pDataPilotSubTotalsElemTokenMap
;
929 SvXMLTokenMap
*pDataPilotSubTotalAttrTokenMap
;
930 SvXMLTokenMap
*pDataPilotMembersElemTokenMap
;
931 SvXMLTokenMap
*pDataPilotMemberAttrTokenMap
;
932 SvXMLTokenMap
*pConsolidationAttrTokenMap
;
933 SvXMLTokenMap
*pCellTextParaElemTokenMap
;
934 SvXMLTokenMap
*pCellTextSpanElemTokenMap
;
935 SvXMLTokenMap
*pCellTextSpanAttrTokenMap
;
936 SvXMLTokenMap
*pCellTextURLAttrTokenMap
;
937 SvXMLTokenMap
*pCellTextSAttrTokenMap
;
938 SvXMLTokenMap
*pDataStreamAttrTokenMap
;
940 sc::ImportPostProcessData
* mpPostProcessData
; /// Lift cycle managed elsewhere, no need to delete.
944 ScMyNamedExpressions
* pMyNamedExpressions
;
945 SheetNamedExpMap maSheetNamedExpressions
;
947 ScMyLabelRanges
* pMyLabelRanges
;
948 ScMyImportValidations
* pValidations
;
949 ScMyImpDetectiveOpArray
* pDetectiveOpArray
;
950 SolarMutexGuard
* pSolarMutexGuard
;
952 std::vector
<OUString
> aTableStyles
;
953 XMLNumberFormatAttributesExportHelper
* pNumberFormatAttributesExportHelper
;
954 ScMyStyleNumberFormats
* pStyleNumberFormats
;
955 com::sun::star::uno::Reference
<com::sun::star::util::XNumberFormats
> xNumberFormats
;
956 com::sun::star::uno::Reference
<com::sun::star::util::XNumberFormatTypes
> xNumberFormatTypes
;
958 com::sun::star::uno::Reference
<com::sun::star::sheet::XSheetCellRangeContainer
> xSheetCellRanges
;
961 OUString sPrevStyleName
;
962 OUString sPrevCurrency
;
963 sal_uInt32 nSolarMutexLocked
;
964 sal_Int32 nProgressCount
;
965 sal_uInt16 nStyleFamilyMask
;// Mask of styles to load
966 sal_Int16 nPrevCellType
;
967 bool bLoadDoc
; // Load doc or styles only
968 bool bRemoveLastChar
;
969 bool bNullDateSetted
;
970 bool bSelfImportingXMLSet
;
971 bool mbLockSolarMutex
;
973 bool mbHasNewCondFormatData
;
977 // This method is called after the namespace map has been updated, but
978 // before a context for the current element has been pushed.
979 virtual SvXMLImportContext
*CreateContext(sal_uInt16 nPrefix
,
980 const OUString
& rLocalName
,
981 const ::com::sun::star::uno::Reference
<
982 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
983 virtual XMLShapeImportHelper
* CreateShapeImport() SAL_OVERRIDE
;
988 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& rContext
,
989 OUString
const & implementationName
, SvXMLImportFlags nImportFlag
);
991 virtual ~ScXMLImport() throw();
994 virtual void SAL_CALL
initialize( const css::uno::Sequence
<css::uno::Any
>& aArguments
)
995 throw (css::uno::Exception
, css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
998 // NB: in contrast to other CreateFooContexts, this particular one handles
999 // the root element (i.e. office:document-meta)
1000 SvXMLImportContext
*CreateMetaContext(
1001 const OUString
& rLocalName
);
1002 SvXMLImportContext
*CreateFontDeclsContext(const sal_uInt16 nPrefix
, const OUString
& rLocalName
,
1003 const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
1004 SvXMLImportContext
*CreateScriptContext(
1005 const OUString
& rLocalName
);
1006 SvXMLImportContext
*CreateStylesContext(const OUString
& rLocalName
,
1007 const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
, bool bAutoStyles
);
1008 SvXMLImportContext
*CreateBodyContext(
1009 const OUString
& rLocalName
,
1010 const ::com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
1012 virtual void SetStatistics(
1013 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
> & i_rStats
) SAL_OVERRIDE
;
1015 ScDocumentImport
& GetDoc();
1017 inline ScDocument
* GetDocument() { return pDoc
; }
1018 inline const ScDocument
* GetDocument() const { return pDoc
; }
1020 ScMyTables
& GetTables() { return aTables
; }
1022 sal_uInt16
GetStyleFamilyMask() const { return nStyleFamilyMask
; }
1023 bool IsStylesOnlyMode() const { return !bLoadDoc
; }
1025 sal_Int16
GetCellType(const OUString
& rStrValue
) const;
1027 rtl::Reference
< XMLPropertySetMapper
> GetCellStylesPropertySetMapper() const { return xCellStylesPropertySetMapper
; }
1028 rtl::Reference
< XMLPropertySetMapper
> GetColumnStylesPropertySetMapper() const { return xColumnStylesPropertySetMapper
; }
1029 rtl::Reference
< XMLPropertySetMapper
> GetRowStylesPropertySetMapper() const { return xRowStylesPropertySetMapper
; }
1030 rtl::Reference
< XMLPropertySetMapper
> GetTableStylesPropertySetMapper() const { return xTableStylesPropertySetMapper
; }
1032 const SvXMLTokenMap
& GetDocElemTokenMap();
1033 const SvXMLTokenMap
& GetBodyElemTokenMap();
1034 const SvXMLTokenMap
& GetContentValidationsElemTokenMap();
1035 const SvXMLTokenMap
& GetContentValidationElemTokenMap();
1036 const SvXMLTokenMap
& GetContentValidationAttrTokenMap();
1037 const SvXMLTokenMap
& GetContentValidationMessageElemTokenMap();
1038 const SvXMLTokenMap
& GetContentValidationHelpMessageAttrTokenMap();
1039 const SvXMLTokenMap
& GetContentValidationErrorMessageAttrTokenMap();
1040 const SvXMLTokenMap
& GetContentValidationErrorMacroAttrTokenMap();
1041 const SvXMLTokenMap
& GetCondFormatsTokenMap();
1042 const SvXMLTokenMap
& GetCondFormatTokenMap();
1043 const SvXMLTokenMap
& GetCondFormatAttrMap();
1044 const SvXMLTokenMap
& GetCondDateAttrMap();
1045 const SvXMLTokenMap
& GetConditionAttrMap();
1046 const SvXMLTokenMap
& GetColorScaleTokenMap();
1047 const SvXMLTokenMap
& GetColorScaleEntryAttrMap();
1048 const SvXMLTokenMap
& GetFormattingTokenMap();
1049 const SvXMLTokenMap
& GetDataBarAttrMap();
1050 const SvXMLTokenMap
& GetDataBarEntryAttrMap();
1051 const SvXMLTokenMap
& GetIconSetAttrMap();
1052 const SvXMLTokenMap
& GetLabelRangesElemTokenMap();
1053 const SvXMLTokenMap
& GetLabelRangeAttrTokenMap();
1054 const SvXMLTokenMap
& GetTableElemTokenMap();
1055 const SvXMLTokenMap
& GetTableProtectionAttrTokenMap();
1056 const SvXMLTokenMap
& GetTableRowsElemTokenMap();
1057 const SvXMLTokenMap
& GetTableColsElemTokenMap();
1058 const SvXMLTokenMap
& GetTableAttrTokenMap();
1059 const SvXMLTokenMap
& GetTableScenarioAttrTokenMap();
1060 const SvXMLTokenMap
& GetTableColAttrTokenMap();
1061 const SvXMLTokenMap
& GetTableRowElemTokenMap();
1062 const SvXMLTokenMap
& GetTableRowAttrTokenMap();
1063 const SvXMLTokenMap
& GetTableRowCellElemTokenMap();
1064 const SvXMLTokenMap
& GetTableRowCellAttrTokenMap();
1065 const SvXMLTokenMap
& GetTableAnnotationAttrTokenMap();
1066 const SvXMLTokenMap
& GetDetectiveElemTokenMap();
1067 const SvXMLTokenMap
& GetDetectiveHighlightedAttrTokenMap();
1068 const SvXMLTokenMap
& GetDetectiveOperationAttrTokenMap();
1069 const SvXMLTokenMap
& GetTableCellRangeSourceAttrTokenMap();
1070 const SvXMLTokenMap
& GetNamedExpressionsElemTokenMap();
1071 const SvXMLTokenMap
& GetNamedRangeAttrTokenMap();
1072 const SvXMLTokenMap
& GetNamedExpressionAttrTokenMap();
1073 const SvXMLTokenMap
& GetDatabaseRangesElemTokenMap();
1074 const SvXMLTokenMap
& GetDatabaseRangeElemTokenMap();
1075 const SvXMLTokenMap
& GetDatabaseRangeAttrTokenMap();
1076 const SvXMLTokenMap
& GetDatabaseRangeSourceSQLAttrTokenMap();
1077 const SvXMLTokenMap
& GetDatabaseRangeSourceTableAttrTokenMap();
1078 const SvXMLTokenMap
& GetDatabaseRangeSourceQueryAttrTokenMap();
1079 const SvXMLTokenMap
& GetFilterElemTokenMap();
1080 const SvXMLTokenMap
& GetFilterAttrTokenMap();
1081 const SvXMLTokenMap
& GetFilterConditionElemTokenMap();
1082 const SvXMLTokenMap
& GetFilterConditionAttrTokenMap();
1083 const SvXMLTokenMap
& GetFilterSetItemAttrTokenMap();
1084 const SvXMLTokenMap
& GetSortElemTokenMap();
1085 const SvXMLTokenMap
& GetSortAttrTokenMap();
1086 const SvXMLTokenMap
& GetSortSortByAttrTokenMap();
1087 const SvXMLTokenMap
& GetDatabaseRangeSubTotalRulesElemTokenMap();
1088 const SvXMLTokenMap
& GetDatabaseRangeSubTotalRulesAttrTokenMap();
1089 const SvXMLTokenMap
& GetSubTotalRulesSortGroupsAttrTokenMap();
1090 const SvXMLTokenMap
& GetSubTotalRulesSubTotalRuleElemTokenMap();
1091 const SvXMLTokenMap
& GetSubTotalRulesSubTotalRuleAttrTokenMap();
1092 const SvXMLTokenMap
& GetSubTotalRuleSubTotalFieldAttrTokenMap();
1093 const SvXMLTokenMap
& GetDataPilotTablesElemTokenMap();
1094 const SvXMLTokenMap
& GetDataPilotTableAttrTokenMap();
1095 const SvXMLTokenMap
& GetDataPilotTableElemTokenMap();
1096 const SvXMLTokenMap
& GetDataPilotTableSourceServiceAttrTokenMap();
1097 const SvXMLTokenMap
& GetDataPilotGrandTotalAttrTokenMap();
1098 const SvXMLTokenMap
& GetDataPilotTableSourceCellRangeElemTokenMap();
1099 const SvXMLTokenMap
& GetDataPilotTableSourceCellRangeAttrTokenMap();
1100 const SvXMLTokenMap
& GetDataPilotFieldAttrTokenMap();
1101 const SvXMLTokenMap
& GetDataPilotFieldElemTokenMap();
1102 const SvXMLTokenMap
& GetDataPilotLevelAttrTokenMap();
1103 const SvXMLTokenMap
& GetDataPilotLevelElemTokenMap();
1104 const SvXMLTokenMap
& GetDataPilotSubTotalsElemTokenMap();
1105 const SvXMLTokenMap
& GetDataPilotSubTotalAttrTokenMap();
1106 const SvXMLTokenMap
& GetDataPilotMembersElemTokenMap();
1107 const SvXMLTokenMap
& GetDataPilotMemberAttrTokenMap();
1108 const SvXMLTokenMap
& GetConsolidationAttrTokenMap();
1109 const SvXMLTokenMap
& GetCellTextParaElemTokenMap();
1110 const SvXMLTokenMap
& GetCellTextSpanElemTokenMap();
1111 const SvXMLTokenMap
& GetCellTextSpanAttrTokenMap();
1112 const SvXMLTokenMap
& GetCellTextURLAttrTokenMap();
1113 const SvXMLTokenMap
& GetCellTextSAttrTokenMap();
1114 const SvXMLTokenMap
& GetDataStreamAttrTokenMap();
1116 void SetPostProcessData( sc::ImportPostProcessData
* p
);
1117 sc::ImportPostProcessData
* GetPostProcessData() { return mpPostProcessData
;}
1119 sc::PivotTableSources
& GetPivotTableSources();
1121 void AddNamedExpression(ScMyNamedExpression
* pMyNamedExpression
)
1123 if (!pMyNamedExpressions
)
1124 pMyNamedExpressions
= new ScMyNamedExpressions();
1125 pMyNamedExpressions
->push_back(pMyNamedExpression
);
1128 ScMyNamedExpressions
* GetNamedExpressions() { return pMyNamedExpressions
; }
1130 void AddNamedExpression(SCTAB nTab
, ScMyNamedExpression
* pNamedExp
);
1132 void AddLabelRange(const ScMyLabelRange
* pMyLabelRange
) {
1133 if (!pMyLabelRanges
)
1134 pMyLabelRanges
= new ScMyLabelRanges();
1135 pMyLabelRanges
->push_back(pMyLabelRange
); }
1136 ScMyLabelRanges
* GetLabelRanges() { return pMyLabelRanges
; }
1138 void AddValidation(const ScMyImportValidation
& rValidation
) {
1140 pValidations
= new ScMyImportValidations();
1141 pValidations
->push_back(rValidation
); }
1142 bool GetValidation(const OUString
& sName
, ScMyImportValidation
& aValidation
);
1144 ScMyImpDetectiveOpArray
* GetDetectiveOpArray();
1146 void SetRemoveLastChar(bool bValue
) { bRemoveLastChar
= bValue
; }
1147 bool GetRemoveLastChar() { return bRemoveLastChar
; }
1149 ScXMLChangeTrackingImportHelper
* GetChangeTrackingImportHelper();
1150 void AddViewContext(SvXMLImportContext
* pContext
) { aViewContextList
.push_back(pContext
); }
1151 void InsertStyles();
1153 void SetChangeTrackingViewSettings(const com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& rChangeProps
);
1154 virtual void SetViewSettings(const com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& aViewProps
) SAL_OVERRIDE
;
1155 virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& aConfigProps
) SAL_OVERRIDE
;
1157 void SetTableStyle(const OUString
& rValue
) { aTableStyles
.push_back(rValue
); }
1158 std::vector
<OUString
> GetTableStyle() { return aTableStyles
; }
1159 ScMyStylesImportHelper
* GetStylesImportHelper() { return pStylesImportHelper
; }
1160 sal_Int32
SetCurrencySymbol(const sal_Int32 nKey
, const OUString
& rCurrency
);
1161 bool IsCurrencySymbol(const sal_Int32 nNumberFormat
, const OUString
& sCurrencySymbol
, const OUString
& sBankSymbol
);
1162 void SetType(com::sun::star::uno::Reference
<com::sun::star::beans::XPropertySet
>& rProperties
,
1163 sal_Int32
& rNumberFormat
,
1164 const sal_Int16 nCellType
,
1165 const OUString
& rCurrency
);
1167 void ProgressBarIncrement(bool bEditCell
, sal_Int32 nInc
= 1);
1169 void SetNewCondFormatData() { mbHasNewCondFormatData
= true; }
1170 bool HasNewCondFormatData() { return mbHasNewCondFormatData
; }
1173 void AddStyleRange(const com::sun::star::table::CellRangeAddress
& rCellRange
);
1174 void SetStyleToRanges();
1176 void ExamineDefaultStyle();
1178 void SetStyleToRange(const ScRange
& rRange
, const OUString
* pStyleName
,
1179 const sal_Int16 nCellType
, const OUString
* pCurrency
);
1180 bool SetNullDateOnUnitConverter();
1181 XMLNumberFormatAttributesExportHelper
* GetNumberFormatAttributesExportHelper();
1182 ScMyStyleNumberFormats
* GetStyleNumberFormats();
1184 void SetStylesToRangesFinished();
1187 virtual void SAL_CALL
setTargetDocument( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>& xDoc
) throw(::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
1189 virtual void SAL_CALL
startDocument()
1190 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
1191 virtual void SAL_CALL
endDocument()
1192 throw(::com::sun::star::xml::sax::SAXException
,
1193 ::com::sun::star::uno::RuntimeException
,
1194 std::exception
) SAL_OVERRIDE
;
1196 virtual void DisposingModel() SAL_OVERRIDE
;
1199 * Use this class to manage solar mutex locking instead of calling
1200 * LockSolarMutex() and UnlockSolarMutex() directly.
1205 explicit MutexGuard(ScXMLImport
& rImport
);
1208 ScXMLImport
& mrImport
;
1210 void LockSolarMutex();
1211 void UnlockSolarMutex();
1213 sal_Int32
GetByteOffset();
1215 void SetRangeOverflowType(sal_uInt32 nType
);
1217 static sal_Int32
GetRangeType(const OUString
& sRangeType
);
1218 void SetNamedRanges();
1219 void SetSheetNamedRanges();
1220 void SetLabelRanges();
1221 void AddDefaultNote( const com::sun::star::table::CellAddress
& aCell
);
1222 void SetStringRefSyntaxIfMissing();
1224 /** Extracts the formula string, the formula grammar namespace URL, and a
1225 grammar enum value from the passed formula attribute value.
1228 (out-parameter) Returns the plain formula string with the leading
1229 equality sign if existing.
1232 (out-parameter) Returns the URL of the formula grammar namespace if
1233 the attribute value contains the prefix of an unknown namespace.
1236 (out-parameter) Returns the exact formula grammar if the formula
1237 is in a supported ODF format (e.g. FormulaGrammar::GRAM_PODF for
1238 ODF 1.0/1.1 formulas, or FormulaGrammar::GRAM_ODFF for ODF 1.2
1239 formulas a.k.a. OpenFormula). Returns the default storage grammar,
1240 if the attribute value does not contain a namespace prefix. Returns
1241 the special value FormulaGrammar::GRAM_EXTERNAL, if an unknown
1242 namespace could be extracted from the formula which will be
1243 contained in the parameter rFormulaNmsp then.
1246 The value of the processed formula attribute.
1248 @param bRestrictToExternalNmsp
1249 If set to true, only namespaces of external formula grammars will
1250 be recognized. Internal namespace prefixes (e.g. 'oooc:' or 'of:'
1251 will be considered to be part of the formula, e.g. an expression
1252 with range operator.
1254 void ExtractFormulaNamespaceGrammar(
1256 OUString
& rFormulaNmsp
,
1257 ::formula::FormulaGrammar::Grammar
& reGrammar
,
1258 const OUString
& rAttrValue
,
1259 bool bRestrictToExternalNmsp
= false ) const;
1261 bool IsFormulaErrorConstant( const OUString
& rStr
) const;
1263 ScEditEngineDefaulter
* GetEditEngine();
1264 const ScXMLEditAttributeMap
& GetEditAttributeMap() const;
1265 virtual void NotifyEmbeddedFontRead() SAL_OVERRIDE
;
1270 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */