[Libreoffice-commits] core.git: sc/qa sc/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Tue Jul 2 20:53:15 PDT 2013
sc/qa/unit/subsequent_filters-test.cxx | 2 +-
sc/source/core/data/column.cxx | 15 ++++++++++++---
sc/source/core/data/column3.cxx | 10 ++++++++--
3 files changed, 21 insertions(+), 6 deletions(-)
New commits:
commit a4c6f4c570213236102ad790531df2ee55bf60b4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 3 05:46:51 2013 +0200
fix the inherited number format removal code
Change-Id: Ieb17d6f8505d7a5934b9542d407be8902b4be427
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index c8bbcf0..a9ca9a2 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -146,7 +146,7 @@ public:
CPPUNIT_TEST(testRangeNameXLSX);
CPPUNIT_TEST(testHardRecalcODS);
CPPUNIT_TEST(testFunctionsODS);
-// CPPUNIT_TEST(testCachedFormulaResultsODS); TODO: Fix this
+ CPPUNIT_TEST(testCachedFormulaResultsODS);
CPPUNIT_TEST(testCachedMatrixFormulaResultsODS);
CPPUNIT_TEST(testDatabaseRangesODS);
CPPUNIT_TEST(testDatabaseRangesXLS);
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 6a2dbd3..18dc981 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2628,11 +2628,20 @@ struct CompileAllHandler
class CompileXMLHandler
{
ScProgress& mrProgress;
+ const ScColumn& mrCol;
public:
- CompileXMLHandler(ScProgress& rProgress) : mrProgress(rProgress) {}
+ CompileXMLHandler(ScProgress& rProgress, const ScColumn& rCol) :
+ mrProgress(rProgress),
+ mrCol(rCol) {}
- void operator() (size_t /*nRow*/, ScFormulaCell* pCell)
+ void operator() (size_t nRow, ScFormulaCell* pCell)
{
+ sal_uInt32 nFormat = mrCol.GetNumberFormat(nRow);
+ if( (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+ pCell->SetNeedNumberFormat(false);
+ else
+ pCell->SetDirty(true);
+
pCell->CompileXML(mrProgress);
}
};
@@ -2914,7 +2923,7 @@ void ScColumn::CompileAll()
void ScColumn::CompileXML( ScProgress& rProgress )
{
- CompileXMLHandler aFunc(rProgress);
+ CompileXMLHandler aFunc(rProgress, *this);
sc::ProcessFormula(maCells, aFunc);
RegroupFormulaCells();
}
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index ee200f5..15a085a 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1829,7 +1829,7 @@ void ScColumn::SetFormula( SCROW nRow, const ScTokenArray& rArray, formula::Form
sc::CellStoreType::iterator it = GetPositionToInsert(nRow);
ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, &rArray, eGram);
sal_uInt32 nCellFormat = GetNumberFormat(nRow);
- if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+ if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
pCell->SetNeedNumberFormat(true);
it = maCells.set(it, nRow, pCell);
maCellTextAttrs.set(nRow, sc::CellTextAttr());
@@ -1845,7 +1845,7 @@ void ScColumn::SetFormula( SCROW nRow, const OUString& rFormula, formula::Formul
sc::CellStoreType::iterator it = GetPositionToInsert(nRow);
ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, rFormula, eGram);
sal_uInt32 nCellFormat = GetNumberFormat(nRow);
- if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+ if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
pCell->SetNeedNumberFormat(true);
it = maCells.set(it, nRow, pCell);
maCellTextAttrs.set(nRow, sc::CellTextAttr());
@@ -1857,6 +1857,9 @@ void ScColumn::SetFormula( SCROW nRow, const OUString& rFormula, formula::Formul
ScFormulaCell* ScColumn::SetFormulaCell( SCROW nRow, ScFormulaCell* pCell )
{
sc::CellStoreType::iterator it = GetPositionToInsert(nRow);
+ sal_uInt32 nCellFormat = GetNumberFormat(nRow);
+ if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+ pCell->SetNeedNumberFormat(true);
it = maCells.set(it, nRow, pCell);
maCellTextAttrs.set(nRow, sc::CellTextAttr());
CellStorageModified();
@@ -1868,6 +1871,9 @@ ScFormulaCell* ScColumn::SetFormulaCell( SCROW nRow, ScFormulaCell* pCell )
ScFormulaCell* ScColumn::SetFormulaCell( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, ScFormulaCell* pCell )
{
rBlockPos.miCellPos = GetPositionToInsert(rBlockPos.miCellPos, nRow);
+ sal_uInt32 nCellFormat = GetNumberFormat(nRow);
+ if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+ pCell->SetNeedNumberFormat(true);
rBlockPos.miCellPos = maCells.set(rBlockPos.miCellPos, nRow, pCell);
rBlockPos.miCellTextAttrPos = maCellTextAttrs.set(
rBlockPos.miCellTextAttrPos, nRow, sc::CellTextAttr());
More information about the Libreoffice-commits
mailing list