add color scales to copy document
Change-Id: I03e141746920c7794e18267cf01799d03c7cafb3
This commit is contained in:
@@ -50,6 +50,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
ScColorScaleEntry(double nVal, const Color& rCol);
|
ScColorScaleEntry(double nVal, const Color& rCol);
|
||||||
ScColorScaleEntry(const ScColorScaleEntry& rEntry);
|
ScColorScaleEntry(const ScColorScaleEntry& rEntry);
|
||||||
|
ScColorScaleEntry(ScDocument* pDoc, const ScColorScaleEntry& rEntry);
|
||||||
~ScColorScaleEntry();
|
~ScColorScaleEntry();
|
||||||
|
|
||||||
const Color& GetColor() const;
|
const Color& GetColor() const;
|
||||||
@@ -83,6 +84,7 @@ private:
|
|||||||
bool CheckEntriesForRel(const ScRange& rRange) const;
|
bool CheckEntriesForRel(const ScRange& rRange) const;
|
||||||
public:
|
public:
|
||||||
ScColorScaleFormat(ScDocument* pDoc);
|
ScColorScaleFormat(ScDocument* pDoc);
|
||||||
|
ScColorScaleFormat(ScDocument* pDoc, const ScColorScaleFormat& rFormat);
|
||||||
|
|
||||||
Color* GetColor(const ScAddress& rAddr) const;
|
Color* GetColor(const ScAddress& rAddr) const;
|
||||||
void AddEntry(ScColorScaleEntry* pEntry);
|
void AddEntry(ScColorScaleEntry* pEntry);
|
||||||
@@ -108,6 +110,7 @@ private:
|
|||||||
boost::ptr_vector<ScColorScaleFormat> maColorScaleFormats;
|
boost::ptr_vector<ScColorScaleFormat> maColorScaleFormats;
|
||||||
public:
|
public:
|
||||||
ScColorScaleFormatList() {};
|
ScColorScaleFormatList() {};
|
||||||
|
ScColorScaleFormatList(ScDocument* pDoc, const ScColorScaleFormatList& rList);
|
||||||
|
|
||||||
typedef ColorScaleFormatContainer::iterator iterator;
|
typedef ColorScaleFormatContainer::iterator iterator;
|
||||||
typedef ColorScaleFormatContainer::const_iterator const_iterator;
|
typedef ColorScaleFormatContainer::const_iterator const_iterator;
|
||||||
|
@@ -50,6 +50,16 @@ 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))),
|
||||||
|
mbMin(rEntry.mbMin),
|
||||||
|
mbMax(rEntry.mbMax),
|
||||||
|
mbPercent(rEntry.mbPercent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
ScColorScaleEntry::~ScColorScaleEntry()
|
ScColorScaleEntry::~ScColorScaleEntry()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -101,6 +111,17 @@ ScColorScaleFormat::ScColorScaleFormat(ScDocument* pDoc):
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScColorScaleFormat::ScColorScaleFormat(ScDocument* pDoc, const ScColorScaleFormat& rFormat):
|
||||||
|
maRanges(rFormat.maRanges),
|
||||||
|
mpDoc(pDoc)
|
||||||
|
{
|
||||||
|
for(const_iterator itr = rFormat.begin(); itr != rFormat.end(); ++itr)
|
||||||
|
{
|
||||||
|
maColorScales.push_back(new ScColorScaleEntry(pDoc, *itr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScColorScaleFormat::AddEntry( ScColorScaleEntry* pEntry )
|
void ScColorScaleFormat::AddEntry( ScColorScaleEntry* pEntry )
|
||||||
{
|
{
|
||||||
maColorScales.push_back( pEntry );
|
maColorScales.push_back( pEntry );
|
||||||
@@ -465,6 +486,14 @@ ScColorScaleFormat::const_iterator ScColorScaleFormat::end() const
|
|||||||
return maColorScales.end();
|
return maColorScales.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScColorScaleFormatList::ScColorScaleFormatList(ScDocument* pDoc, const ScColorScaleFormatList& rList)
|
||||||
|
{
|
||||||
|
for(const_iterator itr = rList.begin(); itr != rList.end(); ++itr)
|
||||||
|
{
|
||||||
|
maColorScaleFormats.push_back(new ScColorScaleFormat(pDoc, *itr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ScColorScaleFormatList::AddFormat( ScColorScaleFormat* pFormat )
|
void ScColorScaleFormatList::AddFormat( ScColorScaleFormat* pFormat )
|
||||||
{
|
{
|
||||||
maColorScaleFormats.push_back( pFormat );
|
maColorScaleFormats.push_back( pFormat );
|
||||||
|
@@ -475,6 +475,11 @@ void ScDocument::InitClipPtrs( ScDocument* pSourceDoc )
|
|||||||
const ScConditionalFormatList* pSourceCond = pSourceDoc->pCondFormList;
|
const ScConditionalFormatList* pSourceCond = pSourceDoc->pCondFormList;
|
||||||
if ( pSourceCond )
|
if ( pSourceCond )
|
||||||
pCondFormList = new ScConditionalFormatList(this, *pSourceCond);
|
pCondFormList = new ScConditionalFormatList(this, *pSourceCond);
|
||||||
|
|
||||||
|
const ScColorScaleFormatList* pSourceColorScaleList = pSourceDoc->mpColorScaleList.get();
|
||||||
|
if ( pSourceColorScaleList )
|
||||||
|
mpColorScaleList.reset(new ScColorScaleFormatList(this, *pSourceColorScaleList));
|
||||||
|
|
||||||
const ScValidationDataList* pSourceValid = pSourceDoc->pValidationList;
|
const ScValidationDataList* pSourceValid = pSourceDoc->pValidationList;
|
||||||
if ( pSourceValid )
|
if ( pSourceValid )
|
||||||
pValidationList = new ScValidationDataList(this, *pSourceValid);
|
pValidationList = new ScValidationDataList(this, *pSourceValid);
|
||||||
|
Reference in New Issue
Block a user