Kaydet (Commit) 5762370f authored tarafından Markus Mohrhard's avatar Markus Mohrhard

implement last missing IconSet piece

Change-Id: I97fb3a2e8bc5abb68a07e4daab6492a4ffa5c52a
üst 8b3137c9
...@@ -1228,6 +1228,44 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScIconSetFormatObj::getProperty ...@@ -1228,6 +1228,44 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScIconSetFormatObj::getProperty
return aRef; return aRef;
} }
namespace {
void setIconSetEntry(ScIconSetFormat* pFormat, uno::Reference<sheet::XIconSetEntry> xEntry, size_t nPos)
{
ScIconSetFormatData* pData = pFormat->GetIconSetData();
ScColorScaleEntryType eType;
sal_Int32 nApiType = xEntry->getType();
bool bFound = false;
for (size_t i = 0; i < SAL_N_ELEMENTS(aIconSetEntryTypeMap); ++i)
{
if (aIconSetEntryTypeMap[i].nApiType == nApiType)
{
eType = aIconSetEntryTypeMap[i].eType;
bFound = true;
break;
}
}
if (!bFound)
throw lang::IllegalArgumentException();
pData->maEntries[nPos].SetType(eType);
switch (eType)
{
case COLORSCALE_FORMULA:
// TODO: Implement
break;
default:
{
double nVal = xEntry->getFormula().toDouble();
pData->maEntries[nPos].SetValue(nVal);
}
break;
}
}
}
void SAL_CALL ScIconSetFormatObj::setPropertyValue( void SAL_CALL ScIconSetFormatObj::setPropertyValue(
const OUString& aPropertyName, const uno::Any& aValue ) const OUString& aPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, throw(beans::UnknownPropertyException, beans::PropertyVetoException,
...@@ -1286,7 +1324,11 @@ void SAL_CALL ScIconSetFormatObj::setPropertyValue( ...@@ -1286,7 +1324,11 @@ void SAL_CALL ScIconSetFormatObj::setPropertyValue(
uno::Sequence<uno::Reference<sheet::XIconSetEntry> > aEntries; uno::Sequence<uno::Reference<sheet::XIconSetEntry> > aEntries;
if (aValue >>= aEntries) if (aValue >>= aEntries)
{ {
sal_Int32 nLength = aEntries.getLength();
for (size_t i = 0; i < size_t(nLength); ++i)
{
setIconSetEntry(getCoreObject(), aEntries[i], i);
}
} }
else else
throw lang::IllegalArgumentException(); throw lang::IllegalArgumentException();
......
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