diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-26 16:18:52 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-27 05:59:50 +0200 |
commit | 59c2e0487473508335924c2195759d9bcd9fb3a3 (patch) | |
tree | d2b1795d306d923c6f1e76f6e12ce9fa020c50b6 /sc | |
parent | 46b8dbda43c365abf84717014c478d42f4007e53 (diff) |
support colored axis in data bars
Change-Id: Ie74404b35e31a2f96641abb18a9aaf46467e31c0
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/colorscale.hxx | 7 | ||||
-rw-r--r-- | sc/inc/fillinfo.hxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/colorscale.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/condformat/colorformat.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 5 |
5 files changed, 14 insertions, 2 deletions
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index 72349dc95b34..24aa2ea3c027 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -99,6 +99,7 @@ enum ScAxisPostion struct SC_DLLPUBLIC ScDataBarFormatData { ScDataBarFormatData(): + maAxisColor(COL_BLACK), mbGradient(true), mbNeg(true), meAxisPosition(databar::AUTOMATIC), @@ -106,6 +107,7 @@ struct SC_DLLPUBLIC ScDataBarFormatData ScDataBarFormatData(const ScDataBarFormatData& r): maPositiveColor(r.maPositiveColor), + maAxisColor(r.maAxisColor), mbGradient(r.mbGradient), mbNeg(r.mbNeg), meAxisPosition(r.meAxisPosition), @@ -131,6 +133,11 @@ struct SC_DLLPUBLIC ScDataBarFormatData */ boost::scoped_ptr<Color> mpNegativeColor; /** + * Color of the axis if used + * Default color is black + */ + Color maAxisColor; + /** * Paint the bars with gradient. If this is used the default is to draw with * borders. * diff --git a/sc/inc/fillinfo.hxx b/sc/inc/fillinfo.hxx index 842ef1bb3899..838255ef1236 100644 --- a/sc/inc/fillinfo.hxx +++ b/sc/inc/fillinfo.hxx @@ -69,6 +69,7 @@ struct ScDataBarInfo double mnLength; // -100 to 100 bool mbGradient; bool mbShowValue; + Color maAxisColor; bool operator==(const ScDataBarInfo& r) const { diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index c6773975060e..38f061aed9b2 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -842,6 +842,7 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const pInfo->mbGradient = mpFormatData->mbGradient; pInfo->mbShowValue = !mpFormatData->mbOnlyBar; + pInfo->maAxisColor = mpFormatData->maAxisColor; return pInfo; } diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index 7093bb10ccf2..71b88c91d3f5 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -176,6 +176,7 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarForma ::SetType(rData.mpUpperLimit.get(), maLbTypeMax); SetValue(rData.mpLowerLimit.get(), maEdMin); SetValue(rData.mpUpperLimit.get(), maEdMax); + maLbAxisCol.SelectEntry(rData.maAxisColor); TypeSelectHdl(NULL); } @@ -259,6 +260,7 @@ ScDataBarFormatData* ScDataBarSettingsDlg::GetData() pData->mbGradient = true; //FIXME pData->mpUpperLimit.reset(new ScColorScaleEntry()); pData->mpLowerLimit.reset(new ScColorScaleEntry()); + pData->maAxisColor = maLbAxisCol.GetSelectEntryColor(); ::GetType(maLbTypeMin, maEdMin, pData->mpLowerLimit.get(), mpNumberFormatter); ::GetType(maLbTypeMax, maEdMax, pData->mpUpperLimit.get(), mpNumberFormatter); diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index facfbe1ec1f3..91cce9a2915b 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -861,10 +861,11 @@ void drawDataBars( const ScDataBarInfo* pOldDataBarInfo, OutputDevice* pDev, con aLineInfo.SetDashCount( 4 ); aLineInfo.SetDistance( 3 ); aLineInfo.SetDashLen( 3 ); - pDev->SetFillColor(COL_BLACK); - pDev->SetLineColor(COL_BLACK); + pDev->SetFillColor(pOldDataBarInfo->maAxisColor); + pDev->SetLineColor(pOldDataBarInfo->maAxisColor); pDev->DrawLine(aPoint1, aPoint2, aLineInfo); pDev->SetLineColor(); + pDev->SetFillColor(); } } |