[Libreoffice-commits] .: Branch 'libreoffice-4-0' - 3 commits - sc/inc sc/qa sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 4 19:11:09 PST 2013


 sc/inc/compiler.hxx                    |    2 +-
 sc/qa/unit/subsequent_filters-test.cxx |    2 +-
 sc/source/filter/xml/xmlcelli.cxx      |   10 ++++++++--
 sc/source/filter/xml/xmlrowi.cxx       |    7 -------
 sc/source/filter/xml/xmlrowi.hxx       |    2 --
 5 files changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 235aaeb596c3701373889535f8fd8e29c92d333e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Jan 5 04:09:48 2013 +0100

    don't set formula cells with possible error val clean, fdo#59039
    
    Change-Id: Ide96d7f052ee4c8f56b33629ae48c6425a8ca19f

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index fe24511..4aa393d 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -350,7 +350,6 @@ private:
     bool IsDBRange( const String& );
     bool IsColRowName( const String& );
     bool IsBoolean( const String& );
-    bool IsErrorConstant( const String& );
     void AutoCorrectParsedSymbol();
 
     void SetRelNameReference();
@@ -387,6 +386,7 @@ public:
 
     // Check if it is a valid english function name
     bool IsEnglishSymbol( const String& rName );
+    bool IsErrorConstant( const String& );
 
     //! _either_ CompileForFAP _or_ AutoCorrection, _not_ both
     // #i101512# SetCompileForFAP is in formula::FormulaCompiler
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 5e745e9..b64ab03 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -47,6 +47,7 @@
 #include "scerrors.hxx"
 #include "editutil.hxx"
 #include "cell.hxx"
+#include "compiler.hxx"
 
 
 #include <xmloff/xmltkmap.hxx>
@@ -726,8 +727,13 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const
     {
         if( bFormulaTextResult && pOUTextValue )
         {
-            pFCell->SetHybridString( *pOUTextValue );
-            pFCell->ResetDirty();
+            static ScCompiler aComp(NULL, ScAddress());
+            aComp.SetGrammar(formula::FormulaGrammar::GRAM_ODFF);
+            if(!aComp.IsErrorConstant(*pOUTextValue))
+            {
+                pFCell->SetHybridString( *pOUTextValue );
+                pFCell->ResetDirty();
+            }
         }
         else if (!rtl::math::isNan(fValue))
         {
commit 1cdb049115a5a62bcd0febdd590d80049f67ebe6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Jan 5 00:18:21 2013 +0100

    enable the unit test

diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 5acbfb8..618e627 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -213,7 +213,7 @@ public:
     CPPUNIT_TEST(testCellAnchoredShapesODS);
 
     CPPUNIT_TEST(testPivotTableBasicODS);
-//  CPPUNIT_TEST(testRowHeight);
+    CPPUNIT_TEST(testRowHeight);
     CPPUNIT_TEST(testFormulaDependency);
 
     //disable testPassword on MacOSX due to problems with libsqlite3
commit 734c469a91fad731715870e30886de9bb420c5c6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Jan 5 00:14:47 2013 +0100

    Revert "workaround problems with row import, fdo#58539"
    
    This reverts commit 119483d9b0af6b4830733161fcf56cea10ed01d7.

diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx
index a4434e1..ec4c5a5 100644
--- a/sc/source/filter/xml/xmlrowi.cxx
+++ b/sc/source/filter/xml/xmlrowi.cxx
@@ -98,7 +98,6 @@ ScXMLTableRowContext::ScXMLTableRowContext( ScXMLImport& rImport,
             break;*/
         }
     }
-    mnLastRow = GetScImport().GetTables().GetCurrentRow() + nRepeatedRows;
     GetScImport().GetTables().AddRow();
     GetScImport().GetTables().SetRowStyle(sCellStyleName);
 }
@@ -156,12 +155,6 @@ void ScXMLTableRowContext::EndElement()
     }
     SCTAB nSheet = rXMLImport.GetTables().GetCurrentSheet();
     sal_Int32 nCurrentRow(rXMLImport.GetTables().GetCurrentRow());
-    if(nCurrentRow != mnLastRow)
-    {
-        // this document is most likely invalid in some way
-        SAL_WARN("sc", "we did not generate enough rows in the cell import!!");
-        nCurrentRow = mnLastRow;
-    }
     uno::Reference<sheet::XSpreadsheet> xSheet(rXMLImport.GetTables().GetCurrentXSheet());
     if(xSheet.is())
     {
diff --git a/sc/source/filter/xml/xmlrowi.hxx b/sc/source/filter/xml/xmlrowi.hxx
index 02c5255..a900ff7 100644
--- a/sc/source/filter/xml/xmlrowi.hxx
+++ b/sc/source/filter/xml/xmlrowi.hxx
@@ -29,8 +29,6 @@ class ScXMLTableRowContext : public SvXMLImportContext
     rtl::OUString sStyleName;
     rtl::OUString sVisibility;
     sal_Int32 nRepeatedRows;
-    sal_Int32 mnLastRow; // to workaround problems with the cell import, can be removed when the cell
-                        // always adds enough rows
     bool bHasCell;
 
     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }


More information about the Libreoffice-commits mailing list