summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-11-04 15:56:11 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-11-04 16:33:17 +0100
commit491abc60c1ea0d708173d3614e9097b01a67f607 (patch)
tree5a646c4121c36857c0d755138895af606f110e3b
parent14b78ada71d0a6fff0336c7bccd4dfdbc32d33bd (diff)
implement text cond format import from odf
Change-Id: Ic3616bf28711a3a5f0ea35caacaf181458eb5bb1
-rw-r--r--sc/source/filter/xml/xmlcondformat.cxx32
1 files changed, 32 insertions, 0 deletions
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;
}