diff options
author | Aleksas Pantechovskis <alex.pantec@gmail.com> | 2016-03-30 23:05:19 +0300 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-03-31 19:35:13 +0000 |
commit | e3e0ac4d3d3d7f701618358ccbb3d667683c6b20 (patch) | |
tree | c902d54762b6226a93f000a64bc92a099e90ab2b /sc/source/ui/view/spelleng.cxx | |
parent | 50223ea6e212b60b7d33839c2753c5601fb50f95 (diff) |
tdf#98893 Remove expensive calls to GetCellType + GetValue/... in calc
Change-Id: If8aa0158c60d5727d9bdd66aa351c50c987c3e5f
Reviewed-on: https://gerrit.libreoffice.org/23662
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/ui/view/spelleng.cxx')
-rw-r--r-- | sc/source/ui/view/spelleng.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index 871de86d2c0e..ffb20f53a761 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -34,6 +34,8 @@ #include "spelldialog.hxx" #include "tabvwsh.hxx" #include "docsh.hxx" +#include "cellvalue.hxx" +#include "cellform.hxx" #include "formulacell.hxx" #include "patattr.hxx" #include "waitoff.hxx" @@ -247,19 +249,24 @@ void ScConversionEngineBase::FillFromCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) { ScAddress aPos(nCol, nRow, nTab); - switch (mrDoc.GetCellType(aPos)) + ScRefCellValue aCell(mrDoc, aPos); + switch (aCell.meType) { case CELLTYPE_STRING: { - OUString aText = mrDoc.GetString(aPos); - SetText( aText ); + SvNumberFormatter* pFormatter = mrDoc.GetFormatTable(); + sal_uLong nNumFmt = mrDoc.GetNumberFormat(aPos); + OUString aText; + Color* pColor; + ScCellFormat::GetString(aCell, nNumFmt, aText, &pColor, *pFormatter, &mrDoc); + + SetText(aText); } break; case CELLTYPE_EDIT: { - const EditTextObject* pNewEditObj = mrDoc.GetEditText(aPos); - if (pNewEditObj) - SetText(*pNewEditObj); + const EditTextObject* pNewEditObj = aCell.mpEditText; + SetText(*pNewEditObj); } break; default: |