summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/viewfunc.cxx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-02-11 15:19:01 +0000
committerOliver Bolte <obo@openoffice.org>2009-02-11 15:19:01 +0000
commit0b423770754b274dd9de2147a8b38e41af184a77 (patch)
tree126541b987a9f9a0ae652fc3f036c13aec8783aa /sc/source/ui/view/viewfunc.cxx
parent39c33b91931f789899c7b0a3c616eb330c65a7ae (diff)
CWS-TOOLING: integrate CWS tbe35
2008-12-15 15:10:58 +0100 tbe r265503 : CWS-TOOLING: rebase CWS tbe35 to trunk@264807 (milestone: DEV300:m37) 2008-12-11 17:12:58 +0100 tbe r265335 : #i90682# formatting failed when first character is '-', '+' or '=' 2008-12-10 18:59:13 +0100 nn r265228 : #i96930# invalidate sort toolbar slots in SelectionChanged 2008-12-09 15:58:45 +0100 nn r265111 : #i77853# InitDocShell: SetLayoutRTL 2008-12-03 15:54:50 +0100 tbe r264795 : #i94841# [Collaboration] When deleting rows is rejected, the content is sometimes wrong 2008-11-14 16:13:21 +0100 tbe r263682 : #i95212# [Collaboration] Bad handling of row insertion in shared spreadsheet
Diffstat (limited to 'sc/source/ui/view/viewfunc.cxx')
-rw-r--r--sc/source/ui/view/viewfunc.cxx46
1 files changed, 40 insertions, 6 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index edaa0e0d4..afd20eae3 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -345,7 +345,7 @@ BOOL lcl_AddFunction( ScAppOptions& rAppOpt, USHORT nOpCode )
// Eingabe - Undo OK
void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString,
- BOOL bRecord )
+ BOOL bRecord, const EditTextObject* pData )
{
ScDocument* pDoc = GetViewData()->GetDocument();
ScMarkData& rMark = GetViewData()->GetMarkData();
@@ -369,6 +369,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rS
ULONG* pOldFormats = NULL;
SCTAB* pTabs = NULL;
SCTAB nUndoPos = 0;
+ EditTextObject* pUndoData = NULL;
if ( bRecord )
{
ppOldCells = new ScBaseCell*[nSelCount];
@@ -415,6 +416,8 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rS
}
DBG_ASSERT( nUndoPos==nSelCount, "nUndoPos!=nSelCount" );
+
+ pUndoData = ( pData ? pData->Clone() : NULL );
}
bool bFormula = false;
@@ -581,8 +584,16 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rS
if ( pFormatter->GetType( nIndex ) == NUMBERFORMAT_TEXT ||
( ( rString.GetChar(0) == '+' || rString.GetChar(0) == '-' ) && nError && rString.Equals( aFormula ) ) )
{
- ScStringCell* pCell = new ScStringCell( aFormula );
- pDoc->PutCell( aPos, pCell );
+ if ( pData )
+ {
+ ScEditCell* pCell = new ScEditCell( pData, pDoc, NULL );
+ pDoc->PutCell( aPos, pCell );
+ }
+ else
+ {
+ ScStringCell* pCell = new ScStringCell( aFormula );
+ pDoc->PutCell( aPos, pCell );
+ }
}
else
{
@@ -631,10 +642,10 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rS
if ( bRecord )
{ // wg. ChangeTrack erst jetzt
- pDocSh->GetUndoManager()->AddUndoAction(
+ pDocSh->GetUndoManager()->AddUndoAction(
new ScUndoEnterData( pDocSh, nCol, nRow, nTab, nUndoPos, pTabs,
ppOldCells, pHasFormat, pOldFormats,
- rString, NULL ) );
+ rString, pUndoData ) );
}
for (i=0; i<nTabCount; i++)
@@ -1585,7 +1596,30 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd, BOOL bRecord )
{
ScDocShell* pDocSh = GetViewData()->GetDocShell();
const ScMarkData& rMark = GetViewData()->GetMarkData();
- pDocSh->GetDocFunc().DeleteCells( aRange, &rMark, eCmd, bRecord, FALSE );
+
+ // #i94841# [Collaboration] When deleting rows is rejected, the content is sometimes wrong
+ if ( pDocSh->IsDocShared() && ( eCmd == DEL_DELROWS || eCmd == DEL_DELCOLS ) )
+ {
+ ScRange aDelRange( aRange.aStart );
+ SCCOLROW nCount = 0;
+ if ( eCmd == DEL_DELROWS )
+ {
+ nCount = sal::static_int_cast< SCCOLROW >( aRange.aEnd.Row() - aRange.aStart.Row() + 1 );
+ }
+ else
+ {
+ nCount = sal::static_int_cast< SCCOLROW >( aRange.aEnd.Col() - aRange.aStart.Col() + 1 );
+ }
+ while ( nCount > 0 )
+ {
+ pDocSh->GetDocFunc().DeleteCells( aDelRange, &rMark, eCmd, bRecord, FALSE );
+ --nCount;
+ }
+ }
+ else
+ {
+ pDocSh->GetDocFunc().DeleteCells( aRange, &rMark, eCmd, bRecord, FALSE );
+ }
pDocSh->UpdateOle(GetViewData());
CellContentChanged();