diff options
Diffstat (limited to 'sc/source/core/data/column3.cxx')
-rw-r--r-- | sc/source/core/data/column3.cxx | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index dfdd4e59e1bc..74b2e1ac7fad 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1023,7 +1023,7 @@ void ScColumn::DeleteArea( if ( nDelFlag & InsertDeleteFlags::EDITATTR ) { OSL_ENSURE( nContFlag == InsertDeleteFlags::NONE, "DeleteArea: Wrong Flags" ); - RemoveEditAttribs( nStartRow, nEndRow ); + RemoveEditAttribs(aBlockPos, nStartRow, nEndRow); } // Delete attributes just now @@ -1123,7 +1123,16 @@ public: mpSharedStringPool(pSharedStringPool) { if (mpDestBlockPos) + { + { + // Re-initialize the broadcaster position hint, which may have + // become invalid by the time it gets here... + sc::ColumnBlockPosition aTempPos; + mrDestCol.InitBlockPosition(aTempPos); + mpDestBlockPos->miBroadcasterPos = aTempPos.miBroadcasterPos; + } maDestBlockPos = *mpDestBlockPos; + } else mrDestCol.InitBlockPosition(maDestBlockPos); } @@ -1144,7 +1153,7 @@ public: if (node.type == sc::element_type_empty) { - if (bCopyCellNotes && !mrCxt.isSkipAttrForEmptyCells()) + if (bCopyCellNotes && !mrCxt.isSkipEmptyCells()) { bool bCloneCaption = (nFlags & InsertDeleteFlags::NOCAPTIONS) == InsertDeleteFlags::NONE; duplicateNotes(nSrcRow1, nDataSize, bCloneCaption ); @@ -1357,7 +1366,7 @@ public: mpDestBlockPos(rCxt.getBlockPosition(nDestTab, nDestCol)) { if (mpDestBlockPos) - maDestBlockPos = *mpDestBlockPos; + maDestBlockPos.miCellTextAttrPos = mpDestBlockPos->miCellTextAttrPos; else rDestCol.InitBlockPosition(maDestBlockPos); } @@ -1366,7 +1375,7 @@ public: { if (mpDestBlockPos) // Don't forget to save this to the context! - *mpDestBlockPos = maDestBlockPos; + mpDestBlockPos->miCellTextAttrPos = maDestBlockPos.miCellTextAttrPos; } void operator() ( const sc::CellTextAttrStoreType::value_type& aNode, size_t nOffset, size_t nDataSize ) @@ -1392,9 +1401,13 @@ public: void ScColumn::CopyFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1, SCROW nRow2, tools::Long nDy, ScColumn& rColumn ) { + sc::ColumnBlockPosition* pBlockPos = rCxt.getBlockPosition(nTab, nCol); + if (!pBlockPos) + return; + if ((rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB) != InsertDeleteFlags::NONE) { - if (rCxt.isSkipAttrForEmptyCells()) + if (rCxt.isSkipEmptyCells()) { // copy only attributes for non-empty cells between nRow1-nDy and nRow2-nDy. sc::SingleColumnSpanSet aSpanSet(GetDoc().GetSheetLimits()); @@ -1433,7 +1446,7 @@ void ScColumn::CopyFromClip( ScTokenArray aArr(GetDoc()); aArr.AddSingleReference( aRef ); - SetFormulaCell(nDestRow, new ScFormulaCell(rDocument, aDestPos, aArr)); + SetFormulaCell(*pBlockPos, nDestRow, new ScFormulaCell(rDocument, aDestPos, aArr)); } // Don't forget to copy the cell text attributes. |