Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions graf2d/graf/src/TText.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ TText::~TText()
////////////////////////////////////////////////////////////////////////////////
/// Copy constructor.

TText::TText(const TText &text) : TNamed(text), TAttText(text), TAttBBox2D(text)
TText::TText(const TText &text) : TNamed(text), TAttText(text), TAttBBox2D(text), fWcsTitle(NULL)
{
fX = 0.;
fY = 0.;
Expand All @@ -110,13 +110,17 @@ void TText::Copy(TObject &obj) const
((TText&)obj).fY = fY;
TNamed::Copy(obj);
TAttText::Copy(((TText&)obj));
if (fWcsTitle != NULL) {
*reinterpret_cast<std::wstring *>(fWcsTitle) =
*reinterpret_cast<std::wstring *>(((TText&)obj).fWcsTitle);
if (((TText&)obj).fWcsTitle != NULL) {
if (fWcsTitle != NULL) {
*reinterpret_cast<std::wstring*>(&((TText&)obj).fWcsTitle) = *reinterpret_cast<const std::wstring*>(&fWcsTitle);
} else {
delete reinterpret_cast<std::wstring*>(&((TText&)obj).fWcsTitle);
((TText&)obj).fWcsTitle = NULL;
}
} else {
dynamic_cast<TText &>(obj).fWcsTitle =
new std::wstring(*reinterpret_cast<std::wstring *>(
dynamic_cast<TText &>(obj).fWcsTitle));
if (fWcsTitle != NULL) {
((TText&)(obj)).fWcsTitle = new std::wstring(*reinterpret_cast<const std::wstring*>(fWcsTitle));
}
}
}

Expand Down