summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-08 15:18:16 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-08 15:48:12 -0400
commit3786609a153b7fa38393eb646557d241af2d3060 (patch)
treed2d33086cf318229a7893dc0958630834fc1ec16 /sc/source/core/data
parenta7ff6e0a3fc5fccad33f06ae9d4ec7019f9ae156 (diff)
No more getIdentifier*() calls because they are not efficient.
They shall never be used. Change-Id: I019c88b1511a67175d782777cd41e0ec0434f497
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/column3.cxx48
-rw-r--r--sc/source/core/data/document.cxx14
-rw-r--r--sc/source/core/data/table2.cxx14
3 files changed, 13 insertions, 63 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f331d354b2e1..ae84c131cd77 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1736,62 +1736,28 @@ bool ScColumn::SetGroupFormulaCell( SCROW nRow, ScFormulaCell* pCell )
return true;
}
-sal_uIntPtr ScColumn::GetCellStringID( SCROW nRow ) const
+svl::SharedString ScColumn::GetSharedString( SCROW nRow ) const
{
sc::CellStoreType::const_position_type aPos = maCells.position(nRow);
switch (aPos.first->type)
{
case sc::element_type_string:
- {
- const svl::SharedString& rStr = sc::string_block::at(*aPos.first->data, aPos.second);
- return reinterpret_cast<sal_uIntPtr>(rStr.getData());
- }
- break;
- case sc::element_type_edittext:
- {
- std::vector<sal_uIntPtr> aIDs;
- const EditTextObject* pObj = sc::edittext_block::at(*aPos.first->data, aPos.second);
- pObj->GetStringIDs(pDocument->GetSharedStringPool(), aIDs);
- if (aIDs.size() != 1)
- // We don't handle multiline content for now.
- return 0;
-
- return aIDs[0];
- }
- break;
- default:
- ;
- }
- return 0;
-}
-
-sal_uIntPtr ScColumn::GetCellStringIDIgnoreCase( SCROW nRow ) const
-{
- sc::CellStoreType::const_position_type aPos = maCells.position(nRow);
- switch (aPos.first->type)
- {
- case sc::element_type_string:
- {
- const svl::SharedString& rStr = sc::string_block::at(*aPos.first->data, aPos.second);
- return reinterpret_cast<sal_uIntPtr>(rStr.getDataIgnoreCase());
- }
- break;
+ return sc::string_block::at(*aPos.first->data, aPos.second);
case sc::element_type_edittext:
{
- std::vector<sal_uIntPtr> aIDs;
const EditTextObject* pObj = sc::edittext_block::at(*aPos.first->data, aPos.second);
- pObj->GetStringIDsIgnoreCase(pDocument->GetSharedStringPool(), aIDs);
- if (aIDs.size() != 1)
+ std::vector<svl::SharedString> aSSs = pObj->GetSharedStrings();
+ if (aSSs.size() != 1)
// We don't handle multiline content for now.
- return 0;
+ return svl::SharedString();
- return aIDs[0];
+ return aSSs[0];
}
break;
default:
;
}
- return 0;
+ return svl::SharedString();
}
namespace {
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index b5f6b8e4dc58..51a5c2ef8eb0 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3213,20 +3213,12 @@ double* ScDocument::GetValueCell( const ScAddress& rPos )
return maTabs[rPos.Tab()]->GetValueCell(rPos.Col(), rPos.Row());
}
-sal_uIntPtr ScDocument::GetCellStringID( const ScAddress& rPos ) const
+svl::SharedString ScDocument::GetSharedString( const ScAddress& rPos ) const
{
if (!TableExists(rPos.Tab()))
- return 0;
-
- return maTabs[rPos.Tab()]->GetCellStringID(rPos.Col(), rPos.Row());
-}
-
-sal_uIntPtr ScDocument::GetCellStringIDIgnoreCase( const ScAddress& rPos ) const
-{
- if (!TableExists(rPos.Tab()))
- return 0;
+ return svl::SharedString();
- return maTabs[rPos.Tab()]->GetCellStringIDIgnoreCase(rPos.Col(), rPos.Row());
+ return maTabs[rPos.Tab()]->GetSharedString(rPos.Col(), rPos.Row());
}
void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, OUString& rString )
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index a7504ccb5234..be791ca1abcb 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1505,20 +1505,12 @@ bool ScTable::SetGroupFormulaCell( SCCOL nCol, SCROW nRow, ScFormulaCell* pCell
return aCol[nCol].SetGroupFormulaCell(nRow, pCell);
}
-sal_uIntPtr ScTable::GetCellStringID( SCCOL nCol, SCROW nRow ) const
+svl::SharedString ScTable::GetSharedString( SCCOL nCol, SCROW nRow ) const
{
if (!ValidColRow(nCol, nRow))
- return 0;
-
- return aCol[nCol].GetCellStringID(nRow);
-}
-
-sal_uIntPtr ScTable::GetCellStringIDIgnoreCase( SCCOL nCol, SCROW nRow ) const
-{
- if (!ValidColRow(nCol, nRow))
- return 0;
+ return svl::SharedString();
- return aCol[nCol].GetCellStringIDIgnoreCase(nRow);
+ return aCol[nCol].GetSharedString(nRow);
}
void ScTable::SetValue( SCCOL nCol, SCROW nRow, const double& rVal )