summaryrefslogtreecommitdiff
path: root/chart2/source/controller/sidebar/ChartColorWrapper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/sidebar/ChartColorWrapper.cxx')
-rw-r--r--chart2/source/controller/sidebar/ChartColorWrapper.cxx25
1 files changed, 23 insertions, 2 deletions
diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
index d8a8f870f28f..beeb85df3c72 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
@@ -11,6 +11,10 @@
#include "ChartController.hxx"
+#include <editeng/colritem.hxx>
+#include <svx/tbcontrl.hxx>
+#include <svx/svxids.hrc>
+
namespace chart { namespace sidebar {
namespace {
@@ -56,13 +60,15 @@ css::uno::Reference<css::beans::XPropertySet> getPropSet(
}
ChartColorWrapper::ChartColorWrapper(
- css::uno::Reference<css::frame::XModel> xModel):
+ css::uno::Reference<css::frame::XModel> xModel,
+ SvxColorToolBoxControl* pControl):
mxModel(xModel),
+ mpControl(pControl),
maPropertyName("FillColor")
{
}
-void ChartColorWrapper::operator()(const OUString& rCommand, const Color& rColor)
+void ChartColorWrapper::operator()(const OUString& , const Color& rColor)
{
css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(mxModel);
assert(xPropSet.is());
@@ -75,6 +81,21 @@ void ChartColorWrapper::updateModel(css::uno::Reference<css::frame::XModel> xMod
mxModel = xModel;
}
+void ChartColorWrapper::updateData()
+{
+ css::uno::Reference<css::beans::XPropertySet> xPropSet = getPropSet(mxModel);
+ if (!xPropSet.is())
+ return;
+
+ css::uno::Any aAny = xPropSet->getPropertyValue(maPropertyName);
+ sal_uInt32 nColor = 0;
+ aAny >>= nColor;
+ Color aColor(nColor);
+
+ SvxColorItem aItem(aColor, SID_ATTR_FILL_COLOR);
+ mpControl->StateChanged(SID_ATTR_FILL_COLOR, SfxItemState::SET, &aItem);
+}
+
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */