[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 035e5a0 2/9: Simplify
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 035e5a0 2/9: Simplify |
Date: |
Wed, 4 Apr 2018 21:27:37 -0400 (EDT) |
branch: master
commit 035e5a070dd3974512f880ddd7c805474e2b4285
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Simplify
Made a member variable's name more descriptive so that it doesn't need
a comment explaining its purpose.
---
pdf_writer_wx.cpp | 10 +++++-----
pdf_writer_wx.hpp | 3 +--
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/pdf_writer_wx.cpp b/pdf_writer_wx.cpp
index 1bc3a2c..b2f05d2 100644
--- a/pdf_writer_wx.cpp
+++ b/pdf_writer_wx.cpp
@@ -128,7 +128,7 @@ pdf_writer_wx::pdf_writer_wx
wxDC& pdf_writer_wx::dc()
{
LMI_ASSERT_WITH_MSG
- (!was_saved_
+ (!save_has_been_called_
,"Can't use device context of the PDF file \""
<< print_data_.GetFilename().ToStdString(wxConvUTF8)
<< "\" which was already saved"
@@ -155,7 +155,7 @@ void pdf_writer_wx::output_image
)
{
LMI_ASSERT_WITH_MSG
- (!was_saved_
+ (!save_has_been_called_
,"Can't add an image to the PDF file \""
<< print_data_.GetFilename().ToStdString(wxConvUTF8)
<< "\" which was already saved"
@@ -200,7 +200,7 @@ int pdf_writer_wx::output_html
)
{
LMI_ASSERT_WITH_MSG
- (!was_saved_
+ (!save_has_been_called_
,"Can't output HTML to the PDF file \""
<< print_data_.GetFilename().ToStdString(wxConvUTF8)
<< "\" which was already saved"
@@ -274,7 +274,7 @@ void pdf_writer_wx::save() &&
{
pdf_dc_.EndDoc();
- was_saved_ = true;
+ save_has_been_called_ = true;
}
pdf_writer_wx::~pdf_writer_wx()
@@ -286,7 +286,7 @@ pdf_writer_wx::~pdf_writer_wx()
// in a dtor of some other object, which is the only situation in which the
// two versions would behave differently -- and even if it did happen, it
// would just result in incorrectly skipping the check, i.e. not critical.
- if(!std::uncaught_exceptions() && !was_saved_)
+ if(!std::uncaught_exceptions() && !save_has_been_called_)
{
std::ostringstream oss;
oss
diff --git a/pdf_writer_wx.hpp b/pdf_writer_wx.hpp
index c9be498..9a1835e 100644
--- a/pdf_writer_wx.hpp
+++ b/pdf_writer_wx.hpp
@@ -105,8 +105,7 @@ class pdf_writer_wx
wxSize const total_page_size_;
- // Set to true after save() was called.
- bool was_saved_{false};
+ bool save_has_been_called_{false};
};
#endif // pdf_writer_wx_hpp
- [lmi-commits] [lmi] master updated (d9f9215 -> f4580cf), Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master 035e5a0 2/9: Simplify,
Greg Chicares <=
- [lmi-commits] [lmi] master afdbbeb 6/9: Consolidate commentary, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master 38df10a 4/9: Simplify diagnostics, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master 6586cab 1/9: Simplify, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master ecd1362 3/9: Shorten diagnostics, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master 783f4dd 5/9: Consolidate and revise documentation, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master f4580cf 9/9: Don't ref-qualify save(), Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master 5d225f5 7/9: Move commentary to point of member-function definition, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master f5651d1 8/9: Prevent save() from being called twice, Greg Chicares, 2018/04/04