[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sc/inc sc/source
Eike Rathke
erack at kemper.freedesktop.org
Thu Jul 5 11:43:03 PDT 2012
sc/inc/cell.hxx | 8 ++++++++
sc/inc/formularesult.hxx | 12 +++++++-----
sc/source/filter/excel/excform.cxx | 2 +-
3 files changed, 16 insertions(+), 6 deletions(-)
New commits:
commit d5bd0ff8450985d0adadfdb13b4d97249b1b4bf4
Author: Eike Rathke <erack at redhat.com>
Date: Thu Jul 5 20:26:20 2012 +0200
resolved fdo#51664 some matrix cases broken in binary Excel import
Import (ab)used ScFormulaCell::SetHybridDouble() in the sense that
actually it is not a hybrid (no formula string, the token array is
present in binary import) and during interpretation a matrix was
expected but instead the hybrid encountered.
Introduced ScFormulaCell::SetResultDouble() for exactly this case as a
workaround.
Change-Id: I4da3812ef4974380224b5a2bf42d0b62c14d121b
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index de4d1ad..5d750d8 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -503,6 +503,14 @@ public:
void SetHybridFormula( const rtl::OUString& r,
const formula::FormulaGrammar::Grammar eGrammar )
{ aResult.SetHybridFormula( r); eTempGrammar = eGrammar; }
+
+ /** For import only: set a double result.
+ Use this instead of SetHybridDouble() if there is no (temporary)
+ formula string because the formula is present as a token array, as it
+ is the case for binary Excel import.
+ */
+ void SetResultDouble( double n ) { aResult.SetDouble( n); }
+
void SetErrCode( sal_uInt16 n );
inline bool IsHyperLinkCell() const { return pCode && pCode->IsHyperLink(); }
EditTextObject* CreateURLObject() ;
diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index 2983176..e0f586c 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -151,11 +151,13 @@ public:
void SetResultError( sal_uInt16 nErr );
/** Set direct double. Shouldn't be used externally except in
- ScFormulaCell for rounded CalcAsShown or SetErrCode(). If
- ScMatrixFormulaCellToken the token isn't replaced but upper left result
- is modified instead, but only if it was of type formula::svDouble before or not
- set at all. */
- void SetDouble( double f );
+ ScFormulaCell for rounded CalcAsShown or SetErrCode() or
+ SetResultDouble(), see there for condition. If
+ ScMatrixFormulaCellToken the token isn't replaced but upper
+ left result is modified instead, but only if it was of type
+ formula::svDouble before or not set at all.
+ */
+ SC_DLLPUBLIC void SetDouble( double f );
/** Return value if type formula::svDouble or formula::svHybridCell or formula::svMatrixCell and upper
left formula::svDouble, else 0.0 */
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index 4fcf976..416d46f 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -160,7 +160,7 @@ void ImportExcel::Formula(
ExcelToSc::SetError( *pCell, eErr );
if (!rtl::math::isNan(fCurVal))
- pCell->SetHybridDouble(fCurVal);
+ pCell->SetResultDouble(fCurVal);
}
GetXFRangeBuffer().SetXF( aScPos, nXF );
More information about the Libreoffice-commits
mailing list