summaryrefslogtreecommitdiff
path: root/sc/source/core/data/table7.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/table7.cxx')
-rw-r--r--sc/source/core/data/table7.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx
index 8a7391c6e48e..a5936cbeeef9 100644
--- a/sc/source/core/data/table7.cxx
+++ b/sc/source/core/data/table7.cxx
@@ -8,6 +8,10 @@
*/
#include <table.hxx>
+#include <clipcontext.hxx>
+#include <document.hxx>
+#include <clipparam.hxx>
+#include <bcaslot.hxx>
bool ScTable::IsMerged( SCCOL nCol, SCROW nRow ) const
{
@@ -17,6 +21,34 @@ bool ScTable::IsMerged( SCCOL nCol, SCROW nRow ) const
return aCol[nCol].IsMerged(nRow);
}
+void ScTable::DeleteBeforeCopyFromClip( sc::CopyFromClipContext& rCxt, const ScTable& rClipTab )
+{
+ sc::CopyFromClipContext::Range aRange = rCxt.getDestRange();
+ if (!ValidCol(aRange.mnCol1) || !ValidCol(aRange.mnCol2))
+ return;
+
+ // Pass some stuff to the columns via context.
+ rCxt.setTableProtected(IsProtected());
+ rCxt.setCondFormatList(mpCondFormatList.get());
+
+ ScRange aClipRange = rCxt.getClipDoc()->GetClipParam().getWholeRange();
+ SCCOL nClipCol = aClipRange.aStart.Col();
+ {
+ ScBulkBroadcast aBulkBroadcast(pDocument->GetBASM());
+
+ for (SCCOL nCol = aRange.mnCol1; nCol <= aRange.mnCol2; ++nCol, ++nClipCol)
+ {
+ if (nClipCol > aClipRange.aEnd.Col())
+ nClipCol = aClipRange.aStart.Col(); // loop through columns.
+
+ const ScColumn& rClipCol = rClipTab.aCol[nClipCol];
+ aCol[nCol].DeleteBeforeCopyFromClip(rCxt, rClipCol);
+ }
+ }
+
+ SetStreamValid(false);
+}
+
void ScTable::CopyOneCellFromClip(
sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
{