diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-05-21 01:19:19 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-05-21 01:19:19 +0200 |
commit | 67ff63988f3b8eef2cc2b5bdf917918b93c3f070 (patch) | |
tree | ff9507a6d8040326af013735fb6a574f5d8fd82e /sc | |
parent | d4b94e9eb96f24411ac0dcebe92ac878a8fae91f (diff) |
support to suppress values in data bar cells
Change-Id: Ia292edd73408eed19cd6bc824e9621992c33ac97
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/colorscale.hxx | 8 | ||||
-rw-r--r-- | sc/inc/fillinfo.hxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/colorscale.cxx | 1 | ||||
-rw-r--r-- | sc/source/filter/inc/condformatbuffer.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/oox/condformatbuffer.cxx | 5 | ||||
-rw-r--r-- | sc/source/filter/oox/condformatcontext.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 7 |
7 files changed, 25 insertions, 1 deletions
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index 0dbb87681eb8..997c2a0c6f36 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -89,7 +89,8 @@ struct ScDataBarFormatData ScDataBarFormatData(): mbGradient(true), mbNeg(true), - meAxisPosition(databar::AUTOMATIC) {} + meAxisPosition(databar::AUTOMATIC), + mbOnlyBar(false){} /** * Color for all Positive Values and if mbNeg == false also for negative ones @@ -124,6 +125,11 @@ struct ScDataBarFormatData */ databar::ScAxisPostion meAxisPosition; + /** + * If TRUE we only show the bar and not the value + */ + bool mbOnlyBar; + boost::scoped_ptr<ScColorScaleEntry> mpUpperLimit; boost::scoped_ptr<ScColorScaleEntry> mpLowerLimit; }; diff --git a/sc/inc/fillinfo.hxx b/sc/inc/fillinfo.hxx index c2fa4a774e69..842ef1bb3899 100644 --- a/sc/inc/fillinfo.hxx +++ b/sc/inc/fillinfo.hxx @@ -68,6 +68,7 @@ struct ScDataBarInfo Color maColor; double mnLength; // -100 to 100 bool mbGradient; + bool mbShowValue; bool operator==(const ScDataBarInfo& r) const { diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 70b48726ac71..3361d729cf8d 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -765,6 +765,7 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const pInfo->maColor = mpFormatData->maPositiveColor; pInfo->mbGradient = mpFormatData->mbGradient; + pInfo->mbShowValue = !mpFormatData->mbOnlyBar; return pInfo; } diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx index 09b9a83fd8b4..60f24d749a39 100644 --- a/sc/source/filter/inc/condformatbuffer.hxx +++ b/sc/source/filter/inc/condformatbuffer.hxx @@ -120,6 +120,7 @@ public: DataBarRule( const CondFormat& rFormat ); void importCfvo( const AttributeList& rAttribs ); void importColor( const AttributeList& rAttribs ); + void importAttribs( const AttributeList& rAttribs ); void SetData( ScDataBarFormat* pFormat, ScDocument* pDoc, const ScAddress& rAddr ); diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 655b264364bc..8792546ba258 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -328,6 +328,11 @@ void DataBarRule::importCfvo( const AttributeList& rAttribs ) } } +void DataBarRule::importAttribs( const AttributeList& rAttribs ) +{ + mpFormat->mbOnlyBar = !rAttribs.getBool( XML_showValue, true ); +} + void DataBarRule::SetData( ScDataBarFormat* pFormat, ScDocument* pDoc, const ScAddress& rAddr ) { ScColorScaleEntry* pUpperEntry = ConvertToModel( *mpUpperLimit.get(), pDoc, rAddr); diff --git a/sc/source/filter/oox/condformatcontext.cxx b/sc/source/filter/oox/condformatcontext.cxx index 81d56fbdc134..4e01d4756c74 100644 --- a/sc/source/filter/oox/condformatcontext.cxx +++ b/sc/source/filter/oox/condformatcontext.cxx @@ -109,6 +109,9 @@ void DataBarContext::onStartElement( const AttributeList& rAttribs ) { switch( getCurrentElement() ) { + case XLS_TOKEN( dataBar ): + mxRule->getDataBar()->importAttribs( rAttribs ); + break; case XLS_TOKEN( cfvo ): mxRule->getDataBar()->importCfvo( rAttribs ); break; diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index a91a7fe86526..26aeadbbb9b1 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1537,6 +1537,13 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) if ( bDoCell && bEditMode && nCellX == nEditCol && nCellY == nEditRow ) bDoCell = false; + // skip text in cell if data bar is set and only value selected + if ( bDoCell ) + { + if(pInfo->pDataBar && !pInfo->pDataBar->mbShowValue) + bDoCell = false; + } + // // output the cell text // |