summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/condformatuno.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-03-30 01:27:47 +0200
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-03-30 04:34:31 +0200
commit2773e6ffb57d514e667e8e75cf165a6bfef82dec (patch)
treea9e567834df6ffcb31209d16ed501908034aa149 /sc/source/ui/unoobj/condformatuno.cxx
parent5762370f7a9b6061e30ea458a4b08d24ff745788 (diff)
add last databar part
Change-Id: Id86dfa4e6795d0ec6a66850747f95de6b0bd8b98
Diffstat (limited to 'sc/source/ui/unoobj/condformatuno.cxx')
-rw-r--r--sc/source/ui/unoobj/condformatuno.cxx41
1 files changed, 41 insertions, 0 deletions
diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx
index 0b81b5a81c94..c0c20f0a2256 100644
--- a/sc/source/ui/unoobj/condformatuno.cxx
+++ b/sc/source/ui/unoobj/condformatuno.cxx
@@ -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();