diff options
-rw-r--r-- | sc/qa/unit/helper/csv_handler.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 21 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 2 |
4 files changed, 19 insertions, 24 deletions
diff --git a/sc/qa/unit/helper/csv_handler.hxx b/sc/qa/unit/helper/csv_handler.hxx index 7fe94ffcb8d1..e23efb185d25 100644 --- a/sc/qa/unit/helper/csv_handler.hxx +++ b/sc/qa/unit/helper/csv_handler.hxx @@ -51,7 +51,7 @@ rtl::OUString getConditionalFormatString(ScDocument* pDoc, SCCOL nCol, SCROW nRo const ScPatternAttr* pPattern = pDoc->GetPattern(nCol, nRow, nTab); SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet ); - ScCellFormat::GetString( pCell, nFormat, aString, &pColor, *pFormatter); + aString = ScCellFormat::GetString(*pDoc, ScAddress(nCol, nRow, nTab), nFormat, &pColor, *pFormatter); return aString; } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index deea8594fb9c..7a2aebae2a11 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1874,6 +1874,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt nNextCol = nCol + 1; CellType eType = pCell->GetCellType(); + ScAddress aPos(nCol, nRow, nTab); if ( bTabProtect ) { const ScProtectionAttr* pProtAttr = @@ -1907,12 +1908,11 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt } else if ( ((ScFormulaCell*)pCell)->IsValue() ) { - sal_uInt32 nFormat; - aDocument.GetNumberFormat( nCol, nRow, nTab, nFormat ); + sal_uInt32 nFormat = aDocument.GetNumberFormat(aPos); if ( bFixedWidth || bSaveAsShown ) { Color* pDummy; - ScCellFormat::GetString( pCell, nFormat, aString, &pDummy, rFormatter ); + aString = ScCellFormat::GetString(aDocument, aPos, nFormat, &pDummy, rFormatter); bString = bSaveAsShown && rFormatter.IsTextFormat( nFormat); } else @@ -1925,10 +1925,9 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt { if ( bSaveAsShown ) { - sal_uInt32 nFormat; - aDocument.GetNumberFormat( nCol, nRow, nTab, nFormat ); + sal_uInt32 nFormat = aDocument.GetNumberFormat(aPos); Color* pDummy; - ScCellFormat::GetString( pCell, nFormat, aString, &pDummy, rFormatter ); + aString = ScCellFormat::GetString(aDocument, aPos, nFormat, &pDummy, rFormatter); } else aString = ((ScFormulaCell*)pCell)->GetString(); @@ -1939,10 +1938,9 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt case CELLTYPE_STRING : if ( bSaveAsShown ) { - sal_uInt32 nFormat; - aDocument.GetNumberFormat( nCol, nRow, nTab, nFormat ); + sal_uInt32 nFormat = aDocument.GetNumberFormat(aPos); Color* pDummy; - ScCellFormat::GetString( pCell, nFormat, aString, &pDummy, rFormatter ); + aString = ScCellFormat::GetString(aDocument, aPos, nFormat, &pDummy, rFormatter); } else aString = ((ScStringCell*)pCell)->GetString(); @@ -1964,7 +1962,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt if ( bFixedWidth || bSaveAsShown ) { Color* pDummy; - ScCellFormat::GetString( pCell, nFormat, aString, &pDummy, rFormatter ); + aString = ScCellFormat::GetString(aDocument, aPos, nFormat, &pDummy, rFormatter); bString = bSaveAsShown && rFormatter.IsTextFormat( nFormat); } else diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 40c4a0fe5ca4..e17b8c4e1df2 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -768,14 +768,13 @@ inline void lcl_getLongVarCharEditString( rtl::OUString& rString, rString = rEditEngine.GetText( LINEEND_CRLF ); } -inline void lcl_getLongVarCharString( rtl::OUString& rString, ScBaseCell* pCell, - ScDocument& rDocument, SCCOL nCol, SCROW nRow, SCTAB nTab, - SvNumberFormatter& rNumFmt ) +inline void lcl_getLongVarCharString( + OUString& rString, ScDocument& rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, SvNumberFormatter& rNumFmt ) { - sal_uInt32 nFormat; Color* pColor; - rDocument.GetNumberFormat( nCol, nRow, nTab, nFormat ); - ScCellFormat::GetString( pCell, nFormat, rString, &pColor, rNumFmt ); + ScAddress aPos(nCol, nRow, nTab); + sal_uInt32 nFormat = rDoc.GetNumberFormat(aPos); + rString = ScCellFormat::GetString(rDoc, aPos, nFormat, &pColor, rNumFmt); } } @@ -981,9 +980,8 @@ sal_uLong ScDocShell::DBaseExport( const rtl::OUString& rFullFileName, CharSet e } else { - lcl_getLongVarCharString( aString, pCell, - aDocument, nDocCol, nDocRow, nTab, - *pNumFmt); + lcl_getLongVarCharString( + aString, aDocument, nDocCol, nDocRow, nTab, *pNumFmt); } xRowUpdate->updateString( nCol+1, aString ); } @@ -1095,9 +1093,8 @@ sal_uLong ScDocShell::DBaseExport( const rtl::OUString& rFullFileName, CharSet e lcl_getLongVarCharEditString( aString, pCell, aEditEngine); else - lcl_getLongVarCharString( aString, - pCell, aDocument, nDocCol, - nDocRow, nTab, *pNumFmt); + lcl_getLongVarCharString( + aString, aDocument, nDocCol, nDocRow, nTab, *pNumFmt); } } break; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index cfd864a2acf7..ab082b59bb76 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -6273,7 +6273,7 @@ String ScCellObj::GetOutputString_Impl(ScDocument* pDoc, const ScAddress& aCellP // wie in GetString am Dokument (column) Color* pColor; sal_uLong nNumFmt = pDoc->GetNumberFormat( aCellPos ); - ScCellFormat::GetString( pCell, nNumFmt, aVal, &pColor, *pDoc->GetFormatTable() ); + aVal = ScCellFormat::GetString(*pDoc, aCellPos, nNumFmt, &pColor, *pDoc->GetFormatTable()); } } } |