Skip to content

Commit

Permalink
use clang-format, fix some small warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tfussell committed Dec 26, 2019
1 parent dbc0ddd commit a560756
Show file tree
Hide file tree
Showing 94 changed files with 4,430 additions and 2,823 deletions.
38 changes: 19 additions & 19 deletions include/xlnt/cell/cell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@ class XLNT_API cell
/// <summary>
/// Adds an internal hyperlink to this cell pointing to the given cell.
/// </summary>
void hyperlink(xlnt::cell target, const std::string& display = "");
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 = "");
void hyperlink(xlnt::range target, const std::string &display = "");

/// <summary>
/// Returns true if this cell has a hyperlink set.
Expand Down Expand Up @@ -431,10 +431,10 @@ class XLNT_API cell
/// </summary>
class style style();

/// <summary>
/// Returns a wrapper pointing to the named style applied to this cell.
/// </summary>
const class style style() const;
/// <summary>
/// Returns a wrapper pointing to the named style applied to this cell.
/// </summary>
const class style style() const;

/// <summary>
/// Sets the named style applied to this cell to a style named style_name.
Expand Down Expand Up @@ -670,43 +670,43 @@ XLNT_API bool operator==(const cell &cell, std::nullptr_t);
/// </summary>
XLNT_API std::ostream &operator<<(std::ostream &stream, const xlnt::cell &cell);

template<>
template <>
bool cell::value<bool>() const;

template<>
template <>
int cell::value<int>() const;

template<>
template <>
unsigned int cell::value<unsigned int>() const;

template<>
template <>
long long int cell::value<long long int>() const;

template<>
template <>
unsigned long long cell::value<unsigned long long int>() const;

template<>
template <>
float cell::value<float>() const;

template<>
template <>
double cell::value<double>() const;

template<>
template <>
date cell::value<date>() const;

template<>
template <>
time cell::value<time>() const;

template<>
template <>
datetime cell::value<datetime>() const;

template<>
template <>
timedelta cell::value<timedelta>() const;

template<>
template <>
std::string cell::value<std::string>() const;

template<>
template <>
rich_text cell::value<rich_text>() const;

} // namespace xlnt
11 changes: 5 additions & 6 deletions include/xlnt/cell/cell_reference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

#pragma once

#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/index_types.hpp>
#include <cstdint>
#include <string>
#include <utility>
#include <tuple>
#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/index_types.hpp>
#include <utility>

namespace xlnt {

Expand Down Expand Up @@ -256,8 +256,7 @@ class XLNT_API cell_reference

} // namespace xlnt

namespace std
{
namespace std {
template <>
struct hash<xlnt::cell_reference>
{
Expand All @@ -268,4 +267,4 @@ struct hash<xlnt::cell_reference>
return hash<std::uint64_t>{}(x.row() | static_cast<std::uint64_t>(x.column_index()) << 32);
}
};
}
} // namespace std
9 changes: 4 additions & 5 deletions include/xlnt/cell/hyperlink.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

#pragma once

#include <string>
#include <xlnt/xlnt_config.hpp>
#include <string>

namespace xlnt {

Expand All @@ -51,15 +51,15 @@ class XLNT_API hyperlink

bool has_display() const;
void display(const std::string &value);
const std::string& display() const;
const std::string &display() const;

bool has_tooltip() const;
void tooltip(const std::string &value);
const std::string& tooltip() const;
const std::string &tooltip() const;

bool has_location() const;
void location(const std::string &value);
const std::string& location() const;
const std::string &location() const;

private:
friend class cell;
Expand All @@ -68,4 +68,3 @@ class XLNT_API hyperlink
};

} // namespace xlnt

8 changes: 4 additions & 4 deletions include/xlnt/cell/rich_text.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include <vector>

#include <xlnt/xlnt_config.hpp>
#include <xlnt/cell/rich_text_run.hpp>
#include <xlnt/cell/phonetic_run.hpp>
#include <xlnt/cell/rich_text_run.hpp>
#include <xlnt/worksheet/phonetic_pr.hpp>

namespace xlnt {
Expand Down Expand Up @@ -124,12 +124,12 @@ class XLNT_API rich_text
/// <summary>
/// Sets the phonetic properties of this text to phonetic_props
/// </summary>
void phonetic_properties(const phonetic_pr& phonetic_props);
void phonetic_properties(const phonetic_pr &phonetic_props);

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

/// <summary>
/// Returns true if the runs that make up this text are identical to those in rhs.
Expand Down Expand Up @@ -163,7 +163,7 @@ class XLNT_API rich_text
class XLNT_API rich_text_hash
{
public:
std::size_t operator()(const rich_text& k) const
std::size_t operator()(const rich_text &k) const
{
std::size_t res = 0;

Expand Down
12 changes: 6 additions & 6 deletions include/xlnt/drawing/spreadsheet_drawing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@

#pragma once

#include <xlnt/xlnt_config.hpp>
#include <string>
#include <vector>
#include <xlnt/xlnt_config.hpp>

namespace xml {
class parser;
class serializer;
}
class parser;
class serializer;
} // namespace xml

namespace xlnt {

Expand All @@ -49,11 +49,11 @@ class XLNT_API spreadsheet_drawing
void serialize(xml::serializer &serializer);

std::vector<std::string> get_embed_ids();

private:
std::string serialized_value_;
std::string serialized_value_;
std::vector<std::string> embed_ids_;
};

} // namespace drawing
} // namespace xlnt

17 changes: 9 additions & 8 deletions include/xlnt/packaging/ext_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
namespace xml {
class parser;
class serializer;
}
} // namespace xml

namespace xlnt {

Expand All @@ -46,16 +46,16 @@ class XLNT_API ext_list
public:
struct ext
{
ext(xml::parser &parser, const std::string& ns);
ext(const uri& ID, const std::string& serialised);
void serialise(xml::serializer &serialiser, const std::string& ns);
ext(xml::parser &parser, const std::string &ns);
ext(const uri &ID, const std::string &serialised);
void serialise(xml::serializer &serialiser, const std::string &ns);

uri extension_ID_;
std::string serialised_value_;
};
ext_list() = default; // default ctor required by xlnt::optional
explicit ext_list(xml::parser &parser, const std::string& ns);
void serialize(xml::serializer &serialiser, const std::string& ns);
explicit ext_list(xml::parser &parser, const std::string &ns);
void serialize(xml::serializer &serialiser, const std::string &ns);

void add_extension(const uri &ID, const std::string &element);

Expand All @@ -65,12 +65,13 @@ class XLNT_API ext_list

const std::vector<ext> &extensions() const;

bool operator==(const ext_list& rhs) const;
bool operator==(const ext_list &rhs) const;

private:
std::vector<ext> extensions_;
};

inline bool operator==(const ext_list::ext& lhs, const ext_list::ext& rhs)
inline bool operator==(const ext_list::ext &lhs, const ext_list::ext &rhs)
{
return lhs.extension_ID_ == rhs.extension_ID_
&& lhs.serialised_value_ == rhs.serialised_value_;
Expand Down
2 changes: 1 addition & 1 deletion include/xlnt/packaging/relationship.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class XLNT_API relationship
/// <summary>
/// Returns a string of the form rId# that identifies the relationship.
/// </summary>
const std::string& id() const;
const std::string &id() const;

/// <summary>
/// Returns the type of this relationship.
Expand Down
2 changes: 1 addition & 1 deletion include/xlnt/packaging/uri.hpp
Original file line number Diff line number Diff line change
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>
const class path& path() const;
const class path &path() const;

/// <summary>
/// Returns true if this URI has a non-null query string section.
Expand Down
50 changes: 25 additions & 25 deletions include/xlnt/styles/alignment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class XLNT_API alignment

/// <summary>
/// Sets the indent size in number of spaces from the side of the cell. This will only
/// take effect when left or right horizontal alignment has also been set.
/// take effect when left or right horizontal alignment has also been set.
/// </summary>
alignment &indent(int indent_size);

Expand Down Expand Up @@ -134,34 +134,34 @@ class XLNT_API alignment
bool operator!=(const alignment &other) const;

private:
/// <summary>
/// Whether or not to shrink font size until it fits on one line
/// </summary>
bool shrink_to_fit_ = false;

/// <summary>
/// Whether or not to wrap text to the next line
/// </summary>
bool wrap_text_ = false;

/// <summary>
/// The indent in number of spaces from the side
/// </summary>
optional<int> indent_;

/// <summary>
/// The text roation in degrees
/// </summary>
/// <summary>
/// Whether or not to shrink font size until it fits on one line
/// </summary>
bool shrink_to_fit_ = false;

/// <summary>
/// Whether or not to wrap text to the next line
/// </summary>
bool wrap_text_ = false;

/// <summary>
/// The indent in number of spaces from the side
/// </summary>
optional<int> indent_;

/// <summary>
/// The text roation in degrees
/// </summary>
optional<int> text_rotation_;

/// <summary>
/// The horizontal alignment
/// </summary>
/// <summary>
/// The horizontal alignment
/// </summary>
optional<horizontal_alignment> horizontal_;

/// <summary>
/// The vertical alignment
/// </summary>
/// <summary>
/// The vertical alignment
/// </summary>
optional<vertical_alignment> vertical_;
};

Expand Down
Loading

0 comments on commit a560756

Please sign in to comment.