[Libreoffice-commits] core.git: Branch 'private/kohei/xlsx-import-speedup' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Nov 12 12:28:24 PST 2013


 sc/source/filter/oox/sheetdatabuffer.cxx |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit b3ae8934a57e3edb4f01d1558f615c0e573a8276
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Nov 12 15:29:36 2013 -0500

    Avoid using UNO API formula tokens.
    
    Change-Id: Ide89b06a64405d006ac4b88cd3ae88b696f981f2

diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index 2b340c5..c4dcc2d 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -53,6 +53,7 @@
 #include "docpool.hxx"
 #include "paramisc.hxx"
 #include "documentimport.hxx"
+#include "formulabuffer.hxx"
 
 namespace oox {
 namespace xls {
@@ -199,7 +200,9 @@ void SheetDataBuffer::setDateTimeCell( const CellModel& rModel, const ::com::sun
 
 void SheetDataBuffer::setBooleanCell( const CellModel& rModel, bool bValue )
 {
-    setCellFormula( rModel.maCellAddr, getFormulaParser().convertBoolToFormula( bValue ) );
+    getFormulaBuffer().setCellFormula(
+        rModel.maCellAddr, bValue ? OUString("TRUE()") : OUString("FALSE()"));
+
     // #108770# set 'Standard' number format for all Boolean cells
     setCellFormat( rModel, 0 );
 }
@@ -211,7 +214,12 @@ void SheetDataBuffer::setErrorCell( const CellModel& rModel, const OUString& rEr
 
 void SheetDataBuffer::setErrorCell( const CellModel& rModel, sal_uInt8 nErrorCode )
 {
-    setCellFormula( rModel.maCellAddr, getFormulaParser().convertErrorToFormula( nErrorCode ) );
+    OUStringBuffer aBuf;
+    aBuf.append(sal_Unicode('{'));
+    aBuf.append(BiffHelper::calcDoubleFromError(nErrorCode));
+    aBuf.append(sal_Unicode('}'));
+
+    getFormulaBuffer().setCellFormula(rModel.maCellAddr, aBuf.makeStringAndClear());
     setCellFormat( rModel );
 }
 


More information about the Libreoffice-commits mailing list