diff --git a/source/detail/custom_value_traits.cpp b/source/detail/custom_value_traits.cpp index 928097c7..ac59dd02 100644 --- a/source/detail/custom_value_traits.cpp +++ b/source/detail/custom_value_traits.cpp @@ -58,53 +58,52 @@ std::string to_string(relationship_type t) return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"; case relationship_type::vml_drawing: return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing"; - case relationship_type::unknown: - return "unknown"; case relationship_type::custom_properties: return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties"; case relationship_type::printer_settings: - return "printer-settings"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings"; case relationship_type::connections: - return "connections"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections"; case relationship_type::custom_property: - return "custom-property"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customProperty"; case relationship_type::custom_xml_mappings: - return "custom-xml-mappings"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlMappings"; case relationship_type::dialogsheet: - return "dialogsheet"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet"; case relationship_type::drawings: - return "drawings"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"; case relationship_type::external_workbook_references: - return "external-workbook-references"; - case relationship_type::metadata: - return "metadata"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath"; case relationship_type::pivot_table: - return "pivot-table"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable"; case relationship_type::pivot_table_cache_definition: - return "pivot-table-cache-definition"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition"; case relationship_type::pivot_table_cache_records: - return "pivot-table-cache-records"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords"; case relationship_type::query_table: - return "query-table"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/queryTable"; case relationship_type::shared_workbook_revision_headers: - return "shared-workbook-revision-headers"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionHeaders"; case relationship_type::shared_workbook: - return "shared-workbook"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedWorkbook"; case relationship_type::revision_log: - return "revision-log"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionLog"; case relationship_type::shared_workbook_user_data: - return "shared-workbook-user-data"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/usernames"; case relationship_type::single_cell_table_definitions: - return "single-cell-table-definitions"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableSingleCells"; case relationship_type::table_definition: - return "table-definition"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"; case relationship_type::volatile_dependencies: - return "volatile-dependencies"; + return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/volatileDependencies"; case relationship_type::image: return "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"; + case relationship_type::unknown: +#ifndef __clang__ + default: +#endif + return "unknown"; } - - default_case("unknown"); } std::string to_string(pattern_fill_type fill_type) diff --git a/source/detail/custom_value_traits.hpp b/source/detail/custom_value_traits.hpp index b3f4d5f6..a5245ee5 100644 --- a/source/detail/custom_value_traits.hpp +++ b/source/detail/custom_value_traits.hpp @@ -101,7 +101,6 @@ struct value_traits relationship_type::dialogsheet, relationship_type::drawings, relationship_type::external_workbook_references, - relationship_type::metadata, relationship_type::pivot_table, relationship_type::pivot_table_cache_definition, relationship_type::pivot_table_cache_records, @@ -125,8 +124,8 @@ struct value_traits }; // Core properties relationships can have two different type strings - if (relationship_type_string - == "http://schemas.openxmlformats.org/officedocument/2006/relationships/metadata/core-properties") + if (relationship_type_string == "http://schemas.openxmlformats.org/" + "officedocument/2006/relationships/metadata/core-properties") { return relationship_type::core_properties; } @@ -139,7 +138,9 @@ struct value_traits } } - default_case(relationship_type::unknown); + // ECMA 376-4 Part 1 Section 9.1.7 says consumers shall not fail to load + // a document with unknown relationships. + return relationship_type::unknown; } static std::string serialize(xlnt::relationship_type type, const serializer &) @@ -292,7 +293,7 @@ struct value_traits } } - default_case(vertical_alignment::none); + default_case(vertical_alignment::top); } static std::string serialize (xlnt::vertical_alignment alignment, const serializer &) @@ -328,7 +329,7 @@ struct value_traits } } - default_case(horizontal_alignment::none); + default_case(horizontal_alignment::general); } static std::string serialize(xlnt::horizontal_alignment alignment, const serializer &)