diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-07-14 15:16:46 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-07-15 00:36:18 +0200 |
commit | e77596be879c25f5766b73a2f67cf0ddf7775ccc (patch) | |
tree | c8340636cb8f52d68a3e4f26cbe8021bf6960acd /sc/source | |
parent | d11313f341d1d9a9c73c736932441a89d5292e37 (diff) |
tdf#117816, work around MS Excel bug with containsText cond format
Excel seems to require the formula that is equal to the containsText
condition.
According to cfRule (18.3.1.10) "Only rules with a type attribute
value of expression support formula syntax." which contradicts the
MS EXCEL behavior.
Change-Id: Ifa3f9fee58194f70a64b37c62922513435d43bb8
Reviewed-on: https://gerrit.libreoffice.org/57432
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index deb8f8dd2454..6d025f022eeb 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -998,6 +998,16 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm ) rWorksheet->endElement( XML_formula ); } } + else if (IsTextRule(eOperation)) + { + OStringBuffer aBufferOld; + OStringBuffer aBuffer = XclXmlUtils::ToOString(aBufferOld, mrFormatEntry.GetValidSrcPos()); + OString aTextTopCell = aBuffer.makeStringAndClear(); + OString aFormula = "NOT(ISERROR(SEARCH(\"" + aText + "\"," + aTextTopCell + ")))"; + rWorksheet->startElement( XML_formula, FSEND ); + rWorksheet->writeEscaped(aFormula.getStr()); + rWorksheet->endElement( XML_formula ); + } // OOXTODO: XML_extLst rWorksheet->endElement( XML_cfRule ); } |