[Libreoffice-commits] .: 11 commits - sc/inc sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Nov 4 07:35:10 PST 2012


 sc/inc/conditio.hxx                            |    6 +
 sc/inc/globstr.hrc                             |    8 +-
 sc/source/core/data/conditio.cxx               |   76 ++++++++++++++++++++++---
 sc/source/filter/oox/condformatbuffer.cxx      |   52 +++++------------
 sc/source/filter/xml/xmlcondformat.cxx         |   40 +++++++++++++
 sc/source/filter/xml/xmlexprt.cxx              |   26 ++++++++
 sc/source/ui/condformat/condformatdlgentry.cxx |   27 ++++++++
 sc/source/ui/condformat/condformathelper.cxx   |   12 +++
 sc/source/ui/src/condformatdlg.src             |    6 +
 sc/source/ui/src/globstr.src                   |   16 +++++
 10 files changed, 219 insertions(+), 50 deletions(-)

New commits:
commit 0159e9e193011053ebe4cc988bd6c740bf232f44
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 16:02:11 2012 +0100

    we don't need to use the indirection here
    
    Change-Id: I138f35852951db5411c535b467fb82d844d8f25c

diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index a622ef5..7840be1 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -666,10 +666,10 @@ void CondFormatRule::finalizeImport()
             eOperator = static_cast<ScConditionMode>(CondFormatBuffer::convertToInternalOperator( maModel.mnOperator ));
         break;
         case XML_duplicateValues:
-            eOperator = static_cast<ScConditionMode>(CondFormatBuffer::convertToInternalOperator( XML_duplicateValues ));
+            eOperator = SC_COND_DUPLICATE;
         break;
         case XML_uniqueValues:
-            eOperator = static_cast<ScConditionMode>(CondFormatBuffer::convertToInternalOperator( XML_uniqueValues ));
+            eOperator = SC_COND_NOTDUPLICATE;
         break;
         case XML_expression:
             eOperator = SC_COND_DIRECT;
commit 491abc60c1ea0d708173d3614e9097b01a67f607
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 15:56:11 2012 +0100

    implement text cond format import from odf
    
    Change-Id: Ic3616bf28711a3a5f0ea35caacaf181458eb5bb1

diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx
index ab71696..806cb87 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;
 }
commit 14b78ada71d0a6fff0336c7bccd4dfdbc32d33bd
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 14:59:14 2012 +0100

    add the new cond formats to the dialogs
    
    Change-Id: I5383d74abaa1d568a4be8271d0e081f914ac4067

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 5e27e71..ea2d870 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -608,9 +608,13 @@
 #define STR_COND_BELOW_AVERAGE      483
 #define STR_COND_ERROR              484
 #define STR_COND_NOERROR            485
+#define STR_COND_BEGINS_WITH        486
+#define STR_COND_ENDS_WITH          487
+#define STR_COND_CONTAINS           488
+#define STR_COND_NOT_CONTAINS       489
 
-#define STR_ERR_CONDFORMAT_PROTECTED 486
+#define STR_ERR_CONDFORMAT_PROTECTED 490
 
-#define STR_COUNT                   487
+#define STR_COUNT                   491
 
 #endif
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 180b1fc..817da0b 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -227,6 +227,18 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( Window* pParent, ScDocument* pDoc, c
                 maEdVal1.Hide();
                 maLbCondType.SelectEntryPos(17);
                 break;
+            case SC_COND_BEGINS_WITH:
+                maLbCondType.SelectEntryPos(18);
+                break;
+            case SC_COND_ENDS_WITH:
+                maLbCondType.SelectEntryPos(19);
+                break;
+            case SC_COND_CONTAINS_TEXT:
+                maLbCondType.SelectEntryPos(20);
+                break;
+            case SC_COND_NOT_CONTAINS_TEXT:
+                maLbCondType.SelectEntryPos(21);
+                break;
             case SC_COND_NONE:
                 break;
         }
@@ -331,6 +343,18 @@ ScFormatEntry* ScConditionFrmtEntry::createConditionEntry() const
         case 17:
             eMode = SC_COND_NOERROR;
             break;
+        case 18:
+            eMode = SC_COND_BEGINS_WITH;
+            break;
+        case 19:
+            eMode = SC_COND_ENDS_WITH;
+            break;
+        case 20:
+            eMode = SC_COND_CONTAINS_TEXT;
+            break;
+        case 21:
+            eMode = SC_COND_NOT_CONTAINS_TEXT;
+            break;
         default:
             assert(false); // this cannot happen
             return NULL;
@@ -977,7 +1001,8 @@ IMPL_LINK_NOARG( ScConditionFrmtEntry, ConditionTypeSelectHdl )
         maEdVal2.Hide();
         maEdVal1.Hide();
     }
-    else if(nSelectPos < 6 || (nSelectPos >= 10 && nSelectPos <= 13))
+    else if(nSelectPos <= 5 || (nSelectPos >= 10 && nSelectPos <= 13)
+            || nSelectPos >= 18)
     {
         maEdVal1.Show();
         maEdVal2.Hide();
diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx
index 3d8b5ee..09eaa24 100644
--- a/sc/source/ui/condformat/condformathelper.cxx
+++ b/sc/source/ui/condformat/condformathelper.cxx
@@ -76,6 +76,14 @@ rtl::OUString getExpression(sal_Int32 nIndex)
             return ScGlobal::GetRscString(STR_COND_ERROR);
         case 18:
             return ScGlobal::GetRscString(STR_COND_NOERROR);
+        case 19:
+            return ScGlobal::GetRscString(STR_COND_BEGINS_WITH);
+        case 20:
+            return ScGlobal::GetRscString(STR_COND_ENDS_WITH);
+        case 21:
+            return ScGlobal::GetRscString(STR_COND_CONTAINS);
+        case 22:
+            return ScGlobal::GetRscString(STR_COND_NOT_CONTAINS);
     }
     return rtl::OUString();
 }
@@ -111,7 +119,7 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm
                             aBuffer.append(rtl::OUString(" and "));
                             aBuffer.append(pEntry->GetExpression(rPos, 1));
                         }
-                        else if(eMode <= SC_COND_NOTEQUAL)
+                        else if(eMode <= SC_COND_NOTEQUAL || eMode >= SC_COND_BEGINS_WITH)
                         {
                             aBuffer.append(pEntry->GetExpression(rPos, 0));
                         }
@@ -141,7 +149,7 @@ rtl::OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sa
     if(eType == CONDITION)
     {
         aBuffer.append(getExpression(nIndex));
-        if(nIndex <= 7)
+        if(nIndex <= 7 || nIndex >= 19)
         {
             aBuffer.append(" ").append(aStr1);
             if(nIndex == 6 || nIndex == 7)
diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src
index 1cc7c67..8318cc1 100644
--- a/sc/source/ui/src/condformatdlg.src
+++ b/sc/source/ui/src/condformatdlg.src
@@ -149,6 +149,10 @@ Control RID_COND_ENTRY
             "below average";
             "Error";
             "No Error";
+            "Begins with";
+            "Ends with";
+            "Contains";
+            "Not Contains";
         };
     };
     Edit ED_VAL1
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 2212b42..226bb1a 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -1931,6 +1931,22 @@ Resource RID_GLOBSTR
     {
         Text [ en-US ] = "not an Error code";
     };
+    String STR_COND_BEGINS_WITH
+    {
+        Text [ en-US ] = "Begins with";
+    };
+    String STR_COND_ENDS_WITH
+    {
+        Text [ en-US ] = "Ends with";
+    };
+    String STR_COND_CONTAINS
+    {
+        Text [ en-US ] = "Contains";
+    };
+    String STR_COND_NOT_CONTAINS
+    {
+        Text [ en-US ] = "Not Contains";
+    };
     String STR_ERR_CONDFORMAT_PROTECTED
     {
         Text [ en-US ] = "Conditional Formats can not be created, deleted or changed in protected sheets!";
commit 7365db393b5c9f7035c9a8ea36e44904e641a269
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 02:34:17 2012 +0100

    implement text cond format export to odf
    
    Change-Id: I3992fb7150fff1422a04d85ead5f666f2d3f1bfb

diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index b38f273..58cdaa4 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3914,6 +3914,26 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
                             case SC_COND_NOERROR:
                                 aCond.append("is-no-error");
                                 break;
+                            case SC_COND_BEGINS_WITH:
+                                aCond.append("begins-with(");
+                                aCond.append(pEntry->GetExpression(aPos, 0, 0, formula::FormulaGrammar::GRAM_ODFF));
+                                aCond.append(")");
+                                break;
+                            case SC_COND_ENDS_WITH:
+                                aCond.append("ends-with(");
+                                aCond.append(pEntry->GetExpression(aPos, 0, 0, formula::FormulaGrammar::GRAM_ODFF));
+                                aCond.append(")");
+                                break;
+                            case SC_COND_CONTAINS_TEXT:
+                                aCond.append("contains-text(");
+                                aCond.append(pEntry->GetExpression(aPos, 0, 0, formula::FormulaGrammar::GRAM_ODFF));
+                                aCond.append(")");
+                                break;
+                            case SC_COND_NOT_CONTAINS_TEXT:
+                                aCond.append("not-contains-text(");
+                                aCond.append(pEntry->GetExpression(aPos, 0, 0, formula::FormulaGrammar::GRAM_ODFF));
+                                aCond.append(")");
+                                break;
                             case SC_COND_NONE:
                                 continue;
                             default:
commit 63ea94f1e5134e09fe33c8d36375d3608a5861ce
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 02:25:14 2012 +0100

    clean cond format ooxml import code
    
    Except for the base cell we no onger need to modify the formula
    
    Change-Id: I57426910b570b4c4605a5d6e265c165324233a8a

diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 4929e19..a622ef5 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -779,36 +779,6 @@ void CondFormatRule::finalizeImport()
                         aAddress = FormulaProcessorBase::generateAddress2dString( mrCondFormat.getRanges().getBaseAddress(), false );
                     aReplaceFormula = aReplaceFormula.replaceAt( nStrPos, 2, aAddress );
                 break;
-                case 'R':       // range list of conditional formatting
-                    if( aRanges.isEmpty() )
-                        aRanges = FormulaProcessorBase::generateRangeList2dString( mrCondFormat.getRanges(), true, ',', true );
-                    aReplaceFormula = aReplaceFormula.replaceAt( nStrPos, 2, aRanges );
-                break;
-                case 'T':       // comparison text
-                    if( aText.isEmpty() )
-                        // quote the comparison text, and handle embedded quote characters
-                        aText = FormulaProcessorBase::generateApiString( maModel.maText );
-                    aReplaceFormula = aReplaceFormula.replaceAt( nStrPos, 2, aText );
-                break;
-                case 'L':       // length of comparison text
-                    aReplaceFormula = aReplaceFormula.replaceAt( nStrPos, 2,
-                        OUString::valueOf( maModel.maText.getLength() ) );
-                break;
-                case 'K':       // top-10 rank
-                    aReplaceFormula = aReplaceFormula.replaceAt( nStrPos, 2,
-                        OUString::valueOf( maModel.mnRank ) );
-                break;
-                case 'M':       // top-10 top/bottom flag
-                    aReplaceFormula = aReplaceFormula.replaceAt( nStrPos, 2,
-                        OUString::valueOf( static_cast< sal_Int32 >( maModel.mbBottom ? 1 : 0 ) ) );
-                break;
-                case 'C':       // average comparison operator
-                    if( aComp.isEmpty() )
-                        aComp = maModel.mbAboveAverage ?
-                            (maModel.mbEqualAverage ? OUString( ">=" ) : OUString( ">" ) ) :
-                            (maModel.mbEqualAverage ? OUString( "<=" ) : OUString( "<" ) );
-                    aReplaceFormula = aReplaceFormula.replaceAt( nStrPos, 2, aComp );
-                break;
                 default:
                     OSL_FAIL( "CondFormatRule::finalizeImport - unknown placeholder" );
             }
commit 13fa07a4e369ad24ce7279292fb6604f57f86691
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 02:23:26 2012 +0100

    implement text cond formats ooxml import
    
    Change-Id: Icf6677131c6602e539515d73b1f08abd6e883dc9

diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index eb0f1dc..4929e19 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -676,20 +676,20 @@ void CondFormatRule::finalizeImport()
         break;
         case XML_containsText:
             OSL_ENSURE( maModel.mnOperator == XML_containsText, "CondFormatRule::finalizeImport - unexpected operator" );
-            aReplaceFormula = "NOT(ISERROR(SEARCH(#T,#B)))";
+            eOperator = SC_COND_CONTAINS_TEXT;
         break;
         case XML_notContainsText:
             // note: type XML_notContainsText vs. operator XML_notContains
             OSL_ENSURE( maModel.mnOperator == XML_notContains, "CondFormatRule::finalizeImport - unexpected operator" );
-            aReplaceFormula = "ISERROR(SEARCH(#T,#B))";
+            eOperator = SC_COND_NOT_CONTAINS_TEXT;
         break;
         case XML_beginsWith:
             OSL_ENSURE( maModel.mnOperator == XML_beginsWith, "CondFormatRule::finalizeImport - unexpected operator" );
-            aReplaceFormula = "LEFT(#B,#L)=#T";
+            eOperator = SC_COND_BEGINS_WITH;
         break;
         case XML_endsWith:
             OSL_ENSURE( maModel.mnOperator == XML_endsWith, "CondFormatRule::finalizeImport - unexpected operator" );
-            aReplaceFormula = "RIGHT(#B,#L)=#T";
+            eOperator = SC_COND_ENDS_WITH;
         break;
         case XML_timePeriod:
             switch( maModel.mnTimePeriod )
@@ -831,6 +831,16 @@ void CondFormatRule::finalizeImport()
         ScCondFormatEntry* pNewEntry = new ScCondFormatEntry( eOperator, NULL, NULL, &rDoc, aPos, aStyleName );
         mpFormat->AddEntry(pNewEntry);
     }
+    else if( eOperator == SC_COND_BEGINS_WITH || eOperator == SC_COND_ENDS_WITH ||
+            eOperator == SC_COND_CONTAINS_TEXT || eOperator == SC_COND_NOT_CONTAINS_TEXT )
+    {
+        ScDocument& rDoc = getScDocument();
+        ScTokenArray aTokenArray;
+        aTokenArray.AddString(maModel.maText);
+        OUString aStyleName = getStyles().createDxfStyle( maModel.mnDxfId );
+        ScCondFormatEntry* pNewEntry = new ScCondFormatEntry( eOperator, &aTokenArray, NULL, &rDoc, aPos, aStyleName );
+        mpFormat->AddEntry(pNewEntry);
+    }
     else if( (eOperator != SC_COND_NONE) && !maModel.maFormulas.empty() )
     {
         ScDocument& rDoc = getScDocument();
commit bca1f6b9cae0aacf4b49b237a913510c91ca10d1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 02:22:48 2012 +0100

    implement text conditional formats
    
    Change-Id: I29e837c3495264b04c25a8d6977e3f8dd1efd73b

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 935f33e..2f2eb49 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -78,6 +78,10 @@ enum ScConditionMode
     SC_COND_BELOW_AVERAGE,
     SC_COND_ERROR,
     SC_COND_NOERROR,
+    SC_COND_BEGINS_WITH,
+    SC_COND_ENDS_WITH,
+    SC_COND_CONTAINS_TEXT,
+    SC_COND_NOT_CONTAINS_TEXT,
     SC_COND_NONE
 };
 
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 4e3ffcb..f164cc4 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1000,9 +1000,18 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const
 
     if ( bIsStr1 )
     {
-        // wenn auf String getestet wird, bei Zahlen immer sal_False, ausser bei "ungleich"
-
-        return ( eOp == SC_COND_NOTEQUAL );
+        switch( eOp )
+        {
+            case SC_COND_BEGINS_WITH:
+            case SC_COND_ENDS_WITH:
+            case SC_COND_CONTAINS_TEXT:
+            case SC_COND_NOT_CONTAINS_TEXT:
+                break;
+            case SC_COND_NOTEQUAL:
+                return true;
+            default:
+                return false;
+        }
     }
 
     if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN )
@@ -1088,6 +1097,47 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const
             if( eOp == SC_COND_NOERROR )
                 bValid = !bValid;
             break;
+        case SC_COND_BEGINS_WITH:
+            if(!aStrVal1.Len())
+            {
+                rtl::OUString aStr = rtl::OUString::valueOf(nVal1);
+                rtl::OUString aStr2 = rtl::OUString::valueOf(nArg);
+                bValid = aStr2.indexOf(aStr) == 0;
+            }
+            else
+            {
+                rtl::OUString aStr2 = rtl::OUString::valueOf(nArg);
+                bValid = aStr2.indexOf(aStrVal1) == 0;
+            }
+        case SC_COND_ENDS_WITH:
+            if(!aStrVal1.Len())
+            {
+                rtl::OUString aStr = rtl::OUString::valueOf(nVal1);
+                rtl::OUString aStr2 = rtl::OUString::valueOf(nArg);
+                bValid = aStr2.endsWith(aStr) == 0;
+            }
+            else
+            {
+                rtl::OUString aStr2 = rtl::OUString::valueOf(nArg);
+                bValid = aStr2.endsWith(aStrVal1) == 0;
+            }
+        case SC_COND_CONTAINS_TEXT:
+        case SC_COND_NOT_CONTAINS_TEXT:
+            if(!aStrVal1.Len())
+            {
+                rtl::OUString aStr = rtl::OUString::valueOf(nVal1);
+                rtl::OUString aStr2 = rtl::OUString::valueOf(nArg);
+                bValid = aStr2.indexOf(aStr) != -1;
+            }
+            else
+            {
+                rtl::OUString aStr2 = rtl::OUString::valueOf(nArg);
+                bValid = aStr2.indexOf(aStrVal1) != -1;
+            }
+
+            if( eOp == SC_COND_NOT_CONTAINS_TEXT )
+                bValid = !bValid;
+            break;
         default:
             OSL_FAIL("unbekannte Operation bei ScConditionEntry");
             break;
@@ -1156,6 +1206,18 @@ bool ScConditionEntry::IsValidStr( const rtl::OUString& rArg, const ScAddress& r
             if(eOp == SC_COND_NOERROR)
                 bValid = !bValid;
         break;
+        case SC_COND_BEGINS_WITH:
+            bValid = rArg.indexOf(aUpVal1) == 0;
+        break;
+        case SC_COND_ENDS_WITH:
+            bValid = rArg.endsWith(aUpVal1);
+        break;
+        case SC_COND_CONTAINS_TEXT:
+        case SC_COND_NOT_CONTAINS_TEXT:
+            bValid = rArg.indexOf(aUpVal1) != -1;
+            if(eOp == SC_COND_NOT_CONTAINS_TEXT)
+                bValid = !bValid;
+        break;
         default:
         {
             sal_Int32 nCompare = ScGlobal::GetCollator()->compareString(
commit 13deb4cd8fca3f222003e0ace9875b80fda433d2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 01:22:43 2012 +0100

    switch from String to OUString
    
    Change-Id: I755d6e6e9c1118792578de52bd3af484f88072be

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 72f1fc8..935f33e 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -186,7 +186,7 @@ class SC_DLLPUBLIC ScConditionEntry : public ScFormatEntry
     void    Interpret( const ScAddress& rPos );
 
     bool    IsValid( double nArg, const ScAddress& rPos ) const;
-    bool    IsValidStr( const String& rArg, const ScAddress& rPos ) const;
+    bool    IsValidStr( const rtl::OUString& rArg, const ScAddress& rPos ) const;
 
 public:
             ScConditionEntry( ScConditionMode eOper,
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index f660b3b..4e3ffcb 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1095,7 +1095,7 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const
     return bValid;
 }
 
-bool ScConditionEntry::IsValidStr( const String& rArg, const ScAddress& rPos ) const
+bool ScConditionEntry::IsValidStr( const rtl::OUString& rArg, const ScAddress& rPos ) const
 {
     bool bValid = false;
     //  Interpret muss schon gerufen sein
@@ -1105,7 +1105,7 @@ bool ScConditionEntry::IsValidStr( const String& rArg, const ScAddress& rPos ) c
 
     if ( eOp == SC_COND_DUPLICATE || eOp == SC_COND_NOTDUPLICATE )
     {
-        if( pCondFormat && rArg.Len() )
+        if( pCondFormat && !rArg.isEmpty() )
         {
             bValid = IsDuplicate( 0.0, rArg );
             if( eOp == SC_COND_NOTDUPLICATE )
@@ -1122,8 +1122,8 @@ bool ScConditionEntry::IsValidStr( const String& rArg, const ScAddress& rPos ) c
         if ( !bIsStr2 )
             return false;
 
-    String aUpVal1( aStrVal1 );     //! als Member? (dann auch in Interpret setzen)
-    String aUpVal2( aStrVal2 );
+    rtl::OUString aUpVal1( aStrVal1 );     //! als Member? (dann auch in Interpret setzen)
+    rtl::OUString aUpVal2( aStrVal2 );
 
     if ( eOp == SC_COND_BETWEEN || eOp == SC_COND_NOTBETWEEN )
         if ( ScGlobal::GetCollator()->compareString( aUpVal1, aUpVal2 )
commit 2a87ed2c3dbd71dcf7d791b5d3fb756872582aa5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 00:41:36 2012 +0100

    implement (no) error cond format import from odf
    
    Change-Id: I97d049360c9d7868ed1b92e3453f9523747b526a

diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx
index fa2d2f9..ab71696 100644
--- a/sc/source/filter/xml/xmlcondformat.cxx
+++ b/sc/source/filter/xml/xmlcondformat.cxx
@@ -433,6 +433,14 @@ void GetConditionData(const rtl::OUString& rValue, ScConditionMode& eMode, rtl::
         rExpr1 = ScXMLConditionHelper::getExpression( pStart, pEnd, ')');
         eMode = SC_COND_DIRECT;
     }
+    else if(rValue.indexOf("is-error") == 0)
+    {
+        eMode = SC_COND_ERROR;
+    }
+    else if(rValue.indexOf("is-no-error") == 0)
+    {
+        eMode = SC_COND_NOERROR;
+    }
     else
         eMode = SC_COND_NONE;
 }
commit f506e99344158f0215228ab478bd3a19391d7220
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 00:38:25 2012 +0100

    implement export for (no) error cond format export to odf
    
    Change-Id: I5652803231651393b5f01d7c20e853819aef539d

diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 069b238..b38f273 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3908,6 +3908,12 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
                                 aCond.append(pEntry->GetExpression(aPos, 0, 0, formula::FormulaGrammar::GRAM_ODFF));
                                 aCond.append(')');
                                 break;
+                            case SC_COND_ERROR:
+                                aCond.append("is-error");
+                                break;
+                            case SC_COND_NOERROR:
+                                aCond.append("is-no-error");
+                                break;
                             case SC_COND_NONE:
                                 continue;
                             default:
commit 1d1004f604cbdb74b16e963ac6ab8252c7124f0b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Nov 4 00:32:35 2012 +0100

    make the drop down box larger
    
    Change-Id: Iee7d2480eebd94497d8a8547fcd57b1bbc157c64

diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src
index e0e0306..1cc7c67 100644
--- a/sc/source/ui/src/condformatdlg.src
+++ b/sc/source/ui/src/condformatdlg.src
@@ -126,7 +126,7 @@ Control RID_COND_ENTRY
     ListBox LB_CELLIS_TYPE
     {
         Pos = MAP_APPFONT( 90, 15 );
-        Size = MAP_APPFONT( 80, 40 );
+        Size = MAP_APPFONT( 80, 80 );
         Border = TRUE;
         DropDown = TRUE;
         StringList [ en-US ] =


More information about the Libreoffice-commits mailing list