diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-20 17:30:43 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 21:49:18 -0400 |
commit | a67e7ca6cd7ed646bac535c8cdffd6dc1f11d331 (patch) | |
tree | 623c2494d1bf82ea5747943aa9e2531f646c3440 /sc/source/ui/collab | |
parent | 383d39de81c4581830764efab6c31eed757751cc (diff) |
ScDocFunc::SetFormulaCell() to replace use of PutCell() for formula cells.
Due to the complexity of the formula cell class, we'll keep this cell class
until further notice.
Change-Id: I0e11d0aa6ca2ee959a1963c606ad0684aeec27ed
Diffstat (limited to 'sc/source/ui/collab')
-rw-r--r-- | sc/source/ui/collab/sendfunc.cxx | 17 | ||||
-rw-r--r-- | sc/source/ui/collab/sendfunc.hxx | 25 |
2 files changed, 41 insertions, 1 deletions
diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx index 60b1f0f24ec6..ca7947190efc 100644 --- a/sc/source/ui/collab/sendfunc.cxx +++ b/sc/source/ui/collab/sendfunc.cxx @@ -68,6 +68,11 @@ void ScDocFuncSend::RecvMessage( const rtl::OString &rString ) mpDirect->SetEditCell( aReader.getAddress(1), aReader.getEdit(2), aReader.getBool(3)); } + else if (aReader.getMethod() == "setFormulaCell") + { + mpDirect->SetFormulaCell( + aReader.getAddress(1), aReader.getFormulaCell(2), aReader.getBool(3)); + } else if ( aReader.getMethod() == "enterListAction" ) mpDirect->EnterListAction( aReader.getInt( 1 ) ); else if ( aReader.getMethod() == "endListAction" ) @@ -171,6 +176,17 @@ bool ScDocFuncSend::SetEditCell( const ScAddress& rPos, const EditTextObject& rS return true; // needs some code auditing action } +bool ScDocFuncSend::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, bool bInteraction ) +{ + ScChangeOpWriter aOp("setFormulaCell"); + aOp.appendAddress( rPos ); + aOp.appendFormulaCell( pCell ); + aOp.appendBool( bInteraction ); + SendMessage( aOp ); + pCell->Delete(); + return true; // needs some code auditing action +} + sal_Bool ScDocFuncSend::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bool bApi ) { ScChangeOpWriter aOp( "putCell" ); @@ -178,6 +194,7 @@ sal_Bool ScDocFuncSend::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sa aOp.appendCell( pNewCell ); aOp.appendBool( bApi ); SendMessage( aOp ); + pCell->Delete(); return true; // needs some code auditing action } diff --git a/sc/source/ui/collab/sendfunc.hxx b/sc/source/ui/collab/sendfunc.hxx index 6b17a2e5bb0d..5499fd0abda9 100644 --- a/sc/source/ui/collab/sendfunc.hxx +++ b/sc/source/ui/collab/sendfunc.hxx @@ -24,6 +24,12 @@ rtl::OUString cellToString( ScBaseCell *pCell ) return rtl::OUString(); } +OUString formulaCellToString( ScFormulaCell *pCell ) +{ + (void)pCell; // FIXME: implement me + return OUString(); +} + OUString editToString( const EditTextObject& /*rEditText*/ ) { // FIXME: implement me. @@ -36,7 +42,13 @@ EditTextObject stringToEdit( const OUString& rStr ) return EditTextObject(); } -ScBaseCell *stringToCell( const rtl::OUString &rString ) +ScBaseCell* stringToCell( const rtl::OUString &rString ) +{ + (void)rString; // FIXME: implement me + return NULL; +} + +ScFormulaCell* stringToFormulaCell( const OUString &rString ) { (void)rString; // FIXME: implement me return NULL; @@ -98,6 +110,11 @@ public: appendString( cellToString( pCell ) ); } + void appendFormulaCell( ScFormulaCell *pCell ) + { + appendString( formulaCellToString( pCell ) ); + } + void appendEditText( const EditTextObject& rStr ) { appendString( editToString(rStr) ); @@ -219,6 +236,11 @@ public: return stringToCell( getString( n ) ); } + ScFormulaCell* getFormulaCell( sal_Int32 n ) + { + return stringToFormulaCell( getString( n ) ); + } + double getDouble( sal_Int32 n ) { return getString(n).toDouble(); @@ -254,6 +276,7 @@ public: virtual bool SetValueCell( const ScAddress& rPos, double fVal, bool bInteraction ); virtual bool SetStringCell( const ScAddress& rPos, const OUString& rStr, bool bInteraction ); virtual bool SetEditCell( const ScAddress& rPos, const EditTextObject& rStr, bool bInteraction ); + virtual bool SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, bool bInteraction ); virtual sal_Bool PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bool bApi ); virtual sal_Bool PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, sal_Bool bInterpret, sal_Bool bApi ); |