summaryrefslogtreecommitdiff
path: root/sc/source/core/data/documen8.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-03-20 22:24:57 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-03-22 21:49:20 -0400
commit0327a7cdddb88a4841dc1be63fa0ce78ab35fc2d (patch)
tree944b4a0583a3425f02886dd6e6f9a2c1144dca92 /sc/source/core/data/documen8.cxx
parent6de145fdfa60737b4d3c4cb164caab5a44aa6c45 (diff)
More on reducing the use of ScDocument::PutCell().
I'm getting tired of this already... Change-Id: I77c4f82fc61c9371e8a07fa559088851667949d6
Diffstat (limited to 'sc/source/core/data/documen8.cxx')
-rw-r--r--sc/source/core/data/documen8.cxx24
1 files changed, 17 insertions, 7 deletions
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 7c782f394fcf..f5352356a250 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -87,6 +87,7 @@
#include "scresid.hxx"
#include "columniterator.hxx"
#include "globalnames.hxx"
+#include "stringutil.hxx"
#include <memory>
#include <boost/scoped_ptr.hpp>
@@ -815,10 +816,14 @@ bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe
static_cast<ScEditCell*>(pCell)->SetData(pEngine->CreateTextObject());
else
// The cell will take ownership of pNewData.
- PutCell(nCol, nRow, nTab, new ScEditCell(pEngine->CreateTextObject(), this));
+ SetEditText(ScAddress(nCol,nRow,nTab), pEngine->CreateTextObject());
+ }
+ else
+ {
+ ScSetStringParam aParam;
+ aParam.setTextInput();
+ SetString(ScAddress(nCol,nRow,nTab), pEngine->GetText(), &aParam);
}
- else // einfacher String
- PutCell( nCol, nRow, nTab, new ScStringCell( pEngine->GetText() ) );
// Paint
if (pShell)
@@ -1652,12 +1657,13 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
pEngine->SetDefaults( pEmpty, true );
// The cell will take ownership of the text object instance.
- PutCell(nCol, nRow, nTab, new ScEditCell(pEngine->CreateTextObject(), this));
+ SetEditText(ScAddress(nCol,nRow,nTab), pEngine->CreateTextObject());
}
else
{
- rtl::OUString aNewStr = pEngine->GetText();
- PutCell( nCol, nRow, nTab, new ScStringCell( aNewStr ) );
+ ScSetStringParam aParam;
+ aParam.setTextInput();
+ SetString(ScAddress(nCol,nRow,nTab), pEngine->GetText(), &aParam);
}
}
}
@@ -1680,7 +1686,11 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
rtl::OUString aNewStr = aTranslitarationWrapper.transliterate( aOldStr, nLanguage, 0, nOldLen, &aOffsets );
if ( aNewStr != aOldStr )
- PutCell( nCol, nRow, nTab, new ScStringCell( aNewStr ) );
+ {
+ ScSetStringParam aParam;
+ aParam.setTextInput();
+ SetString(ScAddress(nCol,nRow,nTab), aNewStr, &aParam);
+ }
}
bFound = GetNextMarkedCell( nCol, nRow, nTab, rMultiMark );
}