summaryrefslogtreecommitdiff
path: root/sc/source/ui/collab
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-03-20 15:52:14 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-03-22 21:49:17 -0400
commitbcf5b54b47eda4e39b4f5f4813cb43e1f52f0201 (patch)
tree0c32ff51267e7aaaa4bf1927ac5fb40260c70743 /sc/source/ui/collab
parente3504ca6b84f5f38ded12e279d3b3ee36f9ffa33 (diff)
Add SetStringCell() and SetEditCell() to ScDocFunc.
More on averting the use of PutCell(). Change-Id: I3881d7d468780eefe8016c754a053eb42ad3c5ad
Diffstat (limited to 'sc/source/ui/collab')
-rw-r--r--sc/source/ui/collab/sendfunc.cxx30
-rw-r--r--sc/source/ui/collab/sendfunc.hxx25
2 files changed, 55 insertions, 0 deletions
diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx
index 4b969346f5e4..60b1f0f24ec6 100644
--- a/sc/source/ui/collab/sendfunc.cxx
+++ b/sc/source/ui/collab/sendfunc.cxx
@@ -58,6 +58,16 @@ void ScDocFuncSend::RecvMessage( const rtl::OString &rString )
mpDirect->SetValueCell(
aReader.getAddress(1), aReader.getDouble(2), aReader.getBool(3));
}
+ else if (aReader.getMethod() == "setStringCell")
+ {
+ mpDirect->SetStringCell(
+ aReader.getAddress(1), aReader.getString(2), aReader.getBool(3));
+ }
+ else if (aReader.getMethod() == "setEditCell")
+ {
+ mpDirect->SetEditCell(
+ aReader.getAddress(1), aReader.getEdit(2), aReader.getBool(3));
+ }
else if ( aReader.getMethod() == "enterListAction" )
mpDirect->EnterListAction( aReader.getInt( 1 ) );
else if ( aReader.getMethod() == "endListAction" )
@@ -141,6 +151,26 @@ bool ScDocFuncSend::SetValueCell( const ScAddress& rPos, double fVal, bool bInte
return true; // needs some code auditing action
}
+bool ScDocFuncSend::SetStringCell( const ScAddress& rPos, const OUString& rStr, bool bInteraction )
+{
+ ScChangeOpWriter aOp("setStringCell");
+ aOp.appendAddress( rPos );
+ aOp.appendString( rStr );
+ aOp.appendBool( bInteraction );
+ SendMessage( aOp );
+ return true; // needs some code auditing action
+}
+
+bool ScDocFuncSend::SetEditCell( const ScAddress& rPos, const EditTextObject& rStr, bool bInteraction )
+{
+ ScChangeOpWriter aOp("setEditCell");
+ aOp.appendAddress( rPos );
+ aOp.appendEditText( rStr );
+ aOp.appendBool( bInteraction );
+ SendMessage( aOp );
+ return true; // needs some code auditing action
+}
+
sal_Bool ScDocFuncSend::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bool bApi )
{
ScChangeOpWriter aOp( "putCell" );
diff --git a/sc/source/ui/collab/sendfunc.hxx b/sc/source/ui/collab/sendfunc.hxx
index 468414861850..6b17a2e5bb0d 100644
--- a/sc/source/ui/collab/sendfunc.hxx
+++ b/sc/source/ui/collab/sendfunc.hxx
@@ -24,6 +24,18 @@ rtl::OUString cellToString( ScBaseCell *pCell )
return rtl::OUString();
}
+OUString editToString( const EditTextObject& /*rEditText*/ )
+{
+ // FIXME: implement me.
+ return OUString();
+}
+
+EditTextObject stringToEdit( const OUString& rStr )
+{
+ // FIXME: implement me.
+ return EditTextObject();
+}
+
ScBaseCell *stringToCell( const rtl::OUString &rString )
{
(void)rString; // FIXME: implement me
@@ -86,6 +98,11 @@ public:
appendString( cellToString( pCell ) );
}
+ void appendEditText( const EditTextObject& rStr )
+ {
+ appendString( editToString(rStr) );
+ }
+
void appendDouble( double fVal )
{
aMessage.append(fVal);
@@ -206,6 +223,12 @@ public:
{
return getString(n).toDouble();
}
+
+ EditTextObject getEdit( sal_Int32 n )
+ {
+ return stringToEdit(getString(n));
+ }
+
};
} // anonymous namespace
@@ -229,6 +252,8 @@ public:
virtual sal_Bool SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, const String& rText, sal_Bool bApi );
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 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 );