Kaydet (Commit) 569c2229 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Andras Timar

related tdf#117816, only export cond format formula to xlsx when required

Change-Id: I7523d17e9945dfbdf0c346fff8eddd40593f946a
Reviewed-on: https://gerrit.libreoffice.org/57444
Tested-by: Jenkins
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit 16048ebc)
Reviewed-on: https://gerrit.libreoffice.org/72007Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
Tested-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst 0420bf0d
......@@ -939,6 +939,27 @@ bool IsTextRule(ScConditionMode eMode)
return false;
}
bool RequiresFormula(ScConditionMode eMode)
{
if (IsTopBottomRule(eMode))
return false;
else if (IsTextRule(eMode))
return false;
switch (eMode)
{
case ScConditionMode::NoError:
case ScConditionMode::Error:
case ScConditionMode::Duplicate:
case ScConditionMode::NotDuplicate:
return false;
default:
break;
}
return true;
}
bool RequiresFixedFormula(ScConditionMode eMode)
{
switch(eMode)
......@@ -965,9 +986,9 @@ OString GetFixedFormula(ScConditionMode eMode, const ScAddress& rAddress, const
switch (eMode)
{
case ScConditionMode::Error:
return "";
return OString("ISERROR(" + aPos + ")") ;
case ScConditionMode::NoError:
return "";
return OString("NOT(ISERROR(" + aPos + "))") ;
case ScConditionMode::BeginsWith:
return OString("LEFT(" + aPos + ",LEN(\"" + rText + "\"))=\"" + rText + "\"");
case ScConditionMode::EndsWith:
......@@ -1036,7 +1057,7 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
rWorksheet->writeEscaped(aFormula.getStr());
rWorksheet->endElement( XML_formula );
}
else if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation))
else if(RequiresFormula(eOperation))
{
rWorksheet->startElement( XML_formula, FSEND );
std::unique_ptr<ScTokenArray> pTokenArray(mrFormatEntry.CreateFlatCopiedTokenArray(0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment