[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source xmloff/inc xmloff/source

Caolán McNamara caolanm at redhat.com
Fri Oct 2 06:21:42 PDT 2015


 sc/qa/unit/data/xls/pass/crash-1.xls |binary
 sc/source/filter/excel/impop.cxx     |   24 +++++++++++++-----------
 xmloff/inc/DomExport.hxx             |    1 -
 xmloff/source/core/DomExport.cxx     |    6 ------
 4 files changed, 13 insertions(+), 18 deletions(-)

New commits:
commit d2281e20d96c640998530f3fb577b87ee85426f1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 2 10:41:25 2015 +0100

    fix crash on loading certain xls
    
    Change-Id: I2dd58060c1f3c9f12356c4ab18a0c838e7cdd718

diff --git a/sc/qa/unit/data/xls/pass/crash-1.xls b/sc/qa/unit/data/xls/pass/crash-1.xls
index 724bfc1..4b801ea3 100644
Binary files a/sc/qa/unit/data/xls/pass/crash-1.xls and b/sc/qa/unit/data/xls/pass/crash-1.xls differ
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index a08bd14..4339ae4 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -520,13 +520,11 @@ void ImportExcel::Columndefault()
 
 void ImportExcel::Array25()
 {
-    sal_uInt16      nFirstRow, nLastRow, nFormLen;
-    sal_uInt8       nFirstCol, nLastCol;
-
-    nFirstRow = aIn.ReaduInt16();
-    nLastRow = aIn.ReaduInt16();
-    nFirstCol = aIn.ReaduInt8();
-    nLastCol = aIn.ReaduInt8();
+    sal_uInt16 nFormLen;
+    sal_uInt16 nFirstRow = aIn.ReaduInt16();
+    sal_uInt16 nLastRow = aIn.ReaduInt16();
+    sal_uInt8 nFirstCol = aIn.ReaduInt8();
+    sal_uInt8 nLastCol = aIn.ReaduInt8();
 
     if( GetBiff() == EXC_BIFF2 )
     {//                     BIFF2
@@ -539,17 +537,21 @@ void ImportExcel::Array25()
         nFormLen = aIn.ReaduInt16();
     }
 
-    if( ValidColRow( nLastCol, nLastRow ) )
+    const ScTokenArray* pErgebnis = nullptr;
+
+    if (ValidColRow(nLastCol, nLastRow))
     {
         // the read mark is now on the formula, length in nFormLen
-        const ScTokenArray* pErgebnis;
 
         pFormConv->Reset( ScAddress( static_cast<SCCOL>(nFirstCol),
                     static_cast<SCROW>(nFirstRow), GetCurrScTab() ) );
-        pFormConv->Convert( pErgebnis, maStrm, nFormLen, true, FT_CellFormula);
+        pFormConv->Convert(pErgebnis, maStrm, nFormLen, true, FT_CellFormula);
 
-        OSL_ENSURE( pErgebnis, "*ImportExcel::Array25(): ScTokenArray is NULL!" );
+        SAL_WARN_IF(!pErgebnis, "sc", "*ImportExcel::Array25(): ScTokenArray is NULL!");
+    }
 
+    if (pErgebnis)
+    {
         ScDocumentImport& rDoc = GetDocImport();
         ScRange aArrayRange(nFirstCol, nFirstRow, GetCurrScTab(), nLastCol, nLastRow, GetCurrScTab());
         rDoc.setMatrixCells(aArrayRange, *pErgebnis, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1);
commit 78cab9dc44009351ec1f19376b0594cb4a110814
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 2 11:42:24 2015 +0100

    should be safe to remove this piece
    
    Change-Id: Ic1c5be7794ff374c32a3c727d6233f69ea38c7aa

diff --git a/xmloff/inc/DomExport.hxx b/xmloff/inc/DomExport.hxx
index 6f88dc3..c8c9a5d 100644
--- a/xmloff/inc/DomExport.hxx
+++ b/xmloff/inc/DomExport.hxx
@@ -30,7 +30,6 @@ namespace com { namespace sun { namespace star {
 } } }
 
 void exportDom( SvXMLExport&, const com::sun::star::uno::Reference<com::sun::star::xml::dom::XDocument>& );
-void exportDom( SvXMLExport&, const com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode>& );
 
 #endif
 
diff --git a/xmloff/source/core/DomExport.cxx b/xmloff/source/core/DomExport.cxx
index ec55a17..4502718 100644
--- a/xmloff/source/core/DomExport.cxx
+++ b/xmloff/source/core/DomExport.cxx
@@ -257,10 +257,4 @@ void exportDom( SvXMLExport& rExport, const Reference<XDocument>& xDocument )
     visit( aDomExport, xDocument );
 }
 
-void exportDom( SvXMLExport& rExport, const Reference<XNode>& xNode )
-{
-    DomExport aDomExport( rExport );
-    visit( aDomExport, xNode );
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list