summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-11-02 01:55:26 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-11-02 14:58:11 +0100
commit6e78db23c1194a371961e2136a62fb149a8a764d (patch)
tree204e98f905152ccbe6d78427e9c70b95db396972
parent44990c104508c889e459ea6fea3cc13da2fc34a7 (diff)
implement the above/below average import from ooxml
Change-Id: I75421cd66469d73a2614a6528801f9d1e17a0901
-rw-r--r--sc/source/filter/oox/condformatbuffer.cxx21
1 files changed, 17 insertions, 4 deletions
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index a8800a6b8540..7798817fde1b 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -755,8 +755,10 @@ void CondFormatRule::finalizeImport()
}
break;
case XML_aboveAverage:
- if( maModel.mnStdDev == 0 )
- aReplaceFormula = "#B#CAVERAGE(#R)";
+ if(maModel.mbAboveAverage)
+ eOperator = SC_COND_ABOVE_AVERAGE;
+ else
+ eOperator = SC_COND_BELOW_AVERAGE;
break;
case XML_colorScale:
break;
@@ -837,8 +839,8 @@ void CondFormatRule::finalizeImport()
&aTokenArray, pTokenArray2.get(), &rDoc, aPos, aStyleName);
mpFormat->AddEntry(pNewEntry);
}
- else if ( eOperator == SC_COND_TOP10 || SC_COND_BOTTOM10 ||
- SC_COND_TOP_PERCENT || SC_COND_BOTTOM_PERCENT )
+ else if ( eOperator == SC_COND_TOP10 || eOperator == SC_COND_BOTTOM10 ||
+ eOperator == SC_COND_TOP_PERCENT || eOperator == SC_COND_BOTTOM_PERCENT )
{
ScDocument& rDoc = getScDocument();
ScTokenArray aTokenArray;
@@ -847,6 +849,17 @@ void CondFormatRule::finalizeImport()
ScCondFormatEntry* pNewEntry = new ScCondFormatEntry( eOperator, &aTokenArray, NULL, &rDoc, aPos, aStyleName );
mpFormat->AddEntry(pNewEntry);
}
+ else if( eOperator == SC_COND_ABOVE_AVERAGE || eOperator == SC_COND_BELOW_AVERAGE )
+ {
+ ScDocument& rDoc = getScDocument();
+ ScTokenArray aTokenArrayEqual;
+ aTokenArrayEqual.AddDouble( maModel.mbEqualAverage );
+ ScTokenArray aTokenArrayDev;
+ aTokenArrayDev.AddDouble( maModel.mnStdDev );
+ OUString aStyleName = getStyles().createDxfStyle( maModel.mnDxfId );
+ ScCondFormatEntry* pNewEntry = new ScCondFormatEntry( eOperator, &aTokenArrayEqual, &aTokenArrayDev, &rDoc, aPos, aStyleName );
+ mpFormat->AddEntry(pNewEntry);
+ }
else if( mpColor )
{
ScDocument& rDoc = getScDocument();