[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 1db9b66 1/4: Rename member function do_get_ce
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 1db9b66 1/4: Rename member function do_get_cell_x() --> cell_pos_x() |
Date: |
Sat, 26 May 2018 09:54:17 -0400 (EDT) |
branch: master
commit 1db9b66c8448e67b54cd6ad2e8b90e2b474d19f0
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Rename member function do_get_cell_x() --> cell_pos_x()
'cell_x' can too easily be read as Cell[X] rather than Cell.X_position.
The 'do_'- prefix seemed only to mark this as private, but there was no
corresponding public get_cell_x() to distinguish it from.
The 'get_'- prefix seemed unnecessary: there is no complementary 'set_'
function anyway.
---
wx_table_generator.cpp | 14 +++++---------
wx_table_generator.hpp | 2 +-
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 4b44b74..2873175 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -291,7 +291,7 @@ void wx_table_generator::output_super_header
// by the width of all the extra (i.e. not counting the starting one)
// columns in this span.
auto rect = text_rect(begin_column, pos_y);
- rect.width += do_get_cell_x(end_column) - do_get_cell_x(begin_column + 1);
+ rect.width += cell_pos_x(end_column) - cell_pos_x(begin_column + 1);
for(auto const& line : lines)
{
@@ -358,11 +358,7 @@ void wx_table_generator::output_vert_separator
{
LMI_ASSERT(before_column <= all_columns().size());
- do_output_vert_separator
- (do_get_cell_x(before_column)
- ,y
- ,y + row_height_
- );
+ do_output_vert_separator(cell_pos_x(before_column), y, y + row_height_);
}
/// Output a horizontal separator line across the specified columns,
@@ -386,7 +382,7 @@ void wx_table_generator::output_horz_separator
LMI_ASSERT(begin_column < end_column);
LMI_ASSERT(end_column <= all_columns().size());
- int const x1 = do_get_cell_x(begin_column);
+ int const x1 = cell_pos_x(begin_column);
int x2 = x1;
for(std::size_t col = begin_column; col < end_column; ++col)
@@ -793,7 +789,7 @@ void wx_table_generator::do_output_horz_separator(int x1,
int x2, int y)
dc_.DrawLine(x1, y, x2, y);
}
-int wx_table_generator::do_get_cell_x(std::size_t column) const
+int wx_table_generator::cell_pos_x(std::size_t column) const
{
int x = left_margin_;
for(std::size_t col = 0; col < column; ++col)
@@ -809,7 +805,7 @@ int wx_table_generator::do_get_cell_x(std::size_t column)
const
wxRect wx_table_generator::cell_rect(std::size_t column, int y) const
{
return wxRect
- (do_get_cell_x(column)
+ (cell_pos_x(column)
,y
,all_columns().at(column).col_width()
,row_height_
diff --git a/wx_table_generator.hpp b/wx_table_generator.hpp
index 16dd769..1009d00 100644
--- a/wx_table_generator.hpp
+++ b/wx_table_generator.hpp
@@ -139,7 +139,7 @@ class wx_table_generator
void do_output_vert_separator(int x , int y1, int y2);
void do_output_horz_separator(int x1, int x2, int y );
- int do_get_cell_x(std::size_t column) const;
+ int cell_pos_x(std::size_t column) const;
wxRect cell_rect(std::size_t column, int y) const;