Skip to content

Commit

Permalink
clang-format all source files, fix broken test helpers--lots of clean…
Browse files Browse the repository at this point in the history
…up necessary as a result [ci skip]
  • Loading branch information
tfussell committed Dec 24, 2016
1 parent 6c32563 commit c8f2ca2
Show file tree
Hide file tree
Showing 59 changed files with 4,677 additions and 4,392 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Expand Up @@ -27,7 +27,7 @@ BraceWrapping:
BeforeElse: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
ColumnLimit: 120
ColumnLimit: 0
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Cpp11BracedListStyle: true
DerivePointerAlignment: false
Expand Down
3 changes: 3 additions & 0 deletions include/xlnt/cell/cell.hpp
Expand Up @@ -469,6 +469,9 @@ class XLNT_API cell
/// </summary>
void comment(const class comment &new_comment);

double width() const;
double height() const;

// operators

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion include/xlnt/styles/format.hpp
Expand Up @@ -37,6 +37,7 @@ class fill;
class font;
class number_format;
class protection;
class style;

namespace detail {

Expand Down Expand Up @@ -208,7 +209,7 @@ class XLNT_API format
/// <summary>
///
/// </summary>
format style(const xlnt::style &new_style);
format style(const class style &new_style);

/// <summary>
///
Expand Down
1 change: 1 addition & 0 deletions include/xlnt/styles/style.hpp
Expand Up @@ -28,6 +28,7 @@
#include <string>

#include <xlnt/xlnt_config.hpp>
#include <xlnt/utils/optional.hpp>

namespace xlnt {

Expand Down
37 changes: 37 additions & 0 deletions include/xlnt/workbook/calculation_properties.hpp
@@ -0,0 +1,37 @@
// Copyright (c) 2016 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
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE
//
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file

#pragma once

#include <xlnt/xlnt_config.hpp>

namespace xlnt {

/// <summary>
///
/// </summary>
class XLNT_API calculation_properties
{
};

} // namespace xlnt
22 changes: 20 additions & 2 deletions include/xlnt/workbook/workbook.hpp
Expand Up @@ -41,6 +41,7 @@ enum class relationship_type;

class alignment;
class border;
class calculation_properties;
class cell;
class cell_style;
class color;
Expand Down Expand Up @@ -633,14 +634,31 @@ class XLNT_API workbook
/// <summary>
///
/// </summary>
void thumbnail(
const std::vector<std::uint8_t> &thumbnail, const std::string &extension, const std::string &content_type);
void thumbnail(const std::vector<std::uint8_t> &thumbnail,
const std::string &extension, const std::string &content_type);

/// <summary>
///
/// </summary>
const std::vector<std::uint8_t> &thumbnail() const;

// calculation properties

/// <summary>
///
/// </summary>
bool has_calculation_properties() const;

/// <summary>
///
/// </summary>
class calculation_properties calculation_properties() const;

/// <summary>
///
/// </summary>
void calculation_properties(const class calculation_properties &props);

// operators

/// <summary>
Expand Down
82 changes: 60 additions & 22 deletions include/xlnt/worksheet/worksheet.hpp
Expand Up @@ -73,96 +73,99 @@ class XLNT_API worksheet
{
public:
/// <summary>
///
/// Iterate over a non-const worksheet with an iterator of this type.
/// </summary>
using iterator = range_iterator;

/// <summary>
///
/// Iterate over a non-const worksheet with an iterator of this type.
/// </summary>
using const_iterator = const_range_iterator;

/// <summary>
///
/// Iterate in reverse over a non-const worksheet with an iterator of this type.
/// </summary>
using reverse_iterator = std::reverse_iterator<iterator>;

/// <summary>
///
/// Iterate in reverse order over a const worksheet with an iterator of this type.
/// </summary>
using const_reverse_iterator = std::reverse_iterator<const_iterator>;

/// <summary>
///
/// Construct a null worksheet. No methods should be called on such a worksheet.
/// </summary>
worksheet();

/// <summary>
///
/// Copy constructor. This worksheet will point to the same memory as rhs's worksheet.
/// </summary>
worksheet(const worksheet &rhs);

/// <summary>
///
/// Returns a reference to the workbook this worksheet is owned by.
/// </summary>
class workbook &workbook();

/// <summary>
///
/// Returns a reference to the workbook this worksheet is owned by.
/// </summary>
const class workbook &workbook() const;

/// <summary>
///
/// Deletes data held in the worksheet that does not affect the internal data or display.
/// For example, unreference styles and empty cells will be removed.
/// </summary>
void garbage_collect();

// identification

/// <summary>
///
/// Returns the unique numeric identifier of this worksheet. This will sometimes but not necessarily
/// be the index of the worksheet in the workbook.
/// </summary>
std::size_t id() const;

/// <summary>
///
/// Set the unique numeric identifier. The id defaults to the lowest unused id in the workbook
/// so this should not be called without a good reason.
/// </summary>
void id(std::size_t id);

/// <summary>
///
/// Returns the title of this sheet.
/// </summary>
std::string title() const;

/// <summary>
///
/// Sets the title of this sheet.
/// </summary>
void title(const std::string &title);

// freeze panes

/// <summary>
///
/// Returns the top left corner of the region above and to the left of which panes are frozen.
/// </summary>
cell_reference frozen_panes() const;

/// <summary>
///
/// Freeze panes above and to the left of top_left_cell.
/// </summary>
void freeze_panes(cell top_left_cell);

/// <summary>
///
/// Freeze panes above and to the left of top_left_coordinate.
/// </summary>
void freeze_panes(const cell_reference &top_left_coordinate);

/// <summary>
///
/// Remove frozen panes. The data in those panes will be unaffected--this affects only the view.
/// </summary>
void unfreeze_panes();

/// <summary>
///
/// Returns true if this sheet has a frozen row, frozen column, or both.
/// </summary>
bool has_frozen_panes() const;

Expand Down Expand Up @@ -260,6 +263,12 @@ class XLNT_API worksheet
/// </summary>
void add_column_properties(column_t column, const class column_properties &props);

/// <summary>
/// Calculate the width of the given column. This will be the default column width if
/// a custom width is not set on this column's column_properties.
/// </summary>
double column_width(column_t column) const;

/// <summary>
///
/// </summary>
Expand All @@ -280,6 +289,12 @@ class XLNT_API worksheet
/// </summary>
void add_row_properties(row_t row, const class row_properties &props);

/// <summary>
/// Calculate the height of the given row. This will be the default row height if
/// a custom height is not set on this row's row_properties.
/// </summary>
double row_height(row_t row) const;

// positioning

/// <summary>
Expand Down Expand Up @@ -686,10 +701,33 @@ class XLNT_API worksheet
/// </summary>
void add_view(const sheet_view &new_view);

std::vector<row_t> &row_breaks();
const std::vector<row_t> &row_breaks() const;
std::vector<column_t> &column_breaks();
const std::vector<column_t> &column_breaks() const;
// page breaks

/// <summary>
/// Remove all manual column and row page breaks (represented as dashed
/// blue lines in the page view in Excel).
/// </summary>
void clear_page_breaks();

/// <summary>
/// Returns vector where each element represents a row which will break a page below it.
/// </summary>
const std::vector<row_t> &page_break_rows() const;

/// <summary>
/// Add a page break at the given row.
/// </summary>
void page_break_at_row(row_t row);

/// <summary>
/// Returns vector where each element represents a column which will break a page to the right.
/// </summary>
const std::vector<column_t> &page_break_columns() const;

/// <summary>
/// Add a page break at the given column.
/// </summary>
void page_break_at_column(column_t column);

private:
friend class cell;
Expand Down

0 comments on commit c8f2ca2

Please sign in to comment.