From d14f8c2e5f515780a47ce22b4ae6d865a81631b2 Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Wed, 14 Jun 2017 15:44:19 -0400 Subject: [PATCH 1/3] fix canonicalization of relationship chains when the last link is absolute --- source/packaging/manifest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/packaging/manifest.cpp b/source/packaging/manifest.cpp index 13e8590d..64aeaa67 100644 --- a/source/packaging/manifest.cpp +++ b/source/packaging/manifest.cpp @@ -39,6 +39,11 @@ void manifest::clear() path manifest::canonicalize(const std::vector &rels) const { + if (rels.back().target().path().is_absolute()) + { + return rels.back().target().path().relative_to(path("/")); + } + xlnt::path relative; for (auto component : rels) From cae6276b23cee096e033a2f013674e32614190cb Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Wed, 14 Jun 2017 15:45:01 -0400 Subject: [PATCH 2/3] prevent exception from being thrown when a view doesn't contain window attributes --- source/detail/serialization/xlsx_consumer.cpp | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/source/detail/serialization/xlsx_consumer.cpp b/source/detail/serialization/xlsx_consumer.cpp index b356dcd2..41aee10e 100644 --- a/source/detail/serialization/xlsx_consumer.cpp +++ b/source/detail/serialization/xlsx_consumer.cpp @@ -529,10 +529,26 @@ void xlsx_consumer::read_office_document(const std::string &content_type) // CT_ "showHorizontalScroll", "showSheetTabs", "showVerticalScroll"}); workbook_view view; - view.x_window = parser().attribute("xWindow"); - view.y_window = parser().attribute("yWindow"); - view.window_width = parser().attribute("windowWidth"); - view.window_height = parser().attribute("windowHeight"); + + if (parser().attribute_present("xWindow")) + { + view.x_window = parser().attribute("xWindow"); + } + + if (parser().attribute_present("yWindow")) + { + view.y_window = parser().attribute("yWindow"); + } + + if (parser().attribute_present("windowWidth")) + { + view.window_width = parser().attribute("windowWidth"); + } + + if (parser().attribute_present("windowHeight")) + { + view.window_height = parser().attribute("windowHeight"); + } if (parser().attribute_present("tabRatio")) { From 15492bdcc4a12cf85c17de3f931619be2655adac Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Wed, 14 Jun 2017 15:56:48 -0400 Subject: [PATCH 3/3] remove ambiguous wording about project status [ci skip] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 62f14399..603f431b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://opensource.org/licenses/MIT) ## Introduction -xlnt is a modern C++ library for manipulating spreadsheets in memory and reading/writing them from/to XLSX files as described in [ECMA 376 4th edition](http://www.ecma-international.org/publications/standards/Ecma-376.htm). xlnt is currently under active feature development and is on track for the version 1.0 release in the next few weeks. Until then, the API could have significant changes. For a high-level summary of what you can do with this library, see [the feature list](https://tfussell.gitbooks.io/xlnt/content/docs/introduction/Features.html). +xlnt is a modern C++ library for manipulating spreadsheets in memory and reading/writing them from/to XLSX files as described in [ECMA 376 4th edition](http://www.ecma-international.org/publications/standards/Ecma-376.htm). The first public release of xlnt version 1.0 was on May 10th, 2017. Current work is focused on increasing compatibility, improving performance, and brainstorming future development goals. For a high-level summary of what you can do with this library, see [the feature list](https://tfussell.gitbooks.io/xlnt/content/docs/introduction/Features.html). Contributions are welcome in the form of pull requests or discussions on [the repository's Issues page](https://github.com/tfussell/xlnt/issues). ## Example @@ -29,7 +29,7 @@ int main() wb.save("example.xlsx"); return 0; } -// compile with -std=c++14 -Ixlnt/include -Lxlnt/lib -lxlnt +// compile with -std=c++14 -Ixlnt/include -lxlnt ``` ## Documentation