summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-20 00:12:20 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-20 02:38:22 +0200
commite878c9bba31386cbdb9caca3cbc588a25dc1ae1e (patch)
treea4c0b21034fb5e8bf2b4bc2af6bebe8772212aa9
parentf6a940ad1771016021a75c41a0e9be1e86843fb9 (diff)
allow more complex conditional formats being exported to xlsx
-rw-r--r--sc/source/filter/excel/xecontent.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 3deb48a9701b..8dfe1cb5c385 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -783,7 +783,7 @@ void XclExpCFImpl::WriteBody( XclExpStream& rStrm )
namespace {
-const char* GetOperatorString(ScConditionMode eMode)
+const char* GetOperatorString(ScConditionMode eMode, bool& bFrmla2)
{
switch(eMode)
{
@@ -800,8 +800,10 @@ const char* GetOperatorString(ScConditionMode eMode)
case SC_COND_NOTEQUAL:
return "notEqual";
case SC_COND_BETWEEN:
+ bFrmla2 = true;
return "between";
case SC_COND_NOTBETWEEN:
+ bFrmla2 = true;
return "notBetween";
case SC_COND_DUPLICATE:
case SC_COND_NOTDUPLICATE:
@@ -814,8 +816,10 @@ const char* GetOperatorString(ScConditionMode eMode)
return "";
}
-const char* GetTypeString()
+const char* GetTypeString(ScConditionMode eMode)
{
+ if (eMode == SC_COND_DIRECT)
+ return "expression";
return "cellIs";
}
@@ -823,15 +827,18 @@ const char* GetTypeString()
void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
{
+ bool bFmla2 = false;
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->startElement( XML_cfRule,
- XML_type, GetTypeString(),
+ XML_type, GetTypeString( mrFormatEntry.GetOperation() ),
XML_priority, OString::valueOf( mnPriority + 1 ).getStr(),
- XML_operator, GetOperatorString( mrFormatEntry.GetOperation() ),
+ XML_operator, GetOperatorString( mrFormatEntry.GetOperation(), bFmla2 ),
XML_dxfId, OString::valueOf( GetDxfs().GetDxfId( mrFormatEntry.GetStyle() ) ).getStr(),
FSEND );
rWorksheet->startElement( XML_formula, FSEND );
rWorksheet->write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry( 0 ) ));
+ if (bFmla2)
+ rWorksheet->write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry( 1 ) ));
rWorksheet->endElement( XML_formula );
// OOXTODO: XML_extLst
rWorksheet->endElement( XML_cfRule );