21#include <document.hxx>
35 for (
const auto& rTab : rMark)
37 if (rTab >= nTabCount)
53 pUndoDoc->InitUndo(rDoc, nTab, nTab);
55 for (
const auto& rTab : rMark)
57 pUndoDoc->AddUndoTab( rTab, rTab );
73 rDoc.
CopyToDocument(aCopyRange, nUndoDocFlags, bOnlyMarked, *pUndoDoc, &rMark);
81 const std::shared_ptr<ScSimpleUndo::DataSpansType>& pSpans,
82 bool bMulti,
bool bDrawUndo )
84 std::unique_ptr<ScUndoDeleteContents> pUndo(
86 pDocSh, rMark, rRange, std::move(pUndoDoc), bMulti, nFlags, bDrawUndo));
87 pUndo->SetDataSpans(pSpans);
95 auto pDataSpans = std::make_shared<ScSimpleUndo::DataSpansType>();
96 for (
const SCTAB nTab : rMark)
101 std::pair<ScSimpleUndo::DataSpansType::iterator,bool> r =
102 pDataSpans->insert(std::make_pair(nTab, std::make_unique<sc::ColumnSpanSet>()));
107 pSet->
scan(rDoc, nTab, nCol1, nRow1, nCol2, nRow2,
true);
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
void CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, InsertDeleteFlags nFlags, bool bMarked, ScDocument &rDestDoc, const ScMarkData *pMarks=nullptr, bool bColRowFlags=true)
SC_DLLPUBLIC SCTAB GetTableCount() const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
Structure that stores segments of boolean flags per column, and perform custom action on those segmen...
void scan(const ScDocument &rDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bVal)
Scan specified range in a specified sheet and mark all non-empty cells with specified boolean value.
static void addDeleteContentsUndo(SfxUndoManager *pUndoMgr, ScDocShell *pDocSh, const ScMarkData &rMark, const ScRange &rRange, ScDocumentUniquePtr &&pUndoDoc, InsertDeleteFlags nFlags, const std::shared_ptr< ScSimpleUndo::DataSpansType > &pSpans, bool bMulti, bool bDrawUndo)
static ScDocumentUniquePtr createDeleteContentsUndoDoc(ScDocument &rDoc, const ScMarkData &rMark, const ScRange &rRange, InsertDeleteFlags nFlags, bool bOnlyMarked)
static std::shared_ptr< ScSimpleUndo::DataSpansType > getNonEmptyCellSpans(const ScDocument &rDoc, const ScMarkData &rMark, const ScRange &rRange)
static bool hasProtectedTab(const ScDocument &rDoc, const ScMarkData &rMark)
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
@ NOTE
Strings (and string results if InsertDeleteFlags::FORMULA is not set).
@ NOCAPTIONS
Sparklines in a cell.
@ EDITATTR
Drawing objects.
@ STRING
Dates, times, datetime values.
@ ATTRIB
Internal use only (d&d undo): do not delete caption objects of cell notes.
CAUTION! The following defines must be in the same namespace as the respective type.