Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
j2doll committed Aug 10, 2018
1 parent 6d177ef commit 370a217
Show file tree
Hide file tree
Showing 160 changed files with 3,516 additions and 1,430 deletions.
36 changes: 24 additions & 12 deletions xlnt/include/xlnt/cell/cell.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 Thomas Fussell
// Copyright (c) 2014-2018 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -47,6 +47,8 @@ class font;
class format;
class number_format;
class protection;
class range;
class relationship;
class style;
class workbook;
class worksheet;
Expand Down Expand Up @@ -238,6 +240,11 @@ class XLNT_API cell
/// </summary>
column_t column() const;

/// <summary>
/// Returns the numeric index (A == 1) of the column of this cell.
/// </summary>
column_t::index_t column_index() const;

/// <summary>
/// Returns the row of this cell.
/// </summary>
Expand All @@ -251,25 +258,25 @@ class XLNT_API cell
// hyperlink

/// <summary>
/// Returns the URL of this cell's hyperlink.
/// Returns the relationship of this cell's hyperlink.
/// </summary>
std::string hyperlink() const;

/// <summary>
/// Adds a hyperlink to this cell pointing to the URL of the given value.
/// </summary>
void hyperlink(const std::string &url);
class hyperlink hyperlink() const;

/// <summary>
/// Adds a hyperlink to this cell pointing to the URI of the given value and sets
/// the text value of the cell to the given parameter.
/// </summary>
void hyperlink(const std::string &url, const std::string &display);
void hyperlink(const std::string &url, const std::string &display = "");

/// <summary>
/// Adds an internal hyperlink to this cell pointing to the given cell.
/// </summary>
void hyperlink(xlnt::cell target);
void hyperlink(xlnt::cell target, const std::string& display = "");

/// <summary>
/// Adds an internal hyperlink to this cell pointing to the given range.
/// </summary>
void hyperlink(xlnt::range target, const std::string& display = "");

/// <summary>
/// Returns true if this cell has a hyperlink set.
Expand Down Expand Up @@ -601,9 +608,9 @@ class XLNT_API cell
bool operator==(const cell &comparand) const;

/// <summary>
/// Returns true if this cell is uninitialized.
/// Returns false if this cell the same cell as comparand (compared by reference).
/// </summary>
bool operator==(std::nullptr_t) const;
bool operator!=(const cell &comparand) const;

private:
friend class style;
Expand Down Expand Up @@ -639,6 +646,11 @@ class XLNT_API cell
/// </summary>
XLNT_API bool operator==(std::nullptr_t, const cell &cell);

/// <summary>
/// Returns true if this cell is uninitialized.
/// </summary>
XLNT_API bool operator==(const cell &cell, std::nullptr_t);

/// <summary>
/// Convenience function for writing cell to an ostream.
/// Uses cell::to_string() internally.
Expand Down
2 changes: 1 addition & 1 deletion xlnt/include/xlnt/cell/cell_reference.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 Thomas Fussell
// Copyright (c) 2014-2018 Thomas Fussell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion xlnt/include/xlnt/cell/cell_type.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 Thomas Fussell
// Copyright (c) 2014-2018 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
2 changes: 1 addition & 1 deletion xlnt/include/xlnt/cell/comment.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 Thomas Fussell
// Copyright (c) 2014-2018 Thomas Fussell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion xlnt/include/xlnt/cell/index_types.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 Thomas Fussell
// Copyright (c) 2014-2018 Thomas Fussell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 29 additions & 3 deletions xlnt/include/xlnt/cell/rich_text.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2016-2017 Thomas Fussell
// Copyright (c) 2016-2018 Thomas Fussell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -48,6 +48,11 @@ class XLNT_API rich_text
/// </summary>
rich_text(const std::string &plain_text);

/// <summary>
/// Constructs a rich text object from other
/// </summary>
rich_text(const rich_text &other);

/// <summary>
/// Constructs a rich text object with the given text and font.
/// </summary>
Expand All @@ -67,7 +72,7 @@ class XLNT_API rich_text
/// Clears any runs in this text and adds a single run with default formatting and
/// the given string as its textual content.
/// </summary>
void plain_text(const std::string &s);
void plain_text(const std::string &s, bool preserve_space);

/// <summary>
/// Combines the textual content of each text run in order and returns the result.
Expand All @@ -89,6 +94,11 @@ class XLNT_API rich_text
/// </summary>
void add_run(const rich_text_run &t);

/// <summary>
/// Copies rich text object from other
/// </summary>
rich_text& operator=(const rich_text &rhs);

/// <summary>
/// Returns true if the runs that make up this text are identical to those in rhs.
/// </summary>
Expand All @@ -97,7 +107,7 @@ class XLNT_API rich_text
/// <summary>
/// Returns true if the runs that make up this text are identical to those in rhs.
/// </summary>
bool operator!=(const rich_text &rhs) const;
bool operator!=(const rich_text &rhs) const;

/// <summary>
/// Returns true if this text has a single unformatted run with text equal to rhs.
Expand All @@ -116,4 +126,20 @@ class XLNT_API rich_text
std::vector<rich_text_run> runs_;
};

class XLNT_API rich_text_hash
{
public:
std::size_t operator()(const rich_text& k) const
{
std::size_t res = 0;

for (auto r : k.runs())
{
res ^= std::hash<std::string>()(r.first);
}

return res;
}
};

} // namespace xlnt
5 changes: 3 additions & 2 deletions xlnt/include/xlnt/cell/rich_text_run.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2016-2017 Thomas Fussell
// Copyright (c) 2016-2018 Thomas Fussell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -34,10 +34,11 @@ namespace xlnt {
/// <summary>
/// Typedef a rich_text_run as a pair of string and optional font.
/// </summary>
struct rich_text_run
struct XLNT_API rich_text_run
{
std::string first;
optional<font> second;
bool preserve_space;

bool operator==(const rich_text_run &other) const;

Expand Down
4 changes: 3 additions & 1 deletion xlnt/include/xlnt/packaging/manifest.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 Thomas Fussell
// Copyright (c) 2014-2018 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -172,6 +172,8 @@ class XLNT_API manifest
/// </summary>
void unregister_override_type(const path &part);

bool operator==(const manifest &other) const;

private:
/// <summary>
/// Returns the lowest rId for the given part that hasn't already been registered.
Expand Down
8 changes: 4 additions & 4 deletions xlnt/include/xlnt/packaging/relationship.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 Thomas Fussell
// Copyright (c) 2014-2018 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -115,7 +115,7 @@ class XLNT_API relationship
/// <summary>
/// Returns a string of the form rId# that identifies the relationship.
/// </summary>
std::string id() const;
const std::string& id() const;

/// <summary>
/// Returns the type of this relationship.
Expand All @@ -130,12 +130,12 @@ class XLNT_API relationship
/// <summary>
/// Returns the URI of the package part this relationship points to.
/// </summary>
uri source() const;
const uri &source() const;

/// <summary>
/// Returns the URI of the package part this relationship points to.
/// </summary>
uri target() const;
const uri &target() const;

/// <summary>
/// Returns true if and only if rhs is equal to this relationship.
Expand Down
4 changes: 2 additions & 2 deletions xlnt/include/xlnt/packaging/uri.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 Thomas Fussell
// Copyright (c) 2014-2018 Thomas Fussell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -123,7 +123,7 @@ class XLNT_API uri
/// Returns the path of this URI.
/// E.g. the path of http://example.com/document is "/document"
/// </summary>
class path path() const;
const class path& path() const;

/// <summary>
/// Returns true if this URI has a non-null query string section.
Expand Down
2 changes: 1 addition & 1 deletion xlnt/include/xlnt/styles/alignment.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 Thomas Fussell
// Copyright (c) 2014-2018 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
2 changes: 1 addition & 1 deletion xlnt/include/xlnt/styles/border.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2017 Thomas Fussell
// Copyright (c) 2014-2018 Thomas Fussell
// Copyright (c) 2010-2015 openpyxl
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Loading

0 comments on commit 370a217

Please sign in to comment.