1 diff --git sc/inc/cellform.hxx sc/inc/cellform.hxx
2 index a94ef54..d5c5b20 100644
3 --- sc/inc/cellform.hxx
4 +++ sc/inc/cellform.hxx
5 @@ -58,7 +58,7 @@ public:
6 ScForceTextFmt eForceTextFmt = ftDontForce );
8 static void GetInputString( ScBaseCell* pCell, ULONG nFormat, String& rString,
9 - SvNumberFormatter& rFormatter );
10 + SvNumberFormatter& rFormatter, Color** ppColor = NULL );
14 diff --git sc/source/core/tool/cellform.cxx sc/source/core/tool/cellform.cxx
15 index e6177b0..e17ef9c 100644
16 --- sc/source/core/tool/cellform.cxx
17 +++ sc/source/core/tool/cellform.cxx
18 @@ -159,8 +159,11 @@ void ScCellFormat::GetString( ScBaseCell* pCell, ULONG nFormat, String& rString,
21 void ScCellFormat::GetInputString( ScBaseCell* pCell, ULONG nFormat, String& rString,
22 - SvNumberFormatter& rFormatter )
23 + SvNumberFormatter& rFormatter, Color** ppColor )
28 if (&rFormatter==NULL)
31 @@ -173,17 +176,19 @@ void ScCellFormat::GetInputString( ScBaseCell* pCell, ULONG nFormat, String& rSt
34 ((ScStringCell*)pCell)->GetString( rString );
35 + rFormatter.GetStringColor(nFormat, ppColor);
40 ((ScEditCell*)pCell)->GetString( rString );
41 + rFormatter.GetStringColor(nFormat, ppColor);
46 double nValue = ((ScValueCell*)pCell)->GetValue();
47 - rFormatter.GetInputLineString( nValue, nFormat, rString );
48 + rFormatter.GetInputLineString( nValue, nFormat, rString, ppColor );
51 case CELLTYPE_FORMULA:
52 @@ -195,7 +200,7 @@ void ScCellFormat::GetInputString( ScBaseCell* pCell, ULONG nFormat, String& rSt
53 else if (((ScFormulaCell*)pCell)->IsValue())
55 double nValue = ((ScFormulaCell*)pCell)->GetValue();
56 - rFormatter.GetInputLineString( nValue, nFormat, rString );
57 + rFormatter.GetInputLineString( nValue, nFormat, rString, ppColor );
61 diff --git sc/source/ui/view/output2.cxx sc/source/ui/view/output2.cxx
62 index 8942a38..5826bb1 100644
63 --- sc/source/ui/view/output2.cxx
64 +++ sc/source/ui/view/output2.cxx
65 @@ -451,12 +451,23 @@ BOOL ScDrawStringsVars::SetText( ScBaseCell* pCell )
68 ULONG nFormat = GetValueFormat();
69 - ScCellFormat::GetString( pCell,
70 - nFormat, aString, &pColor,
71 - *pOutput->pDoc->GetFormatTable(),
72 - pOutput->bShowNullValues,
73 - pOutput->bShowFormulas,
76 + if (static_cast<NfIndexTableOffset>(nFormat) == NF_NUMBER_STANDARD)
77 + // For 'General' format type, display the value the same way it
78 + // is displayed in the edit window, which automatically
79 + // adjusts the number of decimal places based on the value of
81 + ScCellFormat::GetInputString( pCell,
83 + *pOutput->pDoc->GetFormatTable(),
86 + ScCellFormat::GetString( pCell,
87 + nFormat, aString, &pColor,
88 + *pOutput->pDoc->GetFormatTable(),
89 + pOutput->bShowNullValues,
90 + pOutput->bShowFormulas,
93 if (aString.Len() > DRAWTEXT_MAX)
94 aString.Erase(DRAWTEXT_MAX);