From 491abc60c1ea0d708173d3614e9097b01a67f607 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard <markus.mohrhard@googlemail.com> Date: Sun, 4 Nov 2012 15:56:11 +0100 Subject: implement text cond format import from odf Change-Id: Ic3616bf28711a3a5f0ea35caacaf181458eb5bb1 --- sc/source/filter/xml/xmlcondformat.cxx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'sc') diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index ab71696ba18f..806cb871c524 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -441,6 +441,38 @@ void GetConditionData(const rtl::OUString& rValue, ScConditionMode& eMode, rtl:: { eMode = SC_COND_NOERROR; } + else if(rValue.indexOf("begins-with") == 0) + { + eMode = SC_COND_BEGINS_WITH; + const sal_Unicode* pStr = rValue.getStr(); + const sal_Unicode* pStart = pStr + 12; + const sal_Unicode* pEnd = pStr + rValue.getLength(); + rExpr1 = ScXMLConditionHelper::getExpression( pStart, pEnd, ')'); + } + else if(rValue.indexOf("ends-with") == 0) + { + eMode = SC_COND_ENDS_WITH; + const sal_Unicode* pStr = rValue.getStr(); + const sal_Unicode* pStart = pStr + 10; + const sal_Unicode* pEnd = pStr + rValue.getLength(); + rExpr1 = ScXMLConditionHelper::getExpression( pStart, pEnd, ')'); + } + else if(rValue.indexOf("contains-text") == 0) + { + eMode = SC_COND_CONTAINS_TEXT; + const sal_Unicode* pStr = rValue.getStr(); + const sal_Unicode* pStart = pStr + 14; + const sal_Unicode* pEnd = pStr + rValue.getLength(); + rExpr1 = ScXMLConditionHelper::getExpression( pStart, pEnd, ')'); + } + else if(rValue.indexOf("not-contains-text") == 0) + { + eMode = SC_COND_NOT_CONTAINS_TEXT; + const sal_Unicode* pStr = rValue.getStr(); + const sal_Unicode* pStart = pStr + 18; + const sal_Unicode* pEnd = pStr + rValue.getLength(); + rExpr1 = ScXMLConditionHelper::getExpression( pStart, pEnd, ')'); + } else eMode = SC_COND_NONE; } -- cgit