mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
get relationship strings up to spec, closes #106
This commit is contained in:
parent
44b11d342c
commit
3acd06b857
|
@ -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)
|
||||
|
|
|
@ -101,7 +101,6 @@ struct value_traits<xlnt::relationship_type>
|
|||
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<xlnt::relationship_type>
|
|||
};
|
||||
|
||||
// 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<xlnt::relationship_type>
|
|||
}
|
||||
}
|
||||
|
||||
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<xlnt::vertical_alignment>
|
|||
}
|
||||
}
|
||||
|
||||
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<xlnt::horizontal_alignment>
|
|||
}
|
||||
}
|
||||
|
||||
default_case(horizontal_alignment::none);
|
||||
default_case(horizontal_alignment::general);
|
||||
}
|
||||
|
||||
static std::string serialize(xlnt::horizontal_alignment alignment, const serializer &)
|
||||
|
|
Loading…
Reference in New Issue
Block a user