sc/source/filter/excel/xecontent.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 5328e04744bbf570e70b13917a2142c0aca159ae
Author:     Markus Mohrhard <markus.mohrh...@googlemail.com>
AuthorDate: Sat Jul 14 15:16:46 2018 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Fri May 10 08:24:39 2019 +0200

    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.mohrh...@googlemail.com>
    (cherry picked from commit e77596be879c25f5766b73a2f67cf0ddf7775ccc)
    Reviewed-on: https://gerrit.libreoffice.org/72004
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>
    Tested-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index d99607a1e0c2..eda436ad1b84 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1000,6 +1000,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 );
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to