summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
authorDaniel Bankston <daniel.e.bankston@gmail.com>2012-05-10 17:01:37 -0500
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-05-15 11:28:08 +0200
commitac409adb1926f6c4f865b3c6df7bfd57e298a60b (patch)
treee73eb8e4a39110c582ea542766c356a47bfbad8d /sc/source/filter
parent14f23858c617b8fa3872d743f6d4a78cf2338020 (diff)
Pass forumlaResult value directly to ScDocument
- Removed extra call to XCell2 and instead passed formula result directly to ScDocument. Change-Id: Ifea731e44f12a048b76f8d5a4cc2d0619a56bbbc
Diffstat (limited to 'sc/source/filter')
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 0f6fb0aa4252..49ab86a886ea 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -56,8 +56,10 @@
#include "oox/helper/propertyset.hxx"
#include "addressconverter.hxx"
#include "autofilterbuffer.hxx"
+#include "cell.hxx"
#include "commentsbuffer.hxx"
#include "condformatbuffer.hxx"
+#include "convuno.hxx"
#include "document.hxx"
#include "drawingfragment.hxx"
#include "drawingmanager.hxx"
@@ -1551,9 +1553,16 @@ void WorksheetHelper::putValue( const CellAddress& rAddress, double fValue ) con
void WorksheetHelper::putFormulaResult( const CellAddress& rAddress, double fValue ) const
{
- Reference< XCell2 > xCell( getCell( rAddress ), UNO_QUERY );
- OSL_ENSURE( xCell.is(), "WorksheetHelper::putFormulaResult - missing cell interface" );
- if( xCell.is() ) xCell->setFormulaResult( fValue );
+ ScDocument& rDoc = getScDocument();
+ ScAddress aCellPos;
+ ScUnoConversion::FillScAddress( aCellPos, rAddress );
+ if ( rDoc.GetCellType( aCellPos ) == CELLTYPE_FORMULA )
+ {
+ ScFormulaCell* pCell = (ScFormulaCell *)rDoc.GetCell( aCellPos );
+ pCell->SetHybridDouble( fValue );
+ pCell->ResetDirty();
+ pCell->ResetChanged();
+ }
}
void WorksheetHelper::putString( const CellAddress& rAddress, const OUString& rText ) const