summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-28 00:46:19 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-28 00:59:12 +0200
commit65c2570e86e0e58ebce447b6d24f11d1c29dfa99 (patch)
tree4ae91731ffa6879be5c2fcf66496bc6a13d11ffb /chart2/source
parent180a5fe0a2c72408e2322f8155415b4639131096 (diff)
handle fill float transparence in chart area panel
Change-Id: Ibf72ba72ec193638f389167aab415b94a383f3d1
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/sidebar/ChartAreaPanel.cxx30
1 files changed, 28 insertions, 2 deletions
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
index f19f6903ed07..f002a31fc1dd 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
@@ -11,11 +11,13 @@
#include "ChartController.hxx"
#include "ViewElementListProvider.hxx"
+#include "PropertyHelper.hxx"
#include "chartview/DrawModelWrapper.hxx"
#include <svx/xfltrit.hxx>
#include <svx/xflftrit.hxx>
+#include <svx/unomid.hxx>
namespace chart { namespace sidebar {
@@ -264,7 +266,17 @@ void ChartAreaPanel::setFillFloatTransparence(
if (!xPropSet.is())
return;
- xPropSet->setPropertyValue("TransparencyGradientName", css::uno::makeAny(rItem.GetValue()));
+ if (!rItem.IsEnabled())
+ {
+ xPropSet->setPropertyValue("TransparencyGradientName", css::uno::makeAny(OUString()));
+ return;
+ }
+
+ OUString aName = rItem.GetName();
+ css::uno::Any aGradientVal;
+ rItem.QueryValue(aGradientVal, MID_FILLGRADIENT);
+ OUString aNewName = PropertyHelper::addTransparencyGradientUniqueNameToTable(aGradientVal, css::uno::Reference<css::lang::XMultiServiceFactory>(mxModel, css::uno::UNO_QUERY_THROW), aName);
+ xPropSet->setPropertyValue("TransparencyGradientName", css::uno::makeAny(aNewName));
}
void ChartAreaPanel::setFillStyle(const XFillStyleItem& rItem)
@@ -364,9 +376,10 @@ void ChartAreaPanel::updateData()
GraphicObject xBitmap = getXBitmapFromName(mxModel, aBitmapName);
XFillBitmapItem aBitmapItem(aBitmapName, xBitmap);
XFillBitmapItem* pBitmapItem = NULL;
+ DrawModelWrapper* pModelWrapper = NULL;
try
{
- DrawModelWrapper* pModelWrapper = getDrawModelWrapper(mxModel);
+ pModelWrapper = getDrawModelWrapper(mxModel);
if (pModelWrapper)
{
pBitmapItem = aBitmapItem.checkForUniqueItem(&pModelWrapper->getSdrModel());
@@ -377,6 +390,19 @@ void ChartAreaPanel::updateData()
}
updateFillBitmap(false, true, pBitmapItem ? pBitmapItem : &aBitmapItem);
delete pBitmapItem;
+
+ OUString aFillFloatTransparenceName;
+ xPropSet->getPropertyValue("TransparencyGradientName") >>= aFillFloatTransparenceName;
+ XFillFloatTransparenceItem aFillFloatTransparenceItem;
+ if (!aFillFloatTransparenceName.isEmpty())
+ aFillFloatTransparenceItem.SetEnabled(true);
+
+ aFillFloatTransparenceItem.SetName(aFillFloatTransparenceName);
+ XFillFloatTransparenceItem* pCorrectFloatTransparenceItem = aFillFloatTransparenceItem.checkForUniqueItem(&pModelWrapper->getSdrModel());
+ XFillFloatTransparenceItem* pFillFloatTransparenceItem = pCorrectFloatTransparenceItem ? pCorrectFloatTransparenceItem : &aFillFloatTransparenceItem;
+ pFillFloatTransparenceItem->SetGradientValue(getXGradientForName(mxModel, pFillFloatTransparenceItem->GetName()));
+ updateFillFloatTransparence(false, true, pFillFloatTransparenceItem);
+ delete pCorrectFloatTransparenceItem;
}
void ChartAreaPanel::modelInvalid()