Kaydet (Commit) 2773e6ff authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add last databar part

Change-Id: Id86dfa4e6795d0ec6a66850747f95de6b0bd8b98
üst 5762370f
......@@ -894,6 +894,43 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDataBarFormatObj::getProperty
return aRef;
}
namespace {
void setDataBarEntry(ScColorScaleEntry* pEntry, uno::Reference<sheet::XDataBarEntry> xEntry)
{
ScColorScaleEntryType eType;
sal_Int32 nApiType = xEntry->getType();
bool bFound = false;
for (size_t i = 0; i < SAL_N_ELEMENTS(aDataBarEntryTypeMap); ++i)
{
if (aDataBarEntryTypeMap[i].nApiType == nApiType)
{
eType = aDataBarEntryTypeMap[i].eType;
bFound = true;
break;
}
}
if (!bFound)
throw lang::IllegalArgumentException();
pEntry->SetType(eType);
switch (eType)
{
case COLORSCALE_FORMULA:
// TODO: Implement
break;
default:
{
double nVal = xEntry->getFormula().toDouble();
pEntry->SetValue(nVal);
}
break;
}
}
}
void SAL_CALL ScDataBarFormatObj::setPropertyValue(
const OUString& aPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException,
......@@ -994,6 +1031,10 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue(
if (aEntries.getLength() != 2)
throw lang::IllegalArgumentException();
setDataBarEntry(getCoreObject()->GetDataBarData()->mpLowerLimit.get(),
aEntries[0]);
setDataBarEntry(getCoreObject()->GetDataBarData()->mpUpperLimit.get(),
aEntries[1]);
}
else
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