summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-03-20 00:22:38 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-03-22 21:49:16 -0400
commit95d2ab279414f9b24b43b9dd532cca842959389d (patch)
tree61b218e7dab235a64b547e5dcbaed8e001a9c311
parent85ab53551239246b2ee5a784e927304bc2397942 (diff)
More on reducing the ScBaseCell usage. That's it for today.
Change-Id: Ie35681e62a4ebcd792fd2f4dd62b5c4b8e4db49c
-rw-r--r--sc/qa/unit/helper/csv_handler.hxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx18
-rw-r--r--sc/source/ui/docshell/docsh8.cxx21
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx2
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());
}
}
}