summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/column3.cxx14
-rw-r--r--sc/source/core/data/formulacell.cxx2
2 files changed, 10 insertions, 6 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 855f82c39423..63fd08498d59 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -998,7 +998,9 @@ public:
{
mrDestCol.SetFormulaCell(
maDestBlockPos, nSrcRow + mnRowOffset,
- new ScFormulaCell(rSrcCell, mrDestCol.GetDoc(), aDestPos));
+ new ScFormulaCell(rSrcCell, mrDestCol.GetDoc(), aDestPos),
+ sc::SingleCellListening,
+ rSrcCell.NeedsNumberFormat());
}
}
else if (bNumeric || bDateTime || bString)
@@ -1963,11 +1965,12 @@ void ScColumn::SetFormula( SCROW nRow, const OUString& rFormula, formula::Formul
}
ScFormulaCell* ScColumn::SetFormulaCell(
- SCROW nRow, ScFormulaCell* pCell, sc::StartListeningType eListenType )
+ SCROW nRow, ScFormulaCell* pCell, sc::StartListeningType eListenType,
+ bool bInheritNumFormatIfNeeded )
{
sc::CellStoreType::iterator it = GetPositionToInsert(nRow);
sal_uInt32 nCellFormat = GetNumberFormat(pDocument->GetNonThreadedContext(), nRow);
- if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+ if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 && bInheritNumFormatIfNeeded )
pCell->SetNeedNumberFormat(true);
it = maCells.set(it, nRow, pCell);
maCellTextAttrs.set(nRow, sc::CellTextAttr());
@@ -1980,11 +1983,12 @@ ScFormulaCell* ScColumn::SetFormulaCell(
void ScColumn::SetFormulaCell(
sc::ColumnBlockPosition& rBlockPos, SCROW nRow, ScFormulaCell* pCell,
- sc::StartListeningType eListenType )
+ sc::StartListeningType eListenType,
+ bool bInheritNumFormatIfNeeded )
{
rBlockPos.miCellPos = GetPositionToInsert(rBlockPos.miCellPos, nRow);
sal_uInt32 nCellFormat = GetNumberFormat(pDocument->GetNonThreadedContext(), nRow);
- if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+ if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0 && bInheritNumFormatIfNeeded )
pCell->SetNeedNumberFormat(true);
rBlockPos.miCellPos = maCells.set(rBlockPos.miCellPos, nRow, pCell);
rBlockPos.miCellTextAttrPos = maCellTextAttrs.set(
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 5b8e6d1d36e9..0d1ca1bf7f6d 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -815,7 +815,7 @@ ScFormulaCell::ScFormulaCell(const ScFormulaCell& rCell, ScDocument& rDoc, const
bInChangeTrack( false ),
bTableOpDirty( false ),
bNeedListening( false ),
- mbNeedsNumberFormat( false ),
+ mbNeedsNumberFormat( rCell.mbNeedsNumberFormat ),
mbAllowNumberFormatChange(false),
mbPostponedDirty(false),
mbIsExtRef(false),