Kaydet (Commit) 4a9ba965 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

implement one more method

Change-Id: I3483b2004c0afb8bea651d9eec35d1cbf9aff2a1
üst c40a4290
......@@ -392,6 +392,7 @@ public:
ScConditionalFormat* Clone(ScDocument* pNewDoc = NULL) const;
void AddEntry( ScFormatEntry* pNew );
void RemoveEntry(size_t nIndex);
void SetRange( const ScRangeList& rRanges );
const ScRangeList& GetRange() const { return maRanges; }
// don't use the same name as for the const version
......
......@@ -1853,6 +1853,15 @@ void ScConditionalFormat::AddEntry( ScFormatEntry* pNew )
pNew->SetParent(this);
}
void ScConditionalFormat::RemoveEntry(size_t n)
{
if (n < maEntries.size())
{
maEntries.erase(maEntries.begin() + n);
DoRepaint(NULL);
}
}
bool ScConditionalFormat::IsEmpty() const
{
return maEntries.empty();
......
......@@ -323,9 +323,14 @@ void ScCondFormatObj::addEntry(const uno::Reference<sheet::XConditionEntry>& /*x
{
}
void ScCondFormatObj::removeByIndex(const sal_Int32 /*nIndex*/)
void ScCondFormatObj::removeByIndex(const sal_Int32 nIndex)
throw(uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
if (getCoreObject()->size() >= size_t(nIndex))
throw lang::IllegalArgumentException();
getCoreObject()->RemoveEntry(nIndex);
}
uno::Type ScCondFormatObj::getElementType()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment