summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-11-02 00:30:25 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-11-02 14:58:11 +0100
commitf1fdd5adb63f84fe7c65374b1a7cf9bd96e7d6b6 (patch)
treed1435d9197f011fa662b4e90f5c62d6a2404e032 /sc
parent5d0ae90546d46a39bb42ea60e3f835ca68e6abdb (diff)
implement ooxml import for new conditional formats
Change-Id: Ia854ef42c23ac8dd4f6d4afa180ecc57b741a3b8
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/condformatbuffer.cxx26
1 files changed, 23 insertions, 3 deletions
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index c1452100e799..a8800a6b8540 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -739,10 +739,20 @@ void CondFormatRule::finalizeImport()
aReplaceFormula = "NOT(ISERROR(#B))";
break;
case XML_top10:
- if( maModel.mbPercent )
- aReplaceFormula = "RANK(#B,#R,#M)/COUNT(#R)<=#K%";
+ if(maModel.mbPercent)
+ {
+ if(maModel.mbBottom)
+ eOperator = SC_COND_BOTTOM_PERCENT;
+ else
+ eOperator = SC_COND_TOP_PERCENT;
+ }
else
- aReplaceFormula = "RANK(#B,#R,#M)<=#K";
+ {
+ if(maModel.mbBottom)
+ eOperator = SC_COND_BOTTOM10;
+ else
+ eOperator = SC_COND_TOP10;
+ }
break;
case XML_aboveAverage:
if( maModel.mnStdDev == 0 )
@@ -827,6 +837,16 @@ 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 )
+ {
+ ScDocument& rDoc = getScDocument();
+ ScTokenArray aTokenArray;
+ aTokenArray.AddDouble( maModel.mnRank );
+ OUString aStyleName = getStyles().createDxfStyle( maModel.mnDxfId );
+ ScCondFormatEntry* pNewEntry = new ScCondFormatEntry( eOperator, &aTokenArray, NULL, &rDoc, aPos, aStyleName );
+ mpFormat->AddEntry(pNewEntry);
+ }
else if( mpColor )
{
ScDocument& rDoc = getScDocument();