Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / core / data / clipcontext.cxx
blob8013684867ee938118091feaf954d09d015cf227
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include "clipcontext.hxx"
11 #include "document.hxx"
12 #include "mtvelements.hxx"
14 namespace sc {
16 ClipContextBase::ClipContextBase(ScDocument& rDoc) :
17 mpSet(new ColumnBlockPositionSet(rDoc)) {}
19 ClipContextBase::~ClipContextBase() {}
21 ColumnBlockPosition* ClipContextBase::getBlockPosition(SCTAB nTab, SCCOL nCol)
23 return mpSet->getBlockPosition(nTab, nCol);
26 CopyFromClipContext::CopyFromClipContext(ScDocument& rDoc,
27 ScDocument* pRefUndoDoc, ScDocument* pClipDoc, sal_uInt16 nInsertFlag,
28 bool bAsLink, bool bSkipAttrForEmptyCells) :
29 ClipContextBase(rDoc),
30 mnTabStart(-1), mnTabEnd(-1),
31 mpRefUndoDoc(pRefUndoDoc), mpClipDoc(pClipDoc), mnInsertFlag(nInsertFlag),
32 mbAsLink(bAsLink), mbSkipAttrForEmptyCells(bSkipAttrForEmptyCells),
33 mbCloneNotes (mnInsertFlag & (IDF_NOTE|IDF_ADDNOTES) )
37 CopyFromClipContext::~CopyFromClipContext()
41 void CopyFromClipContext::setTabRange(SCTAB nStart, SCTAB nEnd)
43 mnTabStart = nStart;
44 mnTabEnd = nEnd;
47 SCTAB CopyFromClipContext::getTabStart() const
49 return mnTabStart;
52 SCTAB CopyFromClipContext::getTabEnd() const
54 return mnTabEnd;
57 ScDocument* CopyFromClipContext::getUndoDoc()
59 return mpRefUndoDoc;
62 ScDocument* CopyFromClipContext::getClipDoc()
64 return mpClipDoc;
67 sal_uInt16 CopyFromClipContext::getInsertFlag() const
69 return mnInsertFlag;
72 bool CopyFromClipContext::isAsLink() const
74 return mbAsLink;
77 bool CopyFromClipContext::isSkipAttrForEmptyCells() const
79 return mbSkipAttrForEmptyCells;
82 bool CopyFromClipContext::isCloneNotes() const
84 return mbCloneNotes;
87 CopyToClipContext::CopyToClipContext(
88 ScDocument& rDoc, bool bKeepScenarioFlags, bool bCloneNotes) :
89 ClipContextBase(rDoc), mbKeepScenarioFlags(bKeepScenarioFlags), mbCloneNotes(bCloneNotes) {}
91 CopyToClipContext::~CopyToClipContext() {}
93 bool CopyToClipContext::isKeepScenarioFlags() const
95 return mbKeepScenarioFlags;
98 bool CopyToClipContext::isCloneNotes() const
100 return mbCloneNotes;
103 CopyToDocContext::CopyToDocContext(ScDocument& rDoc) : ClipContextBase(rDoc) {}
104 CopyToDocContext::~CopyToDocContext() {}
106 MixDocContext::MixDocContext(ScDocument& rDoc) : ClipContextBase(rDoc) {}
107 MixDocContext::~MixDocContext() {}
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */