|
Boost-Commit : |
From: JakeVoytko_at_[hidden]
Date: 2008-02-06 22:58:28
Author: jakevoytko
Date: 2008-02-06 22:58:28 EST (Wed, 06 Feb 2008)
New Revision: 43137
URL: http://svn.boost.org/trac/boost/changeset/43137
Log:
Modified the text_element to work on Windows machines, although it can not be safely copied.
Text files modified:
sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_tag.hpp | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_tag.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_tag.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_tag.hpp 2008-02-06 22:58:28 EST (Wed, 06 Feb 2008)
@@ -427,13 +427,14 @@
virtual void write(std::ostream& o_str) { }
text_parent(const std::string& text): text_(text) { }
+ text_parent(const text_parent& rhs): text_(rhs.text_) { }
};
class text_element_text: public text_parent
{
public:
text_element_text(const std::string& text): text_parent(text) { }
-
+ text_element_text(const text_element_text& rhs): text_parent(rhs){ }
void write(std::ostream& o_str)
{
o_str<<text_;
@@ -469,6 +470,14 @@
{
}
+ tspan_element(const tspan_element& rhs):
+ x_(rhs.x_), y_(rhs.y_), dx_(rhs.dx_), dy_(rhs.dy_), rotate_(rhs.rotate_),
+ text_length_(rhs.text_length_), use_x_(rhs.use_x_), use_y_(rhs.use_y_),
+ use_text_length_(rhs.use_text_length_), style_(rhs.style_),
+ text_parent(rhs)
+ {
+ }
+
// All of the setters.
tspan_element& text(const std::string& text)
{
@@ -727,20 +736,19 @@
data_.push_back(new text_element_text(text));
}
- // Interestingly, we only need to define the copy constructor and
- // operator=().. we don't need the destructor
text_element(const text_element& rhs):
- x_(rhs.x_), y_(rhs.y_), data_(rhs.data_.clone()), style_(rhs.style_),
+ x_(rhs.x_), y_(rhs.y_), style_(rhs.style_),
align_(rhs.align_), rotate_(rhs.rotate_)
{
-
+ data_ = (const_cast<text_element&>(rhs)).data_.release();
}
text_element& operator=(const text_element& rhs)
{
x_ = rhs.x_;
y_ = rhs.y_;
- data_ = rhs.data_.clone();
+ data_.clear();
+ data_.insert(data_.end(), rhs.data_.begin(), rhs.data_.end());
style_ = rhs.style_;
align_ = rhs.align_;
rotate_ = rhs.rotate_;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk