sc/source/filter/excel/excform.cxx | 36 +++++++++++++++++++----------------- sc/source/filter/excel/read.cxx | 12 ++++++------ sc/source/filter/inc/imp_op.hxx | 4 ++-- 3 files changed, 27 insertions(+), 25 deletions(-)
New commits: commit a7f07eab97d9f52431329cb96bc1bf5ebd7da13d Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Tue Apr 10 15:01:19 2012 -0400 bnc#755775: Set numeric formula results when importing xls document. Without this, calculation upon import may incorrectly show #VALUE! in some cells when the iterative calculation option is turned on. This is on par with what we do during the ods document import. diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index 02ba65f..4fcf976 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -158,7 +158,9 @@ void ImportExcel::Formula( { if( eErr != ConvOK ) ExcelToSc::SetError( *pCell, eErr ); - (void)fCurVal; + + if (!rtl::math::isNan(fCurVal)) + pCell->SetHybridDouble(fCurVal); } GetXFRangeBuffer().SetXF( aScPos, nXF ); commit ff0314bf92cd300ddedad566ab0303ddf5e95c17 Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Tue Apr 10 14:46:02 2012 -0400 Method signature cleanup. Taking a reference to double makes no sense here. Plus the bool. diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index 0279b41..02ba65f 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -111,8 +111,8 @@ void ImportExcel::Formula4() } -void ImportExcel::Formula( const XclAddress& rXclPos, - sal_uInt16 nXF, sal_uInt16 nFormLen, double& rCurVal, sal_Bool bShrFmla ) +void ImportExcel::Formula( + const XclAddress& rXclPos, sal_uInt16 nXF, sal_uInt16 nFormLen, double fCurVal, bool bShrFmla) { ConvErr eErr = ConvOK; @@ -158,7 +158,7 @@ void ImportExcel::Formula( const XclAddress& rXclPos, { if( eErr != ConvOK ) ExcelToSc::SetError( *pCell, eErr ); - (void)rCurVal; + (void)fCurVal; } GetXFRangeBuffer().SetXF( aScPos, nXF ); diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx index 57a3374..fc56de7 100644 --- a/sc/source/filter/inc/imp_op.hxx +++ b/sc/source/filter/inc/imp_op.hxx @@ -184,8 +184,8 @@ protected: void Bof5( void ); // 0x0809 // --------------------------------------------------------------- - void Formula( const XclAddress& rXclPos, - sal_uInt16 nXF, sal_uInt16 nFormLen, double &rCurVal, sal_Bool bShrFmla ); + void Formula( + const XclAddress& rXclPos, sal_uInt16 nXF, sal_uInt16 nFormLen, double fCurVal, bool bShrFmla); // -> excform.cxx virtual void EndSheet( void ); commit 8bc22acaa0825c734e4f2dda177ad93b61b488a2 Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Tue Apr 10 14:28:00 2012 -0400 Zelle->Cell, Ergebnis->Result and bit of cleanup. diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index c5d2228..0279b41 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -120,25 +120,25 @@ void ImportExcel::Formula( const XclAddress& rXclPos, if( GetAddressConverter().ConvertAddress( aScPos, rXclPos, GetCurrScTab(), true ) ) { // Formula will be read next, length in nFormLen - const ScTokenArray* pErgebnis = 0; - sal_Bool bConvert; + const ScTokenArray* pResult = NULL; + bool bConvert = false; pFormConv->Reset( aScPos ); if( bShrFmla ) - bConvert = !pFormConv->GetShrFmla( pErgebnis, maStrm, nFormLen ); + bConvert = !pFormConv->GetShrFmla( pResult, maStrm, nFormLen ); else - bConvert = sal_True; + bConvert = true; if( bConvert ) - eErr = pFormConv->Convert( pErgebnis, maStrm, nFormLen, true, FT_CellFormula); + eErr = pFormConv->Convert( pResult, maStrm, nFormLen, true, FT_CellFormula); - ScFormulaCell* pZelle = NULL; + ScFormulaCell* pCell = NULL; - if( pErgebnis ) + if (pResult) { - pZelle = new ScFormulaCell( pD, aScPos, pErgebnis ); - pD->PutCell( aScPos.Col(), aScPos.Row(), aScPos.Tab(), pZelle, true ); + pCell = new ScFormulaCell( pD, aScPos, pResult ); + pD->PutCell( aScPos.Col(), aScPos.Row(), aScPos.Tab(), pCell, true ); } else { @@ -148,16 +148,16 @@ void ImportExcel::Formula( const XclAddress& rXclPos, if( eCellType == CELLTYPE_FORMULA ) { pD->GetCell( aScPos.Col(), aScPos.Row(), aScPos.Tab(), pBaseCell ); - pZelle = ( ScFormulaCell* ) pBaseCell; - if( pZelle ) - pZelle->AddRecalcMode( RECALCMODE_ONLOAD_ONCE ); + pCell = ( ScFormulaCell* ) pBaseCell; + if( pCell ) + pCell->AddRecalcMode( RECALCMODE_ONLOAD_ONCE ); } } - if( pZelle ) + if (pCell) { if( eErr != ConvOK ) - ExcelToSc::SetError( *pZelle, eErr ); + ExcelToSc::SetError( *pCell, eErr ); (void)rCurVal; } commit 65775b4e3fc7485ce42842abdd36eddc197bcd1d Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Tue Apr 10 14:19:18 2012 -0400 Let's use constants instead of raw values to make them more traceable. diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index 4f0ce42..08b56bc 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -664,9 +664,9 @@ FltError ImportExcel::Read( void ) case EXC_ID3_BOOLERR: ReadBoolErr(); break; case EXC_ID_RK: ReadRk(); break; - case 0x0006: - case 0x0206: - case 0x0406: Formula25(); break; + case EXC_ID2_FORMULA: + case EXC_ID3_FORMULA: + case EXC_ID4_FORMULA: Formula25(); break; case 0x0A: Eof(); eAkt = Z_Biff5E; break; case 0x14: case 0x15: rPageSett.ReadHeaderFooter( maStrm ); break; @@ -1184,9 +1184,9 @@ FltError ImportExcel8::Read( void ) case EXC_ID3_BOOLERR: ReadBoolErr(); break; case EXC_ID_RK: ReadRk(); break; - case 0x0006: - case 0x0206: - case 0x0406: Formula25(); break; // FORMULA [ 2 5 ] + case EXC_ID2_FORMULA: + case EXC_ID3_FORMULA: + case EXC_ID4_FORMULA: Formula25(); break; case 0x000C: Calccount(); break; // CALCCOUNT case 0x0010: Delta(); break; // DELTA case 0x0011: Iteration(); break; // ITERATION _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits