Kaydet (Commit) 2ce72093 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

ScDocFunc::PutCell() is no longer used. Remove it.

Change-Id: Id76a8cfe2d67c3461aab6ea0bb71a99abba65e84
üst e509ba00
...@@ -47,12 +47,6 @@ void ScDocFuncSend::RecvMessage( const rtl::OString &rString ) ...@@ -47,12 +47,6 @@ void ScDocFuncSend::RecvMessage( const rtl::OString &rString )
mpDirect->SetNormalString( bNumFmtSet, aReader.getAddress( 1 ), aReader.getString( 2 ), mpDirect->SetNormalString( bNumFmtSet, aReader.getAddress( 1 ), aReader.getString( 2 ),
aReader.getBool( 3 ) ); aReader.getBool( 3 ) );
} }
else if ( aReader.getMethod() == "putCell" )
{
ScBaseCell *pNewCell = aReader.getCell( 2 );
if ( pNewCell )
mpDirect->PutCell( aReader.getAddress( 1 ), pNewCell, aReader.getBool( 3 ) );
}
else if (aReader.getMethod() == "setValueCell") else if (aReader.getMethod() == "setValueCell")
{ {
mpDirect->SetValueCell( mpDirect->SetValueCell(
...@@ -187,17 +181,6 @@ bool ScDocFuncSend::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, ...@@ -187,17 +181,6 @@ bool ScDocFuncSend::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell,
return true; // needs some code auditing action return true; // needs some code auditing action
} }
sal_Bool ScDocFuncSend::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bool bApi )
{
ScChangeOpWriter aOp( "putCell" );
aOp.appendAddress( rPos );
aOp.appendCell( pNewCell );
aOp.appendBool( bApi );
SendMessage( aOp );
pCell->Delete();
return true; // needs some code auditing action
}
sal_Bool ScDocFuncSend::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, sal_Bool ScDocFuncSend::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
sal_Bool bInterpret, sal_Bool bApi ) sal_Bool bInterpret, sal_Bool bApi )
{ {
......
...@@ -277,7 +277,6 @@ public: ...@@ -277,7 +277,6 @@ public:
virtual bool SetStringCell( const ScAddress& rPos, const OUString& rStr, 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 SetEditCell( const ScAddress& rPos, const EditTextObject& rStr, bool bInteraction );
virtual bool SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, 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, virtual sal_Bool PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
sal_Bool bInterpret, sal_Bool bApi ); sal_Bool bInterpret, sal_Bool bApi );
virtual sal_Bool SetCellText( const ScAddress& rPos, const String& rText, virtual sal_Bool SetCellText( const ScAddress& rPos, const String& rText,
......
...@@ -975,71 +975,6 @@ bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, boo ...@@ -975,71 +975,6 @@ bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, boo
return true; return true;
} }
sal_Bool ScDocFunc::PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bool bApi )
{
ScDocShellModificator aModificator( rDocShell );
ScDocument* pDoc = rDocShell.GetDocument();
bool bUndo (pDoc->IsUndoEnabled());
sal_Bool bXMLLoading(pDoc->IsImportingXML());
// #i925#; it is not necessary to test whether the cell is editable on loading a XML document
if (!bXMLLoading)
{
ScEditableTester aTester( pDoc, rPos.Tab(), rPos.Col(),rPos.Row(), rPos.Col(),rPos.Row() );
if (!aTester.IsEditable())
{
if (!bApi)
rDocShell.ErrorMessage(aTester.GetMessageId());
pNewCell->Delete();
return false;
}
}
sal_Bool bEditCell = ( pNewCell->GetCellType() == CELLTYPE_EDIT );
ScBaseCell* pDocCell = pDoc->GetCell( rPos );
sal_Bool bEditDeleted = (pDocCell && pDocCell->GetCellType() == CELLTYPE_EDIT);
sal_Bool bHeight = ( bEditDeleted || bEditCell ||
pDoc->HasAttrib( ScRange(rPos), HASATTR_NEEDHEIGHT ) );
ScBaseCell* pUndoCell = (bUndo && pDocCell) ? pDocCell->Clone( *pDoc, rPos ) : 0;
ScBaseCell* pRedoCell = (bUndo && pNewCell) ? pNewCell->Clone( *pDoc, rPos ) : 0;
pDoc->PutCell( rPos, pNewCell );
// This "interpret once" block was moved from ScViewFunc::EnterData() where
// it was never executed from API, so don't do it here. For performance
// reasons API calls may disable calculation while operating and
// recalculate once when done.
if ( !bXMLLoading && !bApi && pNewCell->GetCellType() == CELLTYPE_FORMULA && !pDoc->GetAutoCalc() )
{
ScFormulaCell *pFormCell = static_cast<ScFormulaCell *>( pNewCell );
// calculate just the cell once and set Dirty again
pFormCell->Interpret();
pFormCell->SetDirtyVar();
pDoc->PutInFormulaTree( pFormCell );
}
// wegen ChangeTracking darf UndoAction erst nach PutCell angelegt werden
if (bUndo)
rDocShell.GetUndoManager()->AddUndoAction(
new ScUndoPutCell( &rDocShell, rPos, pUndoCell, pRedoCell ) );
if (bHeight)
AdjustRowHeight( ScRange(rPos) );
if (!bXMLLoading)
rDocShell.PostPaintCell( rPos );
aModificator.SetDocumentModified();
// #i925#; it is not necessary to notify on loading a XML document
// #103934#; notify editline and cell in edit mode
if (bApi && !bXMLLoading)
NotifyInputHandler( rPos );
return sal_True;
}
void ScDocFunc::NotifyInputHandler( const ScAddress& rPos ) void ScDocFunc::NotifyInputHandler( const ScAddress& rPos )
{ {
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
......
...@@ -100,7 +100,6 @@ public: ...@@ -100,7 +100,6 @@ public:
* must not delete it after passing it to this call. * must not delete it after passing it to this call.
*/ */
virtual bool SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, 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, virtual sal_Bool PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
sal_Bool bInterpret, sal_Bool bApi ); sal_Bool bInterpret, sal_Bool bApi );
virtual sal_Bool SetCellText( const ScAddress& rPos, const String& rText, virtual sal_Bool SetCellText( const ScAddress& rPos, const String& rText,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment