1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef SC_XMLIMPRT_HXX 25 #define SC_XMLIMPRT_HXX 26 27 #include <rsc/rscsfx.hxx> 28 #include <xmloff/xmlictxt.hxx> 29 #include <xmloff/xmlimp.hxx> 30 #include <xmloff/xmltkmap.hxx> 31 #include <xmloff/xmlaustp.hxx> 32 #include <xmloff/xmlstyle.hxx> 33 #include <com/sun/star/frame/XModel.hpp> 34 #include <tools/time.hxx> 35 #include <com/sun/star/util/DateTime.hpp> 36 #include "xmlsubti.hxx" 37 #include "global.hxx" 38 #include "formula/grammar.hxx" 39 40 #include "xmlstyle.hxx" 41 #include "XMLDetectiveContext.hxx" 42 #include <com/sun/star/sheet/ValidationAlertStyle.hpp> 43 #include <com/sun/star/sheet/ValidationType.hpp> 44 #include <com/sun/star/sheet/ConditionOperator.hpp> 45 #include <com/sun/star/table/CellAddress.hpp> 46 #include <com/sun/star/beans/XPropertySet.hpp> 47 #include <com/sun/star/util/XNumberFormatTypes.hpp> 48 #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp> 49 50 #include <vector> 51 #include <hash_map> 52 53 class ScRangeList; 54 class ScMyStyleNumberFormats; 55 class XMLNumberFormatAttributesExportHelper; 56 57 enum ScXMLDocTokens 58 { 59 XML_TOK_DOC_FONTDECLS, 60 XML_TOK_DOC_STYLES, 61 XML_TOK_DOC_AUTOSTYLES, 62 XML_TOK_DOC_MASTERSTYLES, 63 XML_TOK_DOC_META, 64 XML_TOK_DOC_SCRIPTS, 65 XML_TOK_DOC_BODY, 66 XML_TOK_DOC_SETTINGS, 67 XML_TOK_OFFICE_END=XML_TOK_UNKNOWN 68 }; 69 70 enum ScXMLStylesTokens 71 { 72 XML_TOK_STYLES_STYLE 73 }; 74 75 enum ScXMLStylesAttrTokens 76 { 77 XML_TOK_STYLES_STYLE_NAME, 78 XML_TOK_STYLES_STYLE_FAMILY, 79 XML_TOK_STYLES_STYLE_PARENT_STYLE_NAME 80 }; 81 82 enum ScXMLStyleTokens 83 { 84 XML_TOK_STYLE_PROPERTIES 85 }; 86 87 enum ScXMLBodyTokens 88 { 89 XML_TOK_BODY_TRACKED_CHANGES, 90 XML_TOK_BODY_CALCULATION_SETTINGS, 91 XML_TOK_BODY_CONTENT_VALIDATIONS, 92 XML_TOK_BODY_LABEL_RANGES, 93 XML_TOK_BODY_TABLE, 94 XML_TOK_BODY_NAMED_EXPRESSIONS, 95 XML_TOK_BODY_DATABASE_RANGES, 96 XML_TOK_BODY_DATABASE_RANGE, 97 XML_TOK_BODY_DATA_PILOT_TABLES, 98 XML_TOK_BODY_CONSOLIDATION, 99 XML_TOK_BODY_DDE_LINKS 100 }; 101 102 enum ScXMLContentValidationsElemTokens 103 { 104 XML_TOK_CONTENT_VALIDATION 105 }; 106 107 enum ScXMLContentValidationElemTokens 108 { 109 XML_TOK_CONTENT_VALIDATION_ELEM_HELP_MESSAGE, 110 XML_TOK_CONTENT_VALIDATION_ELEM_ERROR_MESSAGE, 111 XML_TOK_CONTENT_VALIDATION_ELEM_ERROR_MACRO, 112 XML_TOK_CONTENT_VALIDATION_ELEM_EVENT_LISTENERS 113 }; 114 115 enum ScXMLContentValidationAttrTokens 116 { 117 XML_TOK_CONTENT_VALIDATION_NAME, 118 XML_TOK_CONTENT_VALIDATION_CONDITION, 119 XML_TOK_CONTENT_VALIDATION_BASE_CELL_ADDRESS, 120 XML_TOK_CONTENT_VALIDATION_ALLOW_EMPTY_CELL, 121 XML_TOK_CONTENT_VALIDATION_DISPLAY_LIST 122 }; 123 124 enum ScXMLContentValidationMessageElemTokens 125 { 126 XML_TOK_P 127 }; 128 129 enum ScXMLContentValidationHelpMessageAttrTokens 130 { 131 XML_TOK_HELP_MESSAGE_ATTR_TITLE, 132 XML_TOK_HELP_MESSAGE_ATTR_DISPLAY 133 }; 134 135 enum ScXMLContentValidationErrorMessageAttrTokens 136 { 137 XML_TOK_ERROR_MESSAGE_ATTR_TITLE, 138 XML_TOK_ERROR_MESSAGE_ATTR_DISPLAY, 139 XML_TOK_ERROR_MESSAGE_ATTR_MESSAGE_TYPE 140 }; 141 142 enum ScXMLContentValidationErrorMacroAttrTokens 143 { 144 XML_TOK_ERROR_MACRO_ATTR_NAME, 145 XML_TOK_ERROR_MACRO_ATTR_EXECUTE 146 }; 147 148 enum ScXMLLabelRangesElemTokens 149 { 150 XML_TOK_LABEL_RANGE_ELEM 151 }; 152 153 enum ScXMLLabelRangeAttrTokens 154 { 155 XML_TOK_LABEL_RANGE_ATTR_LABEL_RANGE, 156 XML_TOK_LABEL_RANGE_ATTR_DATA_RANGE, 157 XML_TOK_LABEL_RANGE_ATTR_ORIENTATION 158 }; 159 160 enum ScXMLTableTokens 161 { 162 XML_TOK_TABLE_COL_GROUP, 163 XML_TOK_TABLE_HEADER_COLS, 164 XML_TOK_TABLE_COLS, 165 XML_TOK_TABLE_COL, 166 XML_TOK_TABLE_ROW_GROUP, 167 XML_TOK_TABLE_HEADER_ROWS, 168 XML_TOK_TABLE_ROWS, 169 XML_TOK_TABLE_ROW, 170 XML_TOK_TABLE_SOURCE, 171 XML_TOK_TABLE_SCENARIO, 172 XML_TOK_TABLE_SHAPES, 173 XML_TOK_TABLE_FORMS, 174 XML_TOK_TABLE_NAMED_EXPRESSIONS, 175 XML_TOK_TABLE_EVENT_LISTENERS, 176 XML_TOK_TABLE_EVENT_LISTENERS_EXT 177 }; 178 179 enum ScXMLTableRowsTokens 180 { 181 XML_TOK_TABLE_ROWS_ROW_GROUP, 182 XML_TOK_TABLE_ROWS_HEADER_ROWS, 183 XML_TOK_TABLE_ROWS_ROWS, 184 XML_TOK_TABLE_ROWS_ROW 185 }; 186 187 enum ScXMLTableColsTokens 188 { 189 XML_TOK_TABLE_COLS_COL_GROUP, 190 XML_TOK_TABLE_COLS_HEADER_COLS, 191 XML_TOK_TABLE_COLS_COLS, 192 XML_TOK_TABLE_COLS_COL 193 }; 194 195 enum ScXMLTableAttrTokens 196 { 197 XML_TOK_TABLE_NAME, 198 XML_TOK_TABLE_STYLE_NAME, 199 XML_TOK_TABLE_PROTECTION, 200 XML_TOK_TABLE_PRINT_RANGES, 201 XML_TOK_TABLE_PASSWORD, 202 XML_TOK_TABLE_PRINT 203 }; 204 205 enum ScXMLTableScenarioAttrTokens 206 { 207 XML_TOK_TABLE_SCENARIO_ATTR_DISPLAY_BORDER, 208 XML_TOK_TABLE_SCENARIO_ATTR_BORDER_COLOR, 209 XML_TOK_TABLE_SCENARIO_ATTR_COPY_BACK, 210 XML_TOK_TABLE_SCENARIO_ATTR_COPY_STYLES, 211 XML_TOK_TABLE_SCENARIO_ATTR_COPY_FORMULAS, 212 XML_TOK_TABLE_SCENARIO_ATTR_IS_ACTIVE, 213 XML_TOK_TABLE_SCENARIO_ATTR_SCENARIO_RANGES, 214 XML_TOK_TABLE_SCENARIO_ATTR_COMMENT, 215 XML_TOK_TABLE_SCENARIO_ATTR_PROTECTED 216 }; 217 218 enum ScXMLTableColAttrTokens 219 { 220 XML_TOK_TABLE_COL_ATTR_STYLE_NAME, 221 XML_TOK_TABLE_COL_ATTR_REPEATED, 222 XML_TOK_TABLE_COL_ATTR_VISIBILITY, 223 XML_TOK_TABLE_COL_ATTR_DEFAULT_CELL_STYLE_NAME 224 }; 225 226 enum ScXMLTableRowTokens 227 { 228 XML_TOK_TABLE_ROW_CELL, 229 XML_TOK_TABLE_ROW_COVERED_CELL 230 }; 231 232 enum ScXMLTableRowAttrTokens 233 { 234 XML_TOK_TABLE_ROW_ATTR_STYLE_NAME, 235 XML_TOK_TABLE_ROW_ATTR_VISIBILITY, 236 XML_TOK_TABLE_ROW_ATTR_REPEATED, 237 XML_TOK_TABLE_ROW_ATTR_DEFAULT_CELL_STYLE_NAME 238 // XML_TOK_TABLE_ROW_ATTR_USE_OPTIMAL_HEIGHT 239 }; 240 241 enum ScXMLTableRowCellTokens 242 { 243 XML_TOK_TABLE_ROW_CELL_P, 244 XML_TOK_TABLE_ROW_CELL_TABLE, 245 XML_TOK_TABLE_ROW_CELL_ANNOTATION, 246 XML_TOK_TABLE_ROW_CELL_DETECTIVE, 247 XML_TOK_TABLE_ROW_CELL_CELL_RANGE_SOURCE 248 }; 249 250 enum ScXMLTableRowCellAttrTokens 251 { 252 XML_TOK_TABLE_ROW_CELL_ATTR_STYLE_NAME, 253 XML_TOK_TABLE_ROW_CELL_ATTR_CONTENT_VALIDATION_NAME, 254 XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_ROWS, 255 XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_COLS, 256 XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_MATRIX_COLS, 257 XML_TOK_TABLE_ROW_CELL_ATTR_SPANNED_MATRIX_ROWS, 258 XML_TOK_TABLE_ROW_CELL_ATTR_REPEATED, 259 XML_TOK_TABLE_ROW_CELL_ATTR_VALUE_TYPE, 260 XML_TOK_TABLE_ROW_CELL_ATTR_VALUE, 261 XML_TOK_TABLE_ROW_CELL_ATTR_DATE_VALUE, 262 XML_TOK_TABLE_ROW_CELL_ATTR_TIME_VALUE, 263 XML_TOK_TABLE_ROW_CELL_ATTR_STRING_VALUE, 264 XML_TOK_TABLE_ROW_CELL_ATTR_BOOLEAN_VALUE, 265 XML_TOK_TABLE_ROW_CELL_ATTR_FORMULA, 266 XML_TOK_TABLE_ROW_CELL_ATTR_CURRENCY 267 }; 268 269 enum ScXMLAnnotationAttrTokens 270 { 271 XML_TOK_TABLE_ANNOTATION_ATTR_AUTHOR, 272 XML_TOK_TABLE_ANNOTATION_ATTR_CREATE_DATE, 273 XML_TOK_TABLE_ANNOTATION_ATTR_CREATE_DATE_STRING, 274 XML_TOK_TABLE_ANNOTATION_ATTR_DISPLAY, 275 XML_TOK_TABLE_ANNOTATION_ATTR_X, 276 XML_TOK_TABLE_ANNOTATION_ATTR_Y 277 }; 278 279 enum ScXMLDetectiveElemTokens 280 { 281 XML_TOK_DETECTIVE_ELEM_HIGHLIGHTED, 282 XML_TOK_DETECTIVE_ELEM_OPERATION 283 }; 284 285 enum ScXMLDetectiveHighlightedAttrTokens 286 { 287 XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_CELL_RANGE, 288 XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_DIRECTION, 289 XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_CONTAINS_ERROR, 290 XML_TOK_DETECTIVE_HIGHLIGHTED_ATTR_MARKED_INVALID 291 }; 292 293 enum ScXMLDetectiveOperationAttrTokens 294 { 295 XML_TOK_DETECTIVE_OPERATION_ATTR_NAME, 296 XML_TOK_DETECTIVE_OPERATION_ATTR_INDEX 297 }; 298 299 enum ScXMLCellRangeSourceAttrTokens 300 { 301 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_NAME, 302 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_HREF, 303 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_FILTER_NAME, 304 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_FILTER_OPTIONS, 305 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_LAST_COLUMN, 306 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_LAST_ROW, 307 XML_TOK_TABLE_CELL_RANGE_SOURCE_ATTR_REFRESH_DELAY 308 }; 309 310 enum ScXMLNamedExpressionsTokens 311 { 312 XML_TOK_NAMED_EXPRESSIONS_NAMED_RANGE, 313 XML_TOK_NAMED_EXPRESSIONS_NAMED_EXPRESSION 314 }; 315 316 enum ScXMLNamedRangeAttrTokens 317 { 318 XML_TOK_NAMED_RANGE_ATTR_NAME, 319 XML_TOK_NAMED_RANGE_ATTR_CELL_RANGE_ADDRESS, 320 XML_TOK_NAMED_RANGE_ATTR_BASE_CELL_ADDRESS, 321 XML_TOK_NAMED_RANGE_ATTR_RANGE_USABLE_AS 322 }; 323 324 enum ScXMLNamedExpressionAttrTokens 325 { 326 XML_TOK_NAMED_EXPRESSION_ATTR_NAME, 327 XML_TOK_NAMED_EXPRESSION_ATTR_BASE_CELL_ADDRESS, 328 XML_TOK_NAMED_EXPRESSION_ATTR_EXPRESSION 329 }; 330 331 enum ScXMLDatabaseRangesTokens 332 { 333 XML_TOK_DATABASE_RANGE 334 }; 335 336 enum ScXMLDatabaseRangeTokens 337 { 338 XML_TOK_DATABASE_RANGE_SOURCE_SQL, 339 XML_TOK_DATABASE_RANGE_SOURCE_TABLE, 340 XML_TOK_DATABASE_RANGE_SOURCE_QUERY, 341 XML_TOK_FILTER, 342 XML_TOK_SORT, 343 XML_TOK_DATABASE_RANGE_SUBTOTAL_RULES 344 }; 345 346 enum ScXMLDatabaseRangeAttrTokens 347 { 348 XML_TOK_DATABASE_RANGE_ATTR_NAME, 349 XML_TOK_DATABASE_RANGE_ATTR_IS_SELECTION, 350 XML_TOK_DATABASE_RANGE_ATTR_ON_UPDATE_KEEP_STYLES, 351 XML_TOK_DATABASE_RANGE_ATTR_ON_UPDATE_KEEP_SIZE, 352 XML_TOK_DATABASE_RANGE_ATTR_HAS_PERSISTENT_DATA, 353 XML_TOK_DATABASE_RANGE_ATTR_ORIENTATION, 354 XML_TOK_DATABASE_RANGE_ATTR_CONTAINS_HEADER, 355 XML_TOK_DATABASE_RANGE_ATTR_DISPLAY_FILTER_BUTTONS, 356 XML_TOK_DATABASE_RANGE_ATTR_TARGET_RANGE_ADDRESS, 357 XML_TOK_DATABASE_RANGE_ATTR_REFRESH_DELAY 358 }; 359 360 enum ScXMLDatabaseRangeSourceSQLAttrTokens 361 { 362 XML_TOK_SOURCE_SQL_ATTR_DATABASE_NAME, 363 XML_TOK_SOURCE_SQL_ATTR_HREF, 364 XML_TOK_SOURCE_SQL_ATTR_CONNECTION_RESSOURCE, 365 XML_TOK_SOURCE_SQL_ATTR_SQL_STATEMENT, 366 XML_TOK_SOURCE_SQL_ATTR_PARSE_SQL_STATEMENT 367 }; 368 369 enum ScXMLDatabaseRangeSourceTableAttrTokens 370 { 371 XML_TOK_SOURCE_TABLE_ATTR_DATABASE_NAME, 372 XML_TOK_SOURCE_TABLE_ATTR_HREF, 373 XML_TOK_SOURCE_TABLE_ATTR_CONNECTION_RESSOURCE, 374 XML_TOK_SOURCE_TABLE_ATTR_TABLE_NAME 375 }; 376 377 enum ScXMLDatabaseRangeSourceQueryAttrTokens 378 { 379 XML_TOK_SOURCE_QUERY_ATTR_DATABASE_NAME, 380 XML_TOK_SOURCE_QUERY_ATTR_HREF, 381 XML_TOK_SOURCE_QUERY_ATTR_CONNECTION_RESSOURCE, 382 XML_TOK_SOURCE_QUERY_ATTR_QUERY_NAME 383 }; 384 385 enum ScXMLFilterTokens 386 { 387 XML_TOK_FILTER_AND, 388 XML_TOK_FILTER_OR, 389 XML_TOK_FILTER_CONDITION 390 }; 391 392 enum ScXMLFilterAttrTokens 393 { 394 XML_TOK_FILTER_ATTR_TARGET_RANGE_ADDRESS, 395 XML_TOK_FILTER_ATTR_CONDITION_SOURCE_RANGE_ADDRESS, 396 XML_TOK_FILTER_ATTR_CONDITION_SOURCE, 397 XML_TOK_FILTER_ATTR_DISPLAY_DUPLICATES 398 }; 399 400 enum ScXMLFilterConditionAttrTokens 401 { 402 XML_TOK_CONDITION_ATTR_FIELD_NUMBER, 403 XML_TOK_CONDITION_ATTR_CASE_SENSITIVE, 404 XML_TOK_CONDITION_ATTR_DATA_TYPE, 405 XML_TOK_CONDITION_ATTR_VALUE, 406 XML_TOK_CONDITION_ATTR_OPERATOR 407 }; 408 409 enum ScXMLSortTokens 410 { 411 XML_TOK_SORT_SORT_BY 412 }; 413 414 enum ScXMLSortAttrTokens 415 { 416 XML_TOK_SORT_ATTR_BIND_STYLES_TO_CONTENT, 417 XML_TOK_SORT_ATTR_TARGET_RANGE_ADDRESS, 418 XML_TOK_SORT_ATTR_CASE_SENSITIVE, 419 XML_TOK_SORT_ATTR_LANGUAGE, 420 XML_TOK_SORT_ATTR_COUNTRY, 421 XML_TOK_SORT_ATTR_ALGORITHM 422 }; 423 424 enum ScXMLSortSortByAttrTokens 425 { 426 XML_TOK_SORT_BY_ATTR_FIELD_NUMBER, 427 XML_TOK_SORT_BY_ATTR_DATA_TYPE, 428 XML_TOK_SORT_BY_ATTR_ORDER 429 }; 430 431 enum ScXMLDatabaseRangeSubTotalRulesTokens 432 { 433 XML_TOK_SUBTOTAL_RULES_SORT_GROUPS, 434 XML_TOK_SUBTOTAL_RULES_SUBTOTAL_RULE 435 }; 436 437 enum ScXMLDatabaseRangeSubTotalRulesAttrTokens 438 { 439 XML_TOK_SUBTOTAL_RULES_ATTR_BIND_STYLES_TO_CONTENT, 440 XML_TOK_SUBTOTAL_RULES_ATTR_CASE_SENSITIVE, 441 XML_TOK_SUBTOTAL_RULES_ATTR_PAGE_BREAKS_ON_GROUP_CHANGE 442 }; 443 444 enum ScXMLSubTotalRulesSortGroupsAttrTokens 445 { 446 XML_TOK_SORT_GROUPS_ATTR_DATA_TYPE, 447 XML_TOK_SORT_GROUPS_ATTR_ORDER 448 }; 449 450 enum ScXMLSubTotalRulesSubTotalRuleTokens 451 { 452 XML_TOK_SUBTOTAL_RULE_SUBTOTAL_FIELD 453 }; 454 455 enum ScXMLSubTotalRulesSubTotalRuleAttrTokens 456 { 457 XML_TOK_SUBTOTAL_RULE_ATTR_GROUP_BY_FIELD_NUMBER 458 }; 459 460 enum ScXMLSubTotalRuleSubTotalField 461 { 462 XML_TOK_SUBTOTAL_FIELD_ATTR_FIELD_NUMBER, 463 XML_TOK_SUBTOTAL_FIELD_ATTR_FUNCTION 464 }; 465 466 enum ScXMLDataPilotTablesElemTokens 467 { 468 XML_TOK_DATA_PILOT_TABLE 469 }; 470 471 enum ScXMLDataPilotTableAttrTokens 472 { 473 XML_TOK_DATA_PILOT_TABLE_ATTR_NAME, 474 XML_TOK_DATA_PILOT_TABLE_ATTR_APPLICATION_DATA, 475 XML_TOK_DATA_PILOT_TABLE_ATTR_GRAND_TOTAL, 476 XML_TOK_DATA_PILOT_TABLE_ATTR_IGNORE_EMPTY_ROWS, 477 XML_TOK_DATA_PILOT_TABLE_ATTR_IDENTIFY_CATEGORIES, 478 XML_TOK_DATA_PILOT_TABLE_ATTR_TARGET_RANGE_ADDRESS, 479 XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS, 480 XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON, 481 XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN 482 }; 483 484 enum ScXMLDataPilotTableElemTokens 485 { 486 XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL, 487 XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE, 488 XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL, 489 XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL_EXT, 490 XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_QUERY, 491 XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SERVICE, 492 XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE, 493 XML_TOK_DATA_PILOT_TABLE_ELEM_DATA_PILOT_FIELD 494 }; 495 496 enum ScXMLDataPilotTableSourceServiceAttrTokens 497 { 498 XML_TOK_SOURCE_SERVICE_ATTR_NAME, 499 XML_TOK_SOURCE_SERVICE_ATTR_SOURCE_NAME, 500 XML_TOK_SOURCE_SERVICE_ATTR_OBJECT_NAME, 501 XML_TOK_SOURCE_SERVICE_ATTR_USER_NAME, 502 XML_TOK_SOURCE_SERVICE_ATTR_PASSWORD 503 }; 504 505 enum ScXMLDataPilotGrandTotalAttrTokens 506 { 507 XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY, 508 XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION, 509 XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME, 510 XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME_EXT 511 }; 512 513 enum ScXMLDataPilotTableSourceCellRangeElemTokens 514 { 515 XML_TOK_SOURCE_CELL_RANGE_ELEM_FILTER 516 }; 517 518 enum ScXMLDataPilotTableSourceCellRangeAttrTokens 519 { 520 XML_TOK_SOURCE_CELL_RANGE_ATTR_CELL_RANGE_ADDRESS 521 }; 522 523 enum ScXMLDataPilotFieldAttrTokens 524 { 525 XML_TOK_DATA_PILOT_FIELD_ATTR_SOURCE_FIELD_NAME, 526 XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME, 527 XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME_EXT, 528 XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD, 529 XML_TOK_DATA_PILOT_FIELD_ATTR_FUNCTION, 530 XML_TOK_DATA_PILOT_FIELD_ATTR_ORIENTATION, 531 XML_TOK_DATA_PILOT_FIELD_ATTR_SELECTED_PAGE, 532 XML_TOK_DATA_PILOT_FIELD_ATTR_USED_HIERARCHY 533 }; 534 535 enum ScXMLDataPilotFieldElemTokens 536 { 537 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_LEVEL, 538 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_REFERENCE, 539 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_GROUPS 540 }; 541 542 enum ScXMLDataPilotLevelAttrTokens 543 { 544 XML_TOK_DATA_PILOT_LEVEL_ATTR_SHOW_EMPTY 545 }; 546 547 enum ScXMLDataPilotLevelElemTokens 548 { 549 XML_TOK_DATA_PILOT_LEVEL_ELEM_DATA_PILOT_SUBTOTALS, 550 XML_TOK_DATA_PILOT_LEVEL_ELEM_DATA_PILOT_MEMBERS, 551 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_DISPLAY_INFO, 552 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_SORT_INFO, 553 XML_TOK_DATA_PILOT_FIELD_ELEM_DATA_PILOT_LAYOUT_INFO 554 }; 555 556 enum ScXMLDataPilotSubTotalsElemTokens 557 { 558 XML_TOK_DATA_PILOT_SUBTOTALS_ELEM_DATA_PILOT_SUBTOTAL 559 }; 560 561 enum ScXMLDataPilotSubTotalAttrTokens 562 { 563 XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION, 564 XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME, 565 XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME_EXT 566 }; 567 568 enum ScXMLDataPilotMembersElemTokens 569 { 570 XML_TOK_DATA_PILOT_MEMBERS_ELEM_DATA_PILOT_MEMBER 571 }; 572 573 enum ScXMLDataPilotMemberAttrTokens 574 { 575 XML_TOK_DATA_PILOT_MEMBER_ATTR_NAME, 576 XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME, 577 XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME_EXT, 578 XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY, 579 XML_TOK_DATA_PILOT_MEMBER_ATTR_SHOW_DETAILS 580 }; 581 582 enum ScXMLConsolidationAttrTokens 583 { 584 XML_TOK_CONSOLIDATION_ATTR_FUNCTION, 585 XML_TOK_CONSOLIDATION_ATTR_SOURCE_RANGES, 586 XML_TOK_CONSOLIDATION_ATTR_TARGET_ADDRESS, 587 XML_TOK_CONSOLIDATION_ATTR_USE_LABEL, 588 XML_TOK_CONSOLIDATION_ATTR_LINK_TO_SOURCE 589 }; 590 591 592 class SvI18NMap; 593 class SvXMLTokenMap; 594 //class SvXMLImportItemMapper; 595 class SvXMLStyleContext; 596 class SfxItemSet; 597 class SvXMLNumFmtHelper; 598 class XMLShapeImportHelper; 599 class ScXMLChangeTrackingImportHelper; 600 class ScUnoGuard; 601 602 struct tScMyCellRange 603 { 604 sal_Int16 Sheet; 605 sal_Int32 StartColumn, EndColumn; 606 sal_Int32 StartRow, EndRow; 607 }; 608 609 struct ScMyNamedExpression 610 { 611 rtl::OUString sName; 612 rtl::OUString sContent; 613 rtl::OUString sContentNmsp; 614 rtl::OUString sBaseCellAddress; 615 rtl::OUString sRangeType; 616 formula::FormulaGrammar::Grammar eGrammar; 617 sal_Bool bIsExpression; 618 SCTAB nNameScope; 619 }; 620 621 typedef std::list<const ScMyNamedExpression*> ScMyNamedExpressions; 622 623 struct ScMyLabelRange 624 { 625 rtl::OUString sLabelRangeStr; 626 rtl::OUString sDataRangeStr; 627 sal_Bool bColumnOrientation; 628 }; 629 630 typedef std::list<const ScMyLabelRange*> ScMyLabelRanges; 631 632 struct ScMyImportValidation 633 { 634 rtl::OUString sName; 635 rtl::OUString sImputTitle; 636 rtl::OUString sImputMessage; 637 rtl::OUString sErrorTitle; 638 rtl::OUString sErrorMessage; 639 rtl::OUString sFormula1; 640 rtl::OUString sFormula2; 641 rtl::OUString sFormulaNmsp1; 642 rtl::OUString sFormulaNmsp2; 643 rtl::OUString sBaseCellAddress; // #b4974740# string is used directly 644 com::sun::star::sheet::ValidationAlertStyle aAlertStyle; 645 com::sun::star::sheet::ValidationType aValidationType; 646 com::sun::star::sheet::ConditionOperator aOperator; 647 formula::FormulaGrammar::Grammar eGrammar1; 648 formula::FormulaGrammar::Grammar eGrammar2; 649 sal_Int16 nShowList; 650 sal_Bool bShowErrorMessage; 651 sal_Bool bShowImputMessage; 652 sal_Bool bIgnoreBlanks; 653 }; 654 655 typedef std::vector<ScMyImportValidation> ScMyImportValidations; 656 typedef std::list<SvXMLImportContext*> ScMyViewContextList; 657 class ScMyStylesImportHelper; 658 659 class ScXMLImport: public SvXMLImport 660 { 661 typedef ::std::hash_map< ::rtl::OUString, sal_Int16, ::rtl::OUStringHash > CellTypeMap; 662 CellTypeMap aCellTypeMap; 663 664 ScDocument* pDoc; 665 ScXMLChangeTrackingImportHelper* pChangeTrackingImportHelper; 666 ScMyViewContextList aViewContextList; 667 ScMyStylesImportHelper* pStylesImportHelper; 668 rtl::OUString sNumberFormat; 669 rtl::OUString sLocale; 670 rtl::OUString sCellStyle; 671 rtl::OUString sStandardFormat; 672 rtl::OUString sType; 673 674 // SvXMLAutoStylePoolP *pScAutoStylePool; 675 UniReference < XMLPropertyHandlerFactory > xScPropHdlFactory; 676 UniReference < XMLPropertySetMapper > xCellStylesPropertySetMapper; 677 UniReference < XMLPropertySetMapper > xColumnStylesPropertySetMapper; 678 UniReference < XMLPropertySetMapper > xRowStylesPropertySetMapper; 679 UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper; 680 // SvXMLImportContextRef xStyles; 681 // SvXMLImportContextRef xAutoStyles; 682 683 // SvXMLImportItemMapper *pParaItemMapper;// paragraph item import 684 // SvI18NMap *pI18NMap; // name mapping for I18N 685 SvXMLTokenMap *pDocElemTokenMap; 686 SvXMLTokenMap *pStylesElemTokenMap; 687 SvXMLTokenMap *pStylesAttrTokenMap; 688 SvXMLTokenMap *pStyleElemTokenMap; 689 SvXMLTokenMap *pBodyElemTokenMap; 690 SvXMLTokenMap *pContentValidationsElemTokenMap; 691 SvXMLTokenMap *pContentValidationElemTokenMap; 692 SvXMLTokenMap *pContentValidationAttrTokenMap; 693 SvXMLTokenMap *pContentValidationMessageElemTokenMap; 694 SvXMLTokenMap *pContentValidationHelpMessageAttrTokenMap; 695 SvXMLTokenMap *pContentValidationErrorMessageAttrTokenMap; 696 SvXMLTokenMap *pContentValidationErrorMacroAttrTokenMap; 697 SvXMLTokenMap *pLabelRangesElemTokenMap; 698 SvXMLTokenMap *pLabelRangeAttrTokenMap; 699 SvXMLTokenMap *pTableElemTokenMap; 700 SvXMLTokenMap *pTableRowsElemTokenMap; 701 SvXMLTokenMap *pTableColsElemTokenMap; 702 SvXMLTokenMap *pTableScenarioAttrTokenMap; 703 SvXMLTokenMap *pTableAttrTokenMap; 704 SvXMLTokenMap *pTableColAttrTokenMap; 705 SvXMLTokenMap *pTableRowElemTokenMap; 706 SvXMLTokenMap *pTableRowAttrTokenMap; 707 SvXMLTokenMap *pTableRowCellElemTokenMap; 708 SvXMLTokenMap *pTableRowCellAttrTokenMap; 709 SvXMLTokenMap *pTableAnnotationAttrTokenMap; 710 SvXMLTokenMap *pDetectiveElemTokenMap; 711 SvXMLTokenMap *pDetectiveHighlightedAttrTokenMap; 712 SvXMLTokenMap *pDetectiveOperationAttrTokenMap; 713 SvXMLTokenMap *pTableCellRangeSourceAttrTokenMap; 714 SvXMLTokenMap *pNamedExpressionsElemTokenMap; 715 SvXMLTokenMap *pNamedRangeAttrTokenMap; 716 SvXMLTokenMap *pNamedExpressionAttrTokenMap; 717 SvXMLTokenMap *pDatabaseRangesElemTokenMap; 718 SvXMLTokenMap *pDatabaseRangeElemTokenMap; 719 SvXMLTokenMap *pDatabaseRangeAttrTokenMap; 720 SvXMLTokenMap *pDatabaseRangeSourceSQLAttrTokenMap; 721 SvXMLTokenMap *pDatabaseRangeSourceTableAttrTokenMap; 722 SvXMLTokenMap *pDatabaseRangeSourceQueryAttrTokenMap; 723 SvXMLTokenMap *pFilterElemTokenMap; 724 SvXMLTokenMap *pFilterAttrTokenMap; 725 SvXMLTokenMap *pFilterConditionAttrTokenMap; 726 SvXMLTokenMap *pSortElemTokenMap; 727 SvXMLTokenMap *pSortAttrTokenMap; 728 SvXMLTokenMap *pSortSortByAttrTokenMap; 729 SvXMLTokenMap *pDatabaseRangeSubTotalRulesElemTokenMap; 730 SvXMLTokenMap *pDatabaseRangeSubTotalRulesAttrTokenMap; 731 SvXMLTokenMap *pSubTotalRulesSortGroupsAttrTokenMap; 732 SvXMLTokenMap *pSubTotalRulesSubTotalRuleElemTokenMap; 733 SvXMLTokenMap *pSubTotalRulesSubTotalRuleAttrTokenMap; 734 SvXMLTokenMap *pSubTotalRuleSubTotalFieldAttrTokenMap; 735 SvXMLTokenMap *pDataPilotTablesElemTokenMap; 736 SvXMLTokenMap *pDataPilotTableAttrTokenMap; 737 SvXMLTokenMap *pDataPilotTableElemTokenMap; 738 SvXMLTokenMap *pDataPilotTableSourceServiceAttrTokenMap; 739 SvXMLTokenMap *pDataPilotGrandTotalAttrTokenMap; 740 SvXMLTokenMap *pDataPilotTableSourceCellRangeElemTokenMap; 741 SvXMLTokenMap *pDataPilotTableSourceCellRangeAttrTokenMap; 742 SvXMLTokenMap *pDataPilotFieldAttrTokenMap; 743 SvXMLTokenMap *pDataPilotFieldElemTokenMap; 744 SvXMLTokenMap *pDataPilotLevelAttrTokenMap; 745 SvXMLTokenMap *pDataPilotLevelElemTokenMap; 746 SvXMLTokenMap *pDataPilotSubTotalsElemTokenMap; 747 SvXMLTokenMap *pDataPilotSubTotalAttrTokenMap; 748 SvXMLTokenMap *pDataPilotMembersElemTokenMap; 749 SvXMLTokenMap *pDataPilotMemberAttrTokenMap; 750 SvXMLTokenMap *pConsolidationAttrTokenMap; 751 752 ScMyTables aTables; 753 754 ScMyNamedExpressions* pMyNamedExpressions; 755 ScMyLabelRanges* pMyLabelRanges; 756 ScMyImportValidations* pValidations; 757 ScMyImpDetectiveOpArray* pDetectiveOpArray; 758 ScUnoGuard* pScUnoGuard; 759 760 std::vector<rtl::OUString> aTableStyles; 761 XMLNumberFormatAttributesExportHelper* pNumberFormatAttributesExportHelper; 762 ScMyStyleNumberFormats* pStyleNumberFormats; 763 com::sun::star::uno::Reference <com::sun::star::util::XNumberFormats> xNumberFormats; 764 com::sun::star::uno::Reference <com::sun::star::util::XNumberFormatTypes> xNumberFormatTypes; 765 766 com::sun::star::uno::Reference <com::sun::star::sheet::XSheetCellRangeContainer> xSheetCellRanges; 767 768 rtl::OUString sEmpty; 769 rtl::OUString sPrevStyleName; 770 rtl::OUString sPrevCurrency; 771 sal_uInt32 nSolarMutexLocked; 772 sal_Int32 nProgressCount; 773 sal_uInt16 nStyleFamilyMask;// Mask of styles to load 774 sal_Int16 nPrevCellType; 775 sal_Bool bLoadDoc; // Load doc or styles only 776 sal_Bool bRemoveLastChar; 777 sal_Bool bNullDateSetted; 778 sal_Bool bSelfImportingXMLSet; 779 sal_Bool bLatinDefaultStyle; // latin-only number format in default style? 780 sal_Bool bFromWrapper; // called from ScDocShell / ScXMLImportWrapper? 781 782 783 protected: 784 785 // This method is called after the namespace map has been updated, but 786 // before a context for the current element has been pushed. 787 virtual SvXMLImportContext *CreateContext(sal_uInt16 nPrefix, 788 const ::rtl::OUString& rLocalName, 789 const ::com::sun::star::uno::Reference< 790 ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); 791 virtual XMLShapeImportHelper* CreateShapeImport(); 792 793 public: 794 // #110680# 795 ScXMLImport( 796 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, 797 const sal_uInt16 nImportFlag); 798 799 ~ScXMLImport() throw(); 800 801 // namespace office 802 // NB: in contrast to other CreateFooContexts, this particular one handles 803 // the root element (i.e. office:document-meta) 804 SvXMLImportContext *CreateMetaContext( 805 const ::rtl::OUString& rLocalName ); 806 SvXMLImportContext *CreateFontDeclsContext(const sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, 807 const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList); 808 SvXMLImportContext *CreateScriptContext( 809 const ::rtl::OUString& rLocalName ); 810 SvXMLImportContext *CreateStylesContext(const ::rtl::OUString& rLocalName, 811 const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList, sal_Bool bAutoStyles ); 812 // SvXMLImportContext *CreateUseStylesContext(const ::rtl::OUString& rLocalName , 813 // const ::com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList); 814 SvXMLImportContext *CreateBodyContext( 815 const ::rtl::OUString& rLocalName, 816 const ::com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList ); 817 818 virtual void SetStatistics( 819 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue> & i_rStats); 820 GetDocument()821 inline ScDocument* GetDocument() { return pDoc; } GetDocument() const822 inline const ScDocument* GetDocument() const { return pDoc; } 823 GetTables()824 ScMyTables& GetTables() { return aTables; } 825 GetStyleFamilyMask() const826 sal_uInt16 GetStyleFamilyMask() const { return nStyleFamilyMask; } IsStylesOnlyMode() const827 sal_Bool IsStylesOnlyMode() const { return !bLoadDoc; } 828 IsLatinDefaultStyle() const829 sal_Bool IsLatinDefaultStyle() const { return bLatinDefaultStyle; } 830 831 sal_Int16 GetCellType(const ::rtl::OUString& rStrValue) const; 832 833 // SvI18NMap& GetI18NMap() { return *pI18NMap; } 834 835 // inline const SvXMLImportItemMapper& GetParaItemMapper() const; 836 // SvXMLImportContext *CreateParaItemImportContext( sal_uInt16 nPrefix, 837 // const ::rtl::OUString& rLocalName, 838 // const ::com::sun::star::uno::Reference< 839 // ::com::sun::star::xml::sax::XAttributeList& xAttrList, 840 // SfxItemSet& rItemSet ); 841 GetCellStylesPropertySetMapper() const842 UniReference < XMLPropertySetMapper > GetCellStylesPropertySetMapper() const { return xCellStylesPropertySetMapper; } GetColumnStylesPropertySetMapper() const843 UniReference < XMLPropertySetMapper > GetColumnStylesPropertySetMapper() const { return xColumnStylesPropertySetMapper; } GetRowStylesPropertySetMapper() const844 UniReference < XMLPropertySetMapper > GetRowStylesPropertySetMapper() const { return xRowStylesPropertySetMapper; } GetTableStylesPropertySetMapper() const845 UniReference < XMLPropertySetMapper > GetTableStylesPropertySetMapper() const { return xTableStylesPropertySetMapper; } 846 // SvXMLImportContextRef GetAutoStyles() const { return xAutoStyles; } 847 // SvXMLImportContextRef GetStyles() const { return xStyles; } 848 849 const SvXMLTokenMap& GetDocElemTokenMap(); 850 //UNUSED2008-05 const SvXMLTokenMap& GetStylesElemTokenMap(); 851 //UNUSED2008-05 const SvXMLTokenMap& GetStylesAttrTokenMap(); 852 //UNUSED2008-05 const SvXMLTokenMap& GetStyleElemTokenMap(); 853 const SvXMLTokenMap& GetBodyElemTokenMap(); 854 const SvXMLTokenMap& GetContentValidationsElemTokenMap(); 855 const SvXMLTokenMap& GetContentValidationElemTokenMap(); 856 const SvXMLTokenMap& GetContentValidationAttrTokenMap(); 857 const SvXMLTokenMap& GetContentValidationMessageElemTokenMap(); 858 const SvXMLTokenMap& GetContentValidationHelpMessageAttrTokenMap(); 859 const SvXMLTokenMap& GetContentValidationErrorMessageAttrTokenMap(); 860 const SvXMLTokenMap& GetContentValidationErrorMacroAttrTokenMap(); 861 const SvXMLTokenMap& GetLabelRangesElemTokenMap(); 862 const SvXMLTokenMap& GetLabelRangeAttrTokenMap(); 863 const SvXMLTokenMap& GetTableElemTokenMap(); 864 const SvXMLTokenMap& GetTableRowsElemTokenMap(); 865 const SvXMLTokenMap& GetTableColsElemTokenMap(); 866 const SvXMLTokenMap& GetTableAttrTokenMap(); 867 const SvXMLTokenMap& GetTableScenarioAttrTokenMap(); 868 const SvXMLTokenMap& GetTableColAttrTokenMap(); 869 const SvXMLTokenMap& GetTableRowElemTokenMap(); 870 const SvXMLTokenMap& GetTableRowAttrTokenMap(); 871 const SvXMLTokenMap& GetTableRowCellElemTokenMap(); 872 const SvXMLTokenMap& GetTableRowCellAttrTokenMap(); 873 const SvXMLTokenMap& GetTableAnnotationAttrTokenMap(); 874 const SvXMLTokenMap& GetDetectiveElemTokenMap(); 875 const SvXMLTokenMap& GetDetectiveHighlightedAttrTokenMap(); 876 const SvXMLTokenMap& GetDetectiveOperationAttrTokenMap(); 877 const SvXMLTokenMap& GetTableCellRangeSourceAttrTokenMap(); 878 const SvXMLTokenMap& GetNamedExpressionsElemTokenMap(); 879 const SvXMLTokenMap& GetNamedRangeAttrTokenMap(); 880 const SvXMLTokenMap& GetNamedExpressionAttrTokenMap(); 881 const SvXMLTokenMap& GetDatabaseRangesElemTokenMap(); 882 const SvXMLTokenMap& GetDatabaseRangeElemTokenMap(); 883 const SvXMLTokenMap& GetDatabaseRangeAttrTokenMap(); 884 const SvXMLTokenMap& GetDatabaseRangeSourceSQLAttrTokenMap(); 885 const SvXMLTokenMap& GetDatabaseRangeSourceTableAttrTokenMap(); 886 const SvXMLTokenMap& GetDatabaseRangeSourceQueryAttrTokenMap(); 887 const SvXMLTokenMap& GetFilterElemTokenMap(); 888 const SvXMLTokenMap& GetFilterAttrTokenMap(); 889 const SvXMLTokenMap& GetFilterConditionAttrTokenMap(); 890 const SvXMLTokenMap& GetSortElemTokenMap(); 891 const SvXMLTokenMap& GetSortAttrTokenMap(); 892 const SvXMLTokenMap& GetSortSortByAttrTokenMap(); 893 const SvXMLTokenMap& GetDatabaseRangeSubTotalRulesElemTokenMap(); 894 const SvXMLTokenMap& GetDatabaseRangeSubTotalRulesAttrTokenMap(); 895 const SvXMLTokenMap& GetSubTotalRulesSortGroupsAttrTokenMap(); 896 const SvXMLTokenMap& GetSubTotalRulesSubTotalRuleElemTokenMap(); 897 const SvXMLTokenMap& GetSubTotalRulesSubTotalRuleAttrTokenMap(); 898 const SvXMLTokenMap& GetSubTotalRuleSubTotalFieldAttrTokenMap(); 899 const SvXMLTokenMap& GetDataPilotTablesElemTokenMap(); 900 const SvXMLTokenMap& GetDataPilotTableAttrTokenMap(); 901 const SvXMLTokenMap& GetDataPilotTableElemTokenMap(); 902 const SvXMLTokenMap& GetDataPilotTableSourceServiceAttrTokenMap(); 903 const SvXMLTokenMap& GetDataPilotGrandTotalAttrTokenMap(); 904 const SvXMLTokenMap& GetDataPilotTableSourceCellRangeElemTokenMap(); 905 const SvXMLTokenMap& GetDataPilotTableSourceCellRangeAttrTokenMap(); 906 const SvXMLTokenMap& GetDataPilotFieldAttrTokenMap(); 907 const SvXMLTokenMap& GetDataPilotFieldElemTokenMap(); 908 const SvXMLTokenMap& GetDataPilotLevelAttrTokenMap(); 909 const SvXMLTokenMap& GetDataPilotLevelElemTokenMap(); 910 const SvXMLTokenMap& GetDataPilotSubTotalsElemTokenMap(); 911 const SvXMLTokenMap& GetDataPilotSubTotalAttrTokenMap(); 912 const SvXMLTokenMap& GetDataPilotMembersElemTokenMap(); 913 const SvXMLTokenMap& GetDataPilotMemberAttrTokenMap(); 914 const SvXMLTokenMap& GetConsolidationAttrTokenMap(); 915 // const SvXMLTokenMap& GetTextPElemTokenMap(); 916 // const SvXMLTokenMap& GetTextPAttrTokenMap(); 917 // const SvXMLTokenMap& GetStyleStylesElemTokenMap(); 918 // const SvXMLTokenMap& GetTextListBlockAttrTokenMap(); 919 // const SvXMLTokenMap& GetTextListBlockElemTokenMap(); 920 AddNamedExpression(const ScMyNamedExpression * pMyNamedExpression)921 void AddNamedExpression(const ScMyNamedExpression* pMyNamedExpression) { 922 if (!pMyNamedExpressions) 923 pMyNamedExpressions = new ScMyNamedExpressions(); 924 pMyNamedExpressions->push_back(pMyNamedExpression); } GetNamedExpressions()925 ScMyNamedExpressions* GetNamedExpressions() { return pMyNamedExpressions; } 926 AddLabelRange(const ScMyLabelRange * pMyLabelRange)927 void AddLabelRange(const ScMyLabelRange* pMyLabelRange) { 928 if (!pMyLabelRanges) 929 pMyLabelRanges = new ScMyLabelRanges(); 930 pMyLabelRanges->push_back(pMyLabelRange); } GetLabelRanges()931 ScMyLabelRanges* GetLabelRanges() { return pMyLabelRanges; } 932 AddValidation(const ScMyImportValidation & rValidation)933 void AddValidation(const ScMyImportValidation& rValidation) { 934 if (!pValidations) 935 pValidations = new ScMyImportValidations(); 936 pValidations->push_back(rValidation); } 937 sal_Bool GetValidation(const rtl::OUString& sName, ScMyImportValidation& aValidation); 938 GetDetectiveOpArray()939 inline ScMyImpDetectiveOpArray* GetDetectiveOpArray() { 940 if (!pDetectiveOpArray) 941 pDetectiveOpArray = new ScMyImpDetectiveOpArray(); 942 return pDetectiveOpArray; } 943 SetRemoveLastChar(sal_Bool bValue)944 void SetRemoveLastChar(sal_Bool bValue) { bRemoveLastChar = bValue; } GetRemoveLastChar()945 sal_Bool GetRemoveLastChar() { return bRemoveLastChar; } 946 947 ScXMLChangeTrackingImportHelper* GetChangeTrackingImportHelper(); AddViewContext(SvXMLImportContext * pContext)948 void AddViewContext(SvXMLImportContext* pContext) { aViewContextList.push_back(pContext); } 949 void InsertStyles(); 950 951 void SetChangeTrackingViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rChangeProps); 952 virtual void SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps); 953 virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps); 954 SetTableStyle(const rtl::OUString & rValue)955 void SetTableStyle(const rtl::OUString& rValue) { aTableStyles.push_back(rValue); } GetTableStyle()956 std::vector<rtl::OUString> GetTableStyle() { return aTableStyles; } GetStylesImportHelper()957 ScMyStylesImportHelper* GetStylesImportHelper() { return pStylesImportHelper; } 958 sal_Int32 SetCurrencySymbol(const sal_Int32 nKey, const rtl::OUString& rCurrency); 959 sal_Bool IsCurrencySymbol(const sal_Int32 nNumberFormat, const rtl::OUString& sCurrencySymbol, const rtl::OUString& sBankSymbol); 960 void SetType(com::sun::star::uno::Reference <com::sun::star::beans::XPropertySet>& rProperties, 961 sal_Int32& rNumberFormat, 962 const sal_Int16 nCellType, 963 const rtl::OUString& rCurrency); 964 965 void ProgressBarIncrement(sal_Bool bEditCell, sal_Int32 nInc = 1); 966 967 private: 968 void AddStyleRange(const com::sun::star::table::CellRangeAddress& rCellRange); 969 void SetStyleToRanges(); 970 971 void ExamineDefaultStyle(); 972 public: 973 void SetStyleToRange(const ScRange& rRange, const rtl::OUString* pStyleName, 974 const sal_Int16 nCellType, const rtl::OUString* pCurrency); 975 sal_Bool SetNullDateOnUnitConverter(); 976 XMLNumberFormatAttributesExportHelper* GetNumberFormatAttributesExportHelper(); 977 ScMyStyleNumberFormats* GetStyleNumberFormats(); 978 979 void SetStylesToRangesFinished(); 980 981 // XImporter 982 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); 983 984 // XServiceInfo 985 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); 986 987 // ::com::sun::star::xml::sax::XDocumentHandler 988 virtual void SAL_CALL startDocument(void) 989 throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); 990 virtual void SAL_CALL endDocument(void) 991 throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException ); 992 993 virtual void DisposingModel(); 994 995 void LockSolarMutex(); 996 void UnlockSolarMutex(); 997 998 sal_Int32 GetByteOffset(); 999 1000 void SetRangeOverflowType(sal_uInt32 nType); 1001 1002 sal_Int32 GetRangeType(const rtl::OUString sRangeType) const; 1003 void SetNamedRanges(); 1004 void SetLabelRanges(); 1005 void AddDefaultNote( const com::sun::star::table::CellAddress& aCell ); 1006 1007 sal_Int32 GetVisibleSheet(); 1008 /** Extracts the formula string, the formula grammar namespace URL, and a 1009 grammar enum value from the passed formula attribute value. 1010 1011 @param rFormula 1012 (out-parameter) Returns the plain formula string with the leading 1013 equality sign if existing. 1014 1015 @param rFormulaNmsp 1016 (out-parameter) Returns the URL of the formula grammar namespace if 1017 the attribute value contains the prefix of an unknown namespace. 1018 1019 @param reGrammar 1020 (out-parameter) Returns the exact formula grammar if the formula 1021 is in a supported ODF format (e.g. FormulaGrammar::GRAM_PODF for 1022 ODF 1.0/1.1 formulas, or FormulaGrammar::GRAM_ODFF for ODF 1.2 1023 formulas a.k.a. OpenFormula). Returns the default storage grammar, 1024 if the attribute value does not contain a namespace prefix. Returns 1025 the special value FormulaGrammar::GRAM_EXTERNAL, if an unknown 1026 namespace could be extracted from the formula which will be 1027 contained in the parameter rFormulaNmsp then. 1028 1029 @param rAttrValue 1030 The value of the processed formula attribute. 1031 1032 @param bRestrictToExternalNmsp 1033 If set to sal_True, only namespaces of external formula grammars will 1034 be recognized. Internal namespace prefixes (e.g. 'oooc:' or 'of:' 1035 will be considered to be part of the formula, e.g. an expression 1036 with range operator. 1037 */ 1038 void ExtractFormulaNamespaceGrammar( 1039 ::rtl::OUString& rFormula, 1040 ::rtl::OUString& rFormulaNmsp, 1041 ::formula::FormulaGrammar::Grammar& reGrammar, 1042 const ::rtl::OUString& rAttrValue, 1043 bool bRestrictToExternalNmsp = false ) const; 1044 }; 1045 1046 #endif 1047 1048