fix crash in ScColorScaleEntry's c'tor

Change-Id: I1cf60db16e5e6c82589b6b315680a6dff1761815
This commit is contained in:
Markus Mohrhard 2012-05-14 07:47:19 +02:00
parent 63bfed7bce
commit 596e40f9a2

View file

@ -43,7 +43,7 @@ ScColorScaleEntry::ScColorScaleEntry(double nVal, const Color& rCol):
ScColorScaleEntry::ScColorScaleEntry(const ScColorScaleEntry& rEntry):
mnVal(rEntry.mnVal),
maColor(rEntry.maColor),
mpCell(NULL),
mpCell(),
mbMin(rEntry.mbMin),
mbMax(rEntry.mbMax),
mbPercent(rEntry.mbPercent)
@ -53,11 +53,15 @@ ScColorScaleEntry::ScColorScaleEntry(const ScColorScaleEntry& rEntry):
ScColorScaleEntry::ScColorScaleEntry(ScDocument* pDoc, const ScColorScaleEntry& rEntry):
mnVal(rEntry.mnVal),
maColor(rEntry.maColor),
mpCell(static_cast<ScFormulaCell*>(rEntry.mpCell->Clone(*pDoc))),
mpCell(),
mbMin(rEntry.mbMin),
mbMax(rEntry.mbMax),
mbPercent(rEntry.mbPercent)
{
if(rEntry.mpCell)
{
mpCell.reset(static_cast<ScFormulaCell*>(rEntry.mpCell->Clone(*pDoc)));
}
}
ScColorScaleEntry::~ScColorScaleEntry()