GPU-Calc: remove Alloc_Host_Ptr for clmem of NAN vector
[LibreOffice.git] / sc / source / ui / view / cellmergeoption.cxx
blobdb8400bb05f805e497a142cb4922839c28d4aa68
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 */
11 #include "cellmergeoption.hxx"
12 #include "address.hxx"
14 ScCellMergeOption::ScCellMergeOption(const ScRange& rRange) :
15 mnStartCol(rRange.aStart.Col()),
16 mnStartRow(rRange.aStart.Row()),
17 mnEndCol(rRange.aEnd.Col()),
18 mnEndRow(rRange.aEnd.Row()),
19 mbCenter(false)
21 SCTAB nTab1 = rRange.aStart.Tab();
22 SCTAB nTab2 = rRange.aEnd.Tab();
23 for (SCTAB i = nTab1; i <= nTab2; ++i)
24 maTabs.insert(i);
27 ScCellMergeOption::ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bCenter) :
28 mnStartCol(nStartCol),
29 mnStartRow(nStartRow),
30 mnEndCol(nEndCol),
31 mnEndRow(nEndRow),
32 mbCenter(bCenter)
36 ScCellMergeOption::ScCellMergeOption(const ScCellMergeOption& r) :
37 maTabs(r.maTabs),
38 mnStartCol(r.mnStartCol),
39 mnStartRow(r.mnStartRow),
40 mnEndCol(r.mnEndCol),
41 mnEndRow(r.mnEndRow),
42 mbCenter(r.mbCenter)
46 ScRange ScCellMergeOption::getSingleRange(SCTAB nTab) const
48 return ScRange(mnStartCol, mnStartRow, nTab, mnEndCol, mnEndRow, nTab);
51 ScRange ScCellMergeOption::getFirstSingleRange() const
53 SCTAB nTab = 0;
54 if (!maTabs.empty())
55 nTab = *maTabs.begin();
57 return getSingleRange(nTab);
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */